@ai-sdk/provider 2.0.0-canary.13 → 2.0.0-canary.14
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 +10 -0
- package/dist/index.d.mts +31 -17
- package/dist/index.d.ts +31 -17
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,15 @@
|
|
1
1
|
# @ai-sdk/provider
|
2
2
|
|
3
|
+
## 2.0.0-canary.14
|
4
|
+
|
5
|
+
### Major Changes
|
6
|
+
|
7
|
+
- 7979f7f: feat (provider): support reasoning tokens, cached input tokens, total token in usage information
|
8
|
+
|
9
|
+
### Patch Changes
|
10
|
+
|
11
|
+
- a8c8bd5: feat(embed-many): respect supportsParallelCalls & concurrency
|
12
|
+
|
3
13
|
## 2.0.0-canary.13
|
4
14
|
|
5
15
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
@@ -1004,17 +1004,34 @@ type LanguageModelV2ToolCallDelta = {
|
|
1004
1004
|
};
|
1005
1005
|
|
1006
1006
|
/**
|
1007
|
-
|
1007
|
+
Usage information for a language model call.
|
1008
|
+
|
1009
|
+
If your API return additional usage information, you can add it to the
|
1010
|
+
provider metadata under your provider's key.
|
1008
1011
|
*/
|
1009
1012
|
type LanguageModelV2Usage = {
|
1010
1013
|
/**
|
1011
|
-
|
1014
|
+
The number of input (prompt) tokens used.
|
1012
1015
|
*/
|
1013
1016
|
inputTokens: number | undefined;
|
1014
1017
|
/**
|
1015
|
-
|
1018
|
+
The number of output (completion) tokens used.
|
1016
1019
|
*/
|
1017
1020
|
outputTokens: number | undefined;
|
1021
|
+
/**
|
1022
|
+
The total number of tokens as reported by the provider.
|
1023
|
+
This number might be different from the sum of `inputTokens` and `outputTokens`
|
1024
|
+
and e.g. include reasoning tokens or other overhead.
|
1025
|
+
*/
|
1026
|
+
totalTokens: number | undefined;
|
1027
|
+
/**
|
1028
|
+
The number of reasoning tokens used.
|
1029
|
+
*/
|
1030
|
+
reasoningTokens?: number | undefined;
|
1031
|
+
/**
|
1032
|
+
The number of cached input tokens.
|
1033
|
+
*/
|
1034
|
+
cachedInputTokens?: number | undefined;
|
1018
1035
|
};
|
1019
1036
|
|
1020
1037
|
type LanguageModelV2StreamPart = LanguageModelV2Content | {
|
@@ -1039,11 +1056,7 @@ Specification for a language model that implements the language model interface
|
|
1039
1056
|
*/
|
1040
1057
|
type LanguageModelV2 = {
|
1041
1058
|
/**
|
1042
|
-
The language model must specify which language model interface
|
1043
|
-
version it implements. This will allow us to evolve the language
|
1044
|
-
model interface and retain backwards compatibility. The different
|
1045
|
-
implementation versions can be handled as a discriminated union
|
1046
|
-
on our side.
|
1059
|
+
The language model must specify which language model interface version it implements.
|
1047
1060
|
*/
|
1048
1061
|
readonly specificationVersion: 'v2';
|
1049
1062
|
/**
|
@@ -1055,15 +1068,16 @@ type LanguageModelV2 = {
|
|
1055
1068
|
*/
|
1056
1069
|
readonly modelId: string;
|
1057
1070
|
/**
|
1058
|
-
|
1059
|
-
|
1060
|
-
|
1061
|
-
|
1062
|
-
|
1063
|
-
|
1064
|
-
|
1065
|
-
|
1066
|
-
|
1071
|
+
Supported URL patterns by media type for the provider.
|
1072
|
+
|
1073
|
+
The keys are media type patterns or full media types (e.g. `*\/*` for everything, `audio/*`, `video/*`, or `application/pdf`).
|
1074
|
+
and the values are arrays of regular expressions that match the URL paths.
|
1075
|
+
|
1076
|
+
The matching should be against lower-case URLs.
|
1077
|
+
|
1078
|
+
Matched URLs are supported natively by the model and are not downloaded.
|
1079
|
+
|
1080
|
+
@returns A map of supported URL patterns by media type (as a promise or a plain object).
|
1067
1081
|
*/
|
1068
1082
|
supportedUrls: PromiseLike<Record<string, RegExp[]>> | Record<string, RegExp[]>;
|
1069
1083
|
/**
|
package/dist/index.d.ts
CHANGED
@@ -1004,17 +1004,34 @@ type LanguageModelV2ToolCallDelta = {
|
|
1004
1004
|
};
|
1005
1005
|
|
1006
1006
|
/**
|
1007
|
-
|
1007
|
+
Usage information for a language model call.
|
1008
|
+
|
1009
|
+
If your API return additional usage information, you can add it to the
|
1010
|
+
provider metadata under your provider's key.
|
1008
1011
|
*/
|
1009
1012
|
type LanguageModelV2Usage = {
|
1010
1013
|
/**
|
1011
|
-
|
1014
|
+
The number of input (prompt) tokens used.
|
1012
1015
|
*/
|
1013
1016
|
inputTokens: number | undefined;
|
1014
1017
|
/**
|
1015
|
-
|
1018
|
+
The number of output (completion) tokens used.
|
1016
1019
|
*/
|
1017
1020
|
outputTokens: number | undefined;
|
1021
|
+
/**
|
1022
|
+
The total number of tokens as reported by the provider.
|
1023
|
+
This number might be different from the sum of `inputTokens` and `outputTokens`
|
1024
|
+
and e.g. include reasoning tokens or other overhead.
|
1025
|
+
*/
|
1026
|
+
totalTokens: number | undefined;
|
1027
|
+
/**
|
1028
|
+
The number of reasoning tokens used.
|
1029
|
+
*/
|
1030
|
+
reasoningTokens?: number | undefined;
|
1031
|
+
/**
|
1032
|
+
The number of cached input tokens.
|
1033
|
+
*/
|
1034
|
+
cachedInputTokens?: number | undefined;
|
1018
1035
|
};
|
1019
1036
|
|
1020
1037
|
type LanguageModelV2StreamPart = LanguageModelV2Content | {
|
@@ -1039,11 +1056,7 @@ Specification for a language model that implements the language model interface
|
|
1039
1056
|
*/
|
1040
1057
|
type LanguageModelV2 = {
|
1041
1058
|
/**
|
1042
|
-
The language model must specify which language model interface
|
1043
|
-
version it implements. This will allow us to evolve the language
|
1044
|
-
model interface and retain backwards compatibility. The different
|
1045
|
-
implementation versions can be handled as a discriminated union
|
1046
|
-
on our side.
|
1059
|
+
The language model must specify which language model interface version it implements.
|
1047
1060
|
*/
|
1048
1061
|
readonly specificationVersion: 'v2';
|
1049
1062
|
/**
|
@@ -1055,15 +1068,16 @@ type LanguageModelV2 = {
|
|
1055
1068
|
*/
|
1056
1069
|
readonly modelId: string;
|
1057
1070
|
/**
|
1058
|
-
|
1059
|
-
|
1060
|
-
|
1061
|
-
|
1062
|
-
|
1063
|
-
|
1064
|
-
|
1065
|
-
|
1066
|
-
|
1071
|
+
Supported URL patterns by media type for the provider.
|
1072
|
+
|
1073
|
+
The keys are media type patterns or full media types (e.g. `*\/*` for everything, `audio/*`, `video/*`, or `application/pdf`).
|
1074
|
+
and the values are arrays of regular expressions that match the URL paths.
|
1075
|
+
|
1076
|
+
The matching should be against lower-case URLs.
|
1077
|
+
|
1078
|
+
Matched URLs are supported natively by the model and are not downloaded.
|
1079
|
+
|
1080
|
+
@returns A map of supported URL patterns by media type (as a promise or a plain object).
|
1067
1081
|
*/
|
1068
1082
|
supportedUrls: PromiseLike<Record<string, RegExp[]>> | Record<string, RegExp[]>;
|
1069
1083
|
/**
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ai-sdk/provider",
|
3
|
-
"version": "2.0.0-canary.
|
3
|
+
"version": "2.0.0-canary.14",
|
4
4
|
"license": "Apache-2.0",
|
5
5
|
"sideEffects": false,
|
6
6
|
"main": "./dist/index.js",
|
@@ -34,7 +34,7 @@
|
|
34
34
|
"publishConfig": {
|
35
35
|
"access": "public"
|
36
36
|
},
|
37
|
-
"homepage": "https://sdk.
|
37
|
+
"homepage": "https://ai-sdk.dev/docs",
|
38
38
|
"repository": {
|
39
39
|
"type": "git",
|
40
40
|
"url": "git+https://github.com/vercel/ai.git"
|