ai 7.0.149 → 7.0.151
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 +21 -0
- package/dist/index.d.ts +163 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +279 -4
- package/dist/index.js.map +1 -1
- package/dist/internal/index.js +1 -1
- package/dist/test/index.d.ts +17 -2
- package/dist/test/index.d.ts.map +1 -1
- package/dist/test/index.js +12 -1
- package/dist/test/index.js.map +1 -1
- package/docs/03-ai-sdk-core/18-tools.mdx +181 -9
- package/docs/03-ai-sdk-core/37-speech.mdx +65 -0
- package/docs/07-reference/01-ai-sdk-core/12-stream-speech.mdx +195 -0
- package/docs/07-reference/01-ai-sdk-core/index.mdx +5 -0
- package/package.json +12 -12
- package/src/error/no-speech-generated-error.ts +5 -1
- package/src/generate-speech/index.ts +7 -0
- package/src/generate-speech/is-streaming-speech-model.ts +17 -0
- package/src/generate-speech/stream-speech-result.ts +95 -0
- package/src/generate-speech/stream-speech.ts +569 -0
- package/src/test/mock-streaming-speech-model-v4.ts +28 -0
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
2
|
import { GatewayAuthenticationError, GatewayError, createGateway, gateway, gateway as gateway$1 } from "@ai-sdk/gateway";
|
|
3
|
-
import { DEFAULT_MAX_DOWNLOAD_SIZE, DelayedPromise, DownloadError, DownloadError as DownloadError$1, EXPERIMENTAL_EMBEDDING_MODEL_MAX_INPUT_BYTES_PER_CALL, EXPERIMENTAL_EMBEDDING_MODEL_PROVIDER_OPTIONS_TRANSFORMER, asArray, asSchema, asSchema as asSchema$1, cancelResponseBody, convertBase64ToUint8Array, convertUint8ArrayToBase64, createIdGenerator, createIdGenerator as createIdGenerator$1, delay, detectMediaType, dynamicTool, executeTool, experimental_getToolCaller, experimental_toolCaller, fetchUntrustedUrl, filterNullable, generateId, generateId as generateId$1, getErrorMessage, getRuntimeEnvironmentUserAgent, getWebSocketConstructor, isAbortError, isBuffer, isExecutableTool, isFullMediaType, isNonNullable, isProviderReference, isProviderStreamError, isUrlSupported, jsonSchema, jsonSchema as jsonSchema$1, lazySchema, normalizeHeaders, parseJsonEventStream, parseJsonEventStream as parseJsonEventStream$1, readResponseWithSizeLimit, readWebSocketMessageText, resolve, retryWithExponentialBackoff, safeParseJSON, safeValidateTypes, toWebSocketUrl, tool, tool as tool$1, validateTypes, waitForWebSocketBufferDrain, withUserAgentSuffix, zodSchema, zodSchema as zodSchema$1 } from "@ai-sdk/provider-utils";
|
|
3
|
+
import { DEFAULT_MAX_DOWNLOAD_SIZE, DelayedPromise, DownloadError, DownloadError as DownloadError$1, EXPERIMENTAL_EMBEDDING_MODEL_MAX_INPUT_BYTES_PER_CALL, EXPERIMENTAL_EMBEDDING_MODEL_PROVIDER_OPTIONS_TRANSFORMER, asArray, asSchema, asSchema as asSchema$1, cancelResponseBody, convertAsyncIteratorToReadableStream, convertBase64ToUint8Array, convertUint8ArrayToBase64, createIdGenerator, createIdGenerator as createIdGenerator$1, delay, detectMediaType, dynamicTool, executeTool, experimental_getToolCaller, experimental_toolCaller, fetchUntrustedUrl, filterNullable, generateId, generateId as generateId$1, getErrorMessage, getRuntimeEnvironmentUserAgent, getWebSocketConstructor, isAbortError, isBuffer, isExecutableTool, isFullMediaType, isNonNullable, isProviderReference, isProviderStreamError, isUrlSupported, jsonSchema, jsonSchema as jsonSchema$1, lazySchema, normalizeHeaders, parseJsonEventStream, parseJsonEventStream as parseJsonEventStream$1, readResponseWithSizeLimit, readWebSocketMessageText, resolve, retryWithExponentialBackoff, safeParseJSON, safeValidateTypes, toWebSocketUrl, tool, tool as tool$1, validateTypes, waitForWebSocketBufferDrain, withUserAgentSuffix, zodSchema, zodSchema as zodSchema$1 } from "@ai-sdk/provider-utils";
|
|
4
4
|
import { AISDKError, AISDKError as AISDKError$1, APICallError, APICallError as APICallError$1, EmptyResponseBodyError, EmptyResponseBodyError as EmptyResponseBodyError$1, Experimental_DecisionRefusalError, Experimental_DecisionRefusalError as Experimental_DecisionRefusalError$1, Experimental_DecisionUnsupportedQuestionTypeError, Experimental_DecisionUnsupportedQuestionTypeError as Experimental_DecisionUnsupportedQuestionTypeError$1, InvalidArgumentError as InvalidArgumentError$1, InvalidPromptError, InvalidPromptError as InvalidPromptError$1, InvalidResponseDataError, InvalidResponseDataError as InvalidResponseDataError$1, JSONParseError, JSONParseError as JSONParseError$1, LoadAPIKeyError, LoadSettingError, NoContentGeneratedError, NoSuchModelError, NoSuchModelError as NoSuchModelError$1, NoSuchProviderReferenceError, TooManyEmbeddingValuesForCallError, TypeValidationError, TypeValidationError as TypeValidationError$1, UnsupportedFunctionalityError, UnsupportedFunctionalityError as UnsupportedFunctionalityError$1, getErrorMessage as getErrorMessage$1, isJSONArray, isJSONObject } from "@ai-sdk/provider";
|
|
5
5
|
import { array, boolean, custom, discriminatedUnion, enum as enum$1, instanceof as instanceof$1, lazy, literal, looseObject, never, null as null$1, number, object, record, string, union, unknown } from "zod/v4";
|
|
6
6
|
//#region src/error/invalid-argument-error.ts
|
|
@@ -225,7 +225,8 @@ var NoSpeechGeneratedError = class extends AISDKError$1 {
|
|
|
225
225
|
constructor(options) {
|
|
226
226
|
super({
|
|
227
227
|
name: name$13,
|
|
228
|
-
message: "No speech audio generated."
|
|
228
|
+
message: "No speech audio generated.",
|
|
229
|
+
...options.cause !== void 0 && { cause: options.cause }
|
|
229
230
|
});
|
|
230
231
|
this[symbol$13] = true;
|
|
231
232
|
this.responses = options.responses;
|
|
@@ -1174,7 +1175,7 @@ function cloneValue(value) {
|
|
|
1174
1175
|
}
|
|
1175
1176
|
//#endregion
|
|
1176
1177
|
//#region src/version.ts
|
|
1177
|
-
const VERSION = "7.0.
|
|
1178
|
+
const VERSION = "7.0.151";
|
|
1178
1179
|
//#endregion
|
|
1179
1180
|
//#region src/util/download/download.ts
|
|
1180
1181
|
/**
|
|
@@ -14840,6 +14841,280 @@ var DefaultSpeechResult = class {
|
|
|
14840
14841
|
}
|
|
14841
14842
|
};
|
|
14842
14843
|
//#endregion
|
|
14844
|
+
//#region src/generate-speech/is-streaming-speech-model.ts
|
|
14845
|
+
/**
|
|
14846
|
+
* Whether a resolved speech model implements the experimental streaming
|
|
14847
|
+
* speech extension (`Experimental_StreamingSpeechModelV4`).
|
|
14848
|
+
*/
|
|
14849
|
+
function isStreamingSpeechModel(model) {
|
|
14850
|
+
return typeof model.doStream === "function";
|
|
14851
|
+
}
|
|
14852
|
+
//#endregion
|
|
14853
|
+
//#region src/generate-speech/stream-speech.ts
|
|
14854
|
+
/**
|
|
14855
|
+
* Streams speech audio using a speech model.
|
|
14856
|
+
*
|
|
14857
|
+
* @param model - The speech model to use. It must support streaming speech.
|
|
14858
|
+
* @param text - The text to convert to speech: a complete string, or a stream of text deltas
|
|
14859
|
+
* (e.g. the text stream of `streamText`) or text parts that is synthesized as it arrives.
|
|
14860
|
+
* A text part can set its own `voice` on providers that support several voices per stream.
|
|
14861
|
+
* @param voice - The voice to use for speech generation.
|
|
14862
|
+
* @param outputFormat - The format of the output audio chunks, e.g. `{ type: 'audio/pcm', rate: 24000 }`.
|
|
14863
|
+
* @param instructions - Instructions for the speech generation e.g. "Speak in a slow and steady tone".
|
|
14864
|
+
* @param speed - The speed of the speech generation.
|
|
14865
|
+
* @param language - The language for speech generation (ISO 639-1 code e.g. "en", "es", "fr") or "auto" for automatic detection.
|
|
14866
|
+
* @param providerOptions - Additional provider-specific options.
|
|
14867
|
+
* @param abortSignal - An optional abort signal that can be used to cancel the call.
|
|
14868
|
+
* @param headers - Additional HTTP/WebSocket headers to send when supported by the provider.
|
|
14869
|
+
* @param includeRawChunks - When true, raw provider chunks are included in `fullStream`.
|
|
14870
|
+
* @param onError - Called for each provider error part; defaults to `console.error`.
|
|
14871
|
+
*
|
|
14872
|
+
* @returns A result object with the audio stream and the final usage and metadata.
|
|
14873
|
+
*/
|
|
14874
|
+
function streamSpeech({ model, text, voice, outputFormat, instructions, speed, language, providerOptions = {}, abortSignal, headers, includeRawChunks, onError = ({ error }) => {
|
|
14875
|
+
console.error(error);
|
|
14876
|
+
}, _internal: { currentDate = () => /* @__PURE__ */ new Date() } = {} }) {
|
|
14877
|
+
const resolvedModel = resolveSpeechModel(model);
|
|
14878
|
+
if (!resolvedModel) throw new Error("Model could not be resolved");
|
|
14879
|
+
if (!isStreamingSpeechModel(resolvedModel)) throw new UnsupportedFunctionalityError$1({
|
|
14880
|
+
functionality: "streaming speech",
|
|
14881
|
+
message: `The ${resolvedModel.provider} model "${resolvedModel.modelId}" does not support streaming speech.` + (typeof model === "string" ? " String model IDs resolve through the global provider (AI Gateway by default). If that provider does not support streaming speech, pass a provider model instance instead (e.g. elevenLabs.speech('eleven_flash_v2_5')) or upgrade @ai-sdk/gateway to a version with streaming speech support." : "")
|
|
14882
|
+
});
|
|
14883
|
+
const textStream = toTextStream$1(text);
|
|
14884
|
+
const headersWithUserAgent = withUserAgentSuffix(headers ?? {}, `ai/${VERSION}`);
|
|
14885
|
+
const usagePromise = new DelayedPromise();
|
|
14886
|
+
const warningsPromise = new DelayedPromise();
|
|
14887
|
+
const responsesPromise = new DelayedPromise();
|
|
14888
|
+
const providerMetadataPromise = new DelayedPromise();
|
|
14889
|
+
const rejectPendingPromises = (error) => {
|
|
14890
|
+
for (const promise of [
|
|
14891
|
+
usagePromise,
|
|
14892
|
+
warningsPromise,
|
|
14893
|
+
responsesPromise,
|
|
14894
|
+
providerMetadataPromise
|
|
14895
|
+
]) if (promise.isPending()) promise.reject(error);
|
|
14896
|
+
};
|
|
14897
|
+
const startedAt = currentDate();
|
|
14898
|
+
let response;
|
|
14899
|
+
const currentResponseMetadata = () => response ?? {
|
|
14900
|
+
timestamp: startedAt,
|
|
14901
|
+
modelId: resolvedModel.modelId
|
|
14902
|
+
};
|
|
14903
|
+
const resolveWarnings = (warnings) => {
|
|
14904
|
+
warningsPromise.resolve(warnings);
|
|
14905
|
+
logWarnings({
|
|
14906
|
+
warnings,
|
|
14907
|
+
provider: resolvedModel.provider,
|
|
14908
|
+
model: resolvedModel.modelId
|
|
14909
|
+
});
|
|
14910
|
+
};
|
|
14911
|
+
const pipeAbortController = new AbortController();
|
|
14912
|
+
let hasAudio = false;
|
|
14913
|
+
let finished = false;
|
|
14914
|
+
let lastError;
|
|
14915
|
+
const incompleteStreamError = () => hasAudio ? lastError ?? new StreamProviderError({ message: "The speech stream ended before it finished." }) : new NoSpeechGeneratedError({
|
|
14916
|
+
responses: [currentResponseMetadata()],
|
|
14917
|
+
cause: lastError
|
|
14918
|
+
});
|
|
14919
|
+
const transform = new TransformStream({
|
|
14920
|
+
transform(value, controller) {
|
|
14921
|
+
switch (value.type) {
|
|
14922
|
+
case "stream-start":
|
|
14923
|
+
resolveWarnings(value.warnings);
|
|
14924
|
+
break;
|
|
14925
|
+
case "response-metadata":
|
|
14926
|
+
response = {
|
|
14927
|
+
timestamp: value.timestamp ?? currentResponseMetadata().timestamp,
|
|
14928
|
+
modelId: value.modelId ?? currentResponseMetadata().modelId,
|
|
14929
|
+
headers: value.headers ?? response?.headers,
|
|
14930
|
+
body: value.body ?? response?.body
|
|
14931
|
+
};
|
|
14932
|
+
break;
|
|
14933
|
+
case "audio": {
|
|
14934
|
+
const audio = typeof value.audio === "string" ? convertBase64ToUint8Array(value.audio) : value.audio;
|
|
14935
|
+
if (audio.length === 0 && value.providerMetadata == null) break;
|
|
14936
|
+
hasAudio ||= audio.length > 0;
|
|
14937
|
+
controller.enqueue({
|
|
14938
|
+
type: "audio",
|
|
14939
|
+
...value.id != null && { id: value.id },
|
|
14940
|
+
audio,
|
|
14941
|
+
audioFormat: value.audioFormat,
|
|
14942
|
+
...value.providerMetadata != null && { providerMetadata: value.providerMetadata }
|
|
14943
|
+
});
|
|
14944
|
+
break;
|
|
14945
|
+
}
|
|
14946
|
+
case "raw":
|
|
14947
|
+
controller.enqueue(value);
|
|
14948
|
+
break;
|
|
14949
|
+
case "error":
|
|
14950
|
+
lastError = value.error;
|
|
14951
|
+
Promise.resolve().then(() => onError({ error: value.error })).catch(() => {});
|
|
14952
|
+
controller.enqueue(value);
|
|
14953
|
+
break;
|
|
14954
|
+
case "finish":
|
|
14955
|
+
if (!warningsPromise.isResolved()) resolveWarnings([]);
|
|
14956
|
+
if (!hasAudio) throw new NoSpeechGeneratedError({
|
|
14957
|
+
responses: [currentResponseMetadata()],
|
|
14958
|
+
cause: lastError
|
|
14959
|
+
});
|
|
14960
|
+
finished = true;
|
|
14961
|
+
usagePromise.resolve(value.usage ?? {});
|
|
14962
|
+
responsesPromise.resolve([currentResponseMetadata()]);
|
|
14963
|
+
providerMetadataPromise.resolve(value.providerMetadata ?? {});
|
|
14964
|
+
}
|
|
14965
|
+
},
|
|
14966
|
+
flush() {
|
|
14967
|
+
if (!finished) throw incompleteStreamError();
|
|
14968
|
+
},
|
|
14969
|
+
cancel(reason) {
|
|
14970
|
+
const cancelReason = reason ?? /* @__PURE__ */ new Error("Speech stream was cancelled.");
|
|
14971
|
+
rejectPendingPromises(cancelReason);
|
|
14972
|
+
pipeAbortController.abort(cancelReason);
|
|
14973
|
+
}
|
|
14974
|
+
});
|
|
14975
|
+
if (abortSignal != null) {
|
|
14976
|
+
const onAbort = () => {
|
|
14977
|
+
const reason = abortSignal.reason;
|
|
14978
|
+
rejectPendingPromises(reason);
|
|
14979
|
+
pipeAbortController.abort(reason);
|
|
14980
|
+
transform.writable.abort(reason).catch(() => {});
|
|
14981
|
+
};
|
|
14982
|
+
if (abortSignal.aborted) onAbort();
|
|
14983
|
+
else abortSignal.addEventListener("abort", onAbort, { once: true });
|
|
14984
|
+
}
|
|
14985
|
+
(async () => {
|
|
14986
|
+
const result = await resolvedModel.doStream({
|
|
14987
|
+
text: textStream,
|
|
14988
|
+
voice,
|
|
14989
|
+
outputFormat,
|
|
14990
|
+
instructions,
|
|
14991
|
+
speed,
|
|
14992
|
+
language,
|
|
14993
|
+
providerOptions,
|
|
14994
|
+
abortSignal: mergeAbortSignals(abortSignal, pipeAbortController.signal),
|
|
14995
|
+
headers: headersWithUserAgent,
|
|
14996
|
+
includeRawChunks
|
|
14997
|
+
});
|
|
14998
|
+
response = {
|
|
14999
|
+
timestamp: result.response?.timestamp ?? startedAt,
|
|
15000
|
+
modelId: result.response?.modelId ?? resolvedModel.modelId,
|
|
15001
|
+
headers: result.response?.headers,
|
|
15002
|
+
body: result.response?.body
|
|
15003
|
+
};
|
|
15004
|
+
await result.stream.pipeTo(transform.writable, { signal: pipeAbortController.signal });
|
|
15005
|
+
})().catch((error) => {
|
|
15006
|
+
const reason = error ?? /* @__PURE__ */ new Error("Speech stream was cancelled or errored.");
|
|
15007
|
+
rejectPendingPromises(reason);
|
|
15008
|
+
textStream.cancel(reason).catch(() => {});
|
|
15009
|
+
transform.writable.abort(reason).catch(() => {});
|
|
15010
|
+
});
|
|
15011
|
+
let streamOwner = "unclaimed";
|
|
15012
|
+
function consumeStream() {
|
|
15013
|
+
if (streamOwner !== "unclaimed") return;
|
|
15014
|
+
streamOwner = "result-promises";
|
|
15015
|
+
const reader = transform.readable.getReader();
|
|
15016
|
+
(async () => {
|
|
15017
|
+
while (!(await reader.read()).done);
|
|
15018
|
+
})().catch(() => {});
|
|
15019
|
+
}
|
|
15020
|
+
function claimStream(owner) {
|
|
15021
|
+
if (streamOwner !== "unclaimed") throw new Error(streamOwner === "result-promises" ? `${owner === "full-stream" ? "fullStream" : "audioStream"} cannot be accessed after a result promise.` : "Only one of audioStream or fullStream can be accessed, and only once.");
|
|
15022
|
+
streamOwner = owner;
|
|
15023
|
+
return transform.readable;
|
|
15024
|
+
}
|
|
15025
|
+
return {
|
|
15026
|
+
get usage() {
|
|
15027
|
+
consumeStream();
|
|
15028
|
+
return usagePromise.promise;
|
|
15029
|
+
},
|
|
15030
|
+
get warnings() {
|
|
15031
|
+
consumeStream();
|
|
15032
|
+
return warningsPromise.promise;
|
|
15033
|
+
},
|
|
15034
|
+
get responses() {
|
|
15035
|
+
consumeStream();
|
|
15036
|
+
return responsesPromise.promise;
|
|
15037
|
+
},
|
|
15038
|
+
get providerMetadata() {
|
|
15039
|
+
consumeStream();
|
|
15040
|
+
return providerMetadataPromise.promise;
|
|
15041
|
+
},
|
|
15042
|
+
get fullStream() {
|
|
15043
|
+
return asAsyncIterableStream(claimStream("full-stream"));
|
|
15044
|
+
},
|
|
15045
|
+
get audioStream() {
|
|
15046
|
+
return asAsyncIterableStream(createAudioByteStream(claimStream("audio-stream")));
|
|
15047
|
+
}
|
|
15048
|
+
};
|
|
15049
|
+
}
|
|
15050
|
+
/**
|
|
15051
|
+
* Projects speech parts to audio bytes with a pull-based stream rather than a
|
|
15052
|
+
* second `pipeThrough`, so an early consumer cancel cancels the part stream
|
|
15053
|
+
* directly instead of surfacing an unhandled rejection from a chained pipe.
|
|
15054
|
+
*/
|
|
15055
|
+
function createAudioByteStream(parts) {
|
|
15056
|
+
let reader;
|
|
15057
|
+
return new ReadableStream({
|
|
15058
|
+
async pull(controller) {
|
|
15059
|
+
reader ??= parts.getReader();
|
|
15060
|
+
for (;;) {
|
|
15061
|
+
const { done, value } = await reader.read();
|
|
15062
|
+
if (done) {
|
|
15063
|
+
controller.close();
|
|
15064
|
+
return;
|
|
15065
|
+
}
|
|
15066
|
+
if (value.type === "audio" && value.audio.length > 0) {
|
|
15067
|
+
controller.enqueue(value.audio);
|
|
15068
|
+
return;
|
|
15069
|
+
}
|
|
15070
|
+
}
|
|
15071
|
+
},
|
|
15072
|
+
async cancel(reason) {
|
|
15073
|
+
if (reader != null) await reader.cancel(reason).catch(() => {});
|
|
15074
|
+
else await parts.cancel(reason).catch(() => {});
|
|
15075
|
+
}
|
|
15076
|
+
});
|
|
15077
|
+
}
|
|
15078
|
+
function toTextStream$1(text) {
|
|
15079
|
+
if (typeof text === "string") return new ReadableStream({ start(controller) {
|
|
15080
|
+
controller.enqueue({
|
|
15081
|
+
type: "text",
|
|
15082
|
+
text
|
|
15083
|
+
});
|
|
15084
|
+
controller.close();
|
|
15085
|
+
} });
|
|
15086
|
+
return toSourceStream(text).pipeThrough(new TransformStream({ transform(value, controller) {
|
|
15087
|
+
controller.enqueue(toTextPart(value));
|
|
15088
|
+
} }));
|
|
15089
|
+
}
|
|
15090
|
+
function toSourceStream(text) {
|
|
15091
|
+
if (text instanceof ReadableStream) return text;
|
|
15092
|
+
if (typeof text?.[Symbol.asyncIterator] === "function") return convertAsyncIteratorToReadableStream(text[Symbol.asyncIterator]());
|
|
15093
|
+
if (typeof text?.[Symbol.iterator] === "function") {
|
|
15094
|
+
const iterable = text;
|
|
15095
|
+
return convertAsyncIteratorToReadableStream((async function* () {
|
|
15096
|
+
yield* iterable;
|
|
15097
|
+
})());
|
|
15098
|
+
}
|
|
15099
|
+
throw new InvalidArgumentError({
|
|
15100
|
+
parameter: "text",
|
|
15101
|
+
value: text,
|
|
15102
|
+
message: "Expected a string, an iterable or async iterable, or a ReadableStream of strings or text parts."
|
|
15103
|
+
});
|
|
15104
|
+
}
|
|
15105
|
+
function toTextPart(value) {
|
|
15106
|
+
if (typeof value === "string") return {
|
|
15107
|
+
type: "text",
|
|
15108
|
+
text: value
|
|
15109
|
+
};
|
|
15110
|
+
return {
|
|
15111
|
+
type: "text",
|
|
15112
|
+
text: value.text,
|
|
15113
|
+
...value.voice != null && { voice: value.voice },
|
|
15114
|
+
...value.providerOptions != null && { providerOptions: value.providerOptions }
|
|
15115
|
+
};
|
|
15116
|
+
}
|
|
15117
|
+
//#endregion
|
|
14843
15118
|
//#region src/generate-speech/index.ts
|
|
14844
15119
|
/**
|
|
14845
15120
|
* @deprecated Use `generateSpeech` instead.
|
|
@@ -21209,6 +21484,6 @@ async function uploadSkill({ api, files, displayTitle, providerOptions }) {
|
|
|
21209
21484
|
});
|
|
21210
21485
|
}
|
|
21211
21486
|
//#endregion
|
|
21212
|
-
export { AISDKError, AI_SDK_TELEMETRY_TRACING_CHANNEL, APICallError, AbstractChat, DefaultChatTransport, DefaultGeneratedFile, DirectChatTransport, DownloadError, EmptyResponseBodyError, AbstractRealtimeSession as Experimental_AbstractRealtimeSession, ToolLoopAgent as Experimental_Agent, ToolLoopAgent, Experimental_DecisionRefusalError, Experimental_DecisionUnsupportedQuestionTypeError, Experimental_EvaluationUnsupportedQuestionTypeError, HttpChatTransport, InvalidArgumentError, InvalidDataContentError, InvalidMessageRoleError, InvalidPromptError, InvalidResponseDataError, InvalidStreamPartError, InvalidToolApprovalError, InvalidToolApprovalSignatureError, InvalidToolInputError, JSONParseError, JsonToSseTransformStream, LoadAPIKeyError, LoadSettingError, MessageConversionError, MissingToolResultsError, NoContentGeneratedError, NoImageGeneratedError, NoObjectGeneratedError, NoOutputGeneratedError, NoSpeechGeneratedError, NoSuchModelError, NoSuchProviderError, NoSuchProviderReferenceError, NoSuchToolError, NoTranscriptGeneratedError, NoTranslationGeneratedError, NoVideoGeneratedError, output_exports as Output, RetryError, SerialJobExecutor, StreamProviderError, TextStreamChatTransport, TooManyEmbeddingValuesForCallError, ToolCallNotFoundForApprovalError, ToolCallRepairError, ToolChoiceViolationError, TypeValidationError, UIMessageStreamError, UI_MESSAGE_STREAM_HEADERS, UnsupportedFunctionalityError, UnsupportedModelVersionError, WebSocketChatTransport, addToolInputExamplesMiddleware, asSchema, assistantModelMessageSchema, callCompletionApi, consumeStream, convertDataContentToBase64String, convertFileListToFileUIParts, convertToModelMessages, cosineSimilarity, createAgentUIStream, createAgentUIStreamResponse, createDownload, createGateway, createIdGenerator, createProviderRegistry, createTextStreamResponse, createUIMessageStream, createUIMessageStreamResponse, customProvider, defaultEmbeddingSettingsMiddleware, defaultInstructionsMiddleware, defaultSettingsMiddleware, detectToolDrift, dynamicTool, embed, embedMany, cancelBatch as experimental_cancelBatch, experimental_createProviderRegistry, decide as experimental_decide, decodeRealtimeAudio as experimental_decodeRealtimeAudio, encodeRealtimeAudio as experimental_encodeRealtimeAudio, experimental_evaluate, filterActiveTools as experimental_filterActiveTools, experimental_generateSpeech, experimental_generateVideo, getBatchResults as experimental_getBatchResults, getBatchStatus as experimental_getBatchStatus, getRealtimeToolDefinitions as experimental_getRealtimeToolDefinitions, experimental_getVideoStatus, listBatches as experimental_listBatches, resampleAudio as experimental_resampleAudio, startBatch as experimental_startBatch, experimental_startVideo, streamLanguageModelCall as experimental_streamLanguageModelCall, streamTextLowMemory as experimental_streamTextLowMemory, streamTranscribe as experimental_streamTranscribe, streamTranslate as experimental_streamTranslate, experimental_toolCaller, experimental_transcribe, extractJsonMiddleware, extractReasoningMiddleware, fingerprintTools, gateway, generateId, generateImage, generateObject, generateSpeech, generateText, getChunkTimeoutMs, getFirstChunkTimeoutMs, getStaticToolName, getStepTimeoutMs, getTextFromDataUrl, getToolName, getToolOrDynamicToolName, getToolTimeoutMs, getTotalTimeoutMs, hasToolCall, isCustomContentUIPart, isDataUIPart, isDeepEqualData, isDynamicToolUIPart, isFileUIPart, isLoopFinished, isReasoningFileUIPart, isReasoningUIPart, isStaticToolUIPart, isStepCount, isStepCount as stepCountIs, isTextUIPart, isToolOutputErrorUIPart, isToolUIPart, jsonSchema, lastAssistantMessageIsCompleteWithApprovalResponses, lastAssistantMessageIsCompleteWithToolCalls, modelMessageSchema, parseJsonEventStream, parsePartialJson, pipeAgentUIStreamToResponse, pipeTextStreamToResponse, pipeUIMessageStreamToResponse, pruneMessages, readUIMessageStream, registerTelemetry, rerank, safeValidateUIMessages, safeValidateWebSocketChatTransportRequest, simulateReadableStream, simulateStreamingMiddleware, smoothStream, streamObject, streamText, systemModelMessageSchema, toTextStream, toUIMessageChunk, toUIMessageStream, tool, toolModelMessageSchema, toolSearch, transcribe, uiMessageChunkSchema, uploadFile, uploadSkill, userModelMessageSchema, validateUIMessages, wrapEmbeddingModel, wrapImageModel, wrapLanguageModel, wrapProvider, zodSchema };
|
|
21487
|
+
export { AISDKError, AI_SDK_TELEMETRY_TRACING_CHANNEL, APICallError, AbstractChat, DefaultChatTransport, DefaultGeneratedFile, DirectChatTransport, DownloadError, EmptyResponseBodyError, AbstractRealtimeSession as Experimental_AbstractRealtimeSession, ToolLoopAgent as Experimental_Agent, ToolLoopAgent, Experimental_DecisionRefusalError, Experimental_DecisionUnsupportedQuestionTypeError, Experimental_EvaluationUnsupportedQuestionTypeError, HttpChatTransport, InvalidArgumentError, InvalidDataContentError, InvalidMessageRoleError, InvalidPromptError, InvalidResponseDataError, InvalidStreamPartError, InvalidToolApprovalError, InvalidToolApprovalSignatureError, InvalidToolInputError, JSONParseError, JsonToSseTransformStream, LoadAPIKeyError, LoadSettingError, MessageConversionError, MissingToolResultsError, NoContentGeneratedError, NoImageGeneratedError, NoObjectGeneratedError, NoOutputGeneratedError, NoSpeechGeneratedError, NoSuchModelError, NoSuchProviderError, NoSuchProviderReferenceError, NoSuchToolError, NoTranscriptGeneratedError, NoTranslationGeneratedError, NoVideoGeneratedError, output_exports as Output, RetryError, SerialJobExecutor, StreamProviderError, TextStreamChatTransport, TooManyEmbeddingValuesForCallError, ToolCallNotFoundForApprovalError, ToolCallRepairError, ToolChoiceViolationError, TypeValidationError, UIMessageStreamError, UI_MESSAGE_STREAM_HEADERS, UnsupportedFunctionalityError, UnsupportedModelVersionError, WebSocketChatTransport, addToolInputExamplesMiddleware, asSchema, assistantModelMessageSchema, callCompletionApi, consumeStream, convertDataContentToBase64String, convertFileListToFileUIParts, convertToModelMessages, cosineSimilarity, createAgentUIStream, createAgentUIStreamResponse, createDownload, createGateway, createIdGenerator, createProviderRegistry, createTextStreamResponse, createUIMessageStream, createUIMessageStreamResponse, customProvider, defaultEmbeddingSettingsMiddleware, defaultInstructionsMiddleware, defaultSettingsMiddleware, detectToolDrift, dynamicTool, embed, embedMany, cancelBatch as experimental_cancelBatch, experimental_createProviderRegistry, decide as experimental_decide, decodeRealtimeAudio as experimental_decodeRealtimeAudio, encodeRealtimeAudio as experimental_encodeRealtimeAudio, experimental_evaluate, filterActiveTools as experimental_filterActiveTools, experimental_generateSpeech, experimental_generateVideo, getBatchResults as experimental_getBatchResults, getBatchStatus as experimental_getBatchStatus, getRealtimeToolDefinitions as experimental_getRealtimeToolDefinitions, experimental_getVideoStatus, listBatches as experimental_listBatches, resampleAudio as experimental_resampleAudio, startBatch as experimental_startBatch, experimental_startVideo, streamLanguageModelCall as experimental_streamLanguageModelCall, streamSpeech as experimental_streamSpeech, streamTextLowMemory as experimental_streamTextLowMemory, streamTranscribe as experimental_streamTranscribe, streamTranslate as experimental_streamTranslate, experimental_toolCaller, experimental_transcribe, extractJsonMiddleware, extractReasoningMiddleware, fingerprintTools, gateway, generateId, generateImage, generateObject, generateSpeech, generateText, getChunkTimeoutMs, getFirstChunkTimeoutMs, getStaticToolName, getStepTimeoutMs, getTextFromDataUrl, getToolName, getToolOrDynamicToolName, getToolTimeoutMs, getTotalTimeoutMs, hasToolCall, isCustomContentUIPart, isDataUIPart, isDeepEqualData, isDynamicToolUIPart, isFileUIPart, isLoopFinished, isReasoningFileUIPart, isReasoningUIPart, isStaticToolUIPart, isStepCount, isStepCount as stepCountIs, isTextUIPart, isToolOutputErrorUIPart, isToolUIPart, jsonSchema, lastAssistantMessageIsCompleteWithApprovalResponses, lastAssistantMessageIsCompleteWithToolCalls, modelMessageSchema, parseJsonEventStream, parsePartialJson, pipeAgentUIStreamToResponse, pipeTextStreamToResponse, pipeUIMessageStreamToResponse, pruneMessages, readUIMessageStream, registerTelemetry, rerank, safeValidateUIMessages, safeValidateWebSocketChatTransportRequest, simulateReadableStream, simulateStreamingMiddleware, smoothStream, streamObject, streamText, systemModelMessageSchema, toTextStream, toUIMessageChunk, toUIMessageStream, tool, toolModelMessageSchema, toolSearch, transcribe, uiMessageChunkSchema, uploadFile, uploadSkill, userModelMessageSchema, validateUIMessages, wrapEmbeddingModel, wrapImageModel, wrapLanguageModel, wrapProvider, zodSchema };
|
|
21213
21488
|
|
|
21214
21489
|
//# sourceMappingURL=index.js.map
|