johann22 commited on
Commit
18542cb
1 Parent(s): 48582e1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -11
app.py CHANGED
@@ -97,17 +97,20 @@ def compress_history(purpose, task, history, directory):
97
 
98
  def call_search(purpose, task, history, directory, action_input):
99
  print("CALLING SEARCH")
100
- if "http" in action_input:
101
- if "<" in action_input:
102
- action_input = action_input.strip("<")
103
- if ">" in action_input:
104
- action_input = action_input.strip(">")
105
- response = i_s(action_input)
106
- #response = google(search_return)
107
- print(response)
108
- history += "observation: search result is: {}\n".format(response)
109
- else:
110
- history += "observation: I need to provide a valid URL to 'action: SEARCH action_input=URL'\n"
 
 
 
111
  return "MAIN", None, history, task
112
 
113
  def call_main(purpose, task, history, directory, action_input):
 
97
 
98
  def call_search(purpose, task, history, directory, action_input):
99
  print("CALLING SEARCH")
100
+ try:
101
+ if "http" in action_input:
102
+ if "<" in action_input:
103
+ action_input = action_input.strip("<")
104
+ if ">" in action_input:
105
+ action_input = action_input.strip(">")
106
+ response = i_s(action_input)
107
+ #response = google(search_return)
108
+ print(response)
109
+ history += "observation: search result is: {}\n".format(response)
110
+ else:
111
+ history += "observation: I need to provide a valid URL to 'action: SEARCH action_input=URL'\n"
112
+ except Exception as e:
113
+ history += "observation: {}'\n".format(e)
114
  return "MAIN", None, history, task
115
 
116
  def call_main(purpose, task, history, directory, action_input):