Spaces:
Build error
Build error
optimised the answer_question function
Browse files
agent.py
CHANGED
@@ -65,6 +65,8 @@ agent = CodeAgent(
|
|
65 |
)
|
66 |
|
67 |
def answer_question(question: str) -> str:
|
68 |
-
"""Run agent on question and format output"""
|
69 |
result = agent.run(question)
|
70 |
-
|
|
|
|
|
|
|
|
65 |
)
|
66 |
|
67 |
def answer_question(question: str) -> str:
|
|
|
68 |
result = agent.run(question)
|
69 |
+
# Ensure output starts with "FINAL ANSWER:"
|
70 |
+
if not result.strip().startswith("FINAL ANSWER:"):
|
71 |
+
result = f"FINAL ANSWER: {result.strip()}"
|
72 |
+
return result
|