Skip to content

Commit

Permalink
update comments in sambanova provider for review
Browse files Browse the repository at this point in the history
  • Loading branch information
snova-zoltanc committed Nov 26, 2024
1 parent 055dfc5 commit 5bc0a43
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions aisuite/providers/sambanova_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,17 @@ def __init__(self, **config):
"Sambanova API key is missing. Please provide it in the config or set the SAMBANOVA_API_KEY environment variable."
)

# NOTE: We could choose to remove above lines for api_key since OpenAI will automatically
# infer certain values from the environment variables.
# Eg: OPENAI_API_KEY, OPENAI_ORG_ID, OPENAI_PROJECT_ID, OPENAI_BASE_URL, etc.

# Pass the entire config to the OpenAI client constructor
self.client = OpenAI(
base_url="https://api.sambanova.ai/v1/",
api_key=config["api_key"],
)

def chat_completions_create(self, model, messages, **kwargs):
# Any exception raised by OpenAI will be returned to the caller.
# Any exception raised by Sambanova will be returned to the caller.
# Maybe we should catch them and raise a custom LLMError.
return self.client.chat.completions.create(
model=model,
messages=messages,
**kwargs # Pass any additional arguments to the OpenAI API
**kwargs # Pass any additional arguments to the Sambanova API
)

0 comments on commit 5bc0a43

Please sign in to comment.