utarn commited on
Commit
e69b86b
·
1 Parent(s): 759f8e5

Have secret api key

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -169,6 +169,9 @@ def create_ui():
169
  if not text.strip() and not files:
170
  return "❌ Please provide either text or upload files", ""
171
 
 
 
 
172
  # Create client
173
  client = OmniAPIClient(base_url)
174
 
@@ -186,7 +189,7 @@ def create_ui():
186
  success, response = client.send_chat_completion(
187
  text=text,
188
  files=valid_files,
189
- api_key=api_key,
190
  model=model,
191
  max_tokens=max_tokens
192
  )
 
169
  if not text.strip() and not files:
170
  return "❌ Please provide either text or upload files", ""
171
 
172
+ # Use API key from environment variable if not provided in UI
173
+ api_key_to_use = api_key or os.getenv("API_KEY", "")
174
+
175
  # Create client
176
  client = OmniAPIClient(base_url)
177
 
 
189
  success, response = client.send_chat_completion(
190
  text=text,
191
  files=valid_files,
192
+ api_key=api_key_to_use,
193
  model=model,
194
  max_tokens=max_tokens
195
  )