Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -22,12 +22,17 @@ class BasicAgent:
|
|
| 22 |
print("BasicAgent initialized.")
|
| 23 |
|
| 24 |
def __call__(self, question: str) -> str:
|
| 25 |
-
print(f"Agent received question
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
|
| 33 |
def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
|
|
| 22 |
print("BasicAgent initialized.")
|
| 23 |
|
| 24 |
def __call__(self, question: str) -> str:
|
| 25 |
+
print(f"Agent received question: {question}")
|
| 26 |
+
|
| 27 |
+
# Get the full response from your agent
|
| 28 |
+
full_response = main(question)
|
| 29 |
+
|
| 30 |
+
# Extract just the answer part after "FINAL ANSWER: "
|
| 31 |
+
if "FINAL ANSWER: " in full_response:
|
| 32 |
+
return full_response.split("FINAL ANSWER: ", 1)[1].strip()
|
| 33 |
+
else:
|
| 34 |
+
return full_response.strip()
|
| 35 |
+
|
| 36 |
|
| 37 |
|
| 38 |
def run_and_submit_all( profile: gr.OAuthProfile | None):
|