ai 7.0.43 → 7.0.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -85,7 +85,7 @@ import {
85
85
  } from "@ai-sdk/provider-utils";
86
86
 
87
87
  // src/version.ts
88
- var VERSION = true ? "7.0.43" : "0.0.0-test";
88
+ var VERSION = true ? "7.0.44" : "0.0.0-test";
89
89
 
90
90
  // src/util/download/download.ts
91
91
  var download = async ({
@@ -653,7 +653,7 @@ Called after the provider response has been normalized and parsed, before local
653
653
  {
654
654
  name: 'modelId',
655
655
  type: 'string',
656
- description: 'Model identifier for this model call.',
656
+ description: 'Provider-returned model identifier for this model call.',
657
657
  },
658
658
  {
659
659
  name: 'finishReason',
@@ -1413,7 +1413,8 @@ To see `generateText` in action, check out [these examples](#examples).
1413
1413
  {
1414
1414
  name: 'modelId',
1415
1415
  type: 'string',
1416
- description: 'The specific model identifier for this model call.',
1416
+ description:
1417
+ 'The provider-returned model identifier for this model call.',
1417
1418
  },
1418
1419
  {
1419
1420
  name: 'finishReason',
@@ -2390,7 +2390,8 @@ To see `streamText` in action, check out [these examples](#examples).
2390
2390
  {
2391
2391
  name: 'modelId',
2392
2392
  type: 'string',
2393
- description: 'The specific model identifier for this model call.',
2393
+ description:
2394
+ 'The provider-returned model identifier for this model call.',
2394
2395
  },
2395
2396
  {
2396
2397
  name: 'finishReason',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai",
3
- "version": "7.0.43",
3
+ "version": "7.0.44",
4
4
  "type": "module",
5
5
  "description": "AI SDK by Vercel - build apps like ChatGPT, Claude, Gemini, and more with a single interface for any model using the Vercel AI Gateway or go direct to OpenAI, Anthropic, Google, or any other model provider.",
6
6
  "license": "Apache-2.0",
@@ -1050,7 +1050,7 @@ export async function generateText<
1050
1050
  event: {
1051
1051
  callId,
1052
1052
  provider: stepModel.provider,
1053
- modelId: stepModel.modelId,
1053
+ modelId: currentModelResponse.response.modelId,
1054
1054
  finishReason: currentModelResponse.finishReason.unified,
1055
1055
  usage: stepUsage,
1056
1056
  content: modelCallContent,
@@ -422,6 +422,7 @@ function createLanguageModelV4StreamPartToLanguageModelStreamPartTransform<
422
422
  const textPartIndexes = new Map<string, number>();
423
423
  const reasoningPartIndexes = new Map<string, number>();
424
424
  let responseId = generateId();
425
+ let responseModelId = modelId;
425
426
  let timeToFirstOutputMs: number | undefined;
426
427
  let previousOutputChunkTimestampMs: number | undefined;
427
428
  const timeBetweenOutputChunksMs: number[] = [];
@@ -590,7 +591,7 @@ function createLanguageModelV4StreamPartToLanguageModelStreamPartTransform<
590
591
  event: {
591
592
  callId,
592
593
  provider,
593
- modelId,
594
+ modelId: responseModelId,
594
595
  finishReason: chunk.finishReason.unified,
595
596
  usage,
596
597
  content: modelCallContent,
@@ -739,6 +740,7 @@ function createLanguageModelV4StreamPartToLanguageModelStreamPartTransform<
739
740
 
740
741
  case 'response-metadata': {
741
742
  responseId = chunk.id ?? responseId;
743
+ responseModelId = chunk.modelId ?? responseModelId;
742
744
 
743
745
  controller.enqueue({
744
746
  type: 'model-call-response-metadata',