Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -7,7 +7,6 @@ import tempfile
|
|
7 |
# Configure the Gemini API
|
8 |
GOOGLE_API_KEY = os.getenv("gemini_api") # Ensure your API key is set
|
9 |
client = genai.Client(api_key=GOOGLE_API_KEY)
|
10 |
-
global chat
|
11 |
chat=None
|
12 |
def transcribe_audio(audio_path):
|
13 |
"""
|
@@ -43,7 +42,7 @@ def chat_with_gemini(user_input, history):
|
|
43 |
"""
|
44 |
if history is None or not isinstance(history, list): # Ensure history is initialized
|
45 |
history = []
|
46 |
-
|
47 |
# Initialize or continue conversation
|
48 |
if chat is None:
|
49 |
chat = client.chats.create(model="gemini-2.0-flash") # Initialize chat once
|
|
|
7 |
# Configure the Gemini API
|
8 |
GOOGLE_API_KEY = os.getenv("gemini_api") # Ensure your API key is set
|
9 |
client = genai.Client(api_key=GOOGLE_API_KEY)
|
|
|
10 |
chat=None
|
11 |
def transcribe_audio(audio_path):
|
12 |
"""
|
|
|
42 |
"""
|
43 |
if history is None or not isinstance(history, list): # Ensure history is initialized
|
44 |
history = []
|
45 |
+
global chat
|
46 |
# Initialize or continue conversation
|
47 |
if chat is None:
|
48 |
chat = client.chats.create(model="gemini-2.0-flash") # Initialize chat once
|