kz919 commited on
Commit
b1d8de3
1 Parent(s): 357eed6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -11,9 +11,13 @@ MODELS = [
11
  "Meta-Llama-3.1-8B-Instruct"
12
  ]
13
 
14
- def create_client(api_key):
15
- openai.api_key = api_key
16
- openai.api_base = "https://api.sambanova.ai/v1" # Fixed Base URL
 
 
 
 
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 = [