Description
Description
The SDK downloads images when using Image URL parts with providers that don't support them (such as Gemini).
However, there is an issue when deciding whether to download the images or now. This seems to be based off of the model given to streamText / generateText, but it doesn't get updated if the model gets changed dynamically in prepareStep.
This means that if I have
streamText({
model: openaiProvider("gpt-5"),
prepareStep: async (step) => {
return {
model: geminiProvider("gemini-2.5-flash")
}
}
})
It will NOT download the images and send image URLs to gemini.
Vice versa, if I set gemini in model and gpt in prepareStep, it will send base64 images to gpt instead of sending URLs.
AI SDK Version
ai: 5.0.59
Code of Conduct