Spaces:
Runtime error
Runtime error
Salvatore Rossitto
commited on
Commit
·
e98f9af
1
Parent(s):
be2fbe5
...
Browse files- RBotReloaded.py +12 -1
RBotReloaded.py
CHANGED
|
@@ -313,8 +313,19 @@ AI:
|
|
| 313 |
if f"{tool}:" in line.lower() or f"{tool}(" in line.lower():
|
| 314 |
action_name = tool
|
| 315 |
action_input = line[line.lower().find(tool)+len(tool):].strip().replace("query_params", "").strip().replace("()","")
|
| 316 |
-
|
|
|
|
|
|
|
|
|
|
| 317 |
if (action_name and action_input): break
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 318 |
|
| 319 |
# Call tool if found
|
| 320 |
if action_name and action_input:
|
|
|
|
| 313 |
if f"{tool}:" in line.lower() or f"{tool}(" in line.lower():
|
| 314 |
action_name = tool
|
| 315 |
action_input = line[line.lower().find(tool)+len(tool):].strip().replace("query_params", "").strip().replace("()","")
|
| 316 |
+
if (len(action_input) < 2):
|
| 317 |
+
action_input = None
|
| 318 |
+
else:
|
| 319 |
+
print(f"Matched unformatted action request. {action_name}:{action_input} from line: {line}")
|
| 320 |
if (action_name and action_input): break
|
| 321 |
+
elif action_name and not action_input:
|
| 322 |
+
action_input = line[line.find(":") + 1:].replace("\"","")
|
| 323 |
+
if (len(action_input) < 2):
|
| 324 |
+
action_input = None
|
| 325 |
+
else:
|
| 326 |
+
print(f"Matched unformatted action request. {action_name}:{action_input} from line: {line}")
|
| 327 |
+
if (action_name and action_input): break
|
| 328 |
+
|
| 329 |
|
| 330 |
# Call tool if found
|
| 331 |
if action_name and action_input:
|