ChIrish06 commited on
Commit
f50d9b5
·
verified ·
1 Parent(s): 154ba0d

Update app.py

Browse files

Updated summarize and answer function to only return the answer

Files changed (1) hide show
  1. app.py +4 -3
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) -> tuple:
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
- To avoid errors, only the answer - the second element of the tuple - should be printed
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()