Currently, format of the API response is as follows:
{
ai_msg: <message of the AI chat-bot>
url: null
}
Problem:
API response should be updated as follows:
{
ai_msg: <message of the AI chat-bot>
url: <null if there is no URL of an image> | <if there is an image, the URL>
}
Example for the current scenario:
Human Message (API request body):
{
"human_msg": "Hi! Can you generate an image of a car for me?"
}
Chat-bot Response:
{
"ai_msg": "Sure! I'd be happy to help you with that. Could you please provide me with some details about the car you'd like to see in the image? For example, the color of the car, the background, the type of car (e.g., sports car, vintage car, SUV), and any other specific details you have in mind.",
"url": null
}
Human Message:
{
"human_msg": "I want a black BMW car riding on a country road."
}
Chat-bot Response:
{
"ai_msg": "Here is the image of a black BMW car riding on a country road. \n[Click here to view the image](https://storage.googleapis.com/text-to-image-bot-657bb.appspot.com/20240507_041456.jpg?X-Goog-Signature=410383542f70a11d4b6a74254b41e5e7525f63026c683b017e66f45f6b6bd4e939bd58408b8bdf09cf5bad97055e9ccc26a4006409dc80c9c9878)\n\nIs there anything specific you would like to add or modify in the image?",
"url": null
}
As you can see in the final chat-bot's response (step 4), the URL for the image is also embedded inside the ai_msg rather than including it in the url field.
Enhancement:
Create a Langchain chat agent to adapt the above scenario.
Current chat agent is defined in the text-to-image-bot\agents\chat_agent.py.
Create a separate agent under text-to-image-bot\agents\ directory to handle this issue.
Description:
Currently, format of the API response is as follows:
Problem:
API response should be updated as follows:
Example for the current scenario:
ai_msg
rather than including it in theurl
field.Enhancement:
Create a
Langchain
chat agent to adapt the above scenario.text-to-image-bot\agents\chat_agent.py
.text-to-image-bot\agents\
directory to handle this issue.Refer Lanchain chat models structured output section.