Update prompt and using gpt-4o-mini because files are long
This commit is contained in:
@@ -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})
|
||||
|
||||
Reference in New Issue
Block a user