@ai-sdk/provider-utils 5.0.45 → 5.0.47
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 +18 -0
- package/dist/experimental-evaluation/index.js +1 -1
- package/dist/experimental-evaluation/index.js.map +1 -1
- package/dist/index.d.ts +22 -1
- package/dist/index.js +9 -9
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/combine-headers.ts +1 -1
- package/src/delay.ts +1 -1
- package/src/detect-media-type.ts +0 -2
- package/src/embedding-model-capabilities.ts +23 -0
- package/src/handle-fetch-error.ts +0 -2
- package/src/index.ts +5 -1
- package/src/normalize-batch-request-counts.ts +0 -2
- 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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-sdk/provider-utils",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.47",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
}
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@ai-sdk/provider": "4.0.
|
|
40
|
+
"@ai-sdk/provider": "4.0.18",
|
|
41
41
|
"@standard-schema/spec": "^1.1.0",
|
|
42
42
|
"@workflow/serde": "4.1.0",
|
|
43
43
|
"eventsource-parser": "^3.0.8",
|
package/src/combine-headers.ts
CHANGED
package/src/delay.ts
CHANGED
package/src/detect-media-type.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { SharedV4ProviderOptions } from '@ai-sdk/provider';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Symbol for exposing the UTF-8 input byte budget of an embedding model.
|
|
3
5
|
*
|
|
@@ -7,3 +9,24 @@
|
|
|
7
9
|
export const EMBEDDING_MODEL_MAX_INPUT_BYTES_PER_CALL = Symbol.for(
|
|
8
10
|
'vercel.ai.embeddingModel.maxInputBytesPerCall',
|
|
9
11
|
);
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Symbol for transforming provider options for an automatically batched
|
|
15
|
+
* embedding model call.
|
|
16
|
+
*
|
|
17
|
+
* This capability is experimental and intentionally lives outside the versioned
|
|
18
|
+
* embedding model specification.
|
|
19
|
+
*/
|
|
20
|
+
export const EMBEDDING_MODEL_PROVIDER_OPTIONS_TRANSFORMER = Symbol.for(
|
|
21
|
+
'vercel.ai.embeddingModel.providerOptionsTransformer',
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
export type EmbeddingModelProviderOptionsTransformer = (options: {
|
|
25
|
+
providerOptions: SharedV4ProviderOptions | undefined;
|
|
26
|
+
values: Array<string>;
|
|
27
|
+
startIndex: number;
|
|
28
|
+
endIndex: number;
|
|
29
|
+
}) =>
|
|
30
|
+
| SharedV4ProviderOptions
|
|
31
|
+
| undefined
|
|
32
|
+
| PromiseLike<SharedV4ProviderOptions | undefined>;
|
package/src/index.ts
CHANGED
|
@@ -30,7 +30,11 @@ export {
|
|
|
30
30
|
} from './detect-media-type';
|
|
31
31
|
export { downloadBlob } from './download-blob';
|
|
32
32
|
export { DownloadError } from './download-error';
|
|
33
|
-
export {
|
|
33
|
+
export {
|
|
34
|
+
EMBEDDING_MODEL_MAX_INPUT_BYTES_PER_CALL as EXPERIMENTAL_EMBEDDING_MODEL_MAX_INPUT_BYTES_PER_CALL,
|
|
35
|
+
EMBEDDING_MODEL_PROVIDER_OPTIONS_TRANSFORMER as EXPERIMENTAL_EMBEDDING_MODEL_PROVIDER_OPTIONS_TRANSFORMER,
|
|
36
|
+
type EmbeddingModelProviderOptionsTransformer,
|
|
37
|
+
} from './embedding-model-capabilities';
|
|
34
38
|
export {
|
|
35
39
|
fetchWithValidatedEndpoint,
|
|
36
40
|
fetchWithValidatedRedirects,
|
package/src/resolve.ts
CHANGED
|
@@ -20,7 +20,7 @@ export const zodPatterns = {
|
|
|
20
20
|
* `a-z` was added to replicate /i flag
|
|
21
21
|
*/
|
|
22
22
|
email:
|
|
23
|
-
/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'
|
|
23
|
+
/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9-]*\.)+[a-zA-Z]{2,}$/,
|
|
24
24
|
/**
|
|
25
25
|
* Constructed a valid Unicode RegExp
|
|
26
26
|
*
|
|
@@ -31,4 +31,12 @@ export type ToolApprovalRequest = {
|
|
|
31
31
|
* Present only when `experimental_toolApprovalSecret` is configured.
|
|
32
32
|
*/
|
|
33
33
|
signature?: string;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Tool input before input schema validation and transformation.
|
|
37
|
+
*
|
|
38
|
+
* This is included when it differs from the validated tool input so that
|
|
39
|
+
* approved tool calls can be safely revalidated before execution.
|
|
40
|
+
*/
|
|
41
|
+
inputSchemaInput?: unknown;
|
|
34
42
|
};
|