Spaces:
Runtime error
Runtime error
Commit
·
ba1c986
1
Parent(s):
6532dec
correct agent type issue
Browse files
app.py
CHANGED
@@ -291,12 +291,19 @@ class GPTRemote(LLM):
|
|
291 |
if CurrentAgent == 'Structured Zero Short Agent':
|
292 |
try:
|
293 |
# temp = output.split('{')[1].split('}')[0:-2]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
294 |
pattern = r'\{((?:[^{}]|(?R))*)\}'
|
295 |
temp = regex.search(pattern, output)
|
296 |
rrr = temp.group()
|
297 |
output = output.replace(rrr, '```'+ '\n' + rrr + '\n'+'```')
|
298 |
|
299 |
-
print(output)
|
300 |
except Exception as e:
|
301 |
print("model internal error:", e)
|
302 |
print("-" * 20)
|
|
|
291 |
if CurrentAgent == 'Structured Zero Short Agent':
|
292 |
try:
|
293 |
# temp = output.split('{')[1].split('}')[0:-2]
|
294 |
+
|
295 |
+
if output.strip()[-1] == '}':
|
296 |
+
print("valid command")
|
297 |
+
else:
|
298 |
+
output = output + '}'
|
299 |
+
print("corrected command")
|
300 |
+
|
301 |
pattern = r'\{((?:[^{}]|(?R))*)\}'
|
302 |
temp = regex.search(pattern, output)
|
303 |
rrr = temp.group()
|
304 |
output = output.replace(rrr, '```'+ '\n' + rrr + '\n'+'```')
|
305 |
|
306 |
+
# print("Found command: ", output)
|
307 |
except Exception as e:
|
308 |
print("model internal error:", e)
|
309 |
print("-" * 20)
|