@ai-sdk/provider-utils 4.0.38 → 4.0.40
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 +12 -0
- package/dist/index.d.mts +7 -3
- package/dist/index.d.ts +7 -3
- package/dist/index.js +16 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/schema.ts +23 -4
- package/src/types/tool.ts +2 -2
package/dist/index.mjs
CHANGED
|
@@ -677,7 +677,7 @@ function withUserAgentSuffix(headers, ...userAgentSuffixParts) {
|
|
|
677
677
|
}
|
|
678
678
|
|
|
679
679
|
// src/version.ts
|
|
680
|
-
var VERSION = true ? "4.0.
|
|
680
|
+
var VERSION = true ? "4.0.40" : "0.0.0-test";
|
|
681
681
|
|
|
682
682
|
// src/get-from-api.ts
|
|
683
683
|
var getOriginalFetch = () => globalThis.fetch;
|
|
@@ -2236,11 +2236,18 @@ function asSchema(schema) {
|
|
|
2236
2236
|
}
|
|
2237
2237
|
function standardSchema(standardSchema2) {
|
|
2238
2238
|
return jsonSchema(
|
|
2239
|
-
() =>
|
|
2240
|
-
standardSchema2
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2239
|
+
() => {
|
|
2240
|
+
if (!hasStandardJsonSchema(standardSchema2)) {
|
|
2241
|
+
throw new Error(
|
|
2242
|
+
`Standard schema vendor '${standardSchema2["~standard"].vendor}' does not support JSON Schema conversion.`
|
|
2243
|
+
);
|
|
2244
|
+
}
|
|
2245
|
+
return addAdditionalPropertiesToJsonSchema(
|
|
2246
|
+
standardSchema2["~standard"].jsonSchema.input({
|
|
2247
|
+
target: "draft-07"
|
|
2248
|
+
})
|
|
2249
|
+
);
|
|
2250
|
+
},
|
|
2244
2251
|
{
|
|
2245
2252
|
validate: async (value) => {
|
|
2246
2253
|
const result = await standardSchema2["~standard"].validate(value);
|
|
@@ -2255,6 +2262,9 @@ function standardSchema(standardSchema2) {
|
|
|
2255
2262
|
}
|
|
2256
2263
|
);
|
|
2257
2264
|
}
|
|
2265
|
+
function hasStandardJsonSchema(schema) {
|
|
2266
|
+
return schema["~standard"].jsonSchema != null;
|
|
2267
|
+
}
|
|
2258
2268
|
function zod3Schema(zodSchema2, options) {
|
|
2259
2269
|
var _a2;
|
|
2260
2270
|
const useReferences = (_a2 = options == null ? void 0 : options.useReferences) != null ? _a2 : false;
|