@ai-sdk/provider-utils 4.0.25 → 4.0.26
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 +6 -0
- package/dist/index.d.mts +12 -1
- package/dist/index.d.ts +12 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/types/tool.ts +13 -1
package/CHANGELOG.md
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LanguageModelV3FunctionTool, LanguageModelV3ProviderTool, ImageModelV3File, AISDKError, JSONSchema7, JSONParseError, TypeValidationError, JSONValue, APICallError, LanguageModelV3Prompt, SharedV3ProviderOptions, TypeValidationContext } from '@ai-sdk/provider';
|
|
1
|
+
import { LanguageModelV3FunctionTool, LanguageModelV3ProviderTool, ImageModelV3File, AISDKError, JSONSchema7, JSONParseError, TypeValidationError, JSONValue, APICallError, LanguageModelV3Prompt, SharedV3ProviderOptions, SharedV3ProviderMetadata, TypeValidationContext } from '@ai-sdk/provider';
|
|
2
2
|
import { StandardSchemaV1, StandardJSONSchemaV1 } from '@standard-schema/spec';
|
|
3
3
|
export * from '@standard-schema/spec';
|
|
4
4
|
import * as z3 from 'zod/v3';
|
|
@@ -1069,6 +1069,16 @@ type Tool<INPUT extends JSONValue | unknown | never = any, OUTPUT extends JSONVa
|
|
|
1069
1069
|
* functionality that can be fully encapsulated in the provider.
|
|
1070
1070
|
*/
|
|
1071
1071
|
providerOptions?: ProviderOptions;
|
|
1072
|
+
/**
|
|
1073
|
+
* Optional metadata about the tool itself (e.g. its source).
|
|
1074
|
+
*
|
|
1075
|
+
* Unlike `providerOptions`, this metadata is not sent to the language
|
|
1076
|
+
* model. Instead, it is propagated onto the resulting tool call's
|
|
1077
|
+
* `providerMetadata` so consumers can read it from tool call / result
|
|
1078
|
+
* parts and UI message parts. This is useful for sources of dynamic
|
|
1079
|
+
* tools (e.g. an MCP server) to identify themselves.
|
|
1080
|
+
*/
|
|
1081
|
+
providerMetadata?: SharedV3ProviderMetadata;
|
|
1072
1082
|
/**
|
|
1073
1083
|
* The schema of the input that the tool expects.
|
|
1074
1084
|
* The language model will use this to generate the input.
|
|
@@ -1196,6 +1206,7 @@ declare function dynamicTool(tool: {
|
|
|
1196
1206
|
description?: string;
|
|
1197
1207
|
title?: string;
|
|
1198
1208
|
providerOptions?: ProviderOptions;
|
|
1209
|
+
providerMetadata?: SharedV3ProviderMetadata;
|
|
1199
1210
|
inputSchema: FlexibleSchema<unknown>;
|
|
1200
1211
|
execute: ToolExecuteFunction<unknown, unknown>;
|
|
1201
1212
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LanguageModelV3FunctionTool, LanguageModelV3ProviderTool, ImageModelV3File, AISDKError, JSONSchema7, JSONParseError, TypeValidationError, JSONValue, APICallError, LanguageModelV3Prompt, SharedV3ProviderOptions, TypeValidationContext } from '@ai-sdk/provider';
|
|
1
|
+
import { LanguageModelV3FunctionTool, LanguageModelV3ProviderTool, ImageModelV3File, AISDKError, JSONSchema7, JSONParseError, TypeValidationError, JSONValue, APICallError, LanguageModelV3Prompt, SharedV3ProviderOptions, SharedV3ProviderMetadata, TypeValidationContext } from '@ai-sdk/provider';
|
|
2
2
|
import { StandardSchemaV1, StandardJSONSchemaV1 } from '@standard-schema/spec';
|
|
3
3
|
export * from '@standard-schema/spec';
|
|
4
4
|
import * as z3 from 'zod/v3';
|
|
@@ -1069,6 +1069,16 @@ type Tool<INPUT extends JSONValue | unknown | never = any, OUTPUT extends JSONVa
|
|
|
1069
1069
|
* functionality that can be fully encapsulated in the provider.
|
|
1070
1070
|
*/
|
|
1071
1071
|
providerOptions?: ProviderOptions;
|
|
1072
|
+
/**
|
|
1073
|
+
* Optional metadata about the tool itself (e.g. its source).
|
|
1074
|
+
*
|
|
1075
|
+
* Unlike `providerOptions`, this metadata is not sent to the language
|
|
1076
|
+
* model. Instead, it is propagated onto the resulting tool call's
|
|
1077
|
+
* `providerMetadata` so consumers can read it from tool call / result
|
|
1078
|
+
* parts and UI message parts. This is useful for sources of dynamic
|
|
1079
|
+
* tools (e.g. an MCP server) to identify themselves.
|
|
1080
|
+
*/
|
|
1081
|
+
providerMetadata?: SharedV3ProviderMetadata;
|
|
1072
1082
|
/**
|
|
1073
1083
|
* The schema of the input that the tool expects.
|
|
1074
1084
|
* The language model will use this to generate the input.
|
|
@@ -1196,6 +1206,7 @@ declare function dynamicTool(tool: {
|
|
|
1196
1206
|
description?: string;
|
|
1197
1207
|
title?: string;
|
|
1198
1208
|
providerOptions?: ProviderOptions;
|
|
1209
|
+
providerMetadata?: SharedV3ProviderMetadata;
|
|
1199
1210
|
inputSchema: FlexibleSchema<unknown>;
|
|
1200
1211
|
execute: ToolExecuteFunction<unknown, unknown>;
|
|
1201
1212
|
/**
|
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 ? "4.0.
|
|
681
|
+
var VERSION = true ? "4.0.26" : "0.0.0-test";
|
|
682
682
|
|
|
683
683
|
// src/get-from-api.ts
|
|
684
684
|
var getOriginalFetch = () => globalThis.fetch;
|