@ai-sdk/provider-utils 3.1.0-beta.4 → 3.1.0-beta.5
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 +8 -0
- package/dist/index.d.mts +6 -6
- package/dist/index.d.ts +6 -6
- 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 +2 -2
package/CHANGELOG.md
CHANGED
package/dist/index.d.mts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { JSONParseError, TypeValidationError, JSONValue, APICallError,
|
1
|
+
import { JSONParseError, TypeValidationError, JSONValue, APICallError, LanguageModelV3Prompt, JSONSchema7, SharedV2ProviderOptions, LanguageModelV3ToolResultOutput, LanguageModelV3ToolResultPart } from '@ai-sdk/provider';
|
2
2
|
import * as z4 from 'zod/v4';
|
3
3
|
import { ZodType, z } from 'zod/v4';
|
4
4
|
import * as z3 from 'zod/v3';
|
@@ -206,11 +206,11 @@ declare const getFromApi: <T>({ url, headers, successfulResponseHandler, failedR
|
|
206
206
|
}>;
|
207
207
|
|
208
208
|
declare function injectJsonInstructionIntoMessages({ messages, schema, schemaPrefix, schemaSuffix, }: {
|
209
|
-
messages:
|
209
|
+
messages: LanguageModelV3Prompt;
|
210
210
|
schema?: JSONSchema7;
|
211
211
|
schemaPrefix?: string;
|
212
212
|
schemaSuffix?: string;
|
213
|
-
}):
|
213
|
+
}): LanguageModelV3Prompt;
|
214
214
|
|
215
215
|
declare function isAbortError(error: unknown): error is Error;
|
216
216
|
|
@@ -508,7 +508,7 @@ interface ToolResultPart {
|
|
508
508
|
/**
|
509
509
|
Result of the tool call. This is a JSON-serializable object.
|
510
510
|
*/
|
511
|
-
output:
|
511
|
+
output: LanguageModelV3ToolResultOutput;
|
512
512
|
/**
|
513
513
|
Additional provider-specific metadata. They are passed through
|
514
514
|
to the provider from the AI SDK and enable provider-specific
|
@@ -686,7 +686,7 @@ Optional conversion function that maps the tool result to an output that can be
|
|
686
686
|
|
687
687
|
If not provided, the tool result will be sent as a JSON object.
|
688
688
|
*/
|
689
|
-
toModelOutput?: (output: 0 extends 1 & OUTPUT ? any : [OUTPUT] extends [never] ? any : NoInfer<OUTPUT>) =>
|
689
|
+
toModelOutput?: (output: 0 extends 1 & OUTPUT ? any : [OUTPUT] extends [never] ? any : NoInfer<OUTPUT>) => LanguageModelV3ToolResultPart['output'];
|
690
690
|
} & ({
|
691
691
|
/**
|
692
692
|
Tool with user-defined input and output schemas.
|
@@ -739,7 +739,7 @@ declare function dynamicTool(tool: {
|
|
739
739
|
providerOptions?: ProviderOptions;
|
740
740
|
inputSchema: FlexibleSchema<unknown>;
|
741
741
|
execute: ToolExecuteFunction<unknown, unknown>;
|
742
|
-
toModelOutput?: (output: unknown) =>
|
742
|
+
toModelOutput?: (output: unknown) => LanguageModelV3ToolResultPart['output'];
|
743
743
|
}): Tool<unknown, unknown> & {
|
744
744
|
type: 'dynamic';
|
745
745
|
};
|
package/dist/index.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { JSONParseError, TypeValidationError, JSONValue, APICallError,
|
1
|
+
import { JSONParseError, TypeValidationError, JSONValue, APICallError, LanguageModelV3Prompt, JSONSchema7, SharedV2ProviderOptions, LanguageModelV3ToolResultOutput, LanguageModelV3ToolResultPart } from '@ai-sdk/provider';
|
2
2
|
import * as z4 from 'zod/v4';
|
3
3
|
import { ZodType, z } from 'zod/v4';
|
4
4
|
import * as z3 from 'zod/v3';
|
@@ -206,11 +206,11 @@ declare const getFromApi: <T>({ url, headers, successfulResponseHandler, failedR
|
|
206
206
|
}>;
|
207
207
|
|
208
208
|
declare function injectJsonInstructionIntoMessages({ messages, schema, schemaPrefix, schemaSuffix, }: {
|
209
|
-
messages:
|
209
|
+
messages: LanguageModelV3Prompt;
|
210
210
|
schema?: JSONSchema7;
|
211
211
|
schemaPrefix?: string;
|
212
212
|
schemaSuffix?: string;
|
213
|
-
}):
|
213
|
+
}): LanguageModelV3Prompt;
|
214
214
|
|
215
215
|
declare function isAbortError(error: unknown): error is Error;
|
216
216
|
|
@@ -508,7 +508,7 @@ interface ToolResultPart {
|
|
508
508
|
/**
|
509
509
|
Result of the tool call. This is a JSON-serializable object.
|
510
510
|
*/
|
511
|
-
output:
|
511
|
+
output: LanguageModelV3ToolResultOutput;
|
512
512
|
/**
|
513
513
|
Additional provider-specific metadata. They are passed through
|
514
514
|
to the provider from the AI SDK and enable provider-specific
|
@@ -686,7 +686,7 @@ Optional conversion function that maps the tool result to an output that can be
|
|
686
686
|
|
687
687
|
If not provided, the tool result will be sent as a JSON object.
|
688
688
|
*/
|
689
|
-
toModelOutput?: (output: 0 extends 1 & OUTPUT ? any : [OUTPUT] extends [never] ? any : NoInfer<OUTPUT>) =>
|
689
|
+
toModelOutput?: (output: 0 extends 1 & OUTPUT ? any : [OUTPUT] extends [never] ? any : NoInfer<OUTPUT>) => LanguageModelV3ToolResultPart['output'];
|
690
690
|
} & ({
|
691
691
|
/**
|
692
692
|
Tool with user-defined input and output schemas.
|
@@ -739,7 +739,7 @@ declare function dynamicTool(tool: {
|
|
739
739
|
providerOptions?: ProviderOptions;
|
740
740
|
inputSchema: FlexibleSchema<unknown>;
|
741
741
|
execute: ToolExecuteFunction<unknown, unknown>;
|
742
|
-
toModelOutput?: (output: unknown) =>
|
742
|
+
toModelOutput?: (output: unknown) => LanguageModelV3ToolResultPart['output'];
|
743
743
|
}): Tool<unknown, unknown> & {
|
744
744
|
type: 'dynamic';
|
745
745
|
};
|
package/dist/index.js
CHANGED
@@ -284,7 +284,7 @@ function handleFetchError({
|
|
284
284
|
}
|
285
285
|
|
286
286
|
// src/version.ts
|
287
|
-
var VERSION = true ? "3.1.0-beta.
|
287
|
+
var VERSION = true ? "3.1.0-beta.5" : "0.0.0-test";
|
288
288
|
|
289
289
|
// src/get-from-api.ts
|
290
290
|
var getOriginalFetch = () => globalThis.fetch;
|