ai 7.0.23 → 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 +28 -0
- package/dist/index.js +10 -4
- package/dist/index.js.map +1 -1
- package/dist/internal/index.js +1 -1
- package/docs/03-ai-sdk-core/36-transcription.mdx +7 -4
- package/docs/06-advanced/11-secure-url-fetching.mdx +117 -0
- package/docs/07-reference/01-ai-sdk-core/11-stream-transcribe.mdx +13 -1
- package/package.json +3 -3
- package/src/generate-text/stream-text.ts +14 -2
- package/src/transcribe/stream-transcribe.ts +13 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# ai
|
|
2
2
|
|
|
3
|
+
## 7.0.26
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 27d294d: feat(ai): group orphaned tool calls after tool approvals under parent span
|
|
8
|
+
|
|
9
|
+
## 7.0.25
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 7805e4a: Cancelling the `experimental_streamTranscribe` `fullStream` now also aborts a still-pending `doStream` setup, so a model whose `doStream` has not yet resolved is cancelled instead of leaking.
|
|
14
|
+
- f8e82fd: Update the `experimental_streamTranscribe` unsupported-model error message now that gateway string model IDs can support streaming transcription.
|
|
15
|
+
- Updated dependencies [4be62c1]
|
|
16
|
+
- Updated dependencies [f8e82fd]
|
|
17
|
+
- Updated dependencies [7805e4a]
|
|
18
|
+
- Updated dependencies [cd12954]
|
|
19
|
+
- @ai-sdk/provider-utils@5.0.9
|
|
20
|
+
- @ai-sdk/gateway@4.0.19
|
|
21
|
+
|
|
22
|
+
## 7.0.24
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- e193290: Cancel the caller's `audio` stream when `experimental_streamTranscribe` fails before or during streaming. Previously, when the model's `doStream` rejected before a stream existed (e.g. missing API key or other auth failure), the audio stream was never consumed or cancelled, so an upstream producer piping into it would hang forever.
|
|
27
|
+
- Updated dependencies [e193290]
|
|
28
|
+
- @ai-sdk/provider-utils@5.0.8
|
|
29
|
+
- @ai-sdk/gateway@4.0.18
|
|
30
|
+
|
|
3
31
|
## 7.0.23
|
|
4
32
|
|
|
5
33
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -1089,7 +1089,7 @@ import {
|
|
|
1089
1089
|
} from "@ai-sdk/provider-utils";
|
|
1090
1090
|
|
|
1091
1091
|
// src/version.ts
|
|
1092
|
-
var VERSION = true ? "7.0.
|
|
1092
|
+
var VERSION = true ? "7.0.26" : "0.0.0-test";
|
|
1093
1093
|
|
|
1094
1094
|
// src/util/download/download.ts
|
|
1095
1095
|
var download = async ({
|
|
@@ -9057,6 +9057,9 @@ var DefaultStreamTextResult = class {
|
|
|
9057
9057
|
var _a23;
|
|
9058
9058
|
return (_a23 = streamTextTracingChannelContext == null ? void 0 : streamTextTracingChannelContext.run(execute)) != null ? _a23 : execute();
|
|
9059
9059
|
};
|
|
9060
|
+
const runInTracingChannelSpanInStreamText = telemetryDispatcher.runInTracingChannelSpan == null ? void 0 : (options) => runInStreamTextTracingChannelContext(
|
|
9061
|
+
() => telemetryDispatcher.runInTracingChannelSpan(options)
|
|
9062
|
+
);
|
|
9060
9063
|
await notify({
|
|
9061
9064
|
event: startEvent,
|
|
9062
9065
|
callbacks: [onStart, telemetryDispatcher.onStart]
|
|
@@ -9127,7 +9130,7 @@ var DefaultStreamTextResult = class {
|
|
|
9127
9130
|
telemetryDispatcher.onToolExecutionEnd
|
|
9128
9131
|
),
|
|
9129
9132
|
executeToolInTelemetryContext: telemetryDispatcher.executeTool,
|
|
9130
|
-
runInTracingChannelSpan:
|
|
9133
|
+
runInTracingChannelSpan: runInTracingChannelSpanInStreamText,
|
|
9131
9134
|
onPreliminaryToolResult: (result2) => {
|
|
9132
9135
|
toolExecutionStepStreamController == null ? void 0 : toolExecutionStepStreamController.enqueue(result2);
|
|
9133
9136
|
}
|
|
@@ -15961,7 +15964,7 @@ function streamTranscribe({
|
|
|
15961
15964
|
if (doStream == null) {
|
|
15962
15965
|
throw new UnsupportedFunctionalityError4({
|
|
15963
15966
|
functionality: "streaming transcription",
|
|
15964
|
-
message: `The ${resolvedModel.provider} model "${resolvedModel.modelId}" does not support streaming transcription.` + (typeof model === "string" ? " String model IDs resolve through the global provider (AI Gateway by default)
|
|
15967
|
+
message: `The ${resolvedModel.provider} model "${resolvedModel.modelId}" does not support streaming transcription.` + (typeof model === "string" ? " String model IDs resolve through the global provider (AI Gateway by default). If that provider does not support streaming transcription, pass a provider model instance instead (e.g. openai.transcription('gpt-realtime-whisper')) or upgrade @ai-sdk/gateway to a version with streaming transcription support." : "")
|
|
15965
15968
|
});
|
|
15966
15969
|
}
|
|
15967
15970
|
const headersWithUserAgent = withUserAgentSuffix11(
|
|
@@ -16065,7 +16068,8 @@ function streamTranscribe({
|
|
|
16065
16068
|
audio,
|
|
16066
16069
|
inputAudioFormat,
|
|
16067
16070
|
providerOptions,
|
|
16068
|
-
|
|
16071
|
+
// merged so cancelling fullStream also aborts a still-pending doStream
|
|
16072
|
+
abortSignal: mergeAbortSignals(abortSignal, pipeAbortController.signal),
|
|
16069
16073
|
headers: headersWithUserAgent,
|
|
16070
16074
|
includeRawChunks
|
|
16071
16075
|
});
|
|
@@ -16080,6 +16084,8 @@ function streamTranscribe({
|
|
|
16080
16084
|
})().catch((error) => {
|
|
16081
16085
|
const reason = error != null ? error : new Error("Transcription stream was cancelled or errored.");
|
|
16082
16086
|
rejectPendingPromises(reason);
|
|
16087
|
+
audio.cancel(reason).catch(() => {
|
|
16088
|
+
});
|
|
16083
16089
|
transform.writable.abort(reason).catch(() => {
|
|
16084
16090
|
});
|
|
16085
16091
|
});
|