mfraz commited on
Commit
b27d388
·
verified ·
1 Parent(s): 8d46f3f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -4,8 +4,8 @@ import requests
4
  # Groq API Key (Replace with your actual key)
5
  GROQ_API_KEY = "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"
6
 
7
- # Groq API URL for chat completion
8
- GROQ_API_URL = "https://console.groq.com/keys"
9
 
10
  # Function to interact with Groq API
11
  def chat_with_groq(prompt, history):
@@ -34,7 +34,7 @@ def chat_with_groq(prompt, history):
34
  return response_data["choices"][0]["message"]["content"]
35
  else:
36
  return f"API Error: {response_data.get('error', {}).get('message', 'Unknown error')}"
37
-
38
  except Exception as e:
39
  return f"Exception Error: {str(e)}"
40
 
 
4
  # Groq API Key (Replace with your actual key)
5
  GROQ_API_KEY = "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"
6
 
7
+ # Correct Groq API URL for chat completion
8
+ GROQ_API_URL = "https://api.groq.com/openai/v1/chat/completions"
9
 
10
  # Function to interact with Groq API
11
  def chat_with_groq(prompt, history):
 
34
  return response_data["choices"][0]["message"]["content"]
35
  else:
36
  return f"API Error: {response_data.get('error', {}).get('message', 'Unknown error')}"
37
+
38
  except Exception as e:
39
  return f"Exception Error: {str(e)}"
40