Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -51,9 +51,10 @@ class GeminiModel:
|
|
| 51 |
contents=[{"role": "user", "parts": [{"text": prompt}]}],
|
| 52 |
generation_config=self.generation_config
|
| 53 |
)
|
| 54 |
-
|
|
|
|
| 55 |
except Exception as e:
|
| 56 |
-
return f"Error during Gemini call: {str(e)}"
|
| 57 |
|
| 58 |
# Define BasicAgent properly
|
| 59 |
class BasicAgent:
|
|
|
|
| 51 |
contents=[{"role": "user", "parts": [{"text": prompt}]}],
|
| 52 |
generation_config=self.generation_config
|
| 53 |
)
|
| 54 |
+
# Return a dictionary that CodeAgent expects
|
| 55 |
+
return {"content": response.candidates[0].content.parts[0].text.strip()}
|
| 56 |
except Exception as e:
|
| 57 |
+
return {"content": f"Error during Gemini call: {str(e)}"}"
|
| 58 |
|
| 59 |
# Define BasicAgent properly
|
| 60 |
class BasicAgent:
|