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: