From 02dab2807c8056d7a5386a9323446d2e13fb0422 Mon Sep 17 00:00:00 2001 From: Oleksandr Kozachuk Date: Tue, 24 Oct 2023 12:59:13 +0200 Subject: [PATCH] Fix usage of the dynamic answer is some cases. --- chatmastermind/ais/openai.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chatmastermind/ais/openai.py b/chatmastermind/ais/openai.py index a8ceb34..e3ce5a6 100644 --- a/chatmastermind/ais/openai.py +++ b/chatmastermind/ais/openai.py @@ -150,7 +150,7 @@ class OpenAI(AI): for message in chat.messages: if message.answer: prompt_tokens += append('user', message.question) - prompt_tokens += append('assistant', message.answer) + prompt_tokens += append('assistant', str(message.answer)) if question: prompt_tokens += append('user', question.question) return oai_chat, prompt_tokens