Efficiently Maintaining Chat Context with Images in Conversation History

When I have images and texts in my conversation history, do I have to include the image again with the conversation history in every new message in order to maintain the chat context? Is there a more efficient way to maintain the chat context with conversation histories containing images?

1 Like

they encourage to use image url for this purpose.

For long running conversations, we suggest passing images via URL’s instead of base64.

Reference: Managing images

2 Likes

URLs don’t reduce your cost, in fact they increase it because of sizes unmanaged by you.

Instead, what you can do is implement a strategy of dropping images from chat history user messages after just one or two turns, instead of continuing to send them. You also can use detail:low on past images to reduce the costs over 66%. The AI assistant answer about the images will carry a lot of meaning for the continued answering and illusion of memory if continuing to discuss images.

3 Likes