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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # ai
2
2
 
3
+ ## 7.0.44
4
+
5
+ ### Patch Changes
6
+
7
+ - 015acb4: fix telemetry attribution for language model calls that resolve to a different response model
8
+
3
9
  ## 7.0.43
4
10
 
5
11
  ### Patch Changes
package/dist/index.js CHANGED
@@ -1143,7 +1143,7 @@ import {
1143
1143
  } from "@ai-sdk/provider-utils";
1144
1144
 
1145
1145
  // src/version.ts
1146
- var VERSION = true ? "7.0.43" : "0.0.0-test";
1146
+ var VERSION = true ? "7.0.44" : "0.0.0-test";
1147
1147
 
1148
1148
  // src/util/download/download.ts
1149
1149
  var download = async ({
@@ -5642,7 +5642,7 @@ async function generateText({
5642
5642
  event: {
5643
5643
  callId,
5644
5644
  provider: stepModel.provider,
5645
- modelId: stepModel.modelId,
5645
+ modelId: currentModelResponse.response.modelId,
5646
5646
  finishReason: currentModelResponse.finishReason.unified,
5647
5647
  usage: stepUsage,
5648
5648
  content: modelCallContent,
@@ -8360,12 +8360,13 @@ function createLanguageModelV4StreamPartToLanguageModelStreamPartTransform({
8360
8360
  const textPartIndexes = /* @__PURE__ */ new Map();
8361
8361
  const reasoningPartIndexes = /* @__PURE__ */ new Map();
8362
8362
  let responseId = generateId2();
8363
+ let responseModelId = modelId;
8363
8364
  let timeToFirstOutputMs;
8364
8365
  let previousOutputChunkTimestampMs;
8365
8366
  const timeBetweenOutputChunksMs = [];
8366
8367
  return new TransformStream({
8367
8368
  async transform(chunk, controller) {
8368
- var _a23, _b;
8369
+ var _a23, _b, _c;
8369
8370
  if (isOutputChunk(chunk)) {
8370
8371
  const outputChunkTimestampMs = now2();
8371
8372
  if (timeToFirstOutputMs == null) {
@@ -8498,7 +8499,7 @@ function createLanguageModelV4StreamPartToLanguageModelStreamPartTransform({
8498
8499
  event: {
8499
8500
  callId,
8500
8501
  provider,
8501
- modelId,
8502
+ modelId: responseModelId,
8502
8503
  finishReason: chunk.finishReason.unified,
8503
8504
  usage,
8504
8505
  content: modelCallContent,
@@ -8618,6 +8619,7 @@ function createLanguageModelV4StreamPartToLanguageModelStreamPartTransform({
8618
8619
  }
8619
8620
  case "response-metadata": {
8620
8621
  responseId = (_b = chunk.id) != null ? _b : responseId;
8622
+ responseModelId = (_c = chunk.modelId) != null ? _c : responseModelId;
8621
8623
  controller.enqueue({
8622
8624
  type: "model-call-response-metadata",
8623
8625
  id: chunk.id,