Skip to content

feat (provider): add providerMetadata to ImageModelV2 interface#5977

Merged
gr2m merged 17 commits intov5from
v5-gr2m/image-provider-v2-fixes-and-add-providerMetadata
Apr 30, 2025
Merged

feat (provider): add providerMetadata to ImageModelV2 interface#5977
gr2m merged 17 commits intov5from
v5-gr2m/image-provider-v2-fixes-and-add-providerMetadata

Conversation

@gr2m
Copy link
Collaborator

@gr2m gr2m commented Apr 25, 2025

Background

Compare #5698

Summary

Additional provider-specific options to the image model provider interface. They are passed through to the provider from the AI SDK and enable provider-specific functionality that can be fully encapsulated in the provider.

Unlike other models, ImageModel request return an array of images, and provider can return image-specific metadata for each. So far, this pull request passing through the revised prompt used for each image. In order to make that possible, I introduced a new type ImageModelV2ProviderMetadata which is the same as SharedV2ProviderMetadata plus it guarantees the presence of the .images key

export type ImageModelV2ProviderMetadata = Record<
  string,
  {
    images: JSONArray;
  } & JSONValue
>;

That also makes it possible to deeply merge providerMetadata from multiple responses effectively.

Verification

I updated the examples/ai-core/src/generate-image/openai.ts example to verify that the code is working.

Tasks

  • 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)
  • Formatting issues have been fixed (run pnpm prettier-fix in the project root)

Future Work

  1. STT and TTS models have similar behavior to Image Models. As we add provider metadata we will likely find patterns that will help us to improve the API for .providerMetadata for these types of models.
  2. Implement providerMetadata in image models by other providers - Follow up issue: [v5] Implement .providerMetadata across all image models #6405

@gr2m gr2m changed the title feat (provider): add providerMetadata to ImageModelV2` interface feat (provider): add providerMetadata to ImageModelV2 interface Apr 25, 2025
Base automatically changed from v5-gr2m/image-provider-v2-fixes to v5 April 25, 2025 22:33
…cific type than `ProviderMetaData` to support image-specific metadata
@gr2m gr2m marked this pull request as ready for review April 29, 2025 23:50
Comment on lines +165 to +174
if (result.providerMetadata) {
for (const [providerName, metadata] of Object.entries<{
images: unknown;
}>(result.providerMetadata)) {
providerMetadata[providerName] ??= { images: [] };
providerMetadata[providerName].images.push(
...result.providerMetadata[providerName].images,
);
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

what about provider metadata that's not images?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It would be merged into the result.providerMetadata[providerName] object, but I haven't seen any meta data yet. I can prepare the code for it already though if you like?

export type ImageModelV2ProviderMetadata = Record<
string,
{
images: JSONArray;
Copy link
Collaborator

Choose a reason for hiding this comment

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

can this be optional or null?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think the dx would be better if it's always present, set to an array with the same length as the result.images array. But each item of the JSONArray can be null

@gr2m gr2m merged commit 9bd5ab5 into v5 Apr 30, 2025
8 checks passed
@gr2m gr2m deleted the v5-gr2m/image-provider-v2-fixes-and-add-providerMetadata branch April 30, 2025 16:22
lgrammel pushed a commit that referenced this pull request May 2, 2025
# Releases
## ai@5.0.0-canary.17

### Major Changes

-   f04fb4a: chore (ai): replace useChat attachments with file ui parts
-   fd1924b: chore (ai): remove redundant `mimeType` property
- fafc3f2: chore (ai): change file to parts to use urls instead of data
-   92cb0a2: chore (ai): rename CoreMessage to ModelMessage

### Minor Changes

-   c9ad635: feat (ai): add filename to file ui parts

### Patch Changes

- 9bd5ab5: feat (provider): add providerMetadata to ImageModelV2
interface (#5977)

The `experimental_generateImage` method from the `ai` package now
returnes revised prompts for OpenAI's image models.

    ```js
    const prompt = 'Santa Claus driving a Cadillac';

    const { providerMetadata } = await experimental_generateImage({
      model: openai.image('dall-e-3'),
      prompt,
    });

const revisedPrompt = providerMetadata.openai.images[0]?.revisedPrompt;

    console.log({
      prompt,
      revisedPrompt,
    });
    ```

-   Updated dependencies [957b739]

-   Updated dependencies [9bd5ab5]
    -   @ai-sdk/provider-utils@3.0.0-canary.14
    -   @ai-sdk/provider@2.0.0-canary.13

## @ai-sdk/provider-utils@3.0.0-canary.14

### Major Changes

- 957b739: chore (provider-utils): rename TestServerCall.requestBody to
requestBodyJson

### Patch Changes

-   Updated dependencies [9bd5ab5]
    -   @ai-sdk/provider@2.0.0-canary.13

## @ai-sdk/amazon-bedrock@3.0.0-canary.14

### Patch Changes

-   Updated dependencies [957b739]
-   Updated dependencies [9bd5ab5]
    -   @ai-sdk/provider-utils@3.0.0-canary.14
    -   @ai-sdk/provider@2.0.0-canary.13

## @ai-sdk/anthropic@2.0.0-canary.14

### Patch Changes

-   Updated dependencies [957b739]
-   Updated dependencies [9bd5ab5]
    -   @ai-sdk/provider-utils@3.0.0-canary.14
    -   @ai-sdk/provider@2.0.0-canary.13

## @ai-sdk/assemblyai@0.0.1-canary.2

### Patch Changes

-   Updated dependencies [957b739]
-   Updated dependencies [9bd5ab5]
    -   @ai-sdk/provider-utils@3.0.0-canary.14
    -   @ai-sdk/provider@2.0.0-canary.13

## @ai-sdk/azure@2.0.0-canary.16

### Patch Changes

-   Updated dependencies [957b739]
-   Updated dependencies [136819b]
-   Updated dependencies [9bd5ab5]
-   Updated dependencies [284353f]
    -   @ai-sdk/provider-utils@3.0.0-canary.14
    -   @ai-sdk/openai@2.0.0-canary.15
    -   @ai-sdk/provider@2.0.0-canary.13

## @ai-sdk/cerebras@1.0.0-canary.14

### Patch Changes

-   Updated dependencies [957b739]
-   Updated dependencies [9bd5ab5]
    -   @ai-sdk/provider-utils@3.0.0-canary.14
    -   @ai-sdk/provider@2.0.0-canary.13
    -   @ai-sdk/openai-compatible@1.0.0-canary.14

## @ai-sdk/cohere@2.0.0-canary.15

### Patch Changes

-   Updated dependencies [957b739]
-   Updated dependencies [9bd5ab5]
    -   @ai-sdk/provider-utils@3.0.0-canary.14
    -   @ai-sdk/provider@2.0.0-canary.13

## @ai-sdk/deepgram@1.0.0-canary.7

### Patch Changes

-   Updated dependencies [957b739]
-   Updated dependencies [9bd5ab5]
    -   @ai-sdk/provider-utils@3.0.0-canary.14
    -   @ai-sdk/provider@2.0.0-canary.13

## @ai-sdk/deepinfra@1.0.0-canary.14

### Patch Changes

-   Updated dependencies [957b739]
-   Updated dependencies [9bd5ab5]
    -   @ai-sdk/provider-utils@3.0.0-canary.14
    -   @ai-sdk/provider@2.0.0-canary.13
    -   @ai-sdk/openai-compatible@1.0.0-canary.14

## @ai-sdk/deepseek@1.0.0-canary.14

### Patch Changes

-   Updated dependencies [957b739]
-   Updated dependencies [9bd5ab5]
    -   @ai-sdk/provider-utils@3.0.0-canary.14
    -   @ai-sdk/provider@2.0.0-canary.13
    -   @ai-sdk/openai-compatible@1.0.0-canary.14

## @ai-sdk/elevenlabs@1.0.0-canary.7

### Patch Changes

-   Updated dependencies [957b739]
-   Updated dependencies [9bd5ab5]
    -   @ai-sdk/provider-utils@3.0.0-canary.14
    -   @ai-sdk/provider@2.0.0-canary.13

## @ai-sdk/fal@1.0.0-canary.15

### Patch Changes

-   Updated dependencies [957b739]
-   Updated dependencies [9bd5ab5]
    -   @ai-sdk/provider-utils@3.0.0-canary.14
    -   @ai-sdk/provider@2.0.0-canary.13

## @ai-sdk/fireworks@1.0.0-canary.14

### Patch Changes

-   Updated dependencies [957b739]
-   Updated dependencies [9bd5ab5]
    -   @ai-sdk/provider-utils@3.0.0-canary.14
    -   @ai-sdk/provider@2.0.0-canary.13
    -   @ai-sdk/openai-compatible@1.0.0-canary.14

## @ai-sdk/gladia@1.0.0-canary.4

### Patch Changes

-   Updated dependencies [957b739]
-   Updated dependencies [9bd5ab5]
    -   @ai-sdk/provider-utils@3.0.0-canary.14
    -   @ai-sdk/provider@2.0.0-canary.13

## @ai-sdk/google@2.0.0-canary.15

### Patch Changes

-   Updated dependencies [957b739]
-   Updated dependencies [9bd5ab5]
    -   @ai-sdk/provider-utils@3.0.0-canary.14
    -   @ai-sdk/provider@2.0.0-canary.13

## @ai-sdk/google-vertex@3.0.0-canary.15

### Patch Changes

-   Updated dependencies [957b739]
-   Updated dependencies [9bd5ab5]
    -   @ai-sdk/provider-utils@3.0.0-canary.14
    -   @ai-sdk/provider@2.0.0-canary.13
    -   @ai-sdk/anthropic@2.0.0-canary.14
    -   @ai-sdk/google@2.0.0-canary.15

## @ai-sdk/groq@2.0.0-canary.15

### Patch Changes

-   Updated dependencies [957b739]
-   Updated dependencies [9bd5ab5]
    -   @ai-sdk/provider-utils@3.0.0-canary.14
    -   @ai-sdk/provider@2.0.0-canary.13

## @ai-sdk/hume@1.0.0-canary.7

### Patch Changes

-   Updated dependencies [957b739]
-   Updated dependencies [9bd5ab5]
    -   @ai-sdk/provider-utils@3.0.0-canary.14
    -   @ai-sdk/provider@2.0.0-canary.13

## @ai-sdk/langchain@1.0.0-canary.5

### Patch Changes

-   Updated dependencies [f04fb4a]
-   Updated dependencies [fd1924b]
-   Updated dependencies [957b739]
-   Updated dependencies [fafc3f2]
-   Updated dependencies [c9ad635]
-   Updated dependencies [9bd5ab5]
-   Updated dependencies [92cb0a2]
    -   ai@5.0.0-canary.17
    -   @ai-sdk/provider-utils@3.0.0-canary.14

## @ai-sdk/llamaindex@1.0.0-canary.5

### Patch Changes

-   Updated dependencies [f04fb4a]
-   Updated dependencies [fd1924b]
-   Updated dependencies [957b739]
-   Updated dependencies [fafc3f2]
-   Updated dependencies [c9ad635]
-   Updated dependencies [9bd5ab5]
-   Updated dependencies [92cb0a2]
    -   ai@5.0.0-canary.17
    -   @ai-sdk/provider-utils@3.0.0-canary.14

## @ai-sdk/lmnt@1.0.0-canary.7

### Patch Changes

-   Updated dependencies [957b739]
-   Updated dependencies [9bd5ab5]
    -   @ai-sdk/provider-utils@3.0.0-canary.14
    -   @ai-sdk/provider@2.0.0-canary.13

## @ai-sdk/luma@1.0.0-canary.14

### Patch Changes

-   Updated dependencies [957b739]
-   Updated dependencies [9bd5ab5]
    -   @ai-sdk/provider-utils@3.0.0-canary.14
    -   @ai-sdk/provider@2.0.0-canary.13

## @ai-sdk/mistral@2.0.0-canary.14

### Patch Changes

-   Updated dependencies [957b739]
-   Updated dependencies [9bd5ab5]
    -   @ai-sdk/provider-utils@3.0.0-canary.14
    -   @ai-sdk/provider@2.0.0-canary.13

## @ai-sdk/openai@2.0.0-canary.15

### Patch Changes

- 136819b: chore(providers/openai): re-introduce logprobs as
providerMetadata

- 9bd5ab5: feat (provider): add providerMetadata to ImageModelV2
interface (#5977)

The `experimental_generateImage` method from the `ai` package now
returnes revised prompts for OpenAI's image models.

    ```js
    const prompt = 'Santa Claus driving a Cadillac';

    const { providerMetadata } = await experimental_generateImage({
      model: openai.image('dall-e-3'),
      prompt,
    });

const revisedPrompt = providerMetadata.openai.images[0]?.revisedPrompt;

    console.log({
      prompt,
      revisedPrompt,
    });
    ```

-   284353f: fix(providers/openai): zod parse error with function

-   Updated dependencies [957b739]

-   Updated dependencies [9bd5ab5]
    -   @ai-sdk/provider-utils@3.0.0-canary.14
    -   @ai-sdk/provider@2.0.0-canary.13

## @ai-sdk/openai-compatible@1.0.0-canary.14

### Patch Changes

-   Updated dependencies [957b739]
-   Updated dependencies [9bd5ab5]
    -   @ai-sdk/provider-utils@3.0.0-canary.14
    -   @ai-sdk/provider@2.0.0-canary.13

## @ai-sdk/perplexity@2.0.0-canary.14

### Patch Changes

-   Updated dependencies [957b739]
-   Updated dependencies [9bd5ab5]
    -   @ai-sdk/provider-utils@3.0.0-canary.14
    -   @ai-sdk/provider@2.0.0-canary.13

## @ai-sdk/provider@2.0.0-canary.13

### Patch Changes

- 9bd5ab5: feat (provider): add providerMetadata to ImageModelV2
interface (#5977)

The `experimental_generateImage` method from the `ai` package now
returnes revised prompts for OpenAI's image models.

    ```js
    const prompt = 'Santa Claus driving a Cadillac';

    const { providerMetadata } = await experimental_generateImage({
      model: openai.image('dall-e-3'),
      prompt,
    });

const revisedPrompt = providerMetadata.openai.images[0]?.revisedPrompt;

    console.log({
      prompt,
      revisedPrompt,
    });
    ```

## @ai-sdk/react@2.0.0-canary.16

### Patch Changes

-   c34ccd7: feat (ui/react): support resuming an ongoing stream
-   Updated dependencies [f04fb4a]
-   Updated dependencies [fd1924b]
-   Updated dependencies [957b739]
-   Updated dependencies [fafc3f2]
-   Updated dependencies [c9ad635]
-   Updated dependencies [9bd5ab5]
-   Updated dependencies [92cb0a2]
    -   ai@5.0.0-canary.17
    -   @ai-sdk/provider-utils@3.0.0-canary.14

## @ai-sdk/replicate@1.0.0-canary.14

### Patch Changes

-   Updated dependencies [957b739]
-   Updated dependencies [9bd5ab5]
    -   @ai-sdk/provider-utils@3.0.0-canary.14
    -   @ai-sdk/provider@2.0.0-canary.13

## @ai-sdk/revai@1.0.0-canary.7

### Patch Changes

-   Updated dependencies [957b739]
-   Updated dependencies [9bd5ab5]
    -   @ai-sdk/provider-utils@3.0.0-canary.14
    -   @ai-sdk/provider@2.0.0-canary.13

## @ai-sdk/rsc@1.0.0-canary.15

### Patch Changes

-   Updated dependencies [f04fb4a]
-   Updated dependencies [fd1924b]
-   Updated dependencies [957b739]
-   Updated dependencies [fafc3f2]
-   Updated dependencies [c9ad635]
-   Updated dependencies [9bd5ab5]
-   Updated dependencies [92cb0a2]
    -   ai@5.0.0-canary.17
    -   @ai-sdk/provider-utils@3.0.0-canary.14
    -   @ai-sdk/provider@2.0.0-canary.13

## @ai-sdk/svelte@3.0.0-canary.16

### Patch Changes

-   Updated dependencies [f04fb4a]
-   Updated dependencies [fd1924b]
-   Updated dependencies [957b739]
-   Updated dependencies [fafc3f2]
-   Updated dependencies [c9ad635]
-   Updated dependencies [9bd5ab5]
-   Updated dependencies [92cb0a2]
    -   ai@5.0.0-canary.17
    -   @ai-sdk/provider-utils@3.0.0-canary.14

## @ai-sdk/togetherai@1.0.0-canary.14

### Patch Changes

-   Updated dependencies [957b739]
-   Updated dependencies [9bd5ab5]
    -   @ai-sdk/provider-utils@3.0.0-canary.14
    -   @ai-sdk/provider@2.0.0-canary.13
    -   @ai-sdk/openai-compatible@1.0.0-canary.14

## @ai-sdk/valibot@1.0.0-canary.16

### Patch Changes

-   Updated dependencies [957b739]
    -   @ai-sdk/provider-utils@3.0.0-canary.14

## @ai-sdk/vue@2.0.0-canary.16

### Patch Changes

-   Updated dependencies [f04fb4a]
-   Updated dependencies [fd1924b]
-   Updated dependencies [957b739]
-   Updated dependencies [fafc3f2]
-   Updated dependencies [c9ad635]
-   Updated dependencies [9bd5ab5]
-   Updated dependencies [92cb0a2]
    -   ai@5.0.0-canary.17
    -   @ai-sdk/provider-utils@3.0.0-canary.14

## @ai-sdk/xai@2.0.0-canary.14

### Patch Changes

-   Updated dependencies [957b739]
-   Updated dependencies [9bd5ab5]
    -   @ai-sdk/provider-utils@3.0.0-canary.14
    -   @ai-sdk/provider@2.0.0-canary.13
    -   @ai-sdk/openai-compatible@1.0.0-canary.14

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
iteratetograceness pushed a commit to iteratetograceness/ai that referenced this pull request May 9, 2025
…ercel#5977)

## Background

Compare vercel#5698

## Summary

Additional provider-specific options to the image model provider
interface. They are passed through to the provider from the AI SDK and
enable provider-specific functionality that can be fully encapsulated in
the provider.

Unlike other models, ImageModel request return an array of images, and
provider can return image-specific metadata for each. So far, this pull
request passing through the revised prompt used for each image. In order
to make that possible, I introduced a new type
`ImageModelV2ProviderMetadata` which is the same as
`SharedV2ProviderMetadata` plus it guarantees the presence of the
`.images` key

```js
export type ImageModelV2ProviderMetadata = Record<
  string,
  {
    images: JSONArray;
  } & JSONValue
>;
```

That also makes it possible to deeply merge providerMetadata from
multiple responses effectively.

## Verification

I updated the `examples/ai-core/src/generate-image/openai.ts` example to
verify that the code is working.
iteratetograceness pushed a commit to iteratetograceness/ai that referenced this pull request May 9, 2025
# Releases
## ai@5.0.0-canary.17

### Major Changes

-   f04fb4a: chore (ai): replace useChat attachments with file ui parts
-   fd1924b: chore (ai): remove redundant `mimeType` property
- fafc3f2: chore (ai): change file to parts to use urls instead of data
-   92cb0a2: chore (ai): rename CoreMessage to ModelMessage

### Minor Changes

-   c9ad635: feat (ai): add filename to file ui parts

### Patch Changes

- 9bd5ab5: feat (provider): add providerMetadata to ImageModelV2
interface (vercel#5977)

The `experimental_generateImage` method from the `ai` package now
returnes revised prompts for OpenAI's image models.

    ```js
    const prompt = 'Santa Claus driving a Cadillac';

    const { providerMetadata } = await experimental_generateImage({
      model: openai.image('dall-e-3'),
      prompt,
    });

const revisedPrompt = providerMetadata.openai.images[0]?.revisedPrompt;

    console.log({
      prompt,
      revisedPrompt,
    });
    ```

-   Updated dependencies [957b739]

-   Updated dependencies [9bd5ab5]
    -   @ai-sdk/provider-utils@3.0.0-canary.14
    -   @ai-sdk/provider@2.0.0-canary.13

## @ai-sdk/provider-utils@3.0.0-canary.14

### Major Changes

- 957b739: chore (provider-utils): rename TestServerCall.requestBody to
requestBodyJson

### Patch Changes

-   Updated dependencies [9bd5ab5]
    -   @ai-sdk/provider@2.0.0-canary.13

## @ai-sdk/amazon-bedrock@3.0.0-canary.14

### Patch Changes

-   Updated dependencies [957b739]
-   Updated dependencies [9bd5ab5]
    -   @ai-sdk/provider-utils@3.0.0-canary.14
    -   @ai-sdk/provider@2.0.0-canary.13

## @ai-sdk/anthropic@2.0.0-canary.14

### Patch Changes

-   Updated dependencies [957b739]
-   Updated dependencies [9bd5ab5]
    -   @ai-sdk/provider-utils@3.0.0-canary.14
    -   @ai-sdk/provider@2.0.0-canary.13

## @ai-sdk/assemblyai@0.0.1-canary.2

### Patch Changes

-   Updated dependencies [957b739]
-   Updated dependencies [9bd5ab5]
    -   @ai-sdk/provider-utils@3.0.0-canary.14
    -   @ai-sdk/provider@2.0.0-canary.13

## @ai-sdk/azure@2.0.0-canary.16

### Patch Changes

-   Updated dependencies [957b739]
-   Updated dependencies [136819b]
-   Updated dependencies [9bd5ab5]
-   Updated dependencies [284353f]
    -   @ai-sdk/provider-utils@3.0.0-canary.14
    -   @ai-sdk/openai@2.0.0-canary.15
    -   @ai-sdk/provider@2.0.0-canary.13

## @ai-sdk/cerebras@1.0.0-canary.14

### Patch Changes

-   Updated dependencies [957b739]
-   Updated dependencies [9bd5ab5]
    -   @ai-sdk/provider-utils@3.0.0-canary.14
    -   @ai-sdk/provider@2.0.0-canary.13
    -   @ai-sdk/openai-compatible@1.0.0-canary.14

## @ai-sdk/cohere@2.0.0-canary.15

### Patch Changes

-   Updated dependencies [957b739]
-   Updated dependencies [9bd5ab5]
    -   @ai-sdk/provider-utils@3.0.0-canary.14
    -   @ai-sdk/provider@2.0.0-canary.13

## @ai-sdk/deepgram@1.0.0-canary.7

### Patch Changes

-   Updated dependencies [957b739]
-   Updated dependencies [9bd5ab5]
    -   @ai-sdk/provider-utils@3.0.0-canary.14
    -   @ai-sdk/provider@2.0.0-canary.13

## @ai-sdk/deepinfra@1.0.0-canary.14

### Patch Changes

-   Updated dependencies [957b739]
-   Updated dependencies [9bd5ab5]
    -   @ai-sdk/provider-utils@3.0.0-canary.14
    -   @ai-sdk/provider@2.0.0-canary.13
    -   @ai-sdk/openai-compatible@1.0.0-canary.14

## @ai-sdk/deepseek@1.0.0-canary.14

### Patch Changes

-   Updated dependencies [957b739]
-   Updated dependencies [9bd5ab5]
    -   @ai-sdk/provider-utils@3.0.0-canary.14
    -   @ai-sdk/provider@2.0.0-canary.13
    -   @ai-sdk/openai-compatible@1.0.0-canary.14

## @ai-sdk/elevenlabs@1.0.0-canary.7

### Patch Changes

-   Updated dependencies [957b739]
-   Updated dependencies [9bd5ab5]
    -   @ai-sdk/provider-utils@3.0.0-canary.14
    -   @ai-sdk/provider@2.0.0-canary.13

## @ai-sdk/fal@1.0.0-canary.15

### Patch Changes

-   Updated dependencies [957b739]
-   Updated dependencies [9bd5ab5]
    -   @ai-sdk/provider-utils@3.0.0-canary.14
    -   @ai-sdk/provider@2.0.0-canary.13

## @ai-sdk/fireworks@1.0.0-canary.14

### Patch Changes

-   Updated dependencies [957b739]
-   Updated dependencies [9bd5ab5]
    -   @ai-sdk/provider-utils@3.0.0-canary.14
    -   @ai-sdk/provider@2.0.0-canary.13
    -   @ai-sdk/openai-compatible@1.0.0-canary.14

## @ai-sdk/gladia@1.0.0-canary.4

### Patch Changes

-   Updated dependencies [957b739]
-   Updated dependencies [9bd5ab5]
    -   @ai-sdk/provider-utils@3.0.0-canary.14
    -   @ai-sdk/provider@2.0.0-canary.13

## @ai-sdk/google@2.0.0-canary.15

### Patch Changes

-   Updated dependencies [957b739]
-   Updated dependencies [9bd5ab5]
    -   @ai-sdk/provider-utils@3.0.0-canary.14
    -   @ai-sdk/provider@2.0.0-canary.13

## @ai-sdk/google-vertex@3.0.0-canary.15

### Patch Changes

-   Updated dependencies [957b739]
-   Updated dependencies [9bd5ab5]
    -   @ai-sdk/provider-utils@3.0.0-canary.14
    -   @ai-sdk/provider@2.0.0-canary.13
    -   @ai-sdk/anthropic@2.0.0-canary.14
    -   @ai-sdk/google@2.0.0-canary.15

## @ai-sdk/groq@2.0.0-canary.15

### Patch Changes

-   Updated dependencies [957b739]
-   Updated dependencies [9bd5ab5]
    -   @ai-sdk/provider-utils@3.0.0-canary.14
    -   @ai-sdk/provider@2.0.0-canary.13

## @ai-sdk/hume@1.0.0-canary.7

### Patch Changes

-   Updated dependencies [957b739]
-   Updated dependencies [9bd5ab5]
    -   @ai-sdk/provider-utils@3.0.0-canary.14
    -   @ai-sdk/provider@2.0.0-canary.13

## @ai-sdk/langchain@1.0.0-canary.5

### Patch Changes

-   Updated dependencies [f04fb4a]
-   Updated dependencies [fd1924b]
-   Updated dependencies [957b739]
-   Updated dependencies [fafc3f2]
-   Updated dependencies [c9ad635]
-   Updated dependencies [9bd5ab5]
-   Updated dependencies [92cb0a2]
    -   ai@5.0.0-canary.17
    -   @ai-sdk/provider-utils@3.0.0-canary.14

## @ai-sdk/llamaindex@1.0.0-canary.5

### Patch Changes

-   Updated dependencies [f04fb4a]
-   Updated dependencies [fd1924b]
-   Updated dependencies [957b739]
-   Updated dependencies [fafc3f2]
-   Updated dependencies [c9ad635]
-   Updated dependencies [9bd5ab5]
-   Updated dependencies [92cb0a2]
    -   ai@5.0.0-canary.17
    -   @ai-sdk/provider-utils@3.0.0-canary.14

## @ai-sdk/lmnt@1.0.0-canary.7

### Patch Changes

-   Updated dependencies [957b739]
-   Updated dependencies [9bd5ab5]
    -   @ai-sdk/provider-utils@3.0.0-canary.14
    -   @ai-sdk/provider@2.0.0-canary.13

## @ai-sdk/luma@1.0.0-canary.14

### Patch Changes

-   Updated dependencies [957b739]
-   Updated dependencies [9bd5ab5]
    -   @ai-sdk/provider-utils@3.0.0-canary.14
    -   @ai-sdk/provider@2.0.0-canary.13

## @ai-sdk/mistral@2.0.0-canary.14

### Patch Changes

-   Updated dependencies [957b739]
-   Updated dependencies [9bd5ab5]
    -   @ai-sdk/provider-utils@3.0.0-canary.14
    -   @ai-sdk/provider@2.0.0-canary.13

## @ai-sdk/openai@2.0.0-canary.15

### Patch Changes

- 136819b: chore(providers/openai): re-introduce logprobs as
providerMetadata

- 9bd5ab5: feat (provider): add providerMetadata to ImageModelV2
interface (vercel#5977)

The `experimental_generateImage` method from the `ai` package now
returnes revised prompts for OpenAI's image models.

    ```js
    const prompt = 'Santa Claus driving a Cadillac';

    const { providerMetadata } = await experimental_generateImage({
      model: openai.image('dall-e-3'),
      prompt,
    });

const revisedPrompt = providerMetadata.openai.images[0]?.revisedPrompt;

    console.log({
      prompt,
      revisedPrompt,
    });
    ```

-   284353f: fix(providers/openai): zod parse error with function

-   Updated dependencies [957b739]

-   Updated dependencies [9bd5ab5]
    -   @ai-sdk/provider-utils@3.0.0-canary.14
    -   @ai-sdk/provider@2.0.0-canary.13

## @ai-sdk/openai-compatible@1.0.0-canary.14

### Patch Changes

-   Updated dependencies [957b739]
-   Updated dependencies [9bd5ab5]
    -   @ai-sdk/provider-utils@3.0.0-canary.14
    -   @ai-sdk/provider@2.0.0-canary.13

## @ai-sdk/perplexity@2.0.0-canary.14

### Patch Changes

-   Updated dependencies [957b739]
-   Updated dependencies [9bd5ab5]
    -   @ai-sdk/provider-utils@3.0.0-canary.14
    -   @ai-sdk/provider@2.0.0-canary.13

## @ai-sdk/provider@2.0.0-canary.13

### Patch Changes

- 9bd5ab5: feat (provider): add providerMetadata to ImageModelV2
interface (vercel#5977)

The `experimental_generateImage` method from the `ai` package now
returnes revised prompts for OpenAI's image models.

    ```js
    const prompt = 'Santa Claus driving a Cadillac';

    const { providerMetadata } = await experimental_generateImage({
      model: openai.image('dall-e-3'),
      prompt,
    });

const revisedPrompt = providerMetadata.openai.images[0]?.revisedPrompt;

    console.log({
      prompt,
      revisedPrompt,
    });
    ```

## @ai-sdk/react@2.0.0-canary.16

### Patch Changes

-   c34ccd7: feat (ui/react): support resuming an ongoing stream
-   Updated dependencies [f04fb4a]
-   Updated dependencies [fd1924b]
-   Updated dependencies [957b739]
-   Updated dependencies [fafc3f2]
-   Updated dependencies [c9ad635]
-   Updated dependencies [9bd5ab5]
-   Updated dependencies [92cb0a2]
    -   ai@5.0.0-canary.17
    -   @ai-sdk/provider-utils@3.0.0-canary.14

## @ai-sdk/replicate@1.0.0-canary.14

### Patch Changes

-   Updated dependencies [957b739]
-   Updated dependencies [9bd5ab5]
    -   @ai-sdk/provider-utils@3.0.0-canary.14
    -   @ai-sdk/provider@2.0.0-canary.13

## @ai-sdk/revai@1.0.0-canary.7

### Patch Changes

-   Updated dependencies [957b739]
-   Updated dependencies [9bd5ab5]
    -   @ai-sdk/provider-utils@3.0.0-canary.14
    -   @ai-sdk/provider@2.0.0-canary.13

## @ai-sdk/rsc@1.0.0-canary.15

### Patch Changes

-   Updated dependencies [f04fb4a]
-   Updated dependencies [fd1924b]
-   Updated dependencies [957b739]
-   Updated dependencies [fafc3f2]
-   Updated dependencies [c9ad635]
-   Updated dependencies [9bd5ab5]
-   Updated dependencies [92cb0a2]
    -   ai@5.0.0-canary.17
    -   @ai-sdk/provider-utils@3.0.0-canary.14
    -   @ai-sdk/provider@2.0.0-canary.13

## @ai-sdk/svelte@3.0.0-canary.16

### Patch Changes

-   Updated dependencies [f04fb4a]
-   Updated dependencies [fd1924b]
-   Updated dependencies [957b739]
-   Updated dependencies [fafc3f2]
-   Updated dependencies [c9ad635]
-   Updated dependencies [9bd5ab5]
-   Updated dependencies [92cb0a2]
    -   ai@5.0.0-canary.17
    -   @ai-sdk/provider-utils@3.0.0-canary.14

## @ai-sdk/togetherai@1.0.0-canary.14

### Patch Changes

-   Updated dependencies [957b739]
-   Updated dependencies [9bd5ab5]
    -   @ai-sdk/provider-utils@3.0.0-canary.14
    -   @ai-sdk/provider@2.0.0-canary.13
    -   @ai-sdk/openai-compatible@1.0.0-canary.14

## @ai-sdk/valibot@1.0.0-canary.16

### Patch Changes

-   Updated dependencies [957b739]
    -   @ai-sdk/provider-utils@3.0.0-canary.14

## @ai-sdk/vue@2.0.0-canary.16

### Patch Changes

-   Updated dependencies [f04fb4a]
-   Updated dependencies [fd1924b]
-   Updated dependencies [957b739]
-   Updated dependencies [fafc3f2]
-   Updated dependencies [c9ad635]
-   Updated dependencies [9bd5ab5]
-   Updated dependencies [92cb0a2]
    -   ai@5.0.0-canary.17
    -   @ai-sdk/provider-utils@3.0.0-canary.14

## @ai-sdk/xai@2.0.0-canary.14

### Patch Changes

-   Updated dependencies [957b739]
-   Updated dependencies [9bd5ab5]
    -   @ai-sdk/provider-utils@3.0.0-canary.14
    -   @ai-sdk/provider@2.0.0-canary.13
    -   @ai-sdk/openai-compatible@1.0.0-canary.14

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants