ai 7.0.126 → 7.0.128
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 +29 -0
- package/dist/index.d.ts +234 -154
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +307 -199
- package/dist/index.js.map +1 -1
- package/dist/internal/index.d.ts +278 -68
- package/dist/internal/index.d.ts.map +1 -1
- package/dist/internal/index.js +371 -72
- package/dist/internal/index.js.map +1 -1
- package/dist/test/index.d.ts +25 -17
- package/dist/test/index.d.ts.map +1 -1
- package/dist/test/index.js +27 -21
- package/dist/test/index.js.map +1 -1
- package/docs/02-getting-started/03-nextjs-pages-router.mdx +1 -1
- package/docs/02-getting-started/07-expo.mdx +1 -1
- package/docs/03-agents/07-workflow-agent.mdx +80 -12
- package/docs/03-ai-sdk-core/16-mcp-tools.mdx +44 -0
- package/docs/03-ai-sdk-core/19-tool-search.mdx +40 -4
- package/docs/03-ai-sdk-core/{32-evaluation.mdx → 32-decisions.mdx} +49 -49
- package/docs/03-ai-sdk-core/35-image-generation.mdx +6 -1
- package/docs/03-ai-sdk-core/36-transcription.mdx +42 -39
- package/docs/03-ai-sdk-core/37-speech.mdx +2 -0
- package/docs/03-ai-sdk-core/45-provider-management.mdx +8 -8
- package/docs/03-ai-sdk-core/60-telemetry.mdx +40 -31
- package/docs/03-ai-sdk-core/65-lifecycle-callbacks.mdx +21 -22
- package/docs/03-ai-sdk-harnesses/08-terminal-ui.mdx +2 -2
- package/docs/04-ai-sdk-ui/02-chatbot.mdx +2 -1
- package/docs/06-advanced/09-multistep-interfaces.mdx +1 -1
- package/docs/07-reference/01-ai-sdk-core/14-decide.mdx +74 -0
- package/docs/07-reference/01-ai-sdk-core/23-create-mcp-client.mdx +58 -4
- package/docs/07-reference/01-ai-sdk-core/23-tool-search.mdx +62 -6
- package/docs/07-reference/01-ai-sdk-core/40-provider-registry.mdx +11 -11
- package/docs/07-reference/01-ai-sdk-core/42-custom-provider.mdx +9 -9
- package/docs/07-reference/01-ai-sdk-core/66-extract-reasoning-middleware.mdx +24 -8
- package/docs/07-reference/02-ai-sdk-ui/01-use-chat.mdx +13 -0
- package/docs/07-reference/02-ai-sdk-ui/32-prune-messages.mdx +1 -1
- package/docs/07-reference/03-ai-sdk-rsc/01-stream-ui.mdx +1 -0
- package/docs/07-reference/04-ai-sdk-workflow/01-workflow-agent.mdx +39 -2
- package/docs/07-reference/05-ai-sdk-errors/ai-decision-unsupported-question-type-error.mdx +31 -0
- package/docs/07-reference/05-ai-sdk-errors/ai-no-such-model-error.mdx +3 -3
- package/docs/07-reference/05-ai-sdk-errors/ai-no-such-provider-error.mdx +3 -3
- package/docs/08-migration-guides/23-migration-guide-7-0.mdx +1 -1
- package/docs/08-migration-guides/29-migration-guide-4-0.mdx +1 -1
- package/docs/09-troubleshooting/05-tool-invocation-missing-result.mdx +2 -2
- package/package.json +12 -12
- package/src/decide/decide-events.ts +129 -0
- package/src/{evaluate/evaluate.ts → decide/decide.ts} +36 -38
- package/src/decide/decision-provider.ts +11 -0
- package/src/decide/decision-result.ts +39 -0
- package/src/decide/index.ts +64 -0
- package/src/{evaluate → decide}/restricted-telemetry-dispatcher.ts +7 -7
- package/src/{evaluate/validate-evaluation.ts → decide/validate-decision.ts} +9 -9
- package/src/error/index.ts +10 -1
- package/src/generate-speech/generated-audio-file.ts +5 -4
- package/src/generate-text/default-generate-text-result.ts +127 -0
- package/src/generate-text/generate-text.ts +2 -122
- package/src/generate-text/validate-tool-approvals.ts +5 -1
- package/src/global.ts +1 -1
- package/src/index.ts +1 -1
- package/src/middleware/extract-reasoning-middleware.ts +25 -6
- package/src/model/resolve-model.ts +45 -14
- package/src/registry/custom-provider.ts +38 -26
- package/src/registry/index.ts +13 -1
- package/src/registry/no-such-provider-error.ts +2 -0
- package/src/registry/provider-registry.ts +56 -29
- package/src/telemetry/create-telemetry-dispatcher.ts +17 -5
- package/src/telemetry/telemetry.ts +35 -19
- package/src/telemetry/tracing-channel.ts +1 -1
- package/src/test/decision-mock-model-v4.ts +35 -0
- package/src/tool-search/prepare-tool-search.ts +49 -29
- package/src/tool-search/tool-search.ts +58 -4
- package/src/transcribe/transcribe.ts +1 -1
- package/src/ui/chat.ts +9 -1
- package/src/ui/process-ui-message-stream.ts +21 -0
- package/src/ui-message-stream/create-ui-message-stream.ts +29 -4
- package/docs/07-reference/01-ai-sdk-core/14-evaluate.mdx +0 -74
- package/docs/07-reference/05-ai-sdk-errors/ai-evaluation-unsupported-question-type-error.mdx +0 -31
- package/src/evaluate/evaluate-events.ts +0 -131
- package/src/evaluate/evaluation-provider.ts +0 -6
- package/src/evaluate/evaluation-result.ts +0 -39
- package/src/evaluate/index.ts +0 -13
- package/src/test/evaluation-mock-model-v4.ts +0 -27
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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
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, isAbortError, isBuffer, isExecutableTool, isFullMediaType, isNonNullable, isProviderReference, isProviderStreamError, isUrlSupported, jsonSchema, jsonSchema as jsonSchema$1, lazySchema, normalizeHeaders, parseJsonEventStream, parseJsonEventStream as parseJsonEventStream$1, readResponseWithSizeLimit, resolve, retryWithExponentialBackoff, safeParseJSON, safeValidateTypes, tool, tool as tool$1, validateTypes, withUserAgentSuffix, zodSchema, zodSchema as zodSchema$1 } from "@ai-sdk/provider-utils";
|
|
4
|
-
import { AISDKError, AISDKError as AISDKError$1, APICallError, APICallError as APICallError$1, EmptyResponseBodyError, EmptyResponseBodyError as EmptyResponseBodyError$1,
|
|
4
|
+
import { AISDKError, AISDKError as AISDKError$1, APICallError, APICallError as APICallError$1, EmptyResponseBodyError, EmptyResponseBodyError as EmptyResponseBodyError$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
|
|
7
7
|
const name$23 = "AI_InvalidArgumentError";
|
|
@@ -528,6 +528,10 @@ var RetryError = class extends AISDKError$1 {
|
|
|
528
528
|
}
|
|
529
529
|
};
|
|
530
530
|
//#endregion
|
|
531
|
+
//#region src/error/index.ts
|
|
532
|
+
/** @deprecated Use `Experimental_DecisionUnsupportedQuestionTypeError` instead. */
|
|
533
|
+
const Experimental_EvaluationUnsupportedQuestionTypeError = Experimental_DecisionUnsupportedQuestionTypeError$1;
|
|
534
|
+
//#endregion
|
|
531
535
|
//#region src/logger/log-warnings.ts
|
|
532
536
|
/**
|
|
533
537
|
* Formats a warning object into a human-readable string with clear AI SDK branding.
|
|
@@ -1057,18 +1061,19 @@ function resolveRerankingModel(model) {
|
|
|
1057
1061
|
}
|
|
1058
1062
|
return asRerankingModelV4(model);
|
|
1059
1063
|
}
|
|
1060
|
-
function
|
|
1064
|
+
function resolveDecisionModel(model) {
|
|
1061
1065
|
if (typeof model === "string") {
|
|
1062
1066
|
const provider = globalThis.AI_SDK_DEFAULT_PROVIDER ?? gateway$1;
|
|
1063
|
-
|
|
1067
|
+
const factory = provider.decisionModel ?? provider.evaluationModel;
|
|
1068
|
+
if (typeof factory !== "function") throw new NoSuchModelError$1({
|
|
1064
1069
|
modelId: model,
|
|
1065
|
-
modelType: "
|
|
1066
|
-
message: "The default provider does not support
|
|
1070
|
+
modelType: "decisionModel",
|
|
1071
|
+
message: "The default provider does not support decision models. Pass a decision model instance or configure AI_SDK_DEFAULT_PROVIDER with a decisionModel method."
|
|
1067
1072
|
});
|
|
1068
|
-
const resolvedModel =
|
|
1073
|
+
const resolvedModel = factory.call(provider, model);
|
|
1069
1074
|
if (resolvedModel == null) throw new NoSuchModelError$1({
|
|
1070
1075
|
modelId: model,
|
|
1071
|
-
modelType: "
|
|
1076
|
+
modelType: "decisionModel"
|
|
1072
1077
|
});
|
|
1073
1078
|
model = resolvedModel;
|
|
1074
1079
|
}
|
|
@@ -1077,11 +1082,31 @@ function resolveEvaluationModel(model) {
|
|
|
1077
1082
|
provider: model.provider,
|
|
1078
1083
|
modelId: model.modelId
|
|
1079
1084
|
});
|
|
1080
|
-
return model;
|
|
1085
|
+
if ("doDecide" in model) return model;
|
|
1086
|
+
const legacyModel = model;
|
|
1087
|
+
return {
|
|
1088
|
+
specificationVersion: legacyModel.specificationVersion,
|
|
1089
|
+
provider: legacyModel.provider,
|
|
1090
|
+
modelId: legacyModel.modelId,
|
|
1091
|
+
supportedQuestionTypes: legacyModel.supportedQuestionTypes,
|
|
1092
|
+
doDecide: (options) => legacyModel.doEvaluate(options)
|
|
1093
|
+
};
|
|
1081
1094
|
}
|
|
1082
1095
|
function getGlobalProvider() {
|
|
1083
1096
|
return asProviderV4(globalThis.AI_SDK_DEFAULT_PROVIDER ?? gateway$1);
|
|
1084
1097
|
}
|
|
1098
|
+
/** Internal adapter for deprecated provider factories. */
|
|
1099
|
+
function asEvaluationModel(model) {
|
|
1100
|
+
if ("doEvaluate" in model && typeof model.doEvaluate === "function") return model;
|
|
1101
|
+
return {
|
|
1102
|
+
specificationVersion: model.specificationVersion,
|
|
1103
|
+
provider: model.provider,
|
|
1104
|
+
modelId: model.modelId,
|
|
1105
|
+
supportedQuestionTypes: model.supportedQuestionTypes,
|
|
1106
|
+
doDecide: (options) => model.doDecide(options),
|
|
1107
|
+
doEvaluate: (options) => model.doDecide(options)
|
|
1108
|
+
};
|
|
1109
|
+
}
|
|
1085
1110
|
//#endregion
|
|
1086
1111
|
//#region src/prompt/clone-model-message.ts
|
|
1087
1112
|
/**
|
|
@@ -1102,7 +1127,7 @@ function cloneValue(value) {
|
|
|
1102
1127
|
}
|
|
1103
1128
|
//#endregion
|
|
1104
1129
|
//#region src/version.ts
|
|
1105
|
-
const VERSION = "7.0.
|
|
1130
|
+
const VERSION = "7.0.128";
|
|
1106
1131
|
//#endregion
|
|
1107
1132
|
//#region src/util/download/download.ts
|
|
1108
1133
|
/**
|
|
@@ -2949,14 +2974,21 @@ function appendToolCallerMessages({ messages, toolCallerMessages }) {
|
|
|
2949
2974
|
//#endregion
|
|
2950
2975
|
//#region src/tool-search/tool-search.ts
|
|
2951
2976
|
const toolSearchSymbol = Symbol.for("vercel.ai.toolSearch");
|
|
2977
|
+
const toolSearchFunctionSymbol = Symbol.for("vercel.ai.toolSearch.search");
|
|
2978
|
+
const toolSearchMaxResultsSymbol = Symbol.for("vercel.ai.toolSearch.maxResults");
|
|
2952
2979
|
/**
|
|
2953
2980
|
* Search deferred tools by name and description. The surrounding generation
|
|
2954
2981
|
* binds the search registry and makes matches available on the next step.
|
|
2955
2982
|
* Use directly or through code mode with `toolDiscovery: 'conversation'`.
|
|
2956
2983
|
*/
|
|
2957
|
-
function toolSearch() {
|
|
2984
|
+
function toolSearch({ search, maxResults = 5 } = {}) {
|
|
2985
|
+
if (!Number.isSafeInteger(maxResults) || maxResults < 1) throw new InvalidArgumentError({
|
|
2986
|
+
parameter: "maxResults",
|
|
2987
|
+
value: maxResults,
|
|
2988
|
+
message: "maxResults must be a positive safe integer."
|
|
2989
|
+
});
|
|
2958
2990
|
return Object.assign(tool$1({
|
|
2959
|
-
description: "Search for tools by keywords in their names and descriptions. Returns up to five matching tools. Matches become available on the next model step, after this execution finishes. Wait for their tool definitions before calling the discovered tools. If no tools match, try different keywords
|
|
2991
|
+
description: `${search == null ? "Search for tools by keywords in their names and descriptions." : "Search for tools matching a query."} Returns up to ${maxResults === 5 ? "five" : maxResults} matching tools. Matches become available on the next model step, after this execution finishes. Wait for their tool definitions before calling the discovered tools. If no tools match, try different keywords.`,
|
|
2960
2992
|
inputSchema: jsonSchema$1({
|
|
2961
2993
|
type: "object",
|
|
2962
2994
|
properties: { query: {
|
|
@@ -2988,9 +3020,17 @@ function toolSearch() {
|
|
|
2988
3020
|
}
|
|
2989
3021
|
}), {
|
|
2990
3022
|
type: "function",
|
|
2991
|
-
[toolSearchSymbol]: true
|
|
3023
|
+
[toolSearchSymbol]: true,
|
|
3024
|
+
[toolSearchFunctionSymbol]: search,
|
|
3025
|
+
[toolSearchMaxResultsSymbol]: maxResults
|
|
2992
3026
|
});
|
|
2993
3027
|
}
|
|
3028
|
+
function getToolSearchMaxResults(tool) {
|
|
3029
|
+
return tool[toolSearchMaxResultsSymbol] ?? 5;
|
|
3030
|
+
}
|
|
3031
|
+
function getToolSearchFunction(tool) {
|
|
3032
|
+
return tool[toolSearchFunctionSymbol];
|
|
3033
|
+
}
|
|
2994
3034
|
function isToolSearch(tool) {
|
|
2995
3035
|
return tool[toolSearchSymbol] === true;
|
|
2996
3036
|
}
|
|
@@ -3020,28 +3060,39 @@ function createToolSearchState({ tools, toolCallers }) {
|
|
|
3020
3060
|
const candidates = entries.filter(([name, candidate]) => candidate.deferLoading && !isToolSearch(candidate) && callers.some((caller) => getCallers(name).includes(caller)));
|
|
3021
3061
|
return [searchName, {
|
|
3022
3062
|
...tool,
|
|
3023
|
-
execute: ({ query }) => {
|
|
3024
|
-
const
|
|
3025
|
-
const matches = candidates.map(([name, candidate]) => {
|
|
3063
|
+
execute: async ({ query }) => {
|
|
3064
|
+
const availableTools = candidates.map(([name, candidate]) => {
|
|
3026
3065
|
const description = resolveToolDescription({
|
|
3027
3066
|
tool: candidate,
|
|
3028
3067
|
toolName: name,
|
|
3029
3068
|
toolsContext,
|
|
3030
3069
|
experimental_sandbox
|
|
3031
3070
|
});
|
|
3071
|
+
return {
|
|
3072
|
+
name,
|
|
3073
|
+
...description == null ? {} : { description }
|
|
3074
|
+
};
|
|
3075
|
+
});
|
|
3076
|
+
const toolsByName = new Map(availableTools.map((tool) => [tool.name, tool]));
|
|
3077
|
+
const customSearch = getToolSearchFunction(tool);
|
|
3078
|
+
const terms = [...new Set(tokenize(query))];
|
|
3079
|
+
const rankedNames = customSearch ? await customSearch({
|
|
3080
|
+
query,
|
|
3081
|
+
tools: availableTools.map((tool) => ({ ...tool }))
|
|
3082
|
+
}) : availableTools.map(({ name, description }) => {
|
|
3032
3083
|
const nameTerms = tokenize(name);
|
|
3033
3084
|
const descriptionTerms = tokenize(description ?? "");
|
|
3034
3085
|
return {
|
|
3035
3086
|
name,
|
|
3036
|
-
description,
|
|
3037
3087
|
score: terms.reduce((score, term) => score + (nameTerms.includes(term) ? 2 : 0) + (descriptionTerms.includes(term) ? 1 : 0), 0)
|
|
3038
3088
|
};
|
|
3039
|
-
}).filter((match) => match.score > 0).sort((a, b) => b.score - a.score).
|
|
3089
|
+
}).filter((match) => match.score > 0).sort((a, b) => b.score - a.score).map((match) => match.name);
|
|
3090
|
+
const matches = [...new Set(rankedNames)].flatMap((name) => {
|
|
3091
|
+
const match = toolsByName.get(name);
|
|
3092
|
+
return match == null ? [] : [match];
|
|
3093
|
+
}).slice(0, getToolSearchMaxResults(tool));
|
|
3040
3094
|
for (const { name } of matches) discovered.add(name);
|
|
3041
|
-
return { tools: matches
|
|
3042
|
-
name,
|
|
3043
|
-
...description == null ? {} : { description }
|
|
3044
|
-
})) };
|
|
3095
|
+
return { tools: matches };
|
|
3045
3096
|
}
|
|
3046
3097
|
}];
|
|
3047
3098
|
}));
|
|
@@ -3210,6 +3261,122 @@ function filterActiveTools({ tools, activeTools }) {
|
|
|
3210
3261
|
return Object.fromEntries(Object.entries(tools).filter(([name]) => activeTools.includes(name)));
|
|
3211
3262
|
}
|
|
3212
3263
|
//#endregion
|
|
3264
|
+
//#region src/generate-text/reasoning-output.ts
|
|
3265
|
+
function unwrapReasoningFileData(data) {
|
|
3266
|
+
if (typeof data === "object" && data !== null && "type" in data) return data.type === "data" ? data.data : data.url;
|
|
3267
|
+
return data;
|
|
3268
|
+
}
|
|
3269
|
+
function convertFromReasoningOutputs(parts) {
|
|
3270
|
+
return parts.map((part) => {
|
|
3271
|
+
if (part.type === "reasoning") return {
|
|
3272
|
+
type: "reasoning",
|
|
3273
|
+
text: part.text,
|
|
3274
|
+
...part.providerMetadata != null ? { providerOptions: part.providerMetadata } : {}
|
|
3275
|
+
};
|
|
3276
|
+
return {
|
|
3277
|
+
type: "reasoning-file",
|
|
3278
|
+
data: part.file.base64,
|
|
3279
|
+
mediaType: part.file.mediaType,
|
|
3280
|
+
...part.providerMetadata != null ? { providerOptions: part.providerMetadata } : {}
|
|
3281
|
+
};
|
|
3282
|
+
});
|
|
3283
|
+
}
|
|
3284
|
+
function convertToReasoningOutputs(parts) {
|
|
3285
|
+
return parts.map((part) => {
|
|
3286
|
+
if (part.type === "reasoning") return {
|
|
3287
|
+
type: "reasoning",
|
|
3288
|
+
text: part.text,
|
|
3289
|
+
...part.providerOptions != null ? { providerMetadata: part.providerOptions } : {}
|
|
3290
|
+
};
|
|
3291
|
+
const rawData = unwrapReasoningFileData(part.data);
|
|
3292
|
+
return {
|
|
3293
|
+
type: "reasoning-file",
|
|
3294
|
+
file: new DefaultGeneratedFile({
|
|
3295
|
+
data: rawData instanceof ArrayBuffer ? new Uint8Array(rawData) : rawData instanceof URL ? rawData.toString() : rawData,
|
|
3296
|
+
mediaType: part.mediaType
|
|
3297
|
+
}),
|
|
3298
|
+
...part.providerOptions != null ? { providerMetadata: part.providerOptions } : {}
|
|
3299
|
+
};
|
|
3300
|
+
});
|
|
3301
|
+
}
|
|
3302
|
+
//#endregion
|
|
3303
|
+
//#region src/generate-text/default-generate-text-result.ts
|
|
3304
|
+
var DefaultGenerateTextResult = class {
|
|
3305
|
+
constructor(options) {
|
|
3306
|
+
this.initialResponseMessages = options.initialResponseMessages;
|
|
3307
|
+
this.steps = options.steps;
|
|
3308
|
+
this._output = options.output;
|
|
3309
|
+
this.totalUsage = options.totalUsage;
|
|
3310
|
+
}
|
|
3311
|
+
get finalStep() {
|
|
3312
|
+
return this.steps.at(-1);
|
|
3313
|
+
}
|
|
3314
|
+
get content() {
|
|
3315
|
+
return this.steps.flatMap((step) => step.content);
|
|
3316
|
+
}
|
|
3317
|
+
get text() {
|
|
3318
|
+
return this.finalStep.text;
|
|
3319
|
+
}
|
|
3320
|
+
get files() {
|
|
3321
|
+
return this.steps.flatMap((step) => step.files);
|
|
3322
|
+
}
|
|
3323
|
+
get reasoningText() {
|
|
3324
|
+
return this.finalStep.reasoningText;
|
|
3325
|
+
}
|
|
3326
|
+
get reasoning() {
|
|
3327
|
+
return convertToReasoningOutputs(this.finalStep.reasoning);
|
|
3328
|
+
}
|
|
3329
|
+
get toolCalls() {
|
|
3330
|
+
return this.steps.flatMap((step) => step.toolCalls);
|
|
3331
|
+
}
|
|
3332
|
+
get staticToolCalls() {
|
|
3333
|
+
return this.steps.flatMap((step) => step.staticToolCalls);
|
|
3334
|
+
}
|
|
3335
|
+
get dynamicToolCalls() {
|
|
3336
|
+
return this.steps.flatMap((step) => step.dynamicToolCalls);
|
|
3337
|
+
}
|
|
3338
|
+
get toolResults() {
|
|
3339
|
+
return this.steps.flatMap((step) => step.toolResults);
|
|
3340
|
+
}
|
|
3341
|
+
get staticToolResults() {
|
|
3342
|
+
return this.steps.flatMap((step) => step.staticToolResults);
|
|
3343
|
+
}
|
|
3344
|
+
get dynamicToolResults() {
|
|
3345
|
+
return this.steps.flatMap((step) => step.dynamicToolResults);
|
|
3346
|
+
}
|
|
3347
|
+
get sources() {
|
|
3348
|
+
return this.steps.flatMap((step) => step.sources);
|
|
3349
|
+
}
|
|
3350
|
+
get finishReason() {
|
|
3351
|
+
return this.finalStep.finishReason;
|
|
3352
|
+
}
|
|
3353
|
+
get rawFinishReason() {
|
|
3354
|
+
return this.finalStep.rawFinishReason;
|
|
3355
|
+
}
|
|
3356
|
+
get warnings() {
|
|
3357
|
+
return this.steps.flatMap((step) => step.warnings ?? []);
|
|
3358
|
+
}
|
|
3359
|
+
get providerMetadata() {
|
|
3360
|
+
return this.finalStep.providerMetadata;
|
|
3361
|
+
}
|
|
3362
|
+
get response() {
|
|
3363
|
+
return this.finalStep.response;
|
|
3364
|
+
}
|
|
3365
|
+
get responseMessages() {
|
|
3366
|
+
return [...this.initialResponseMessages, ...this.steps.flatMap((step) => step.response.messages)];
|
|
3367
|
+
}
|
|
3368
|
+
get request() {
|
|
3369
|
+
return this.finalStep.request;
|
|
3370
|
+
}
|
|
3371
|
+
get usage() {
|
|
3372
|
+
return this.totalUsage;
|
|
3373
|
+
}
|
|
3374
|
+
get output() {
|
|
3375
|
+
if (this._output == null) throw new NoOutputGeneratedError();
|
|
3376
|
+
return this._output;
|
|
3377
|
+
}
|
|
3378
|
+
};
|
|
3379
|
+
//#endregion
|
|
3213
3380
|
//#region src/generate-text/is-tool-execution-allowed-finish-reason.ts
|
|
3214
3381
|
function isToolExecutionAllowedFinishReason(finishReason) {
|
|
3215
3382
|
return finishReason === "stop" || finishReason === "tool-calls";
|
|
@@ -4053,45 +4220,6 @@ function prepareStepCallSettings({ callSettings, stepSettings }) {
|
|
|
4053
4220
|
});
|
|
4054
4221
|
}
|
|
4055
4222
|
//#endregion
|
|
4056
|
-
//#region src/generate-text/reasoning-output.ts
|
|
4057
|
-
function unwrapReasoningFileData(data) {
|
|
4058
|
-
if (typeof data === "object" && data !== null && "type" in data) return data.type === "data" ? data.data : data.url;
|
|
4059
|
-
return data;
|
|
4060
|
-
}
|
|
4061
|
-
function convertFromReasoningOutputs(parts) {
|
|
4062
|
-
return parts.map((part) => {
|
|
4063
|
-
if (part.type === "reasoning") return {
|
|
4064
|
-
type: "reasoning",
|
|
4065
|
-
text: part.text,
|
|
4066
|
-
...part.providerMetadata != null ? { providerOptions: part.providerMetadata } : {}
|
|
4067
|
-
};
|
|
4068
|
-
return {
|
|
4069
|
-
type: "reasoning-file",
|
|
4070
|
-
data: part.file.base64,
|
|
4071
|
-
mediaType: part.file.mediaType,
|
|
4072
|
-
...part.providerMetadata != null ? { providerOptions: part.providerMetadata } : {}
|
|
4073
|
-
};
|
|
4074
|
-
});
|
|
4075
|
-
}
|
|
4076
|
-
function convertToReasoningOutputs(parts) {
|
|
4077
|
-
return parts.map((part) => {
|
|
4078
|
-
if (part.type === "reasoning") return {
|
|
4079
|
-
type: "reasoning",
|
|
4080
|
-
text: part.text,
|
|
4081
|
-
...part.providerOptions != null ? { providerMetadata: part.providerOptions } : {}
|
|
4082
|
-
};
|
|
4083
|
-
const rawData = unwrapReasoningFileData(part.data);
|
|
4084
|
-
return {
|
|
4085
|
-
type: "reasoning-file",
|
|
4086
|
-
file: new DefaultGeneratedFile({
|
|
4087
|
-
data: rawData instanceof ArrayBuffer ? new Uint8Array(rawData) : rawData instanceof URL ? rawData.toString() : rawData,
|
|
4088
|
-
mediaType: part.mediaType
|
|
4089
|
-
}),
|
|
4090
|
-
...part.providerOptions != null ? { providerMetadata: part.providerOptions } : {}
|
|
4091
|
-
};
|
|
4092
|
-
});
|
|
4093
|
-
}
|
|
4094
|
-
//#endregion
|
|
4095
4223
|
//#region src/generate-text/resolve-tool-approval.ts
|
|
4096
4224
|
/**
|
|
4097
4225
|
* Resolves the approval state for a tool call by checking user-supplied and tool-defined
|
|
@@ -4355,8 +4483,11 @@ function createTelemetryDispatcher({ telemetry }) {
|
|
|
4355
4483
|
includeRuntimeContext: telemetry?.includeRuntimeContext,
|
|
4356
4484
|
includeToolsContext: telemetry?.includeToolsContext
|
|
4357
4485
|
};
|
|
4358
|
-
const mergeTelemetryCallback = (key) => {
|
|
4359
|
-
const integrationCallbacks = integrations.map((integration) =>
|
|
4486
|
+
const mergeTelemetryCallback = (key, deprecatedKey) => {
|
|
4487
|
+
const integrationCallbacks = integrations.map((integration) => {
|
|
4488
|
+
const callback = integration[key] ?? (deprecatedKey == null ? void 0 : integration[deprecatedKey]);
|
|
4489
|
+
return typeof callback === "function" ? callback.bind(integration) : void 0;
|
|
4490
|
+
}).filter(Boolean).map((callback) => ((event) => callback(augmentEvent(event, telemetryMetadata))));
|
|
4360
4491
|
if (integrationCallbacks.length === 0) return;
|
|
4361
4492
|
const mergedIntegrationCallback = mergeCallbacks(...integrationCallbacks);
|
|
4362
4493
|
return async (event) => {
|
|
@@ -4392,10 +4523,10 @@ function createTelemetryDispatcher({ telemetry }) {
|
|
|
4392
4523
|
onEmbedEnd: mergeTelemetryCallback("onEmbedEnd"),
|
|
4393
4524
|
onRerankStart: mergeTelemetryCallback("onRerankStart"),
|
|
4394
4525
|
onRerankEnd: mergeTelemetryCallback("onRerankEnd"),
|
|
4395
|
-
|
|
4396
|
-
|
|
4397
|
-
|
|
4398
|
-
|
|
4526
|
+
experimental_onDecideStart: mergeTelemetryCallback("experimental_onDecideStart", "experimental_onEvaluateStart"),
|
|
4527
|
+
experimental_onDecisionModelCallStart: mergeTelemetryCallback("experimental_onDecisionModelCallStart", "experimental_onEvaluationModelCallStart"),
|
|
4528
|
+
experimental_onDecisionModelCallEnd: mergeTelemetryCallback("experimental_onDecisionModelCallEnd", "experimental_onEvaluationModelCallEnd"),
|
|
4529
|
+
experimental_onDecideEnd: mergeTelemetryCallback("experimental_onDecideEnd", "experimental_onEvaluateEnd"),
|
|
4399
4530
|
experimental_onStreamTranscriptionStart: mergeTelemetryCallback("experimental_onStreamTranscriptionStart"),
|
|
4400
4531
|
experimental_onStreamTranscriptionEnd: mergeTelemetryCallback("experimental_onStreamTranscriptionEnd"),
|
|
4401
4532
|
onEnd: mergeTelemetryCallback("onEnd"),
|
|
@@ -4995,13 +5126,14 @@ async function validateApprovedToolApprovals({ approvedToolApprovals, tools, too
|
|
|
4995
5126
|
let validationError;
|
|
4996
5127
|
if (!validation.success) validationError = validation.error;
|
|
4997
5128
|
else try {
|
|
4998
|
-
|
|
5129
|
+
const revalidatedToolCall = await refineParsedToolCallInput({
|
|
4999
5130
|
toolCall: {
|
|
5000
5131
|
...toolCall,
|
|
5001
5132
|
input: validation.value
|
|
5002
5133
|
},
|
|
5003
5134
|
refineToolInput
|
|
5004
|
-
})
|
|
5135
|
+
});
|
|
5136
|
+
if (!isDeepEqualData(structuredClone(revalidatedToolCall.input), structuredClone(toolCall.input))) validationError = /* @__PURE__ */ new Error("Approved tool input does not match the validated schema output.");
|
|
5005
5137
|
} catch (error) {
|
|
5006
5138
|
validationError = error;
|
|
5007
5139
|
}
|
|
@@ -5822,81 +5954,6 @@ async function executeTools({ toolCalls, tools, callId, messages, abortSignal, t
|
|
|
5822
5954
|
runInTracingChannelSpan
|
|
5823
5955
|
})))).filter((result) => result != null);
|
|
5824
5956
|
}
|
|
5825
|
-
var DefaultGenerateTextResult = class {
|
|
5826
|
-
constructor(options) {
|
|
5827
|
-
this.initialResponseMessages = options.initialResponseMessages;
|
|
5828
|
-
this.steps = options.steps;
|
|
5829
|
-
this._output = options.output;
|
|
5830
|
-
this.totalUsage = options.totalUsage;
|
|
5831
|
-
}
|
|
5832
|
-
get finalStep() {
|
|
5833
|
-
return this.steps.at(-1);
|
|
5834
|
-
}
|
|
5835
|
-
get content() {
|
|
5836
|
-
return this.steps.flatMap((step) => step.content);
|
|
5837
|
-
}
|
|
5838
|
-
get text() {
|
|
5839
|
-
return this.finalStep.text;
|
|
5840
|
-
}
|
|
5841
|
-
get files() {
|
|
5842
|
-
return this.steps.flatMap((step) => step.files);
|
|
5843
|
-
}
|
|
5844
|
-
get reasoningText() {
|
|
5845
|
-
return this.finalStep.reasoningText;
|
|
5846
|
-
}
|
|
5847
|
-
get reasoning() {
|
|
5848
|
-
return convertToReasoningOutputs(this.finalStep.reasoning);
|
|
5849
|
-
}
|
|
5850
|
-
get toolCalls() {
|
|
5851
|
-
return this.steps.flatMap((step) => step.toolCalls);
|
|
5852
|
-
}
|
|
5853
|
-
get staticToolCalls() {
|
|
5854
|
-
return this.steps.flatMap((step) => step.staticToolCalls);
|
|
5855
|
-
}
|
|
5856
|
-
get dynamicToolCalls() {
|
|
5857
|
-
return this.steps.flatMap((step) => step.dynamicToolCalls);
|
|
5858
|
-
}
|
|
5859
|
-
get toolResults() {
|
|
5860
|
-
return this.steps.flatMap((step) => step.toolResults);
|
|
5861
|
-
}
|
|
5862
|
-
get staticToolResults() {
|
|
5863
|
-
return this.steps.flatMap((step) => step.staticToolResults);
|
|
5864
|
-
}
|
|
5865
|
-
get dynamicToolResults() {
|
|
5866
|
-
return this.steps.flatMap((step) => step.dynamicToolResults);
|
|
5867
|
-
}
|
|
5868
|
-
get sources() {
|
|
5869
|
-
return this.steps.flatMap((step) => step.sources);
|
|
5870
|
-
}
|
|
5871
|
-
get finishReason() {
|
|
5872
|
-
return this.finalStep.finishReason;
|
|
5873
|
-
}
|
|
5874
|
-
get rawFinishReason() {
|
|
5875
|
-
return this.finalStep.rawFinishReason;
|
|
5876
|
-
}
|
|
5877
|
-
get warnings() {
|
|
5878
|
-
return this.steps.flatMap((step) => step.warnings ?? []);
|
|
5879
|
-
}
|
|
5880
|
-
get providerMetadata() {
|
|
5881
|
-
return this.finalStep.providerMetadata;
|
|
5882
|
-
}
|
|
5883
|
-
get response() {
|
|
5884
|
-
return this.finalStep.response;
|
|
5885
|
-
}
|
|
5886
|
-
get responseMessages() {
|
|
5887
|
-
return [...this.initialResponseMessages, ...this.steps.flatMap((step) => step.response.messages)];
|
|
5888
|
-
}
|
|
5889
|
-
get request() {
|
|
5890
|
-
return this.finalStep.request;
|
|
5891
|
-
}
|
|
5892
|
-
get usage() {
|
|
5893
|
-
return this.totalUsage;
|
|
5894
|
-
}
|
|
5895
|
-
get output() {
|
|
5896
|
-
if (this._output == null) throw new NoOutputGeneratedError();
|
|
5897
|
-
return this._output;
|
|
5898
|
-
}
|
|
5899
|
-
};
|
|
5900
5957
|
//#endregion
|
|
5901
5958
|
//#region src/util/prepare-headers.ts
|
|
5902
5959
|
function prepareHeaders(headers, defaultHeaders) {
|
|
@@ -6494,7 +6551,7 @@ function createStreamingUIMessageState({ lastMessage, messageId }) {
|
|
|
6494
6551
|
partialToolCalls
|
|
6495
6552
|
};
|
|
6496
6553
|
}
|
|
6497
|
-
function processUIMessageStream({ stream, messageMetadataSchema, dataPartSchemas, runUpdateMessageJob, onError, onToolCall, onData }) {
|
|
6554
|
+
function processUIMessageStream({ stream, messageMetadataSchema, dataPartSchemas, runUpdateMessageJob, onError, onToolCall, onData, resetStateOnMessageIdChange = false }) {
|
|
6498
6555
|
return stream.pipeThrough(new TransformStream({ async transform(chunk, controller) {
|
|
6499
6556
|
await runUpdateMessageJob(async ({ state, write }) => {
|
|
6500
6557
|
function getCurrentStepParts() {
|
|
@@ -6960,6 +7017,10 @@ function processUIMessageStream({ stream, messageMetadataSchema, dataPartSchemas
|
|
|
6960
7017
|
break;
|
|
6961
7018
|
}
|
|
6962
7019
|
case "start":
|
|
7020
|
+
if (resetStateOnMessageIdChange && chunk.messageId != null && chunk.messageId !== state.message.id) Object.assign(state, createStreamingUIMessageState({
|
|
7021
|
+
lastMessage: void 0,
|
|
7022
|
+
messageId: chunk.messageId
|
|
7023
|
+
}), { finishReason: void 0 });
|
|
6963
7024
|
if (chunk.messageId != null) state.message.id = chunk.messageId;
|
|
6964
7025
|
await updateMessageMetadata(chunk.messageMetadata);
|
|
6965
7026
|
if (chunk.messageId != null || chunk.messageMetadata != null) write({ updateStatus: false });
|
|
@@ -10331,10 +10392,20 @@ var ToolLoopAgent = class {
|
|
|
10331
10392
|
function createUIMessageStream({ execute, onError = () => "An error occurred.", originalMessages, onStepEnd, onStepFinish, onEnd, onFinish, generateId = generateId$1 }) {
|
|
10332
10393
|
let controller;
|
|
10333
10394
|
const ongoingStreamPromises = [];
|
|
10395
|
+
const activeReaders = /* @__PURE__ */ new Set();
|
|
10396
|
+
let isCancelled = false;
|
|
10397
|
+
let cancelReason;
|
|
10334
10398
|
let outcome = { status: "unknown" };
|
|
10335
|
-
const stream = new ReadableStream({
|
|
10336
|
-
|
|
10337
|
-
|
|
10399
|
+
const stream = new ReadableStream({
|
|
10400
|
+
start(controllerArg) {
|
|
10401
|
+
controller = controllerArg;
|
|
10402
|
+
},
|
|
10403
|
+
async cancel(reason) {
|
|
10404
|
+
isCancelled = true;
|
|
10405
|
+
cancelReason = reason;
|
|
10406
|
+
await Promise.all(Array.from(activeReaders, (reader) => reader.cancel(reason)));
|
|
10407
|
+
}
|
|
10408
|
+
});
|
|
10338
10409
|
function safeEnqueue(data) {
|
|
10339
10410
|
try {
|
|
10340
10411
|
controller.enqueue(data);
|
|
@@ -10375,12 +10446,22 @@ function createUIMessageStream({ execute, onError = () => "An error occurred.",
|
|
|
10375
10446
|
safeEnqueue(part);
|
|
10376
10447
|
},
|
|
10377
10448
|
merge(streamArg) {
|
|
10449
|
+
if (isCancelled) {
|
|
10450
|
+
streamArg.cancel(cancelReason).catch(() => {});
|
|
10451
|
+
return;
|
|
10452
|
+
}
|
|
10378
10453
|
ongoingStreamPromises.push((async () => {
|
|
10379
10454
|
const reader = streamArg.getReader();
|
|
10380
|
-
|
|
10381
|
-
|
|
10382
|
-
|
|
10383
|
-
|
|
10455
|
+
activeReaders.add(reader);
|
|
10456
|
+
try {
|
|
10457
|
+
while (true) {
|
|
10458
|
+
const { done, value } = await reader.read();
|
|
10459
|
+
if (done) break;
|
|
10460
|
+
safeEnqueue(value);
|
|
10461
|
+
}
|
|
10462
|
+
} finally {
|
|
10463
|
+
activeReaders.delete(reader);
|
|
10464
|
+
reader.releaseLock();
|
|
10384
10465
|
}
|
|
10385
10466
|
})().catch((error) => {
|
|
10386
10467
|
handleError(error);
|
|
@@ -12497,19 +12578,19 @@ var DefaultEmbedManyResult = class {
|
|
|
12497
12578
|
}
|
|
12498
12579
|
};
|
|
12499
12580
|
//#endregion
|
|
12500
|
-
//#region src/
|
|
12581
|
+
//#region src/decide/restricted-telemetry-dispatcher.ts
|
|
12501
12582
|
function createRestrictedTelemetryDispatcher$1({ telemetry }) {
|
|
12502
12583
|
const dispatcher = createTelemetryDispatcher({ telemetry });
|
|
12503
12584
|
return {
|
|
12504
12585
|
...dispatcher,
|
|
12505
|
-
onStart: (event) => dispatcher.
|
|
12586
|
+
onStart: (event) => dispatcher.experimental_onDecideStart?.({
|
|
12506
12587
|
...event,
|
|
12507
12588
|
runtimeContext: filterIncludedContext({
|
|
12508
12589
|
context: event.runtimeContext,
|
|
12509
12590
|
includeContext: telemetry?.includeRuntimeContext
|
|
12510
12591
|
})
|
|
12511
12592
|
}),
|
|
12512
|
-
onEnd: (event) => dispatcher.
|
|
12593
|
+
onEnd: (event) => dispatcher.experimental_onDecideEnd?.({
|
|
12513
12594
|
...event,
|
|
12514
12595
|
runtimeContext: filterIncludedContext({
|
|
12515
12596
|
context: event.runtimeContext,
|
|
@@ -12519,7 +12600,7 @@ function createRestrictedTelemetryDispatcher$1({ telemetry }) {
|
|
|
12519
12600
|
};
|
|
12520
12601
|
}
|
|
12521
12602
|
//#endregion
|
|
12522
|
-
//#region src/
|
|
12603
|
+
//#region src/decide/validate-decision.ts
|
|
12523
12604
|
const tolerance = 1e-6;
|
|
12524
12605
|
function isRecord(value) {
|
|
12525
12606
|
if (value == null || typeof value !== "object" || Array.isArray(value)) return false;
|
|
@@ -12546,7 +12627,7 @@ function invalidInput(parameter, value, message) {
|
|
|
12546
12627
|
message
|
|
12547
12628
|
});
|
|
12548
12629
|
}
|
|
12549
|
-
function
|
|
12630
|
+
function validateDecisionInput({ state, questions }) {
|
|
12550
12631
|
if (!isInput(state)) invalidInput("state", state, "must be a JSON-compatible string, object, or array");
|
|
12551
12632
|
if (!isRecord(questions) || Object.keys(questions).length === 0) invalidInput("questions", questions, "must be a nonempty question map");
|
|
12552
12633
|
for (const [id, question] of Object.entries(questions)) {
|
|
@@ -12586,15 +12667,15 @@ function validateDistribution(value, keys, answers, id, roundingError) {
|
|
|
12586
12667
|
const sum = Object.values(value).reduce((total, probability) => total + probability, 0);
|
|
12587
12668
|
if (Math.abs(sum - 1) > tolerance + keys.length * roundingError) invalidAnswer(answers, `Question "${id}" probabilities must sum to 1 within the declared rounding precision.`);
|
|
12588
12669
|
}
|
|
12589
|
-
function
|
|
12670
|
+
function validateDecisionAnswers({ questions, answers, rounding }) {
|
|
12590
12671
|
function roundingError(decimals) {
|
|
12591
12672
|
if (decimals === void 0) return 0;
|
|
12592
|
-
if (!Number.isInteger(decimals) || decimals < 0 || decimals > 15) invalidAnswer(answers, "
|
|
12673
|
+
if (!Number.isInteger(decimals) || decimals < 0 || decimals > 15) invalidAnswer(answers, "Decision rounding decimals must be integers between 0 and 15.");
|
|
12593
12674
|
return .5 * 10 ** -decimals;
|
|
12594
12675
|
}
|
|
12595
12676
|
const probabilityError = roundingError(rounding?.probabilityDecimals);
|
|
12596
12677
|
const scoreError = roundingError(rounding?.scoreDecimals);
|
|
12597
|
-
if (!isRecord(answers) || !hasExactKeys(answers, Object.keys(questions))) invalidAnswer(answers, "
|
|
12678
|
+
if (!isRecord(answers) || !hasExactKeys(answers, Object.keys(questions))) invalidAnswer(answers, "Decision must return exactly one answer for every question.");
|
|
12598
12679
|
for (const [id, question] of Object.entries(questions)) {
|
|
12599
12680
|
const answer = answers[id];
|
|
12600
12681
|
if (!isRecord(answer) || answer.type !== question.type) invalidAnswer(answers, `Question "${id}" returned an answer with the wrong type.`);
|
|
@@ -12622,19 +12703,19 @@ function validateEvaluationAnswers({ questions, answers, rounding }) {
|
|
|
12622
12703
|
}
|
|
12623
12704
|
}
|
|
12624
12705
|
//#endregion
|
|
12625
|
-
//#region src/
|
|
12706
|
+
//#region src/decide/decide.ts
|
|
12626
12707
|
const originalGenerateCallId$4 = createIdGenerator$1({
|
|
12627
12708
|
prefix: "call",
|
|
12628
12709
|
size: 24
|
|
12629
12710
|
});
|
|
12630
|
-
/**
|
|
12631
|
-
async function
|
|
12632
|
-
const model =
|
|
12633
|
-
|
|
12711
|
+
/** Decide answers to typed questions against one shared state. Experimental. */
|
|
12712
|
+
async function decide({ model: modelArg, state, questions, maxRetries, abortSignal, headers, providerOptions = {}, telemetry, runtimeContext = {}, onStart, onEnd, _internal: { generateCallId = originalGenerateCallId$4 } = {} }) {
|
|
12713
|
+
const model = resolveDecisionModel(modelArg);
|
|
12714
|
+
validateDecisionInput({
|
|
12634
12715
|
state,
|
|
12635
12716
|
questions
|
|
12636
12717
|
});
|
|
12637
|
-
for (const [questionId, question] of Object.entries(questions)) if (!model.supportedQuestionTypes.includes(question.type)) throw new
|
|
12718
|
+
for (const [questionId, question] of Object.entries(questions)) if (!model.supportedQuestionTypes.includes(question.type)) throw new Experimental_DecisionUnsupportedQuestionTypeError$1({
|
|
12638
12719
|
questionId,
|
|
12639
12720
|
questionType: question.type,
|
|
12640
12721
|
provider: model.provider,
|
|
@@ -12649,7 +12730,7 @@ async function evaluate({ model: modelArg, state, questions, maxRetries, abortSi
|
|
|
12649
12730
|
const runInTracingChannelSpan = telemetryDispatcher.runInTracingChannelSpan ?? (async ({ execute }) => await execute());
|
|
12650
12731
|
const startEvent = {
|
|
12651
12732
|
callId,
|
|
12652
|
-
operationId: "ai.
|
|
12733
|
+
operationId: "ai.decide",
|
|
12653
12734
|
runtimeContext,
|
|
12654
12735
|
provider: model.provider,
|
|
12655
12736
|
modelId: model.modelId,
|
|
@@ -12660,7 +12741,7 @@ async function evaluate({ model: modelArg, state, questions, maxRetries, abortSi
|
|
|
12660
12741
|
providerOptions
|
|
12661
12742
|
};
|
|
12662
12743
|
return await runInTracingChannelSpan({
|
|
12663
|
-
type: "
|
|
12744
|
+
type: "experimental_decide",
|
|
12664
12745
|
event: startEvent,
|
|
12665
12746
|
execute: async () => {
|
|
12666
12747
|
await notify({
|
|
@@ -12670,7 +12751,7 @@ async function evaluate({ model: modelArg, state, questions, maxRetries, abortSi
|
|
|
12670
12751
|
try {
|
|
12671
12752
|
const modelCallEvent = {
|
|
12672
12753
|
callId,
|
|
12673
|
-
operationId: "ai.
|
|
12754
|
+
operationId: "ai.decide.doDecide",
|
|
12674
12755
|
provider: model.provider,
|
|
12675
12756
|
modelId: model.modelId,
|
|
12676
12757
|
state,
|
|
@@ -12678,11 +12759,11 @@ async function evaluate({ model: modelArg, state, questions, maxRetries, abortSi
|
|
|
12678
12759
|
};
|
|
12679
12760
|
await notify({
|
|
12680
12761
|
event: modelCallEvent,
|
|
12681
|
-
callbacks: [telemetryDispatcher.
|
|
12762
|
+
callbacks: [telemetryDispatcher.experimental_onDecisionModelCallStart]
|
|
12682
12763
|
});
|
|
12683
12764
|
const result = await retry(async () => {
|
|
12684
12765
|
abortSignal?.throwIfAborted();
|
|
12685
|
-
return await model.
|
|
12766
|
+
return await model.doDecide({
|
|
12686
12767
|
state,
|
|
12687
12768
|
questions,
|
|
12688
12769
|
abortSignal,
|
|
@@ -12691,7 +12772,7 @@ async function evaluate({ model: modelArg, state, questions, maxRetries, abortSi
|
|
|
12691
12772
|
});
|
|
12692
12773
|
});
|
|
12693
12774
|
abortSignal?.throwIfAborted();
|
|
12694
|
-
|
|
12775
|
+
validateDecisionAnswers({
|
|
12695
12776
|
questions,
|
|
12696
12777
|
answers: result.answers,
|
|
12697
12778
|
rounding: result.rounding
|
|
@@ -12701,7 +12782,7 @@ async function evaluate({ model: modelArg, state, questions, maxRetries, abortSi
|
|
|
12701
12782
|
...modelCallEvent,
|
|
12702
12783
|
...result
|
|
12703
12784
|
},
|
|
12704
|
-
callbacks: [telemetryDispatcher.
|
|
12785
|
+
callbacks: [telemetryDispatcher.experimental_onDecisionModelCallEnd]
|
|
12705
12786
|
});
|
|
12706
12787
|
logWarnings({
|
|
12707
12788
|
warnings: result.warnings,
|
|
@@ -12710,7 +12791,7 @@ async function evaluate({ model: modelArg, state, questions, maxRetries, abortSi
|
|
|
12710
12791
|
});
|
|
12711
12792
|
const inputTokens = result.usage?.inputTokens;
|
|
12712
12793
|
const outputTokens = result.usage?.outputTokens;
|
|
12713
|
-
const
|
|
12794
|
+
const decisionResult = {
|
|
12714
12795
|
answers: result.answers,
|
|
12715
12796
|
usage: {
|
|
12716
12797
|
inputTokens,
|
|
@@ -12729,11 +12810,11 @@ async function evaluate({ model: modelArg, state, questions, maxRetries, abortSi
|
|
|
12729
12810
|
await notify({
|
|
12730
12811
|
event: {
|
|
12731
12812
|
...startEvent,
|
|
12732
|
-
...
|
|
12813
|
+
...decisionResult
|
|
12733
12814
|
},
|
|
12734
12815
|
callbacks: [onEnd, telemetryDispatcher.onEnd]
|
|
12735
12816
|
});
|
|
12736
|
-
return
|
|
12817
|
+
return decisionResult;
|
|
12737
12818
|
} catch (error) {
|
|
12738
12819
|
await telemetryDispatcher.onError?.({
|
|
12739
12820
|
callId,
|
|
@@ -12745,6 +12826,10 @@ async function evaluate({ model: modelArg, state, questions, maxRetries, abortSi
|
|
|
12745
12826
|
});
|
|
12746
12827
|
}
|
|
12747
12828
|
//#endregion
|
|
12829
|
+
//#region src/decide/index.ts
|
|
12830
|
+
/** @deprecated Use `experimental_decide` instead. */
|
|
12831
|
+
const experimental_evaluate = decide;
|
|
12832
|
+
//#endregion
|
|
12748
12833
|
//#region src/generate-text/extract-reasoning-content.ts
|
|
12749
12834
|
function extractReasoningContent(content) {
|
|
12750
12835
|
const parts = content.filter((content) => content.type === "reasoning");
|
|
@@ -14077,7 +14162,10 @@ var DefaultGeneratedAudioFile = class extends DefaultGeneratedFile {
|
|
|
14077
14162
|
if (mediaType !== "audio/mpeg") format = mediaTypeParts[1];
|
|
14078
14163
|
}
|
|
14079
14164
|
}
|
|
14080
|
-
if (!format) throw new
|
|
14165
|
+
if (!format) throw new InvalidResponseDataError$1({
|
|
14166
|
+
data: mediaType,
|
|
14167
|
+
message: `Could not determine audio format from media type: ${mediaType}`
|
|
14168
|
+
});
|
|
14081
14169
|
this.format = format;
|
|
14082
14170
|
}
|
|
14083
14171
|
};
|
|
@@ -15171,16 +15259,24 @@ function getPotentialStartIndex(text, searchedText) {
|
|
|
15171
15259
|
//#endregion
|
|
15172
15260
|
//#region src/middleware/extract-reasoning-middleware.ts
|
|
15173
15261
|
/**
|
|
15174
|
-
* Extracts
|
|
15262
|
+
* Extracts a delimited reasoning section from the generated text and exposes it
|
|
15175
15263
|
* as a `reasoning` property on the result.
|
|
15176
15264
|
*
|
|
15177
|
-
* @param tagName -
|
|
15265
|
+
* @param tagName - An XML tag name (without angle brackets), or literal opening
|
|
15266
|
+
* and closing delimiters for formats such as Gemma's thought channel.
|
|
15178
15267
|
* @param separator - The separator to use between reasoning and text sections.
|
|
15179
15268
|
* @param startWithReasoning - Whether to start with reasoning tokens.
|
|
15180
15269
|
*/
|
|
15181
15270
|
function extractReasoningMiddleware({ tagName, separator = "\n", startWithReasoning = false }) {
|
|
15182
|
-
const openingTag = `<${tagName}
|
|
15183
|
-
const closingTag = `</${tagName}
|
|
15271
|
+
const openingTag = typeof tagName === "string" ? `<${tagName}>` : tagName.opening;
|
|
15272
|
+
const closingTag = typeof tagName === "string" ? `</${tagName}>` : tagName.closing;
|
|
15273
|
+
if (openingTag.length === 0 || closingTag.length === 0) throw new InvalidArgumentError({
|
|
15274
|
+
parameter: "tagName",
|
|
15275
|
+
value: tagName,
|
|
15276
|
+
message: "Reasoning delimiters must not be empty."
|
|
15277
|
+
});
|
|
15278
|
+
const escapedOpeningTag = openingTag.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
15279
|
+
const escapedClosingTag = closingTag.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
15184
15280
|
return {
|
|
15185
15281
|
specificationVersion: "v4",
|
|
15186
15282
|
wrapGenerate: async ({ doGenerate }) => {
|
|
@@ -15192,7 +15288,7 @@ function extractReasoningMiddleware({ tagName, separator = "\n", startWithReason
|
|
|
15192
15288
|
continue;
|
|
15193
15289
|
}
|
|
15194
15290
|
const text = startWithReasoning ? openingTag + part.text : part.text;
|
|
15195
|
-
const regexp = new RegExp(`${
|
|
15291
|
+
const regexp = new RegExp(`${escapedOpeningTag}(.*?)${escapedClosingTag}`, "gs");
|
|
15196
15292
|
const matches = Array.from(text.matchAll(regexp));
|
|
15197
15293
|
if (!matches.length) {
|
|
15198
15294
|
transformedContent.push(part);
|
|
@@ -17975,7 +18071,7 @@ var AbstractRealtimeSession = class {
|
|
|
17975
18071
|
* @param {Record<string, SpeechModel>} [options.speechModels] - A record of speech models, where keys are model IDs and values are speech model instances.
|
|
17976
18072
|
* @param {Record<string, RerankingModel>} [options.rerankingModels] - A record of reranking models, where keys are model IDs and values are reranking model instances.
|
|
17977
18073
|
* @param {Record<string, VideoModel>} [options.videoModels] - A record of video models, where keys are model IDs and values are video model instances.
|
|
17978
|
-
* @param {Record<string,
|
|
18074
|
+
* @param {Record<string, DecisionModel>} [options.decisionModels] - Experimental decision models or default-provider model IDs, keyed by alias.
|
|
17979
18075
|
* @param {FilesV4} [options.files] - A files interface for uploading files.
|
|
17980
18076
|
* @param {SkillsV4} [options.skills] - A skills interface for uploading skills.
|
|
17981
18077
|
* @param {ProviderV2 | ProviderV3 | ProviderV4} [options.fallbackProvider] - An optional fallback provider to use when a requested model is not found in the custom provider.
|
|
@@ -17983,7 +18079,8 @@ var AbstractRealtimeSession = class {
|
|
|
17983
18079
|
*
|
|
17984
18080
|
* @throws {NoSuchModelError} Throws when a requested model is not found and no fallback provider is available.
|
|
17985
18081
|
*/
|
|
17986
|
-
function customProvider({ languageModels, embeddingModels, imageModels, transcriptionModels, speechModels, rerankingModels, videoModels, evaluationModels, files, skills, fallbackProvider: fallbackProviderArg }) {
|
|
18082
|
+
function customProvider({ languageModels, embeddingModels, imageModels, transcriptionModels, speechModels, rerankingModels, videoModels, decisionModels: decisionModelsArg, evaluationModels, files, skills, fallbackProvider: fallbackProviderArg }) {
|
|
18083
|
+
const decisionModels = decisionModelsArg ?? evaluationModels;
|
|
17987
18084
|
const fallbackProvider = fallbackProviderArg == null ? void 0 : asProviderV4(fallbackProviderArg);
|
|
17988
18085
|
const baseProvider = {
|
|
17989
18086
|
specificationVersion: "v4",
|
|
@@ -18041,18 +18138,22 @@ function customProvider({ languageModels, embeddingModels, imageModels, transcri
|
|
|
18041
18138
|
modelType: "rerankingModel"
|
|
18042
18139
|
});
|
|
18043
18140
|
},
|
|
18044
|
-
|
|
18045
|
-
if (
|
|
18141
|
+
decisionModel(modelId) {
|
|
18142
|
+
if (decisionModels != null && Object.hasOwn(decisionModels, modelId)) return resolveDecisionModel(decisionModels[modelId]);
|
|
18046
18143
|
const provider = fallbackProviderArg;
|
|
18047
|
-
|
|
18048
|
-
|
|
18049
|
-
|
|
18144
|
+
const factory = provider?.decisionModel ?? provider?.evaluationModel;
|
|
18145
|
+
if (typeof factory === "function") {
|
|
18146
|
+
const model = factory.call(provider, modelId);
|
|
18147
|
+
if (model != null) return resolveDecisionModel(model);
|
|
18050
18148
|
}
|
|
18051
18149
|
throw new NoSuchModelError$1({
|
|
18052
18150
|
modelId,
|
|
18053
|
-
modelType: "
|
|
18151
|
+
modelType: "decisionModel"
|
|
18054
18152
|
});
|
|
18055
18153
|
},
|
|
18154
|
+
evaluationModel(modelId) {
|
|
18155
|
+
return asEvaluationModel(this.decisionModel(modelId));
|
|
18156
|
+
},
|
|
18056
18157
|
videoModel(modelId) {
|
|
18057
18158
|
if (videoModels != null && modelId in videoModels) return resolveVideoModel(videoModels[modelId]);
|
|
18058
18159
|
const provider = fallbackProviderArg;
|
|
@@ -18135,12 +18236,13 @@ var DefaultProviderRegistry = class {
|
|
|
18135
18236
|
registerProvider({ id, provider }) {
|
|
18136
18237
|
const providerV4 = asProviderV4(provider);
|
|
18137
18238
|
const videoModel = provider.videoModel?.bind(provider);
|
|
18138
|
-
const
|
|
18239
|
+
const decisionProvider = provider;
|
|
18240
|
+
const decisionModel = (decisionProvider.decisionModel ?? decisionProvider.evaluationModel)?.bind(provider);
|
|
18139
18241
|
const registeredProvider = videoModel == null ? providerV4 : Object.assign(Object.create(Object.getPrototypeOf(providerV4)), {
|
|
18140
18242
|
...providerV4,
|
|
18141
18243
|
videoModel: (modelId) => asVideoModelV4(videoModel(modelId))
|
|
18142
18244
|
});
|
|
18143
|
-
if (registeredProvider !== provider &&
|
|
18245
|
+
if (registeredProvider !== provider && decisionModel != null) Object.assign(registeredProvider, { decisionModel });
|
|
18144
18246
|
this.providers[id] = registeredProvider;
|
|
18145
18247
|
}
|
|
18146
18248
|
getProvider(id, modelType) {
|
|
@@ -18233,14 +18335,19 @@ var DefaultProviderRegistry = class {
|
|
|
18233
18335
|
});
|
|
18234
18336
|
return asVideoModelV4(model);
|
|
18235
18337
|
}
|
|
18236
|
-
|
|
18237
|
-
const [providerId, modelId] = this.splitId(id, "
|
|
18238
|
-
const
|
|
18338
|
+
decisionModel(id) {
|
|
18339
|
+
const [providerId, modelId] = this.splitId(id, "decisionModel");
|
|
18340
|
+
const provider = this.getProvider(providerId, "decisionModel");
|
|
18341
|
+
const model = (provider.decisionModel ?? provider.evaluationModel)?.call(provider, modelId);
|
|
18239
18342
|
if (model == null) throw new NoSuchModelError$1({
|
|
18240
18343
|
modelId: id,
|
|
18241
|
-
modelType: "
|
|
18344
|
+
modelType: "decisionModel"
|
|
18242
18345
|
});
|
|
18243
|
-
return
|
|
18346
|
+
return resolveDecisionModel(model);
|
|
18347
|
+
}
|
|
18348
|
+
/** @deprecated Use `decisionModel` instead. */
|
|
18349
|
+
evaluationModel(id) {
|
|
18350
|
+
return asEvaluationModel(this.decisionModel(id));
|
|
18244
18351
|
}
|
|
18245
18352
|
files(id) {
|
|
18246
18353
|
const files = this.getProvider(id, "languageModel").files?.();
|
|
@@ -18626,7 +18733,7 @@ async function transcribe({ model, audio, providerOptions = {}, maxRetries: maxR
|
|
|
18626
18733
|
provider: resolvedModel.provider,
|
|
18627
18734
|
model: resolvedModel.modelId
|
|
18628
18735
|
});
|
|
18629
|
-
if (
|
|
18736
|
+
if (result.text == null) throw new NoTranscriptGeneratedError({ responses: [result.response] });
|
|
18630
18737
|
await notify({
|
|
18631
18738
|
event: {
|
|
18632
18739
|
callId,
|
|
@@ -19683,7 +19790,7 @@ var AbstractChat = class {
|
|
|
19683
19790
|
const lastMessage = this.lastMessage;
|
|
19684
19791
|
const responseMessageIndex = trigger === "submit-message" && messageId != null ? this.state.messages.findIndex((message) => message.id === messageId) : this.state.messages.length - 1;
|
|
19685
19792
|
const responseMessage = responseMessageIndex === -1 ? lastMessage : this.state.messages[responseMessageIndex];
|
|
19686
|
-
const resumableResponseMessage = trigger === "resume-stream" && responseMessage?.role === "assistant" && responseMessage.parts.some((part) => isToolUIPart(part) && part.state === "input-streaming") ? this.state.snapshot(responseMessage) : void 0;
|
|
19793
|
+
const resumableResponseMessage = trigger === "resume-stream" && responseMessage?.role === "assistant" && responseMessage.parts.some((part) => isToolUIPart(part) && (part.state === "input-streaming" || part.state === "approval-responded")) ? this.state.snapshot(responseMessage) : void 0;
|
|
19687
19794
|
const usesEarlierAssistantMessage = responseMessageIndex !== -1 && responseMessageIndex < this.state.messages.length - 1 && responseMessage?.role === "assistant";
|
|
19688
19795
|
let isAbort = false;
|
|
19689
19796
|
let isDisconnect = false;
|
|
@@ -19730,6 +19837,7 @@ var AbstractChat = class {
|
|
|
19730
19837
|
await consumeStream({
|
|
19731
19838
|
stream: processUIMessageStream({
|
|
19732
19839
|
stream,
|
|
19840
|
+
resetStateOnMessageIdChange: trigger === "resume-stream",
|
|
19733
19841
|
onToolCall: this.onToolCall,
|
|
19734
19842
|
onData: this.onData,
|
|
19735
19843
|
messageMetadataSchema: this.messageMetadataSchema,
|
|
@@ -20030,6 +20138,6 @@ async function uploadSkill({ api, files, displayTitle, providerOptions }) {
|
|
|
20030
20138
|
});
|
|
20031
20139
|
}
|
|
20032
20140
|
//#endregion
|
|
20033
|
-
export { AISDKError, AI_SDK_TELEMETRY_TRACING_CHANNEL, APICallError, AbstractChat, DefaultChatTransport, DefaultGeneratedFile, DirectChatTransport, DownloadError, EmptyResponseBodyError, AbstractRealtimeSession as Experimental_AbstractRealtimeSession, ToolLoopAgent as Experimental_Agent, ToolLoopAgent, 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, 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, decodeRealtimeAudio as experimental_decodeRealtimeAudio, encodeRealtimeAudio as experimental_encodeRealtimeAudio,
|
|
20141
|
+
export { AISDKError, AI_SDK_TELEMETRY_TRACING_CHANNEL, APICallError, AbstractChat, DefaultChatTransport, DefaultGeneratedFile, DirectChatTransport, DownloadError, EmptyResponseBodyError, AbstractRealtimeSession as Experimental_AbstractRealtimeSession, ToolLoopAgent as Experimental_Agent, ToolLoopAgent, 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, 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, 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, simulateReadableStream, simulateStreamingMiddleware, smoothStream, streamObject, streamText, systemModelMessageSchema, toTextStream, toUIMessageChunk, toUIMessageStream, tool, toolModelMessageSchema, toolSearch, transcribe, uiMessageChunkSchema, uploadFile, uploadSkill, userModelMessageSchema, validateUIMessages, wrapEmbeddingModel, wrapImageModel, wrapLanguageModel, wrapProvider, zodSchema };
|
|
20034
20142
|
|
|
20035
20143
|
//# sourceMappingURL=index.js.map
|