Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,16 +1,9 @@
|
|
1 |
import gradio as gr
|
2 |
from groq import Groq
|
3 |
-
from dotenv import load_dotenv
|
4 |
import os
|
5 |
|
6 |
-
# Load environment variables from .env file
|
7 |
-
load_dotenv()
|
8 |
-
|
9 |
-
# Access the API key
|
10 |
-
api_key = os.getenv("MY_API_KEY")
|
11 |
-
|
12 |
# Initialize Groq client
|
13 |
-
client = Groq(api_key=
|
14 |
|
15 |
# Function to generate responses with error handling
|
16 |
def generate_response(user_input, chat_history):
|
|
|
1 |
import gradio as gr
|
2 |
from groq import Groq
|
|
|
3 |
import os
|
4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
# Initialize Groq client
|
6 |
+
client = Groq(api_key=GROQ_API_KEY)
|
7 |
|
8 |
# Function to generate responses with error handling
|
9 |
def generate_response(user_input, chat_history):
|