@ai-sdk/provider-utils 5.0.0-beta.11 → 5.0.0-beta.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 +24 -0
- package/dist/index.d.mts +10 -14
- package/dist/index.d.ts +10 -14
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/load-api-key.ts +1 -1
- package/src/load-setting.ts +1 -1
- package/src/types/content-part.ts +0 -8
- package/src/types/tool.ts +10 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @ai-sdk/provider-utils
|
|
2
2
|
|
|
3
|
+
## 5.0.0-beta.14
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [34bd95d]
|
|
8
|
+
- Updated dependencies [008271d]
|
|
9
|
+
- @ai-sdk/provider@4.0.0-beta.8
|
|
10
|
+
|
|
11
|
+
## 5.0.0-beta.13
|
|
12
|
+
|
|
13
|
+
### Major Changes
|
|
14
|
+
|
|
15
|
+
- 7e26e81: chore: rename experimental_context to context
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- b0c2869: chore(ai): remove deprecated `media` type part from `ToolResultOutput`
|
|
20
|
+
|
|
21
|
+
## 5.0.0-beta.12
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- 46d1149: chore(provider-utils,google): fix grammar errors in error and warning messages
|
|
26
|
+
|
|
3
27
|
## 5.0.0-beta.11
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -837,13 +837,6 @@ type ToolResultOutput = {
|
|
|
837
837
|
* Provider-specific options.
|
|
838
838
|
*/
|
|
839
839
|
providerOptions?: ProviderOptions;
|
|
840
|
-
} | {
|
|
841
|
-
/**
|
|
842
|
-
* @deprecated Use image-data or file-data instead.
|
|
843
|
-
*/
|
|
844
|
-
type: 'media';
|
|
845
|
-
data: string;
|
|
846
|
-
mediaType: string;
|
|
847
840
|
} | {
|
|
848
841
|
type: 'file-data';
|
|
849
842
|
/**
|
|
@@ -1119,7 +1112,7 @@ interface ToolExecutionOptions<CONTEXT extends Context> {
|
|
|
1119
1112
|
*/
|
|
1120
1113
|
abortSignal?: AbortSignal;
|
|
1121
1114
|
/**
|
|
1122
|
-
* User-defined context.
|
|
1115
|
+
* User-defined runtime context.
|
|
1123
1116
|
*
|
|
1124
1117
|
* Treat the context object as immutable inside tools.
|
|
1125
1118
|
* Mutating the context object can lead to race conditions and unexpected results
|
|
@@ -1127,10 +1120,8 @@ interface ToolExecutionOptions<CONTEXT extends Context> {
|
|
|
1127
1120
|
*
|
|
1128
1121
|
* If you need to mutate the context, analyze the tool calls and results
|
|
1129
1122
|
* in `prepareStep` and update it there.
|
|
1130
|
-
*
|
|
1131
|
-
* Experimental (can break in patch releases).
|
|
1132
1123
|
*/
|
|
1133
|
-
|
|
1124
|
+
context: CONTEXT;
|
|
1134
1125
|
}
|
|
1135
1126
|
/**
|
|
1136
1127
|
* Function that is called to determine if the tool needs approval before it can be executed.
|
|
@@ -1146,11 +1137,16 @@ type ToolNeedsApprovalFunction<INPUT, CONTEXT extends Context> = (input: INPUT,
|
|
|
1146
1137
|
*/
|
|
1147
1138
|
messages: ModelMessage[];
|
|
1148
1139
|
/**
|
|
1149
|
-
*
|
|
1140
|
+
* User-defined runtime context.
|
|
1150
1141
|
*
|
|
1151
|
-
*
|
|
1142
|
+
* Treat the context object as immutable inside tools.
|
|
1143
|
+
* Mutating the context object can lead to race conditions and unexpected results
|
|
1144
|
+
* when tools are called in parallel.
|
|
1145
|
+
*
|
|
1146
|
+
* If you need to mutate the context, analyze the tool calls and results
|
|
1147
|
+
* in `prepareStep` and update it there.
|
|
1152
1148
|
*/
|
|
1153
|
-
|
|
1149
|
+
context: CONTEXT;
|
|
1154
1150
|
}) => boolean | PromiseLike<boolean>;
|
|
1155
1151
|
/**
|
|
1156
1152
|
* Function that executes the tool and returns either a single result or a stream of results.
|
package/dist/index.d.ts
CHANGED
|
@@ -837,13 +837,6 @@ type ToolResultOutput = {
|
|
|
837
837
|
* Provider-specific options.
|
|
838
838
|
*/
|
|
839
839
|
providerOptions?: ProviderOptions;
|
|
840
|
-
} | {
|
|
841
|
-
/**
|
|
842
|
-
* @deprecated Use image-data or file-data instead.
|
|
843
|
-
*/
|
|
844
|
-
type: 'media';
|
|
845
|
-
data: string;
|
|
846
|
-
mediaType: string;
|
|
847
840
|
} | {
|
|
848
841
|
type: 'file-data';
|
|
849
842
|
/**
|
|
@@ -1119,7 +1112,7 @@ interface ToolExecutionOptions<CONTEXT extends Context> {
|
|
|
1119
1112
|
*/
|
|
1120
1113
|
abortSignal?: AbortSignal;
|
|
1121
1114
|
/**
|
|
1122
|
-
* User-defined context.
|
|
1115
|
+
* User-defined runtime context.
|
|
1123
1116
|
*
|
|
1124
1117
|
* Treat the context object as immutable inside tools.
|
|
1125
1118
|
* Mutating the context object can lead to race conditions and unexpected results
|
|
@@ -1127,10 +1120,8 @@ interface ToolExecutionOptions<CONTEXT extends Context> {
|
|
|
1127
1120
|
*
|
|
1128
1121
|
* If you need to mutate the context, analyze the tool calls and results
|
|
1129
1122
|
* in `prepareStep` and update it there.
|
|
1130
|
-
*
|
|
1131
|
-
* Experimental (can break in patch releases).
|
|
1132
1123
|
*/
|
|
1133
|
-
|
|
1124
|
+
context: CONTEXT;
|
|
1134
1125
|
}
|
|
1135
1126
|
/**
|
|
1136
1127
|
* Function that is called to determine if the tool needs approval before it can be executed.
|
|
@@ -1146,11 +1137,16 @@ type ToolNeedsApprovalFunction<INPUT, CONTEXT extends Context> = (input: INPUT,
|
|
|
1146
1137
|
*/
|
|
1147
1138
|
messages: ModelMessage[];
|
|
1148
1139
|
/**
|
|
1149
|
-
*
|
|
1140
|
+
* User-defined runtime context.
|
|
1150
1141
|
*
|
|
1151
|
-
*
|
|
1142
|
+
* Treat the context object as immutable inside tools.
|
|
1143
|
+
* Mutating the context object can lead to race conditions and unexpected results
|
|
1144
|
+
* when tools are called in parallel.
|
|
1145
|
+
*
|
|
1146
|
+
* If you need to mutate the context, analyze the tool calls and results
|
|
1147
|
+
* in `prepareStep` and update it there.
|
|
1152
1148
|
*/
|
|
1153
|
-
|
|
1149
|
+
context: CONTEXT;
|
|
1154
1150
|
}) => boolean | PromiseLike<boolean>;
|
|
1155
1151
|
/**
|
|
1156
1152
|
* Function that executes the tool and returns either a single result or a stream of results.
|
package/dist/index.js
CHANGED
|
@@ -678,7 +678,7 @@ function withUserAgentSuffix(headers, ...userAgentSuffixParts) {
|
|
|
678
678
|
}
|
|
679
679
|
|
|
680
680
|
// src/version.ts
|
|
681
|
-
var VERSION = true ? "5.0.0-beta.
|
|
681
|
+
var VERSION = true ? "5.0.0-beta.14" : "0.0.0-test";
|
|
682
682
|
|
|
683
683
|
// src/get-from-api.ts
|
|
684
684
|
var getOriginalFetch = () => globalThis.fetch;
|
|
@@ -831,7 +831,7 @@ function loadApiKey({
|
|
|
831
831
|
}
|
|
832
832
|
if (typeof process === "undefined") {
|
|
833
833
|
throw new import_provider5.LoadAPIKeyError({
|
|
834
|
-
message: `${description} API key is missing. Pass it using the '${apiKeyParameterName}' parameter. Environment variables
|
|
834
|
+
message: `${description} API key is missing. Pass it using the '${apiKeyParameterName}' parameter. Environment variables are not supported in this environment.`
|
|
835
835
|
});
|
|
836
836
|
}
|
|
837
837
|
apiKey = process.env[environmentVariableName];
|
|
@@ -941,7 +941,7 @@ function loadSetting({
|
|
|
941
941
|
}
|
|
942
942
|
if (typeof process === "undefined") {
|
|
943
943
|
throw new import_provider6.LoadSettingError({
|
|
944
|
-
message: `${description} setting is missing. Pass it using the '${settingName}' parameter. Environment variables
|
|
944
|
+
message: `${description} setting is missing. Pass it using the '${settingName}' parameter. Environment variables are not supported in this environment.`
|
|
945
945
|
});
|
|
946
946
|
}
|
|
947
947
|
settingValue = process.env[environmentVariableName];
|