ai 7.0.23 → 7.0.25

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,27 @@
1
1
  # ai
2
2
 
3
+ ## 7.0.25
4
+
5
+ ### Patch Changes
6
+
7
+ - 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.
8
+ - f8e82fd: Update the `experimental_streamTranscribe` unsupported-model error message now that gateway string model IDs can support streaming transcription.
9
+ - Updated dependencies [4be62c1]
10
+ - Updated dependencies [f8e82fd]
11
+ - Updated dependencies [7805e4a]
12
+ - Updated dependencies [cd12954]
13
+ - @ai-sdk/provider-utils@5.0.9
14
+ - @ai-sdk/gateway@4.0.19
15
+
16
+ ## 7.0.24
17
+
18
+ ### Patch Changes
19
+
20
+ - 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.
21
+ - Updated dependencies [e193290]
22
+ - @ai-sdk/provider-utils@5.0.8
23
+ - @ai-sdk/gateway@4.0.18
24
+
3
25
  ## 7.0.23
4
26
 
5
27
  ### 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.23" : "0.0.0-test";
1092
+ var VERSION = true ? "7.0.25" : "0.0.0-test";
1093
1093
 
1094
1094
  // src/util/download/download.ts
1095
1095
  var download = async ({
@@ -15961,7 +15961,7 @@ function streamTranscribe({
15961
15961
  if (doStream == null) {
15962
15962
  throw new UnsupportedFunctionalityError4({
15963
15963
  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), which does not support streaming transcription yet. Pass a provider model instance instead, e.g. openai.transcription('gpt-realtime-whisper')." : "")
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). 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
15965
  });
15966
15966
  }
15967
15967
  const headersWithUserAgent = withUserAgentSuffix11(
@@ -16065,7 +16065,8 @@ function streamTranscribe({
16065
16065
  audio,
16066
16066
  inputAudioFormat,
16067
16067
  providerOptions,
16068
- abortSignal,
16068
+ // merged so cancelling fullStream also aborts a still-pending doStream
16069
+ abortSignal: mergeAbortSignals(abortSignal, pipeAbortController.signal),
16069
16070
  headers: headersWithUserAgent,
16070
16071
  includeRawChunks
16071
16072
  });
@@ -16080,6 +16081,8 @@ function streamTranscribe({
16080
16081
  })().catch((error) => {
16081
16082
  const reason = error != null ? error : new Error("Transcription stream was cancelled or errored.");
16082
16083
  rejectPendingPromises(reason);
16084
+ audio.cancel(reason).catch(() => {
16085
+ });
16083
16086
  transform.writable.abort(reason).catch(() => {
16084
16087
  });
16085
16088
  });