Spaces:
Running
Running
Update app.py
Browse filesUpdated summarize and answer function to only return the answer
app.py
CHANGED
@@ -101,11 +101,11 @@ def get_current_time_in_timezone(timezone: str) -> str:
|
|
101 |
except Exception as e:
|
102 |
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
103 |
@tool
|
104 |
-
def summarize_and_answer_from_web(url: str, question:str) ->
|
105 |
'''
|
106 |
A tool which takes a pair of inputs, a website and a question, and finds all relevant information
|
107 |
about that question from the website, and return both the summary and the answer.
|
108 |
-
|
109 |
Args:
|
110 |
url: a string which says which website to get information from
|
111 |
question: a string of text asking for information from that website
|
@@ -144,7 +144,8 @@ def summarize_and_answer_from_web(url: str, question:str) -> tuple:
|
|
144 |
answer = para
|
145 |
break
|
146 |
|
147 |
-
return summary, answer
|
|
|
148 |
|
149 |
|
150 |
final_answer = FinalAnswerTool()
|
|
|
101 |
except Exception as e:
|
102 |
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
103 |
@tool
|
104 |
+
def summarize_and_answer_from_web(url: str, question:str) -> str:
|
105 |
'''
|
106 |
A tool which takes a pair of inputs, a website and a question, and finds all relevant information
|
107 |
about that question from the website, and return both the summary and the answer.
|
108 |
+
Adjusted the code to only return the answer, to avoid errors in application by the agent.
|
109 |
Args:
|
110 |
url: a string which says which website to get information from
|
111 |
question: a string of text asking for information from that website
|
|
|
144 |
answer = para
|
145 |
break
|
146 |
|
147 |
+
#return summary, answer
|
148 |
+
return answer
|
149 |
|
150 |
|
151 |
final_answer = FinalAnswerTool()
|