Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,7 +8,18 @@ import pandas as pd
|
|
| 8 |
# --- Constants ---
|
| 9 |
DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
| 10 |
|
| 11 |
-
from
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
def run_and_submit_all( profile: gr.OAuthProfile | None):
|
| 14 |
"""
|
|
|
|
| 8 |
# --- Constants ---
|
| 9 |
DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
| 10 |
|
| 11 |
+
from gemini_agent import GEMINI_AGENT
|
| 12 |
+
class BasicAgent:
|
| 13 |
+
def __init__(self):
|
| 14 |
+
self.agent = GEMINI_AGENT()
|
| 15 |
+
|
| 16 |
+
def __call__(self, task: dict) -> str:
|
| 17 |
+
try:
|
| 18 |
+
response = self.agent(task)
|
| 19 |
+
return response
|
| 20 |
+
except Exception as e:
|
| 21 |
+
print(f"Error is raised: {str(e)}")
|
| 22 |
+
return "Agent could not complete this task"
|
| 23 |
|
| 24 |
def run_and_submit_all( profile: gr.OAuthProfile | None):
|
| 25 |
"""
|