ai 4.3.16 → 4.3.17
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 +6 -0
- package/dist/index.js +21 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +21 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
@@ -2885,6 +2885,9 @@ async function generateObject({
|
|
2885
2885
|
"ai.response.id": responseData.id,
|
2886
2886
|
"ai.response.model": responseData.modelId,
|
2887
2887
|
"ai.response.timestamp": responseData.timestamp.toISOString(),
|
2888
|
+
"ai.response.providerMetadata": JSON.stringify(
|
2889
|
+
result2.providerMetadata
|
2890
|
+
),
|
2888
2891
|
"ai.usage.promptTokens": result2.usage.promptTokens,
|
2889
2892
|
"ai.usage.completionTokens": result2.usage.completionTokens,
|
2890
2893
|
// standardized gen-ai llm span attributes:
|
@@ -2995,6 +2998,9 @@ async function generateObject({
|
|
2995
2998
|
"ai.response.id": responseData.id,
|
2996
2999
|
"ai.response.model": responseData.modelId,
|
2997
3000
|
"ai.response.timestamp": responseData.timestamp.toISOString(),
|
3001
|
+
"ai.response.providerMetadata": JSON.stringify(
|
3002
|
+
result2.providerMetadata
|
3003
|
+
),
|
2998
3004
|
"ai.usage.promptTokens": result2.usage.promptTokens,
|
2999
3005
|
"ai.usage.completionTokens": result2.usage.completionTokens,
|
3000
3006
|
// standardized gen-ai llm span attributes:
|
@@ -3695,6 +3701,7 @@ var DefaultStreamObjectResult = class {
|
|
3695
3701
|
"ai.response.id": response.id,
|
3696
3702
|
"ai.response.model": response.modelId,
|
3697
3703
|
"ai.response.timestamp": response.timestamp.toISOString(),
|
3704
|
+
"ai.response.providerMetadata": JSON.stringify(providerMetadata),
|
3698
3705
|
"ai.usage.promptTokens": finalUsage.promptTokens,
|
3699
3706
|
"ai.usage.completionTokens": finalUsage.completionTokens,
|
3700
3707
|
// standardized gen-ai llm span attributes:
|
@@ -3715,7 +3722,8 @@ var DefaultStreamObjectResult = class {
|
|
3715
3722
|
"ai.usage.completionTokens": finalUsage.completionTokens,
|
3716
3723
|
"ai.response.object": {
|
3717
3724
|
output: () => JSON.stringify(object2)
|
3718
|
-
}
|
3725
|
+
},
|
3726
|
+
"ai.response.providerMetadata": JSON.stringify(providerMetadata)
|
3719
3727
|
}
|
3720
3728
|
})
|
3721
3729
|
);
|
@@ -4384,6 +4392,9 @@ async function generateText({
|
|
4384
4392
|
"ai.response.id": responseData.id,
|
4385
4393
|
"ai.response.model": responseData.modelId,
|
4386
4394
|
"ai.response.timestamp": responseData.timestamp.toISOString(),
|
4395
|
+
"ai.response.providerMetadata": JSON.stringify(
|
4396
|
+
result.providerMetadata
|
4397
|
+
),
|
4387
4398
|
"ai.usage.promptTokens": result.usage.promptTokens,
|
4388
4399
|
"ai.usage.completionTokens": result.usage.completionTokens,
|
4389
4400
|
// standardized gen-ai llm span attributes:
|
@@ -4510,7 +4521,10 @@ async function generateText({
|
|
4510
4521
|
output: () => JSON.stringify(currentModelResponse.toolCalls)
|
4511
4522
|
},
|
4512
4523
|
"ai.usage.promptTokens": currentModelResponse.usage.promptTokens,
|
4513
|
-
"ai.usage.completionTokens": currentModelResponse.usage.completionTokens
|
4524
|
+
"ai.usage.completionTokens": currentModelResponse.usage.completionTokens,
|
4525
|
+
"ai.response.providerMetadata": JSON.stringify(
|
4526
|
+
currentModelResponse.providerMetadata
|
4527
|
+
)
|
4514
4528
|
}
|
4515
4529
|
})
|
4516
4530
|
);
|
@@ -5563,7 +5577,10 @@ var DefaultStreamTextResult = class {
|
|
5563
5577
|
}
|
5564
5578
|
},
|
5565
5579
|
"ai.usage.promptTokens": usage.promptTokens,
|
5566
|
-
"ai.usage.completionTokens": usage.completionTokens
|
5580
|
+
"ai.usage.completionTokens": usage.completionTokens,
|
5581
|
+
"ai.response.providerMetadata": JSON.stringify(
|
5582
|
+
lastStep.providerMetadata
|
5583
|
+
)
|
5567
5584
|
}
|
5568
5585
|
})
|
5569
5586
|
);
|
@@ -5940,6 +5957,7 @@ var DefaultStreamTextResult = class {
|
|
5940
5957
|
"ai.response.id": stepResponse.id,
|
5941
5958
|
"ai.response.model": stepResponse.modelId,
|
5942
5959
|
"ai.response.timestamp": stepResponse.timestamp.toISOString(),
|
5960
|
+
"ai.response.providerMetadata": JSON.stringify(stepProviderMetadata),
|
5943
5961
|
"ai.usage.promptTokens": stepUsage.promptTokens,
|
5944
5962
|
"ai.usage.completionTokens": stepUsage.completionTokens,
|
5945
5963
|
// standardized gen-ai llm span attributes:
|