Skip to content

Commit

Permalink
fix client constructor to pass in the entire config
Browse files Browse the repository at this point in the history
  • Loading branch information
snova-zoltanc committed Dec 2, 2024
1 parent 5bc0a43 commit 896271a
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions aisuite/providers/sambanova_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@ def __init__(self, **config):
raise ValueError(
"Sambanova API key is missing. Please provide it in the config or set the SAMBANOVA_API_KEY environment variable."
)


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

def chat_completions_create(self, model, messages, **kwargs):
# Any exception raised by Sambanova will be returned to the caller.
Expand Down

0 comments on commit 896271a

Please sign in to comment.