ai 3.3.4 → 3.3.6
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/dist/index.d.mts +84 -60
- package/dist/index.d.ts +84 -60
- package/dist/index.js +241 -215
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +192 -155
- package/dist/index.mjs.map +1 -1
- package/package.json +8 -8
- package/rsc/dist/rsc-server.mjs +5 -37
- package/rsc/dist/rsc-server.mjs.map +1 -1
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "ai",
|
3
|
-
"version": "3.3.
|
3
|
+
"version": "3.3.6",
|
4
4
|
"description": "Vercel AI SDK - The AI Toolkit for TypeScript and JavaScript",
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"sideEffects": false,
|
@@ -58,13 +58,13 @@
|
|
58
58
|
}
|
59
59
|
},
|
60
60
|
"dependencies": {
|
61
|
-
"@ai-sdk/provider": "0.0.
|
62
|
-
"@ai-sdk/provider-utils": "1.0.
|
63
|
-
"@ai-sdk/react": "0.0.
|
64
|
-
"@ai-sdk/solid": "0.0.
|
65
|
-
"@ai-sdk/svelte": "0.0.
|
66
|
-
"@ai-sdk/ui-utils": "0.0.
|
67
|
-
"@ai-sdk/vue": "0.0.
|
61
|
+
"@ai-sdk/provider": "0.0.18",
|
62
|
+
"@ai-sdk/provider-utils": "1.0.10",
|
63
|
+
"@ai-sdk/react": "0.0.42",
|
64
|
+
"@ai-sdk/solid": "0.0.33",
|
65
|
+
"@ai-sdk/svelte": "0.0.35",
|
66
|
+
"@ai-sdk/ui-utils": "0.0.30",
|
67
|
+
"@ai-sdk/vue": "0.0.34",
|
68
68
|
"@opentelemetry/api": "1.9.0",
|
69
69
|
"eventsource-parser": "1.1.2",
|
70
70
|
"jsondiffpatch": "0.6.0",
|
package/rsc/dist/rsc-server.mjs
CHANGED
@@ -417,7 +417,7 @@ function createStreamableValueImpl(initialValue) {
|
|
417
417
|
}
|
418
418
|
|
419
419
|
// rsc/render.ts
|
420
|
-
import
|
420
|
+
import zodToJsonSchema from "zod-to-json-schema";
|
421
421
|
|
422
422
|
// util/retry-with-exponential-backoff.ts
|
423
423
|
import { APICallError } from "@ai-sdk/provider";
|
@@ -1090,40 +1090,8 @@ function calculateCompletionTokenUsage(usage) {
|
|
1090
1090
|
};
|
1091
1091
|
}
|
1092
1092
|
|
1093
|
-
// core/
|
1094
|
-
import {
|
1095
|
-
import zodToJsonSchema from "zod-to-json-schema";
|
1096
|
-
var schemaSymbol = Symbol.for("vercel.ai.schema");
|
1097
|
-
function jsonSchema(jsonSchema2, {
|
1098
|
-
validate
|
1099
|
-
} = {}) {
|
1100
|
-
return {
|
1101
|
-
[schemaSymbol]: true,
|
1102
|
-
_type: void 0,
|
1103
|
-
// should never be used directly
|
1104
|
-
[validatorSymbol]: true,
|
1105
|
-
jsonSchema: jsonSchema2,
|
1106
|
-
validate
|
1107
|
-
};
|
1108
|
-
}
|
1109
|
-
function isSchema(value) {
|
1110
|
-
return typeof value === "object" && value !== null && schemaSymbol in value && value[schemaSymbol] === true && "jsonSchema" in value && "validate" in value;
|
1111
|
-
}
|
1112
|
-
function asSchema(schema) {
|
1113
|
-
return isSchema(schema) ? schema : zodSchema(schema);
|
1114
|
-
}
|
1115
|
-
function zodSchema(zodSchema2) {
|
1116
|
-
return jsonSchema(
|
1117
|
-
// we assume that zodToJsonSchema will return a valid JSONSchema7:
|
1118
|
-
zodToJsonSchema(zodSchema2),
|
1119
|
-
{
|
1120
|
-
validate: (value) => {
|
1121
|
-
const result = zodSchema2.safeParse(value);
|
1122
|
-
return result.success ? { success: true, value: result.data } : { success: false, error: result.error };
|
1123
|
-
}
|
1124
|
-
}
|
1125
|
-
);
|
1126
|
-
}
|
1093
|
+
// core/prompt/prepare-tools-and-tool-choice.ts
|
1094
|
+
import { asSchema } from "@ai-sdk/ui-utils";
|
1127
1095
|
|
1128
1096
|
// core/util/is-non-empty-object.ts
|
1129
1097
|
function isNonEmptyObject(object) {
|
@@ -1717,7 +1685,7 @@ function render(options) {
|
|
1717
1685
|
return {
|
1718
1686
|
name: name8,
|
1719
1687
|
description,
|
1720
|
-
parameters:
|
1688
|
+
parameters: zodToJsonSchema(parameters)
|
1721
1689
|
};
|
1722
1690
|
}
|
1723
1691
|
) : void 0;
|
@@ -1728,7 +1696,7 @@ function render(options) {
|
|
1728
1696
|
function: {
|
1729
1697
|
name: name8,
|
1730
1698
|
description,
|
1731
|
-
parameters:
|
1699
|
+
parameters: zodToJsonSchema(parameters)
|
1732
1700
|
}
|
1733
1701
|
};
|
1734
1702
|
}
|