Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -57,8 +57,19 @@ def call_search(purpose, task, history, action_input):
|
|
| 57 |
print(f'THIS_OBJ :: {this_obj[0]}')
|
| 58 |
for i,eb in enumerate(this_obj):
|
| 59 |
#return_list.append(this_obj[i].id)
|
| 60 |
-
return_list.append(this_obj[i]
|
| 61 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
print (return_list)
|
| 63 |
history = "observation: the search results are:\n {}\n".format(return_list)
|
| 64 |
else:
|
|
@@ -182,12 +193,16 @@ def run_action(purpose, task, history, action_name, action_input):
|
|
| 182 |
if VERBOSE:
|
| 183 |
print("COMPRESSING HISTORY")
|
| 184 |
history = compress_history(purpose, task, history)
|
|
|
|
|
|
|
|
|
|
| 185 |
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
|
|
|
|
| 191 |
|
| 192 |
def run(purpose,history):
|
| 193 |
task=None
|
|
|
|
| 57 |
print(f'THIS_OBJ :: {this_obj[0]}')
|
| 58 |
for i,eb in enumerate(this_obj):
|
| 59 |
#return_list.append(this_obj[i].id)
|
| 60 |
+
return_list.append({"id":this_obj[i].id,
|
| 61 |
+
"author":this_obj[i].author,
|
| 62 |
+
"created_at":this_obj[i].created_at,
|
| 63 |
+
"last_modified":this_obj[i].last_modified,
|
| 64 |
+
"private":this_obj[i].private,
|
| 65 |
+
"gated":this_obj[i].gated,
|
| 66 |
+
"disabled":this_obj[i].disabled,
|
| 67 |
+
"downloads":this_obj[i].downloads,
|
| 68 |
+
"likes":this_obj[i].likes,
|
| 69 |
+
"library_name":this_obj[i].library_name,
|
| 70 |
+
"tags":this_obj[i].tags,
|
| 71 |
+
"pipeline_tag":this_obj[i].pipeline_tag,
|
| 72 |
+
})
|
| 73 |
print (return_list)
|
| 74 |
history = "observation: the search results are:\n {}\n".format(return_list)
|
| 75 |
else:
|
|
|
|
| 193 |
if VERBOSE:
|
| 194 |
print("COMPRESSING HISTORY")
|
| 195 |
history = compress_history(purpose, task, history)
|
| 196 |
+
if action_name in NAME_TO_FUNC:
|
| 197 |
+
|
| 198 |
+
assert action_name in NAME_TO_FUNC
|
| 199 |
|
| 200 |
+
print("RUN: ", action_name, action_input)
|
| 201 |
+
return NAME_TO_FUNC[action_name](purpose, task, history, action_input)
|
| 202 |
+
else:
|
| 203 |
+
history += "observation: The TOOL I tried to use returned an error, I need to select a tool from: (UPDATE-TASK, SEARCH, COMPLETE)
|
| 204 |
|
| 205 |
+
return "MAIN", None, history, task
|
| 206 |
|
| 207 |
def run(purpose,history):
|
| 208 |
task=None
|