ai 7.0.25 → 7.0.26
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 +5 -2
- package/dist/index.js.map +1 -1
- package/dist/internal/index.js +1 -1
- package/package.json +1 -1
- package/src/generate-text/stream-text.ts +14 -2
package/dist/internal/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ai",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.26",
|
|
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",
|
|
@@ -1589,6 +1589,19 @@ class DefaultStreamTextResult<
|
|
|
1589
1589
|
// Re-enter the streamText tracing context after stream setup returns.
|
|
1590
1590
|
const runInStreamTextTracingChannelContext = <T>(execute: () => T): T =>
|
|
1591
1591
|
streamTextTracingChannelContext?.run(execute) ?? execute();
|
|
1592
|
+
const runInTracingChannelSpanInStreamText =
|
|
1593
|
+
telemetryDispatcher.runInTracingChannelSpan == null
|
|
1594
|
+
? undefined
|
|
1595
|
+
: <T>(
|
|
1596
|
+
options: Parameters<
|
|
1597
|
+
NonNullable<TelemetryDispatcher['runInTracingChannelSpan']>
|
|
1598
|
+
>[0] & {
|
|
1599
|
+
execute: () => PromiseLike<T>;
|
|
1600
|
+
},
|
|
1601
|
+
) =>
|
|
1602
|
+
runInStreamTextTracingChannelContext(() =>
|
|
1603
|
+
telemetryDispatcher.runInTracingChannelSpan!(options),
|
|
1604
|
+
);
|
|
1592
1605
|
|
|
1593
1606
|
await notify({
|
|
1594
1607
|
event: startEvent,
|
|
@@ -1676,8 +1689,7 @@ class DefaultStreamTextResult<
|
|
|
1676
1689
|
telemetryDispatcher.onToolExecutionEnd,
|
|
1677
1690
|
),
|
|
1678
1691
|
executeToolInTelemetryContext: telemetryDispatcher.executeTool,
|
|
1679
|
-
runInTracingChannelSpan:
|
|
1680
|
-
telemetryDispatcher.runInTracingChannelSpan,
|
|
1692
|
+
runInTracingChannelSpan: runInTracingChannelSpanInStreamText,
|
|
1681
1693
|
onPreliminaryToolResult: result => {
|
|
1682
1694
|
toolExecutionStepStreamController?.enqueue(result);
|
|
1683
1695
|
},
|