Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -418,6 +418,27 @@ with gr.Blocks(title="GAIA Agent") as app:
|
|
| 418 |
outputs=[questions_display]
|
| 419 |
)
|
| 420 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 421 |
if __name__ == "__main__":
|
| 422 |
-
app
|
|
|
|
| 423 |
|
|
|
|
| 418 |
outputs=[questions_display]
|
| 419 |
)
|
| 420 |
|
| 421 |
+
# Import Agent class from agent.py for template compatibility
|
| 422 |
+
try:
|
| 423 |
+
from agent import Agent
|
| 424 |
+
print("✅ Agent class imported from agent.py")
|
| 425 |
+
except ImportError:
|
| 426 |
+
# Fallback: create Agent class here
|
| 427 |
+
class Agent:
|
| 428 |
+
"""Fallback Agent class."""
|
| 429 |
+
def __init__(self):
|
| 430 |
+
print("Agent initialized (fallback)")
|
| 431 |
+
|
| 432 |
+
def __call__(self, question: str) -> str:
|
| 433 |
+
try:
|
| 434 |
+
if not question or not question.strip():
|
| 435 |
+
return "Error: Empty question"
|
| 436 |
+
answer = run_agent(question)
|
| 437 |
+
return answer if answer else "No answer found"
|
| 438 |
+
except Exception as e:
|
| 439 |
+
return f"Error: {str(e)}"
|
| 440 |
+
|
| 441 |
if __name__ == "__main__":
|
| 442 |
+
# Launch main app
|
| 443 |
+
app.launch(share=False, server_name="0.0.0.0", server_port=7860)
|
| 444 |
|