Skip to content

Commit

Permalink
patch - remove lazy import from client
Browse files Browse the repository at this point in the history
  • Loading branch information
dannylee1020 committed Dec 25, 2024
1 parent edf32f8 commit aa46a30
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions openpo/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from .resources.batch.batch import Batch
from .resources.completion.completion import Completion
from .resources.eval.eval import Evaluation
from .resources.provider import Anthropic, HuggingFace, OpenAI, OpenRouter


class OpenPO:
Expand Down Expand Up @@ -51,28 +52,24 @@ def _get_provider_instance(self, provider: str):
if provider == "huggingface":
if not self.hf_api_key:
raise AuthenticationError("HuggingFace")
from .resources.provider import HuggingFace

return HuggingFace(api_key=self.hf_api_key)

if provider == "openrouter":
if not self.openrouter_api_key:
raise AuthenticationError("OpenRouter")
from .resources.provider import OpenRouter

return OpenRouter(api_key=self.openrouter_api_key)

if provider == "openai":
if not self.openai_api_key:
raise AuthenticationError("OpenAI")
from .resources.provider import OpenAI

return OpenAI(api_key=self.openai_api_key)

if provider == "anthropic":
if not self.anthropic_api_key:
raise AuthenticationError("Anthropic")
from .resources.provider import Anthropic

return Anthropic(api_key=self.anthropic_api_key)

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "openpo"
version = "0.7.3"
version = "0.7.4"
description = "Build high quality synthetic datasets with AI feedback from 200+ LLMs"
authors = ["Daniel Lee <dannylee1020@gmail.com>"]
license = "Apache-2.0"
Expand Down

0 comments on commit aa46a30

Please sign in to comment.