We have a use case where we are creating a new conversation from an existing one, and I have to add the last few messages as context to the new conversation. So I create a new conversation and add the conversation items to it using “Create Items“. It works fine until I add a conversation item that contains input_image. When I add an item with an image, it fails with BadRequestError: 400 Error while downloading {imageUrl}. I am adding code that I am using below with the error details:
const response = await this.openAiConvesationService.items.create(conversation.id, {
items: serializedItems,
});
Sample input item
[
{
"type": "message",
"content": [
{
"type": "input_text",
"text": "Okay lets analyze my starter"
},
{
"type": "input_image",
"detail": "auto",
"image_url": "https://images.food52.com/t9oX_tD1C21tZd5Duhh9NmH2FzI=/27aa2e1d-5b46-4c04-b424-045780c98ca8--IMG_0953.jpg"
}
],
"role": "user"
}
]
I get following error:
{
"error": {
"message": "Error while downloading https://images.food52.com/t9oX_tD1C21tZd5Duhh9NmH2FzI=/27aa2e1d-5b46-4c04-b424-045780c98ca8--IMG_0953.jpg.",
"type": "invalid_request_error",
"param": "url",
"code": "invalid_value"
}
}
Please note that this image_url works fine with the responses API and I don’t see any issue with downloading the image. Any help will be appriciated.