Skip to content
This repository has been archived by the owner on Nov 13, 2024. It is now read-only.

Commit

Permalink
changed prefix after code review
Browse files Browse the repository at this point in the history
  • Loading branch information
ptorru committed Feb 29, 2024
1 parent 4dffa98 commit a36ac11
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/canopy/knowledge_base/record_encoder/octoai.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@ def __init__(self,
batch_size: int = 1024,
**kwargs):

ae_api_key = api_key or os.environ.get("OCTOAI_API_KEY")
if not ae_api_key:
octoai_api_key = api_key or os.environ.get("OCTOAI_API_KEY")
if not octoai_api_key:
raise ValueError(
"An OctoAI API token is required to use OctoAI. "
"Please provide it as an argument "
"or set the OCTOAI_API_KEY environment variable."
)
ae_base_url = base_url
octoai_base_url = base_url
encoder = OpenAIEncoder(model_name,
base_url=ae_base_url, api_key=ae_api_key,
base_url=octoai_base_url, api_key=octoai_api_key,
**kwargs)
super().__init__(dense_encoder=encoder, batch_size=batch_size)

Expand Down
8 changes: 4 additions & 4 deletions src/canopy/llm/octoai.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ def __init__(
api_key: Optional[str] = None,
**kwargs: Any,
):
ae_api_key = api_key or os.environ.get("OCTOAI_API_KEY")
if not ae_api_key:
octoai_api_key = api_key or os.environ.get("OCTOAI_API_KEY")
if not octoai_api_key:
raise ValueError(
"OctoAI API key is required to use OctoAI. "
"If you haven't done it, please sign up at https://octo.ai"
"The key can be provided as an argument or via the OCTOAI_API_KEY environment variable."
)
ae_base_url = base_url
super().__init__(model_name, api_key=ae_api_key, base_url=ae_base_url, **kwargs)
octoai_base_url = base_url
super().__init__(model_name, api_key=octoai_api_key, base_url=octoai_base_url, **kwargs)

def enforced_function_call(
self,
Expand Down

0 comments on commit a36ac11

Please sign in to comment.