@ai-sdk/provider-utils 4.0.53 → 4.0.54
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 +11 -0
- package/dist/index.d.mts +31 -10
- package/dist/index.d.ts +31 -10
- package/dist/index.js +10 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/combine-headers.ts +1 -1
- package/src/delay.ts +1 -1
- package/src/embedding-model-capabilities.ts +23 -0
- package/src/index.ts +5 -1
- package/src/resolve.ts +1 -1
- package/src/to-json-schema/zod3-to-json-schema/parsers/string.ts +1 -1
- package/src/types/tool-approval-request.ts +8 -0
- package/src/validate-download-url.ts +0 -1
package/dist/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ function combineHeaders(...headers) {
|
|
|
3
3
|
return headers.reduce(
|
|
4
4
|
(combinedHeaders, currentHeaders) => ({
|
|
5
5
|
...combinedHeaders,
|
|
6
|
-
...currentHeaders
|
|
6
|
+
...currentHeaders
|
|
7
7
|
}),
|
|
8
8
|
{}
|
|
9
9
|
);
|
|
@@ -81,7 +81,7 @@ function createToolNameMapping({
|
|
|
81
81
|
// src/delay.ts
|
|
82
82
|
async function delay(delayInMs, options) {
|
|
83
83
|
if (delayInMs == null) {
|
|
84
|
-
return
|
|
84
|
+
return;
|
|
85
85
|
}
|
|
86
86
|
const signal = options == null ? void 0 : options.abortSignal;
|
|
87
87
|
return new Promise((resolve2, reject) => {
|
|
@@ -298,7 +298,6 @@ function validateDownloadUrl(url) {
|
|
|
298
298
|
message: `URL with IP address ${hostname} is not allowed`
|
|
299
299
|
});
|
|
300
300
|
}
|
|
301
|
-
return;
|
|
302
301
|
}
|
|
303
302
|
}
|
|
304
303
|
function validateDownloadAddress({
|
|
@@ -636,6 +635,9 @@ async function downloadBlob(url, options) {
|
|
|
636
635
|
var EMBEDDING_MODEL_MAX_INPUT_BYTES_PER_CALL = /* @__PURE__ */ Symbol.for(
|
|
637
636
|
"vercel.ai.embeddingModel.maxInputBytesPerCall"
|
|
638
637
|
);
|
|
638
|
+
var EMBEDDING_MODEL_PROVIDER_OPTIONS_TRANSFORMER = /* @__PURE__ */ Symbol.for(
|
|
639
|
+
"vercel.ai.embeddingModel.providerOptionsTransformer"
|
|
640
|
+
);
|
|
639
641
|
|
|
640
642
|
// src/generate-id.ts
|
|
641
643
|
import { InvalidArgumentError } from "@ai-sdk/provider";
|
|
@@ -820,7 +822,7 @@ function withUserAgentSuffix(headers, ...userAgentSuffixParts) {
|
|
|
820
822
|
}
|
|
821
823
|
|
|
822
824
|
// src/version.ts
|
|
823
|
-
var VERSION = true ? "4.0.
|
|
825
|
+
var VERSION = true ? "4.0.54" : "0.0.0-test";
|
|
824
826
|
|
|
825
827
|
// src/get-from-api.ts
|
|
826
828
|
var getOriginalFetch = () => globalThis.fetch;
|
|
@@ -1400,7 +1402,7 @@ var zodPatterns = {
|
|
|
1400
1402
|
/**
|
|
1401
1403
|
* `a-z` was added to replicate /i flag
|
|
1402
1404
|
*/
|
|
1403
|
-
email: /^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'
|
|
1405
|
+
email: /^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9-]*\.)+[a-zA-Z]{2,}$/,
|
|
1404
1406
|
/**
|
|
1405
1407
|
* Constructed a valid Unicode RegExp
|
|
1406
1408
|
*
|
|
@@ -2779,7 +2781,7 @@ async function resolve(value) {
|
|
|
2779
2781
|
if (typeof value === "function") {
|
|
2780
2782
|
value = value();
|
|
2781
2783
|
}
|
|
2782
|
-
return
|
|
2784
|
+
return value;
|
|
2783
2785
|
}
|
|
2784
2786
|
|
|
2785
2787
|
// src/retry-with-exponential-backoff.ts
|
|
@@ -3118,6 +3120,7 @@ export {
|
|
|
3118
3120
|
DelayedPromise,
|
|
3119
3121
|
DownloadError,
|
|
3120
3122
|
EMBEDDING_MODEL_MAX_INPUT_BYTES_PER_CALL as EXPERIMENTAL_EMBEDDING_MODEL_MAX_INPUT_BYTES_PER_CALL,
|
|
3123
|
+
EMBEDDING_MODEL_PROVIDER_OPTIONS_TRANSFORMER as EXPERIMENTAL_EMBEDDING_MODEL_PROVIDER_OPTIONS_TRANSFORMER,
|
|
3121
3124
|
EventSourceParserStream2 as EventSourceParserStream,
|
|
3122
3125
|
VERSION,
|
|
3123
3126
|
asSchema,
|