Skip to content

Conversation

@MarcACard
Copy link
Contributor

@MarcACard MarcACard commented Jan 1, 2026

Background

The AI SDK defines image-url as a valid tool result content type in LanguageModelV3ToolResultOutput, but the OpenAI provider's convertToOpenAIResponsesInput function didn't handle this type.

When a tool returned image-url content, it fell through to the default case, produced a warning ("unsupported tool content part type: image-url"), and the image was dropped.

Summary

Added a case to handle image-url tool result content by converting it to OpenAI's input_image format. OpenAI's Responses API accepts HTTP URLs in the image_url field (alongside data URLs), so this is a gap in the provider implementation rather than a missing API feature.

Manual Verification

I tested these changes in a separate project with a tool that returns image-url content:

  • Before fix: Warning displayed ("unsupported tool content part type: image-url") and image was dropped
  • After fix: No warning, and the LLM successfully processed and described the image from the URL

I can provide a self-contained code sample if needed.

Checklist

  • Tests have been added / updated (for bug fixes / features)
  • Documentation has been added / updated (for bug fixes / features)
  • A patch changeset for relevant packages has been added (for bug fixes / features - run pnpm changeset in the project root)
  • I have reviewed this pull request (self-review)

@vercel-ai-sdk vercel-ai-sdk bot added ai/provider bug Something isn't working as documented provider/anthropic labels Jan 1, 2026
@aayush-kapoor
Copy link
Contributor

hi thanks for the PR!

I can provide a self-contained code sample if needed.

yes please - add it in the examples folder in the appropriate sub directory so that we can verify it too

@aayush-kapoor
Copy link
Contributor

aayush-kapoor commented Jan 5, 2026

can you take a look at the failing CI tests?
nevermind, i fixed them

@MarcACard
Copy link
Contributor Author

yes please - add it in the examples folder in the appropriate sub directory so that we can verify it too

Sure thing, will pull something together and update.

@MarcACard
Copy link
Contributor Author

Example added for testing 👍

Copy link
Contributor

@aayush-kapoor aayush-kapoor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

verified that the fix works for the example

@aayush-kapoor aayush-kapoor merged commit dc87517 into vercel:main Jan 6, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai/provider bug Something isn't working as documented provider/anthropic

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants