@ai-sdk/provider 2.0.0-canary.10 → 2.0.0-canary.12
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 +17 -0
- package/dist/index.d.mts +12 -13
- package/dist/index.d.ts +12 -13
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,22 @@
|
|
1
1
|
# @ai-sdk/provider
|
2
2
|
|
3
|
+
## 2.0.0-canary.12
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- 7b3ae3f: chore (provider): change getSupportedUrls to supportedUrls (language model v2)
|
8
|
+
|
9
|
+
## 2.0.0-canary.11
|
10
|
+
|
11
|
+
### Major Changes
|
12
|
+
|
13
|
+
- e030615: chore (provider): remove prompt type from language model v2 spec
|
14
|
+
|
15
|
+
### Patch Changes
|
16
|
+
|
17
|
+
- 9bf7291: chore(providers/openai): enable structuredOutputs by default & switch to provider option
|
18
|
+
- 4617fab: chore(embedding-models): remove remaining settings
|
19
|
+
|
3
20
|
## 2.0.0-canary.10
|
4
21
|
|
5
22
|
### Major Changes
|
package/dist/index.d.mts
CHANGED
@@ -3,6 +3,10 @@ export { JSONSchema7, JSONSchema7Definition } from 'json-schema';
|
|
3
3
|
|
4
4
|
type SharedV2Headers = Record<string, string>;
|
5
5
|
|
6
|
+
/**
|
7
|
+
A JSON value can be a string, number, boolean, object, array, or null.
|
8
|
+
JSON values can be serialized and deserialized by the JSON.stringify and JSON.parse methods.
|
9
|
+
*/
|
6
10
|
type JSONValue = null | string | number | boolean | JSONObject | JSONArray;
|
7
11
|
type JSONObject = {
|
8
12
|
[key: string]: JSONValue;
|
@@ -88,12 +92,14 @@ type EmbeddingModelV2<VALUE> = {
|
|
88
92
|
readonly modelId: string;
|
89
93
|
/**
|
90
94
|
Limit of how many embeddings can be generated in a single API call.
|
95
|
+
|
96
|
+
Use Infinity for models that do not have a limit.
|
91
97
|
*/
|
92
|
-
readonly maxEmbeddingsPerCall: number | undefined;
|
98
|
+
readonly maxEmbeddingsPerCall: PromiseLike<number | undefined> | number | undefined;
|
93
99
|
/**
|
94
100
|
True if the model can handle multiple embedding calls in parallel.
|
95
101
|
*/
|
96
|
-
readonly supportsParallelCalls: boolean;
|
102
|
+
readonly supportsParallelCalls: PromiseLike<boolean> | boolean;
|
97
103
|
/**
|
98
104
|
Generates a list of embeddings for the given input text.
|
99
105
|
|
@@ -409,7 +415,7 @@ type ImageModelV2CallOptions = {
|
|
409
415
|
}
|
410
416
|
```
|
411
417
|
*/
|
412
|
-
providerOptions:
|
418
|
+
providerOptions: SharedV2ProviderOptions;
|
413
419
|
/**
|
414
420
|
Abort signal for cancelling the operation.
|
415
421
|
*/
|
@@ -435,7 +441,7 @@ type ImageModelV2CallWarning = {
|
|
435
441
|
};
|
436
442
|
|
437
443
|
/**
|
438
|
-
Image generation model specification version
|
444
|
+
Image generation model specification version 2.
|
439
445
|
*/
|
440
446
|
type ImageModelV2 = {
|
441
447
|
/**
|
@@ -445,7 +451,7 @@ type ImageModelV2 = {
|
|
445
451
|
implementation versions can be handled as a discriminated union
|
446
452
|
on our side.
|
447
453
|
*/
|
448
|
-
readonly specificationVersion: '
|
454
|
+
readonly specificationVersion: 'v2';
|
449
455
|
/**
|
450
456
|
Name of the provider for logging purposes.
|
451
457
|
*/
|
@@ -732,13 +738,6 @@ type LanguageModelV2ToolChoice = {
|
|
732
738
|
|
733
739
|
type LanguageModelV2CallOptions = {
|
734
740
|
/**
|
735
|
-
Whether the user provided the input as messages or as
|
736
|
-
a prompt. This can help guide non-chat models in the
|
737
|
-
expansion, bc different expansions can be needed for
|
738
|
-
chat/non-chat use cases.
|
739
|
-
*/
|
740
|
-
inputFormat: 'messages' | 'prompt';
|
741
|
-
/**
|
742
741
|
A language mode prompt is a standardized prompt type.
|
743
742
|
|
744
743
|
Note: This is **not** the user-facing prompt. The AI SDK methods will map the
|
@@ -1045,7 +1044,7 @@ type LanguageModelV2 = {
|
|
1045
1044
|
*
|
1046
1045
|
* @returns A promise resolving to a map of supported URL patterns.
|
1047
1046
|
*/
|
1048
|
-
|
1047
|
+
supportedUrls: PromiseLike<Record<string, RegExp[]>> | Record<string, RegExp[]>;
|
1049
1048
|
/**
|
1050
1049
|
Generates a language model output (non-streaming).
|
1051
1050
|
|
package/dist/index.d.ts
CHANGED
@@ -3,6 +3,10 @@ export { JSONSchema7, JSONSchema7Definition } from 'json-schema';
|
|
3
3
|
|
4
4
|
type SharedV2Headers = Record<string, string>;
|
5
5
|
|
6
|
+
/**
|
7
|
+
A JSON value can be a string, number, boolean, object, array, or null.
|
8
|
+
JSON values can be serialized and deserialized by the JSON.stringify and JSON.parse methods.
|
9
|
+
*/
|
6
10
|
type JSONValue = null | string | number | boolean | JSONObject | JSONArray;
|
7
11
|
type JSONObject = {
|
8
12
|
[key: string]: JSONValue;
|
@@ -88,12 +92,14 @@ type EmbeddingModelV2<VALUE> = {
|
|
88
92
|
readonly modelId: string;
|
89
93
|
/**
|
90
94
|
Limit of how many embeddings can be generated in a single API call.
|
95
|
+
|
96
|
+
Use Infinity for models that do not have a limit.
|
91
97
|
*/
|
92
|
-
readonly maxEmbeddingsPerCall: number | undefined;
|
98
|
+
readonly maxEmbeddingsPerCall: PromiseLike<number | undefined> | number | undefined;
|
93
99
|
/**
|
94
100
|
True if the model can handle multiple embedding calls in parallel.
|
95
101
|
*/
|
96
|
-
readonly supportsParallelCalls: boolean;
|
102
|
+
readonly supportsParallelCalls: PromiseLike<boolean> | boolean;
|
97
103
|
/**
|
98
104
|
Generates a list of embeddings for the given input text.
|
99
105
|
|
@@ -409,7 +415,7 @@ type ImageModelV2CallOptions = {
|
|
409
415
|
}
|
410
416
|
```
|
411
417
|
*/
|
412
|
-
providerOptions:
|
418
|
+
providerOptions: SharedV2ProviderOptions;
|
413
419
|
/**
|
414
420
|
Abort signal for cancelling the operation.
|
415
421
|
*/
|
@@ -435,7 +441,7 @@ type ImageModelV2CallWarning = {
|
|
435
441
|
};
|
436
442
|
|
437
443
|
/**
|
438
|
-
Image generation model specification version
|
444
|
+
Image generation model specification version 2.
|
439
445
|
*/
|
440
446
|
type ImageModelV2 = {
|
441
447
|
/**
|
@@ -445,7 +451,7 @@ type ImageModelV2 = {
|
|
445
451
|
implementation versions can be handled as a discriminated union
|
446
452
|
on our side.
|
447
453
|
*/
|
448
|
-
readonly specificationVersion: '
|
454
|
+
readonly specificationVersion: 'v2';
|
449
455
|
/**
|
450
456
|
Name of the provider for logging purposes.
|
451
457
|
*/
|
@@ -732,13 +738,6 @@ type LanguageModelV2ToolChoice = {
|
|
732
738
|
|
733
739
|
type LanguageModelV2CallOptions = {
|
734
740
|
/**
|
735
|
-
Whether the user provided the input as messages or as
|
736
|
-
a prompt. This can help guide non-chat models in the
|
737
|
-
expansion, bc different expansions can be needed for
|
738
|
-
chat/non-chat use cases.
|
739
|
-
*/
|
740
|
-
inputFormat: 'messages' | 'prompt';
|
741
|
-
/**
|
742
741
|
A language mode prompt is a standardized prompt type.
|
743
742
|
|
744
743
|
Note: This is **not** the user-facing prompt. The AI SDK methods will map the
|
@@ -1045,7 +1044,7 @@ type LanguageModelV2 = {
|
|
1045
1044
|
*
|
1046
1045
|
* @returns A promise resolving to a map of supported URL patterns.
|
1047
1046
|
*/
|
1048
|
-
|
1047
|
+
supportedUrls: PromiseLike<Record<string, RegExp[]>> | Record<string, RegExp[]>;
|
1049
1048
|
/**
|
1050
1049
|
Generates a language model output (non-streaming).
|
1051
1050
|
|