@ai-sdk/provider-utils 5.0.0-beta.4 → 5.0.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 +11 -0
- package/dist/index.d.mts +19 -2
- package/dist/index.d.ts +19 -2
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +2 -2
- package/src/types/assistant-model-message.ts +2 -0
- package/src/types/content-part.ts +20 -0
- package/src/types/index.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @ai-sdk/provider-utils
|
|
2
2
|
|
|
3
|
+
## 5.0.0-beta.5
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- 776b617: feat(provider): adding new 'custom' content type
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [776b617]
|
|
12
|
+
- @ai-sdk/provider@4.0.0-beta.3
|
|
13
|
+
|
|
3
14
|
## 5.0.0-beta.4
|
|
4
15
|
|
|
5
16
|
### Major Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -632,6 +632,23 @@ interface ReasoningPart {
|
|
|
632
632
|
*/
|
|
633
633
|
providerOptions?: ProviderOptions;
|
|
634
634
|
}
|
|
635
|
+
/**
|
|
636
|
+
* Custom content part of a prompt. It contains no standardized payload beyond
|
|
637
|
+
* provider-specific options.
|
|
638
|
+
*/
|
|
639
|
+
interface CustomPart {
|
|
640
|
+
type: 'custom';
|
|
641
|
+
/**
|
|
642
|
+
* The kind of custom content, in the format `{provider}-{provider-type}`.
|
|
643
|
+
*/
|
|
644
|
+
kind: string;
|
|
645
|
+
/**
|
|
646
|
+
* Additional provider-specific metadata. They are passed through
|
|
647
|
+
* to the provider from the AI SDK and enable provider-specific
|
|
648
|
+
* functionality that can be fully encapsulated in the provider.
|
|
649
|
+
*/
|
|
650
|
+
providerOptions?: ProviderOptions;
|
|
651
|
+
}
|
|
635
652
|
/**
|
|
636
653
|
* Reasoning file content part of a prompt. It contains a file generated as part of reasoning.
|
|
637
654
|
*/
|
|
@@ -913,7 +930,7 @@ type AssistantModelMessage = {
|
|
|
913
930
|
* Content of an assistant message.
|
|
914
931
|
* It can be a string or an array of text, image, reasoning, redacted reasoning, and tool call parts.
|
|
915
932
|
*/
|
|
916
|
-
type AssistantContent = string | Array<TextPart | FilePart | ReasoningPart | ReasoningFilePart | ToolCallPart | ToolResultPart | ToolApprovalRequest>;
|
|
933
|
+
type AssistantContent = string | Array<TextPart | CustomPart | FilePart | ReasoningPart | ReasoningFilePart | ToolCallPart | ToolResultPart | ToolApprovalRequest>;
|
|
917
934
|
|
|
918
935
|
/**
|
|
919
936
|
* A system message. It can contain system information.
|
|
@@ -1452,4 +1469,4 @@ interface ToolResult<NAME extends string, INPUT, OUTPUT> {
|
|
|
1452
1469
|
*/
|
|
1453
1470
|
type ToolCallOptions = ToolExecutionOptions;
|
|
1454
1471
|
|
|
1455
|
-
export { type AssistantContent, type AssistantModelMessage, DEFAULT_MAX_DOWNLOAD_SIZE, type DataContent, DelayedPromise, DownloadError, type FetchFunction, type FilePart, type FlexibleSchema, type IdGenerator, type ImagePart, type InferSchema, type InferToolInput, type InferToolOutput, type LazySchema, type MaybePromiseLike, type ModelMessage, type ParseResult, type ProviderOptions, type ProviderToolFactory, type ProviderToolFactoryWithOutputSchema, type ReasoningFilePart, type ReasoningPart, type Resolvable, type ResponseHandler, type Schema, type SystemModelMessage, type TextPart, type Tool, type ToolApprovalRequest, type ToolApprovalResponse, type ToolCall, type ToolCallOptions, type ToolCallPart, type ToolContent, type ToolExecuteFunction, type ToolExecutionOptions, type ToolModelMessage, type ToolNameMapping, type ToolNeedsApprovalFunction, type ToolResult, type ToolResultOutput, type ToolResultPart, type UserContent, type UserModelMessage, VERSION, type ValidationResult, asSchema, combineHeaders, convertAsyncIteratorToReadableStream, convertBase64ToUint8Array, convertImageModelFileToDataUri, convertToBase64, convertToFormData, convertUint8ArrayToBase64, createBinaryResponseHandler, createEventSourceResponseHandler, createIdGenerator, createJsonErrorResponseHandler, createJsonResponseHandler, createProviderToolFactory, createProviderToolFactoryWithOutputSchema, createStatusCodeErrorResponseHandler, createToolNameMapping, delay, downloadBlob, dynamicTool, executeTool, extractResponseHeaders, generateId, getErrorMessage, getFromApi, getRuntimeEnvironmentUserAgent, injectJsonInstructionIntoMessages, isAbortError, isNonNullable, isParsableJson, isUrlSupported, jsonSchema, lazySchema, loadApiKey, loadOptionalSetting, loadSetting, mediaTypeToExtension, normalizeHeaders, parseJSON, parseJsonEventStream, parseProviderOptions, postFormDataToApi, postJsonToApi, postToApi, readResponseWithSizeLimit, removeUndefinedEntries, resolve, safeParseJSON, safeValidateTypes, stripFileExtension, tool, validateDownloadUrl, validateTypes, withUserAgentSuffix, withoutTrailingSlash, zodSchema };
|
|
1472
|
+
export { type AssistantContent, type AssistantModelMessage, type CustomPart, DEFAULT_MAX_DOWNLOAD_SIZE, type DataContent, DelayedPromise, DownloadError, type FetchFunction, type FilePart, type FlexibleSchema, type IdGenerator, type ImagePart, type InferSchema, type InferToolInput, type InferToolOutput, type LazySchema, type MaybePromiseLike, type ModelMessage, type ParseResult, type ProviderOptions, type ProviderToolFactory, type ProviderToolFactoryWithOutputSchema, type ReasoningFilePart, type ReasoningPart, type Resolvable, type ResponseHandler, type Schema, type SystemModelMessage, type TextPart, type Tool, type ToolApprovalRequest, type ToolApprovalResponse, type ToolCall, type ToolCallOptions, type ToolCallPart, type ToolContent, type ToolExecuteFunction, type ToolExecutionOptions, type ToolModelMessage, type ToolNameMapping, type ToolNeedsApprovalFunction, type ToolResult, type ToolResultOutput, type ToolResultPart, type UserContent, type UserModelMessage, VERSION, type ValidationResult, asSchema, combineHeaders, convertAsyncIteratorToReadableStream, convertBase64ToUint8Array, convertImageModelFileToDataUri, convertToBase64, convertToFormData, convertUint8ArrayToBase64, createBinaryResponseHandler, createEventSourceResponseHandler, createIdGenerator, createJsonErrorResponseHandler, createJsonResponseHandler, createProviderToolFactory, createProviderToolFactoryWithOutputSchema, createStatusCodeErrorResponseHandler, createToolNameMapping, delay, downloadBlob, dynamicTool, executeTool, extractResponseHeaders, generateId, getErrorMessage, getFromApi, getRuntimeEnvironmentUserAgent, injectJsonInstructionIntoMessages, isAbortError, isNonNullable, isParsableJson, isUrlSupported, jsonSchema, lazySchema, loadApiKey, loadOptionalSetting, loadSetting, mediaTypeToExtension, normalizeHeaders, parseJSON, parseJsonEventStream, parseProviderOptions, postFormDataToApi, postJsonToApi, postToApi, readResponseWithSizeLimit, removeUndefinedEntries, resolve, safeParseJSON, safeValidateTypes, stripFileExtension, tool, validateDownloadUrl, validateTypes, withUserAgentSuffix, withoutTrailingSlash, zodSchema };
|
package/dist/index.d.ts
CHANGED
|
@@ -632,6 +632,23 @@ interface ReasoningPart {
|
|
|
632
632
|
*/
|
|
633
633
|
providerOptions?: ProviderOptions;
|
|
634
634
|
}
|
|
635
|
+
/**
|
|
636
|
+
* Custom content part of a prompt. It contains no standardized payload beyond
|
|
637
|
+
* provider-specific options.
|
|
638
|
+
*/
|
|
639
|
+
interface CustomPart {
|
|
640
|
+
type: 'custom';
|
|
641
|
+
/**
|
|
642
|
+
* The kind of custom content, in the format `{provider}-{provider-type}`.
|
|
643
|
+
*/
|
|
644
|
+
kind: string;
|
|
645
|
+
/**
|
|
646
|
+
* Additional provider-specific metadata. They are passed through
|
|
647
|
+
* to the provider from the AI SDK and enable provider-specific
|
|
648
|
+
* functionality that can be fully encapsulated in the provider.
|
|
649
|
+
*/
|
|
650
|
+
providerOptions?: ProviderOptions;
|
|
651
|
+
}
|
|
635
652
|
/**
|
|
636
653
|
* Reasoning file content part of a prompt. It contains a file generated as part of reasoning.
|
|
637
654
|
*/
|
|
@@ -913,7 +930,7 @@ type AssistantModelMessage = {
|
|
|
913
930
|
* Content of an assistant message.
|
|
914
931
|
* It can be a string or an array of text, image, reasoning, redacted reasoning, and tool call parts.
|
|
915
932
|
*/
|
|
916
|
-
type AssistantContent = string | Array<TextPart | FilePart | ReasoningPart | ReasoningFilePart | ToolCallPart | ToolResultPart | ToolApprovalRequest>;
|
|
933
|
+
type AssistantContent = string | Array<TextPart | CustomPart | FilePart | ReasoningPart | ReasoningFilePart | ToolCallPart | ToolResultPart | ToolApprovalRequest>;
|
|
917
934
|
|
|
918
935
|
/**
|
|
919
936
|
* A system message. It can contain system information.
|
|
@@ -1452,4 +1469,4 @@ interface ToolResult<NAME extends string, INPUT, OUTPUT> {
|
|
|
1452
1469
|
*/
|
|
1453
1470
|
type ToolCallOptions = ToolExecutionOptions;
|
|
1454
1471
|
|
|
1455
|
-
export { type AssistantContent, type AssistantModelMessage, DEFAULT_MAX_DOWNLOAD_SIZE, type DataContent, DelayedPromise, DownloadError, type FetchFunction, type FilePart, type FlexibleSchema, type IdGenerator, type ImagePart, type InferSchema, type InferToolInput, type InferToolOutput, type LazySchema, type MaybePromiseLike, type ModelMessage, type ParseResult, type ProviderOptions, type ProviderToolFactory, type ProviderToolFactoryWithOutputSchema, type ReasoningFilePart, type ReasoningPart, type Resolvable, type ResponseHandler, type Schema, type SystemModelMessage, type TextPart, type Tool, type ToolApprovalRequest, type ToolApprovalResponse, type ToolCall, type ToolCallOptions, type ToolCallPart, type ToolContent, type ToolExecuteFunction, type ToolExecutionOptions, type ToolModelMessage, type ToolNameMapping, type ToolNeedsApprovalFunction, type ToolResult, type ToolResultOutput, type ToolResultPart, type UserContent, type UserModelMessage, VERSION, type ValidationResult, asSchema, combineHeaders, convertAsyncIteratorToReadableStream, convertBase64ToUint8Array, convertImageModelFileToDataUri, convertToBase64, convertToFormData, convertUint8ArrayToBase64, createBinaryResponseHandler, createEventSourceResponseHandler, createIdGenerator, createJsonErrorResponseHandler, createJsonResponseHandler, createProviderToolFactory, createProviderToolFactoryWithOutputSchema, createStatusCodeErrorResponseHandler, createToolNameMapping, delay, downloadBlob, dynamicTool, executeTool, extractResponseHeaders, generateId, getErrorMessage, getFromApi, getRuntimeEnvironmentUserAgent, injectJsonInstructionIntoMessages, isAbortError, isNonNullable, isParsableJson, isUrlSupported, jsonSchema, lazySchema, loadApiKey, loadOptionalSetting, loadSetting, mediaTypeToExtension, normalizeHeaders, parseJSON, parseJsonEventStream, parseProviderOptions, postFormDataToApi, postJsonToApi, postToApi, readResponseWithSizeLimit, removeUndefinedEntries, resolve, safeParseJSON, safeValidateTypes, stripFileExtension, tool, validateDownloadUrl, validateTypes, withUserAgentSuffix, withoutTrailingSlash, zodSchema };
|
|
1472
|
+
export { type AssistantContent, type AssistantModelMessage, type CustomPart, DEFAULT_MAX_DOWNLOAD_SIZE, type DataContent, DelayedPromise, DownloadError, type FetchFunction, type FilePart, type FlexibleSchema, type IdGenerator, type ImagePart, type InferSchema, type InferToolInput, type InferToolOutput, type LazySchema, type MaybePromiseLike, type ModelMessage, type ParseResult, type ProviderOptions, type ProviderToolFactory, type ProviderToolFactoryWithOutputSchema, type ReasoningFilePart, type ReasoningPart, type Resolvable, type ResponseHandler, type Schema, type SystemModelMessage, type TextPart, type Tool, type ToolApprovalRequest, type ToolApprovalResponse, type ToolCall, type ToolCallOptions, type ToolCallPart, type ToolContent, type ToolExecuteFunction, type ToolExecutionOptions, type ToolModelMessage, type ToolNameMapping, type ToolNeedsApprovalFunction, type ToolResult, type ToolResultOutput, type ToolResultPart, type UserContent, type UserModelMessage, VERSION, type ValidationResult, asSchema, combineHeaders, convertAsyncIteratorToReadableStream, convertBase64ToUint8Array, convertImageModelFileToDataUri, convertToBase64, convertToFormData, convertUint8ArrayToBase64, createBinaryResponseHandler, createEventSourceResponseHandler, createIdGenerator, createJsonErrorResponseHandler, createJsonResponseHandler, createProviderToolFactory, createProviderToolFactoryWithOutputSchema, createStatusCodeErrorResponseHandler, createToolNameMapping, delay, downloadBlob, dynamicTool, executeTool, extractResponseHeaders, generateId, getErrorMessage, getFromApi, getRuntimeEnvironmentUserAgent, injectJsonInstructionIntoMessages, isAbortError, isNonNullable, isParsableJson, isUrlSupported, jsonSchema, lazySchema, loadApiKey, loadOptionalSetting, loadSetting, mediaTypeToExtension, normalizeHeaders, parseJSON, parseJsonEventStream, parseProviderOptions, postFormDataToApi, postJsonToApi, postToApi, readResponseWithSizeLimit, removeUndefinedEntries, resolve, safeParseJSON, safeValidateTypes, stripFileExtension, tool, validateDownloadUrl, validateTypes, withUserAgentSuffix, withoutTrailingSlash, zodSchema };
|
package/dist/index.js
CHANGED
|
@@ -670,7 +670,7 @@ function withUserAgentSuffix(headers, ...userAgentSuffixParts) {
|
|
|
670
670
|
}
|
|
671
671
|
|
|
672
672
|
// src/version.ts
|
|
673
|
-
var VERSION = true ? "5.0.0-beta.
|
|
673
|
+
var VERSION = true ? "5.0.0-beta.5" : "0.0.0-test";
|
|
674
674
|
|
|
675
675
|
// src/get-from-api.ts
|
|
676
676
|
var getOriginalFetch = () => globalThis.fetch;
|
package/dist/index.mjs
CHANGED
|
@@ -574,7 +574,7 @@ function withUserAgentSuffix(headers, ...userAgentSuffixParts) {
|
|
|
574
574
|
}
|
|
575
575
|
|
|
576
576
|
// src/version.ts
|
|
577
|
-
var VERSION = true ? "5.0.0-beta.
|
|
577
|
+
var VERSION = true ? "5.0.0-beta.5" : "0.0.0-test";
|
|
578
578
|
|
|
579
579
|
// src/get-from-api.ts
|
|
580
580
|
var getOriginalFetch = () => globalThis.fetch;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-sdk/provider-utils",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.5",
|
|
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.
|
|
38
|
+
"@ai-sdk/provider": "4.0.0-beta.3"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@types/node": "20.17.24",
|
|
@@ -103,6 +103,26 @@ export interface ReasoningPart {
|
|
|
103
103
|
providerOptions?: ProviderOptions;
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
+
/**
|
|
107
|
+
* Custom content part of a prompt. It contains no standardized payload beyond
|
|
108
|
+
* provider-specific options.
|
|
109
|
+
*/
|
|
110
|
+
export interface CustomPart {
|
|
111
|
+
type: 'custom';
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* The kind of custom content, in the format `{provider}-{provider-type}`.
|
|
115
|
+
*/
|
|
116
|
+
kind: string;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Additional provider-specific metadata. They are passed through
|
|
120
|
+
* to the provider from the AI SDK and enable provider-specific
|
|
121
|
+
* functionality that can be fully encapsulated in the provider.
|
|
122
|
+
*/
|
|
123
|
+
providerOptions?: ProviderOptions;
|
|
124
|
+
}
|
|
125
|
+
|
|
106
126
|
/**
|
|
107
127
|
* Reasoning file content part of a prompt. It contains a file generated as part of reasoning.
|
|
108
128
|
*/
|