Update app.py
Browse files
app.py
CHANGED
|
@@ -46,7 +46,7 @@ def parse_action(string: str):
|
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
-
VERBOSE =
|
| 50 |
MAX_HISTORY = 100
|
| 51 |
MAX_DATA = 20000
|
| 52 |
|
|
@@ -249,15 +249,16 @@ def call_main(purpose, task, history, action_input):
|
|
| 249 |
action_name, action_input = parse_action(line)
|
| 250 |
print(f'ACTION::{action_name} -- INPUT :: {action_input}')
|
| 251 |
history += "{}\n".format(line)
|
| 252 |
-
return action_name, action_input, history, task
|
| 253 |
else:
|
| 254 |
-
|
| 255 |
-
history += "{}\n".format(line)
|
| 256 |
#assert False, "unknown action: {}".format(line)
|
| 257 |
#return "UPDATE-TASK", None, history, task
|
| 258 |
if "VERBOSE":
|
| 259 |
print(history)
|
| 260 |
-
|
|
|
|
| 261 |
|
| 262 |
|
| 263 |
def call_set_task(purpose, task, history, action_input):
|
|
@@ -327,10 +328,10 @@ def find_all(purpose,task,history, url):
|
|
| 327 |
print (f'out:: {out}')
|
| 328 |
history += "observation: the search results are:\n {}\n".format(out)
|
| 329 |
task = "complete?"
|
| 330 |
-
return "
|
| 331 |
else:
|
| 332 |
history += "observation: I need to trigger a search using the following syntax:\naction: SCRAPE_WEBSITE action_input=URL\n"
|
| 333 |
-
return "
|
| 334 |
except Exception as e:
|
| 335 |
print (e)
|
| 336 |
history += "observation: I need to trigger a search using the following syntax:\naction: SCRAPE_WEBSITE action_input=URL\n"
|
|
|
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
+
VERBOSE = True
|
| 50 |
MAX_HISTORY = 100
|
| 51 |
MAX_DATA = 20000
|
| 52 |
|
|
|
|
| 249 |
action_name, action_input = parse_action(line)
|
| 250 |
print(f'ACTION::{action_name} -- INPUT :: {action_input}')
|
| 251 |
history += "{}\n".format(line)
|
| 252 |
+
#return action_name, action_input, history, task
|
| 253 |
else:
|
| 254 |
+
pass
|
| 255 |
+
#history += "{}\n".format(line)
|
| 256 |
#assert False, "unknown action: {}".format(line)
|
| 257 |
#return "UPDATE-TASK", None, history, task
|
| 258 |
if "VERBOSE":
|
| 259 |
print(history)
|
| 260 |
+
action_name="MAIN" if not action_name else action_name
|
| 261 |
+
return action_name, None, history, task
|
| 262 |
|
| 263 |
|
| 264 |
def call_set_task(purpose, task, history, action_input):
|
|
|
|
| 328 |
print (f'out:: {out}')
|
| 329 |
history += "observation: the search results are:\n {}\n".format(out)
|
| 330 |
task = "complete?"
|
| 331 |
+
return "MAIN", None, history, task
|
| 332 |
else:
|
| 333 |
history += "observation: I need to trigger a search using the following syntax:\naction: SCRAPE_WEBSITE action_input=URL\n"
|
| 334 |
+
return "MAIN", None, history, task
|
| 335 |
except Exception as e:
|
| 336 |
print (e)
|
| 337 |
history += "observation: I need to trigger a search using the following syntax:\naction: SCRAPE_WEBSITE action_input=URL\n"
|