From 896271aeb859d556aa034f8df8b6006db332ae68 Mon Sep 17 00:00:00 2001 From: Zoltan Csaki Date: Sun, 1 Dec 2024 22:18:02 -0800 Subject: [PATCH] fix client constructor to pass in the entire config --- aisuite/providers/sambanova_provider.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/aisuite/providers/sambanova_provider.py b/aisuite/providers/sambanova_provider.py index 3eedd769..dbf0fda2 100644 --- a/aisuite/providers/sambanova_provider.py +++ b/aisuite/providers/sambanova_provider.py @@ -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.