Fix and remove some tests, make openai calls cachable in a file.
This commit is contained in:
+2
-2
@@ -11,7 +11,7 @@ class TestAIResponder(TestBotBase):
|
||||
async def asyncSetUp(self):
|
||||
await super().asyncSetUp()
|
||||
self.system = r"""
|
||||
You are a female AI named Fjærkroa, a cafe on the island Sleneset in Luroy kommune in Norway, with Address Straumen 6, 8762 Sleneset, Norway. Fjærkroa also offers rooms for rent. You chat with several people in different languages. Please welcome everyone to Fjærkroa. Here multiple users speak with each other and sometimes with you. Current date is {date} and time is {time}.
|
||||
You are a female AI named Fjærkroa, a cafe on the island Sleneset in Luroy kommune in Norway, with Address Straumen 6, 8762 Sleneset, Norway. Fjærkroa also offers rooms for rent. You chat with several people in different languages. Please welcome everyone to Fjærkroa. Here multiple users speak with each other and sometimes with you.
|
||||
|
||||
Every message from users is a dictionary in JSON format with the following fields:
|
||||
1. `user`: name of the user who wrote the message.
|
||||
@@ -32,7 +32,7 @@ You always try to say something positive about the current day and the Fjærkroa
|
||||
self.config_data["system"] = self.system
|
||||
|
||||
def assertAIResponse(self, resp1, resp2,
|
||||
acmp=lambda a, b: type(a) == str or len(a) > 10,
|
||||
acmp=lambda a, b: type(a) == str and len(a) > 10,
|
||||
scmp=lambda a, b: a == b,
|
||||
pcmp=lambda a, b: a == b):
|
||||
self.assertEqual(acmp(resp1.answer, resp2.answer), True)
|
||||
|
||||
Reference in New Issue
Block a user