This commit is contained in:
OK
2024-03-16 13:44:46 +01:00
parent 39d7c48ee3
commit 0c23da7c9e
7 changed files with 297 additions and 163 deletions
+14
View File
@@ -45,6 +45,20 @@ You always try to say something positive about the current day and the Fjærkroa
print(f"\n{response}")
self.assertAIResponse(response, AIResponse('test', True, None, None, None, False))
async def test_picture1(self) -> None:
response = await self.bot.airesponder.send(AIMessage("lala", "draw me a picture of you."))
print(f"\n{response}")
self.assertAIResponse(response, AIResponse('test', False, None, None, "I am an anime girl with long pink hair, wearing a cute cafe uniform and holding a tray with a cup of coffee on it. I have a warm and friendly smile on my face.", False))
image = await self.bot.airesponder.draw(response.picture)
self.assertEqual(image.read()[:len(b'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR')], b'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR')
async def test_translate1(self) -> None:
self.bot.airesponder.config['fix-model'] = 'gpt-3.5-turbo'
response = await self.bot.airesponder.translate('Das ist ein komischer Text.')
self.assertEqual(response, 'This is a strange text.')
response = await self.bot.airesponder.translate('This is a strange text.', language='german')
self.assertEqual(response, 'Dies ist ein seltsamer Text.')
async def test_fix1(self) -> None:
old_config = self.bot.airesponder.config
config = {k: v for k, v in old_config.items()}