Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
101 |
-
if "
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
|
|
|
|
|
|
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):
|