Merge pull request #19584 from Classic298/patch-1

refac: improve weaker model's ability of understanding that the image was created successfully
This commit is contained in:
Tim Baek 2025-11-29 13:09:45 -05:00 committed by GitHub
commit b56adf01e3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -848,7 +848,7 @@ async def chat_image_generation_handler(
} }
) )
system_message_content = f"<context>Image generation was attempted but failed. The system is currently unable to generate the image. Tell the user that an error occurred: {error_message}</context>" system_message_content = f"<context>Image generation was attempted but failed. The system is currently unable to generate the image. Tell the user that the following error occurred: {error_message}</context>"
else: else:
# Create image(s) # Create image(s)
@ -911,7 +911,7 @@ async def chat_image_generation_handler(
} }
) )
system_message_content = "<context>The requested image has been created and is now being shown to the user. Let them know that it has been generated.</context>" system_message_content = "<context>The requested image has been created by the system successfully and is now being shown to the user. Let the user know that the image they requested has been generated and is now shown in the chat.</context>"
except Exception as e: except Exception as e:
log.debug(e) log.debug(e)
@ -932,7 +932,7 @@ async def chat_image_generation_handler(
} }
) )
system_message_content = f"<context>Image generation was attempted but failed. The system is currently unable to generate the image. Tell the user that an error occurred: {error_message}</context>" system_message_content = f"<context>Image generation was attempted but failed because of an error. The system is currently unable to generate the image. Tell the user that the following error occurred: {error_message}</context>"
if system_message_content: if system_message_content:
form_data["messages"] = add_or_update_system_message( form_data["messages"] = add_or_update_system_message(