From d68262bfee31b2ced6679f470003d3f2c9469061 Mon Sep 17 00:00:00 2001 From: Cyberes Date: Wed, 19 Apr 2023 13:28:53 -0600 Subject: [PATCH] fix wrong func. --- matrix_gpt/bot/chat_functions.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/matrix_gpt/bot/chat_functions.py b/matrix_gpt/bot/chat_functions.py index c75350c..5415716 100644 --- a/matrix_gpt/bot/chat_functions.py +++ b/matrix_gpt/bot/chat_functions.py @@ -215,7 +215,10 @@ async def process_chat( await client.room_typing(room.room_id, typing_state=False, timeout=15000) await react_to_event(client, room.room_id, event.event_id, '❌') return - text_response = response["choices"][0]["message"]["content"].strip().strip('\n') + if openai_model in ['gpt-3', 'gpt-4']: + text_response = response["choices"][0]["message"]["content"].strip().strip('\n') + elif openai_model in ['text-davinci-003', 'davinci-instruct-beta', 'text-davinci-001', 'text-davinci-002', 'text-curie-001', 'text-babbage-001']: + text_response = response["choices"][0]["text"].strip().strip('\n') # Logging stuff if log_full_response: