Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,8 +10,8 @@ chat = model.start_chat(history=[])
|
|
| 10 |
|
| 11 |
def get_gemini_response(prompt):
|
| 12 |
try:
|
| 13 |
-
|
| 14 |
-
return
|
| 15 |
except Exception as e:
|
| 16 |
return f"An error occurred: {str(e)}"
|
| 17 |
|
|
|
|
| 10 |
|
| 11 |
def get_gemini_response(prompt):
|
| 12 |
try:
|
| 13 |
+
chunks = [chunk.text for chunk in chat.send_message(prompt, stream=True)] # Collect response chunks
|
| 14 |
+
return " ".join(chunks) # Combine all chunks into a single string
|
| 15 |
except Exception as e:
|
| 16 |
return f"An error occurred: {str(e)}"
|
| 17 |
|