Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -165,8 +165,9 @@ class GeminiInteractionLoop:
|
|
165 |
return
|
166 |
try:
|
167 |
logging.info(f"Sending text to Gemini: '{user_text[:50]}...'")
|
168 |
-
#
|
169 |
-
|
|
|
170 |
except Exception as e:
|
171 |
logging.error(
|
172 |
f"Error sending text message to Gemini: {e}", exc_info=True)
|
@@ -433,8 +434,9 @@ class GeminiInteractionLoop:
|
|
433 |
f"Gemini session established with API for model {MODEL_NAME}.")
|
434 |
try:
|
435 |
logging.info("Sending system prompt to Gemini...")
|
436 |
-
#
|
437 |
-
|
|
|
438 |
logging.info("System prompt sent successfully.")
|
439 |
except Exception as e:
|
440 |
logging.error(
|
|
|
165 |
return
|
166 |
try:
|
167 |
logging.info(f"Sending text to Gemini: '{user_text[:50]}...'")
|
168 |
+
# Format text as a Content object for the Gemini API
|
169 |
+
content = types.Content(parts=[types.Part(text=user_text)])
|
170 |
+
await self.gemini_session.send(content)
|
171 |
except Exception as e:
|
172 |
logging.error(
|
173 |
f"Error sending text message to Gemini: {e}", exc_info=True)
|
|
|
434 |
f"Gemini session established with API for model {MODEL_NAME}.")
|
435 |
try:
|
436 |
logging.info("Sending system prompt to Gemini...")
|
437 |
+
# Format system prompt as a Content object for the Gemini API
|
438 |
+
content = types.Content(parts=[types.Part(text=MEDICAL_ASSISTANT_SYSTEM_PROMPT)])
|
439 |
+
await self.gemini_session.send(content)
|
440 |
logging.info("System prompt sent successfully.")
|
441 |
except Exception as e:
|
442 |
logging.error(
|