Update prompt and using gpt-4o-mini because files are long

This commit is contained in:
2024-08-17 18:28:33 -05:00
parent 5d7c5aa23d
commit 4afdbebd2e
2 changed files with 20 additions and 17 deletions
+2 -2
View File
@@ -118,7 +118,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, 4096, GPT_4O)
response = get_chat_response(client, messages, 16384, GPT_4O_MINI)
# Extract the assistant's reply
assistant_message = response.choices[0].message
@@ -135,7 +135,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, 4096, GPT_4O).choices[0].message
assistant_message = get_chat_response(client, messages, 16384, GPT_4O_MINI).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})