-
Notifications
You must be signed in to change notification settings - Fork 3.4k
docs(tools): update multi-modal tool results providers and example #9529
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lgrammel
approved these changes
Oct 16, 2025
Collaborator
|
please fix prettier errors |
Collaborator
the automation had a bug, fixed now, sorry for that, one fix introduced another bug, story of my life ✌🏼 |
vercel-ai-sdk bot
pushed a commit
that referenced
this pull request
Oct 16, 2025
…9529) ## Background There are two inaccuracies in the [Multi-modal Tool Results](https://ai-sdk.dev/docs/ai-sdk-core/tools-and-tool-calling#multi-modal-tool-results) documentation: (1) The documentation states that "Multi-modal tool results are experimental and only supported by Anthropic.", but empirically it works for OpenAI. (2) The `toModelOutput` function in the example returns an item with `type: "image"` which is not compatible with `LanguageModelV2ToolResultOutput`: ``` export type LanguageModelV2ToolResultOutput = | { type: 'text'; value: string } | { type: 'json'; value: JSONValue } | { type: 'error-text'; value: string } | { type: 'error-json'; value: JSONValue } | { type: 'content'; value: Array< | { type: 'text'; text: string; } | { type: 'media'; data: string; mediaType: string; } >; }; ``` ## Summary (1) Added OpenAI as a provider with multi-modal tool result support. (2) Replaced `type: "image"` with `type: "media"`.
Contributor
|
✅ Backport PR created: #9570 |
vercel-ai-sdk bot
added a commit
that referenced
this pull request
Oct 16, 2025
…example (#9570) This is an automated backport of #9529 to the release-v5.0 branch. Co-authored-by: Ellis Driscoll <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Background
There are two inaccuracies in the Multi-modal Tool Results documentation:
(1) The documentation states that "Multi-modal tool results are experimental and only supported by Anthropic.", but empirically it works for OpenAI.
(2) The
toModelOutputfunction in the example returns an item withtype: "image"which is not compatible withLanguageModelV2ToolResultOutput:Summary
(1) Added OpenAI as a provider with multi-modal tool result support.
(2) Replaced
type: "image"withtype: "media".Checklist
pnpm changesetin the project root)pnpm prettier-fixin the project root)