@ai-sdk/provider-utils
Advanced tools
+8
-0
| # @ai-sdk/provider-utils | ||
| ## 5.0.0-beta.3 | ||
| ### Patch Changes | ||
| - f7d4f01: feat(provider): add support for `reasoning-file` type for files that are part of reasoning | ||
| - Updated dependencies [f7d4f01] | ||
| - @ai-sdk/provider@4.0.0-beta.2 | ||
| ## 5.0.0-beta.2 | ||
@@ -4,0 +12,0 @@ |
+27
-2
@@ -641,2 +641,27 @@ import { LanguageModelV3FunctionTool, LanguageModelV3ProviderTool, ImageModelV3File, AISDKError, JSONSchema7, JSONParseError, TypeValidationError, JSONValue, APICallError, LanguageModelV3Prompt, SharedV3ProviderOptions, TypeValidationContext } from '@ai-sdk/provider'; | ||
| /** | ||
| * Reasoning file content part of a prompt. It contains a file generated as part of reasoning. | ||
| */ | ||
| interface ReasoningFilePart { | ||
| type: 'reasoning-file'; | ||
| /** | ||
| * File data. Can either be: | ||
| * | ||
| * - data: a base64-encoded string, a Uint8Array, an ArrayBuffer, or a Buffer | ||
| * - URL: a URL that points to the file | ||
| */ | ||
| data: DataContent | URL; | ||
| /** | ||
| * IANA media type of the file. | ||
| * | ||
| * @see https://www.iana.org/assignments/media-types/media-types.xhtml | ||
| */ | ||
| mediaType: string; | ||
| /** | ||
| * Additional provider-specific metadata. They are passed through | ||
| * to the provider from the AI SDK and enable provider-specific | ||
| * functionality that can be fully encapsulated in the provider. | ||
| */ | ||
| providerOptions?: ProviderOptions; | ||
| } | ||
| /** | ||
| * Tool call content part of a prompt. It contains a tool call (usually generated by the AI model). | ||
@@ -897,3 +922,3 @@ */ | ||
| */ | ||
| type AssistantContent = string | Array<TextPart | FilePart | ReasoningPart | ToolCallPart | ToolResultPart | ToolApprovalRequest>; | ||
| type AssistantContent = string | Array<TextPart | FilePart | ReasoningPart | ReasoningFilePart | ToolCallPart | ToolResultPart | ToolApprovalRequest>; | ||
@@ -1435,2 +1460,2 @@ /** | ||
| 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 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 }; | ||
| 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 }; |
+27
-2
@@ -641,2 +641,27 @@ import { LanguageModelV3FunctionTool, LanguageModelV3ProviderTool, ImageModelV3File, AISDKError, JSONSchema7, JSONParseError, TypeValidationError, JSONValue, APICallError, LanguageModelV3Prompt, SharedV3ProviderOptions, TypeValidationContext } from '@ai-sdk/provider'; | ||
| /** | ||
| * Reasoning file content part of a prompt. It contains a file generated as part of reasoning. | ||
| */ | ||
| interface ReasoningFilePart { | ||
| type: 'reasoning-file'; | ||
| /** | ||
| * File data. Can either be: | ||
| * | ||
| * - data: a base64-encoded string, a Uint8Array, an ArrayBuffer, or a Buffer | ||
| * - URL: a URL that points to the file | ||
| */ | ||
| data: DataContent | URL; | ||
| /** | ||
| * IANA media type of the file. | ||
| * | ||
| * @see https://www.iana.org/assignments/media-types/media-types.xhtml | ||
| */ | ||
| mediaType: string; | ||
| /** | ||
| * Additional provider-specific metadata. They are passed through | ||
| * to the provider from the AI SDK and enable provider-specific | ||
| * functionality that can be fully encapsulated in the provider. | ||
| */ | ||
| providerOptions?: ProviderOptions; | ||
| } | ||
| /** | ||
| * Tool call content part of a prompt. It contains a tool call (usually generated by the AI model). | ||
@@ -897,3 +922,3 @@ */ | ||
| */ | ||
| type AssistantContent = string | Array<TextPart | FilePart | ReasoningPart | ToolCallPart | ToolResultPart | ToolApprovalRequest>; | ||
| type AssistantContent = string | Array<TextPart | FilePart | ReasoningPart | ReasoningFilePart | ToolCallPart | ToolResultPart | ToolApprovalRequest>; | ||
@@ -1435,2 +1460,2 @@ /** | ||
| 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 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 }; | ||
| 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 }; |
+2
-2
| { | ||
| "name": "@ai-sdk/provider-utils", | ||
| "version": "5.0.0-beta.2", | ||
| "version": "5.0.0-beta.3", | ||
| "license": "Apache-2.0", | ||
@@ -38,3 +38,3 @@ "sideEffects": false, | ||
| "eventsource-parser": "^3.0.6", | ||
| "@ai-sdk/provider": "4.0.0-beta.1" | ||
| "@ai-sdk/provider": "4.0.0-beta.2" | ||
| }, | ||
@@ -41,0 +41,0 @@ "devDependencies": { |
| import { | ||
| FilePart, | ||
| ReasoningFilePart, | ||
| ReasoningPart, | ||
@@ -36,2 +37,3 @@ TextPart, | ||
| | ReasoningPart | ||
| | ReasoningFilePart | ||
| | ToolCallPart | ||
@@ -38,0 +40,0 @@ | ToolResultPart |
@@ -107,2 +107,31 @@ import { JSONValue } from '@ai-sdk/provider'; | ||
| /** | ||
| * Reasoning file content part of a prompt. It contains a file generated as part of reasoning. | ||
| */ | ||
| export interface ReasoningFilePart { | ||
| type: 'reasoning-file'; | ||
| /** | ||
| * File data. Can either be: | ||
| * | ||
| * - data: a base64-encoded string, a Uint8Array, an ArrayBuffer, or a Buffer | ||
| * - URL: a URL that points to the file | ||
| */ | ||
| data: DataContent | URL; | ||
| /** | ||
| * IANA media type of the file. | ||
| * | ||
| * @see https://www.iana.org/assignments/media-types/media-types.xhtml | ||
| */ | ||
| mediaType: string; | ||
| /** | ||
| * Additional provider-specific metadata. They are passed through | ||
| * to the provider from the AI SDK and enable provider-specific | ||
| * functionality that can be fully encapsulated in the provider. | ||
| */ | ||
| providerOptions?: ProviderOptions; | ||
| } | ||
| /** | ||
| * Tool call content part of a prompt. It contains a tool call (usually generated by the AI model). | ||
@@ -109,0 +138,0 @@ */ |
@@ -8,2 +8,3 @@ export type { | ||
| ImagePart, | ||
| ReasoningFilePart, | ||
| ReasoningPart, | ||
@@ -10,0 +11,0 @@ TextPart, |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
869204
0.31%12102
0.44%+ Added
- Removed