Update app.py
Browse files
app.py
CHANGED
@@ -11,9 +11,13 @@ MODELS = [
|
|
11 |
"Meta-Llama-3.1-8B-Instruct"
|
12 |
]
|
13 |
|
14 |
-
def create_client(api_key):
|
15 |
-
|
16 |
-
|
|
|
|
|
|
|
|
|
17 |
|
18 |
def chat_with_ai(message, chat_history, system_prompt):
|
19 |
messages = [
|
|
|
11 |
"Meta-Llama-3.1-8B-Instruct"
|
12 |
]
|
13 |
|
14 |
+
def create_client(api_key = None):
|
15 |
+
if api_key is not None:
|
16 |
+
openai.api_key = api_key
|
17 |
+
openai.api_base = "https://api.sambanova.ai/v1" # Fixed Base URL
|
18 |
+
else:
|
19 |
+
openai.api_key = os.getenv("API_KEY")
|
20 |
+
openai.api_base = os.getenv("URL")
|
21 |
|
22 |
def chat_with_ai(message, chat_history, system_prompt):
|
23 |
messages = [
|