@ai-sdk/provider-utils 3.0.23 → 3.0.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +40 -38
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +40 -38
- package/dist/index.mjs.map +1 -1
- package/dist/test/index.js.map +1 -1
- package/dist/test/index.mjs.map +1 -1
- package/package.json +4 -3
package/dist/index.mjs
CHANGED
|
@@ -343,7 +343,7 @@ function withUserAgentSuffix(headers, ...userAgentSuffixParts) {
|
|
|
343
343
|
}
|
|
344
344
|
|
|
345
345
|
// src/version.ts
|
|
346
|
-
var VERSION = true ? "3.0.
|
|
346
|
+
var VERSION = true ? "3.0.25" : "0.0.0-test";
|
|
347
347
|
|
|
348
348
|
// src/get-from-api.ts
|
|
349
349
|
var getOriginalFetch = () => globalThis.fetch;
|
|
@@ -1149,6 +1149,35 @@ var createStatusCodeErrorResponseHandler = () => async ({ response, url, request
|
|
|
1149
1149
|
};
|
|
1150
1150
|
};
|
|
1151
1151
|
|
|
1152
|
+
// src/schema.ts
|
|
1153
|
+
var schemaSymbol = /* @__PURE__ */ Symbol.for("vercel.ai.schema");
|
|
1154
|
+
function lazySchema(createSchema) {
|
|
1155
|
+
let schema;
|
|
1156
|
+
return () => {
|
|
1157
|
+
if (schema == null) {
|
|
1158
|
+
schema = createSchema();
|
|
1159
|
+
}
|
|
1160
|
+
return schema;
|
|
1161
|
+
};
|
|
1162
|
+
}
|
|
1163
|
+
function jsonSchema(jsonSchema2, {
|
|
1164
|
+
validate
|
|
1165
|
+
} = {}) {
|
|
1166
|
+
return {
|
|
1167
|
+
[schemaSymbol]: true,
|
|
1168
|
+
_type: void 0,
|
|
1169
|
+
// should never be used directly
|
|
1170
|
+
[validatorSymbol]: true,
|
|
1171
|
+
get jsonSchema() {
|
|
1172
|
+
if (typeof jsonSchema2 === "function") {
|
|
1173
|
+
jsonSchema2 = jsonSchema2();
|
|
1174
|
+
}
|
|
1175
|
+
return jsonSchema2;
|
|
1176
|
+
},
|
|
1177
|
+
validate
|
|
1178
|
+
};
|
|
1179
|
+
}
|
|
1180
|
+
|
|
1152
1181
|
// src/zod-schema.ts
|
|
1153
1182
|
import * as z4 from "zod/v4";
|
|
1154
1183
|
|
|
@@ -1179,15 +1208,6 @@ function addAdditionalPropertiesToJsonSchema(jsonSchema2) {
|
|
|
1179
1208
|
return jsonSchema2;
|
|
1180
1209
|
}
|
|
1181
1210
|
|
|
1182
|
-
// src/zod-to-json-schema/get-relative-path.ts
|
|
1183
|
-
var getRelativePath = (pathA, pathB) => {
|
|
1184
|
-
let i = 0;
|
|
1185
|
-
for (; i < pathA.length && i < pathB.length; i++) {
|
|
1186
|
-
if (pathA[i] !== pathB[i]) break;
|
|
1187
|
-
}
|
|
1188
|
-
return [(pathA.length - i).toString(), ...pathB.slice(i)].join("/");
|
|
1189
|
-
};
|
|
1190
|
-
|
|
1191
1211
|
// src/zod-to-json-schema/options.ts
|
|
1192
1212
|
var ignoreOverride = /* @__PURE__ */ Symbol(
|
|
1193
1213
|
"Let zodToJsonSchema decide on which parser to use"
|
|
@@ -2221,6 +2241,15 @@ var selectParser = (def, typeName, refs) => {
|
|
|
2221
2241
|
}
|
|
2222
2242
|
};
|
|
2223
2243
|
|
|
2244
|
+
// src/zod-to-json-schema/get-relative-path.ts
|
|
2245
|
+
var getRelativePath = (pathA, pathB) => {
|
|
2246
|
+
let i = 0;
|
|
2247
|
+
for (; i < pathA.length && i < pathB.length; i++) {
|
|
2248
|
+
if (pathA[i] !== pathB[i]) break;
|
|
2249
|
+
}
|
|
2250
|
+
return [(pathA.length - i).toString(), ...pathB.slice(i)].join("/");
|
|
2251
|
+
};
|
|
2252
|
+
|
|
2224
2253
|
// src/zod-to-json-schema/parse-def.ts
|
|
2225
2254
|
function parseDef(def, refs, forceResolution = false) {
|
|
2226
2255
|
var _a2;
|
|
@@ -2410,34 +2439,7 @@ function zodSchema(zodSchema2, options) {
|
|
|
2410
2439
|
}
|
|
2411
2440
|
}
|
|
2412
2441
|
|
|
2413
|
-
// src/schema.ts
|
|
2414
|
-
var schemaSymbol = /* @__PURE__ */ Symbol.for("vercel.ai.schema");
|
|
2415
|
-
function lazySchema(createSchema) {
|
|
2416
|
-
let schema;
|
|
2417
|
-
return () => {
|
|
2418
|
-
if (schema == null) {
|
|
2419
|
-
schema = createSchema();
|
|
2420
|
-
}
|
|
2421
|
-
return schema;
|
|
2422
|
-
};
|
|
2423
|
-
}
|
|
2424
|
-
function jsonSchema(jsonSchema2, {
|
|
2425
|
-
validate
|
|
2426
|
-
} = {}) {
|
|
2427
|
-
return {
|
|
2428
|
-
[schemaSymbol]: true,
|
|
2429
|
-
_type: void 0,
|
|
2430
|
-
// should never be used directly
|
|
2431
|
-
[validatorSymbol]: true,
|
|
2432
|
-
get jsonSchema() {
|
|
2433
|
-
if (typeof jsonSchema2 === "function") {
|
|
2434
|
-
jsonSchema2 = jsonSchema2();
|
|
2435
|
-
}
|
|
2436
|
-
return jsonSchema2;
|
|
2437
|
-
},
|
|
2438
|
-
validate
|
|
2439
|
-
};
|
|
2440
|
-
}
|
|
2442
|
+
// src/as-schema.ts
|
|
2441
2443
|
function isSchema(value) {
|
|
2442
2444
|
return typeof value === "object" && value !== null && schemaSymbol in value && value[schemaSymbol] === true && "jsonSchema" in value && "validate" in value;
|
|
2443
2445
|
}
|