@ai-sdk/provider-utils 4.0.0-beta.19 → 4.0.0-beta.20
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 +4 -2
 - package/dist/index.d.ts +4 -2
 - 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/CHANGELOG.md
    CHANGED
    
    
    
        package/dist/index.d.mts
    CHANGED
    
    | 
         @@ -293,6 +293,8 @@ declare function loadSetting({ settingValue, environmentVariableName, settingNam 
     | 
|
| 
       293 
293 
     | 
    
         
             
                description: string;
         
     | 
| 
       294 
294 
     | 
    
         
             
            }): string;
         
     | 
| 
       295 
295 
     | 
    
         | 
| 
      
 296 
     | 
    
         
            +
            type MaybePromiseLike<T> = T | PromiseLike<T>;
         
     | 
| 
      
 297 
     | 
    
         
            +
             
     | 
| 
       296 
298 
     | 
    
         
             
            /**
         
     | 
| 
       297 
299 
     | 
    
         
             
             * Maps a media type to its corresponding file extension.
         
     | 
| 
       298 
300 
     | 
    
         
             
             * It was originally introduced to set a filename for audio file uploads
         
     | 
| 
         @@ -1008,7 +1010,7 @@ declare function createProviderDefinedToolFactoryWithOutputSchema<INPUT, OUTPUT, 
     | 
|
| 
       1008 
1010 
     | 
    
         
             
             */
         
     | 
| 
       1009 
1011 
     | 
    
         
             
            declare function removeUndefinedEntries<T>(record: Record<string, T | undefined>): Record<string, T>;
         
     | 
| 
       1010 
1012 
     | 
    
         | 
| 
       1011 
     | 
    
         
            -
            type Resolvable<T> =  
     | 
| 
      
 1013 
     | 
    
         
            +
            type Resolvable<T> = MaybePromiseLike<T> | (() => MaybePromiseLike<T>);
         
     | 
| 
       1012 
1014 
     | 
    
         
             
            /**
         
     | 
| 
       1013 
1015 
     | 
    
         
             
             * Resolves a value that could be a raw value, a Promise, a function returning a value,
         
     | 
| 
       1014 
1016 
     | 
    
         
             
             * or a function returning a Promise.
         
     | 
| 
         @@ -1141,4 +1143,4 @@ interface ToolResult<NAME extends string, INPUT, OUTPUT> { 
     | 
|
| 
       1141 
1143 
     | 
    
         
             
                dynamic?: boolean;
         
     | 
| 
       1142 
1144 
     | 
    
         
             
            }
         
     | 
| 
       1143 
1145 
     | 
    
         | 
| 
       1144 
     | 
    
         
            -
            export { type AssistantContent, type AssistantModelMessage, type DataContent, type FetchFunction, type FilePart, type FlexibleSchema, type IdGenerator, type ImagePart, type InferSchema, type InferToolInput, type InferToolOutput, type LazySchema, type ModelMessage, type ParseResult, type ProviderDefinedToolFactory, type ProviderDefinedToolFactoryWithOutputSchema, type ProviderOptions, 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 ToolModelMessage, type ToolNeedsApprovalFunction, type ToolResult, type ToolResultOutput, type ToolResultPart, type UserContent, type UserModelMessage, VERSION, type ValidationResult, asSchema, combineHeaders, convertAsyncIteratorToReadableStream, convertBase64ToUint8Array, convertToBase64, convertUint8ArrayToBase64, createBinaryResponseHandler, createEventSourceResponseHandler, createIdGenerator, createJsonErrorResponseHandler, createJsonResponseHandler, createJsonStreamResponseHandler, createProviderDefinedToolFactory, createProviderDefinedToolFactoryWithOutputSchema, createStatusCodeErrorResponseHandler, delay, dynamicTool, executeTool, extractResponseHeaders, generateId, getErrorMessage, getFromApi, getRuntimeEnvironmentUserAgent, injectJsonInstructionIntoMessages, isAbortError, isNonNullable, isParsableJson, isUrlSupported, jsonSchema, lazySchema, loadApiKey, loadOptionalSetting, loadSetting, mediaTypeToExtension, parseJSON, parseJsonEventStream, parseProviderOptions, postFormDataToApi, postJsonToApi, postToApi, removeUndefinedEntries, resolve, safeParseJSON, safeValidateTypes, tool, validateTypes, withUserAgentSuffix, withoutTrailingSlash, zodSchema };
         
     | 
| 
      
 1146 
     | 
    
         
            +
            export { type AssistantContent, type AssistantModelMessage, type DataContent, 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 ProviderDefinedToolFactory, type ProviderDefinedToolFactoryWithOutputSchema, type ProviderOptions, 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 ToolModelMessage, type ToolNeedsApprovalFunction, type ToolResult, type ToolResultOutput, type ToolResultPart, type UserContent, type UserModelMessage, VERSION, type ValidationResult, asSchema, combineHeaders, convertAsyncIteratorToReadableStream, convertBase64ToUint8Array, convertToBase64, convertUint8ArrayToBase64, createBinaryResponseHandler, createEventSourceResponseHandler, createIdGenerator, createJsonErrorResponseHandler, createJsonResponseHandler, createJsonStreamResponseHandler, createProviderDefinedToolFactory, createProviderDefinedToolFactoryWithOutputSchema, createStatusCodeErrorResponseHandler, delay, dynamicTool, executeTool, extractResponseHeaders, generateId, getErrorMessage, getFromApi, getRuntimeEnvironmentUserAgent, injectJsonInstructionIntoMessages, isAbortError, isNonNullable, isParsableJson, isUrlSupported, jsonSchema, lazySchema, loadApiKey, loadOptionalSetting, loadSetting, mediaTypeToExtension, parseJSON, parseJsonEventStream, parseProviderOptions, postFormDataToApi, postJsonToApi, postToApi, removeUndefinedEntries, resolve, safeParseJSON, safeValidateTypes, tool, validateTypes, withUserAgentSuffix, withoutTrailingSlash, zodSchema };
         
     | 
    
        package/dist/index.d.ts
    CHANGED
    
    | 
         @@ -293,6 +293,8 @@ declare function loadSetting({ settingValue, environmentVariableName, settingNam 
     | 
|
| 
       293 
293 
     | 
    
         
             
                description: string;
         
     | 
| 
       294 
294 
     | 
    
         
             
            }): string;
         
     | 
| 
       295 
295 
     | 
    
         | 
| 
      
 296 
     | 
    
         
            +
            type MaybePromiseLike<T> = T | PromiseLike<T>;
         
     | 
| 
      
 297 
     | 
    
         
            +
             
     | 
| 
       296 
298 
     | 
    
         
             
            /**
         
     | 
| 
       297 
299 
     | 
    
         
             
             * Maps a media type to its corresponding file extension.
         
     | 
| 
       298 
300 
     | 
    
         
             
             * It was originally introduced to set a filename for audio file uploads
         
     | 
| 
         @@ -1008,7 +1010,7 @@ declare function createProviderDefinedToolFactoryWithOutputSchema<INPUT, OUTPUT, 
     | 
|
| 
       1008 
1010 
     | 
    
         
             
             */
         
     | 
| 
       1009 
1011 
     | 
    
         
             
            declare function removeUndefinedEntries<T>(record: Record<string, T | undefined>): Record<string, T>;
         
     | 
| 
       1010 
1012 
     | 
    
         | 
| 
       1011 
     | 
    
         
            -
            type Resolvable<T> =  
     | 
| 
      
 1013 
     | 
    
         
            +
            type Resolvable<T> = MaybePromiseLike<T> | (() => MaybePromiseLike<T>);
         
     | 
| 
       1012 
1014 
     | 
    
         
             
            /**
         
     | 
| 
       1013 
1015 
     | 
    
         
             
             * Resolves a value that could be a raw value, a Promise, a function returning a value,
         
     | 
| 
       1014 
1016 
     | 
    
         
             
             * or a function returning a Promise.
         
     | 
| 
         @@ -1141,4 +1143,4 @@ interface ToolResult<NAME extends string, INPUT, OUTPUT> { 
     | 
|
| 
       1141 
1143 
     | 
    
         
             
                dynamic?: boolean;
         
     | 
| 
       1142 
1144 
     | 
    
         
             
            }
         
     | 
| 
       1143 
1145 
     | 
    
         | 
| 
       1144 
     | 
    
         
            -
            export { type AssistantContent, type AssistantModelMessage, type DataContent, type FetchFunction, type FilePart, type FlexibleSchema, type IdGenerator, type ImagePart, type InferSchema, type InferToolInput, type InferToolOutput, type LazySchema, type ModelMessage, type ParseResult, type ProviderDefinedToolFactory, type ProviderDefinedToolFactoryWithOutputSchema, type ProviderOptions, 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 ToolModelMessage, type ToolNeedsApprovalFunction, type ToolResult, type ToolResultOutput, type ToolResultPart, type UserContent, type UserModelMessage, VERSION, type ValidationResult, asSchema, combineHeaders, convertAsyncIteratorToReadableStream, convertBase64ToUint8Array, convertToBase64, convertUint8ArrayToBase64, createBinaryResponseHandler, createEventSourceResponseHandler, createIdGenerator, createJsonErrorResponseHandler, createJsonResponseHandler, createJsonStreamResponseHandler, createProviderDefinedToolFactory, createProviderDefinedToolFactoryWithOutputSchema, createStatusCodeErrorResponseHandler, delay, dynamicTool, executeTool, extractResponseHeaders, generateId, getErrorMessage, getFromApi, getRuntimeEnvironmentUserAgent, injectJsonInstructionIntoMessages, isAbortError, isNonNullable, isParsableJson, isUrlSupported, jsonSchema, lazySchema, loadApiKey, loadOptionalSetting, loadSetting, mediaTypeToExtension, parseJSON, parseJsonEventStream, parseProviderOptions, postFormDataToApi, postJsonToApi, postToApi, removeUndefinedEntries, resolve, safeParseJSON, safeValidateTypes, tool, validateTypes, withUserAgentSuffix, withoutTrailingSlash, zodSchema };
         
     | 
| 
      
 1146 
     | 
    
         
            +
            export { type AssistantContent, type AssistantModelMessage, type DataContent, 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 ProviderDefinedToolFactory, type ProviderDefinedToolFactoryWithOutputSchema, type ProviderOptions, 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 ToolModelMessage, type ToolNeedsApprovalFunction, type ToolResult, type ToolResultOutput, type ToolResultPart, type UserContent, type UserModelMessage, VERSION, type ValidationResult, asSchema, combineHeaders, convertAsyncIteratorToReadableStream, convertBase64ToUint8Array, convertToBase64, convertUint8ArrayToBase64, createBinaryResponseHandler, createEventSourceResponseHandler, createIdGenerator, createJsonErrorResponseHandler, createJsonResponseHandler, createJsonStreamResponseHandler, createProviderDefinedToolFactory, createProviderDefinedToolFactoryWithOutputSchema, createStatusCodeErrorResponseHandler, delay, dynamicTool, executeTool, extractResponseHeaders, generateId, getErrorMessage, getFromApi, getRuntimeEnvironmentUserAgent, injectJsonInstructionIntoMessages, isAbortError, isNonNullable, isParsableJson, isUrlSupported, jsonSchema, lazySchema, loadApiKey, loadOptionalSetting, loadSetting, mediaTypeToExtension, parseJSON, parseJsonEventStream, parseProviderOptions, postFormDataToApi, postJsonToApi, postToApi, removeUndefinedEntries, resolve, safeParseJSON, safeValidateTypes, tool, validateTypes, withUserAgentSuffix, withoutTrailingSlash, zodSchema };
         
     | 
    
        package/dist/index.js
    CHANGED
    
    | 
         @@ -281,7 +281,7 @@ function withUserAgentSuffix(headers, ...userAgentSuffixParts) { 
     | 
|
| 
       281 
281 
     | 
    
         
             
            }
         
     | 
| 
       282 
282 
     | 
    
         | 
| 
       283 
283 
     | 
    
         
             
            // src/version.ts
         
     | 
| 
       284 
     | 
    
         
            -
            var VERSION = true ? "4.0.0-beta. 
     | 
| 
      
 284 
     | 
    
         
            +
            var VERSION = true ? "4.0.0-beta.20" : "0.0.0-test";
         
     | 
| 
       285 
285 
     | 
    
         | 
| 
       286 
286 
     | 
    
         
             
            // src/get-from-api.ts
         
     | 
| 
       287 
287 
     | 
    
         
             
            var getOriginalFetch = () => globalThis.fetch;
         
     |