Changed order of tool parameters, switched over to gpt4o

This commit is contained in:
2024-08-17 19:21:15 -05:00
parent 31a041e300
commit a8d470333b
3 changed files with 11 additions and 9 deletions
+2 -2
View File
@@ -128,7 +128,7 @@ async def handle_message(update: Update, context: ContextTypes.DEFAULT_TYPE) ->
del user_images[user_id]
else:
# Call OpenAI API for inference (text-only)
response = get_chat_response(client, messages, 16384, GPT_4O_MINI)
response = get_chat_response(client, messages, 4096, GPT_4O)
# Extract the assistant's reply
assistant_message = response.choices[0].message
@@ -145,7 +145,7 @@ async def handle_message(update: Update, context: ContextTypes.DEFAULT_TYPE) ->
})
# Call API again to get the final response
assistant_message = get_chat_response(client, messages, 16384, GPT_4O_MINI).choices[0].message
assistant_message = get_chat_response(client, messages, 4096, GPT_4O).choices[0].message
if not hasattr(assistant_message, 'function_call') or not assistant_message.function_call:
assistant_reply = assistant_message.content
conversation_history[user_id].append({"role": "assistant", "content": assistant_reply})