Split AI and main tests, implement first AI test.

This commit is contained in:
OK
2023-03-22 18:05:45 +01:00
parent 934ba62557
commit c0f1e7e405
4 changed files with 56 additions and 34 deletions
+9 -1
View File
@@ -81,9 +81,17 @@ class AIResponder(object):
continue
history.append(answer)
self.history = history
for fld in ('answer', 'staff', 'picture'):
if str(response[fld]).strip().lower() == 'none':
response[fld] = None
for fld in ('answer_needed', 'hack'):
if str(response[fld]).strip().lower() == 'true':
response[fld] = True
else:
response[fld] = False
return AIResponse(response['answer'],
response['answer_needed'],
response['staff'],
response['picture'],
response['hack'])
raise RuntimeError(f"Failed to generate answer after multiple retries")
raise RuntimeError("Failed to generate answer after multiple retries")