Skip to content

Conversation

@vercel-ai-sdk
Copy link
Contributor

@vercel-ai-sdk vercel-ai-sdk bot commented Oct 16, 2025

This is an automated backport of #9529 to the release-v5.0 branch.

…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"`.
@vercel-ai-sdk vercel-ai-sdk bot merged commit 099ed34 into release-v5.0 Oct 16, 2025
20 checks passed
@vercel-ai-sdk vercel-ai-sdk bot deleted the backport-pr-9529-to-release-v5.0 branch October 16, 2025 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants