Spaces:
Running
Running
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +4 -5
src/streamlit_app.py
CHANGED
@@ -98,13 +98,11 @@ else:
|
|
98 |
logging.critical("GEMINI_API_KEY not found.")
|
99 |
st.stop()
|
100 |
|
101 |
-
# Gemini LiveConnectConfig - Using audio response and Puck voice as in your latest code
|
102 |
-
# Ensure this configuration is valid for your API key and model.
|
103 |
LIVE_CONNECT_CONFIG = types.LiveConnectConfig(
|
104 |
-
response_modalities=["audio"], # Requesting audio response
|
105 |
speech_config=types.SpeechConfig(
|
106 |
voice_config=types.VoiceConfig(
|
107 |
-
prebuilt_voice_config=types.PrebuiltVoiceConfig(voice_name="
|
108 |
)
|
109 |
) # <---------------------------------- CORRECTED: Added missing closing parenthesis
|
110 |
)
|
@@ -148,6 +146,7 @@ class GeminiInteractionLoop:
|
|
148 |
audio_chunks_to_gemini_q.task_done(); return audio_chunk
|
149 |
except asyncio.TimeoutError: return None
|
150 |
except Exception as e: logging.error(f"Error getting audio from queue: {e}", exc_info=True); return None
|
|
|
151 |
try:
|
152 |
while self.is_running:
|
153 |
if not self.gemini_session: await asyncio.sleep(0.1); continue
|
@@ -378,7 +377,7 @@ def run_streamlit_app():
|
|
378 |
initialize_app_session_state()
|
379 |
|
380 |
st.title("Live AI Medical Assistant")
|
381 |
-
|
382 |
st.info("Remember: This AI cannot provide medical diagnoses. Always consult a healthcare professional for medical advice.")
|
383 |
|
384 |
with st.sidebar:
|
|
|
98 |
logging.critical("GEMINI_API_KEY not found.")
|
99 |
st.stop()
|
100 |
|
|
|
|
|
101 |
LIVE_CONNECT_CONFIG = types.LiveConnectConfig(
|
102 |
+
response_modalities=["audio", "text", "video"], # Requesting audio response
|
103 |
speech_config=types.SpeechConfig(
|
104 |
voice_config=types.VoiceConfig(
|
105 |
+
prebuilt_voice_config=types.PrebuiltVoiceConfig(voice_name="Zephyr") # Using Puck voice
|
106 |
)
|
107 |
) # <---------------------------------- CORRECTED: Added missing closing parenthesis
|
108 |
)
|
|
|
146 |
audio_chunks_to_gemini_q.task_done(); return audio_chunk
|
147 |
except asyncio.TimeoutError: return None
|
148 |
except Exception as e: logging.error(f"Error getting audio from queue: {e}", exc_info=True); return None
|
149 |
+
|
150 |
try:
|
151 |
while self.is_running:
|
152 |
if not self.gemini_session: await asyncio.sleep(0.1); continue
|
|
|
377 |
initialize_app_session_state()
|
378 |
|
379 |
st.title("Live AI Medical Assistant")
|
380 |
+
|
381 |
st.info("Remember: This AI cannot provide medical diagnoses. Always consult a healthcare professional for medical advice.")
|
382 |
|
383 |
with st.sidebar:
|