@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/provider-utils",
3
- "version": "5.0.0-beta.11",
3
+ "version": "5.0.0-beta.14",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",
@@ -35,7 +35,7 @@
35
35
  "dependencies": {
36
36
  "@standard-schema/spec": "^1.1.0",
37
37
  "eventsource-parser": "^3.0.6",
38
- "@ai-sdk/provider": "4.0.0-beta.7"
38
+ "@ai-sdk/provider": "4.0.0-beta.8"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@types/node": "20.17.24",
@@ -23,7 +23,7 @@ export function loadApiKey({
23
23
 
24
24
  if (typeof process === 'undefined') {
25
25
  throw new LoadAPIKeyError({
26
- message: `${description} API key is missing. Pass it using the '${apiKeyParameterName}' parameter. Environment variables is not supported in this environment.`,
26
+ message: `${description} API key is missing. Pass it using the '${apiKeyParameterName}' parameter. Environment variables are not supported in this environment.`,
27
27
  });
28
28
  }
29
29
 
@@ -35,7 +35,7 @@ export function loadSetting({
35
35
  message:
36
36
  `${description} setting is missing. ` +
37
37
  `Pass it using the '${settingName}' parameter. ` +
38
- `Environment variables is not supported in this environment.`,
38
+ `Environment variables are not supported in this environment.`,
39
39
  });
40
40
  }
41
41
 
@@ -293,14 +293,6 @@ export type ToolResultOutput =
293
293
  */
294
294
  providerOptions?: ProviderOptions;
295
295
  }
296
- | {
297
- /**
298
- * @deprecated Use image-data or file-data instead.
299
- */
300
- type: 'media';
301
- data: string;
302
- mediaType: string;
303
- }
304
296
  | {
305
297
  type: 'file-data';
306
298
 
package/src/types/tool.ts CHANGED
@@ -26,7 +26,7 @@ export interface ToolExecutionOptions<CONTEXT extends Context> {
26
26
  abortSignal?: AbortSignal;
27
27
 
28
28
  /**
29
- * User-defined context.
29
+ * User-defined runtime context.
30
30
  *
31
31
  * Treat the context object as immutable inside tools.
32
32
  * Mutating the context object can lead to race conditions and unexpected results
@@ -34,10 +34,8 @@ export interface ToolExecutionOptions<CONTEXT extends Context> {
34
34
  *
35
35
  * If you need to mutate the context, analyze the tool calls and results
36
36
  * in `prepareStep` and update it there.
37
- *
38
- * Experimental (can break in patch releases).
39
37
  */
40
- experimental_context: CONTEXT;
38
+ context: CONTEXT;
41
39
  }
42
40
 
43
41
  /**
@@ -58,11 +56,16 @@ export type ToolNeedsApprovalFunction<INPUT, CONTEXT extends Context> = (
58
56
  messages: ModelMessage[];
59
57
 
60
58
  /**
61
- * Additional context.
59
+ * User-defined runtime context.
60
+ *
61
+ * Treat the context object as immutable inside tools.
62
+ * Mutating the context object can lead to race conditions and unexpected results
63
+ * when tools are called in parallel.
62
64
  *
63
- * Experimental (can break in patch releases).
65
+ * If you need to mutate the context, analyze the tool calls and results
66
+ * in `prepareStep` and update it there.
64
67
  */
65
- experimental_context: CONTEXT;
68
+ context: CONTEXT;
66
69
  },
67
70
  ) => boolean | PromiseLike<boolean>;
68
71