ai 6.0.0-beta.68 → 6.0.0-beta.70
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 +12 -0
 - package/dist/index.d.mts +47 -12
 - package/dist/index.d.ts +47 -12
 - package/dist/index.js +220 -39
 - package/dist/index.js.map +1 -1
 - package/dist/index.mjs +202 -19
 - package/dist/index.mjs.map +1 -1
 - package/dist/internal/index.js +1 -1
 - package/dist/internal/index.mjs +1 -1
 - package/package.json +1 -1
 
    
        package/CHANGELOG.md
    CHANGED
    
    
    
        package/dist/index.d.mts
    CHANGED
    
    | 
         @@ -657,11 +657,6 @@ type PartialObject<ObjectType extends object> = { 
     | 
|
| 
       657 
657 
     | 
    
         
             
            interface Output<OUTPUT = any, PARTIAL = any> {
         
     | 
| 
       658 
658 
     | 
    
         
             
                readonly type: 'object' | 'text';
         
     | 
| 
       659 
659 
     | 
    
         
             
                responseFormat: PromiseLike<LanguageModelV3CallOptions['responseFormat']>;
         
     | 
| 
       660 
     | 
    
         
            -
                parsePartial(options: {
         
     | 
| 
       661 
     | 
    
         
            -
                    text: string;
         
     | 
| 
       662 
     | 
    
         
            -
                }): Promise<{
         
     | 
| 
       663 
     | 
    
         
            -
                    partial: PARTIAL;
         
     | 
| 
       664 
     | 
    
         
            -
                } | undefined>;
         
     | 
| 
       665 
660 
     | 
    
         
             
                parseOutput(options: {
         
     | 
| 
       666 
661 
     | 
    
         
             
                    text: string;
         
     | 
| 
       667 
662 
     | 
    
         
             
                }, context: {
         
     | 
| 
         @@ -669,29 +664,69 @@ interface Output<OUTPUT = any, PARTIAL = any> { 
     | 
|
| 
       669 
664 
     | 
    
         
             
                    usage: LanguageModelUsage;
         
     | 
| 
       670 
665 
     | 
    
         
             
                    finishReason: FinishReason;
         
     | 
| 
       671 
666 
     | 
    
         
             
                }): Promise<OUTPUT>;
         
     | 
| 
      
 667 
     | 
    
         
            +
                parsePartial(options: {
         
     | 
| 
      
 668 
     | 
    
         
            +
                    text: string;
         
     | 
| 
      
 669 
     | 
    
         
            +
                }): Promise<{
         
     | 
| 
      
 670 
     | 
    
         
            +
                    partial: PARTIAL;
         
     | 
| 
      
 671 
     | 
    
         
            +
                } | undefined>;
         
     | 
| 
       672 
672 
     | 
    
         
             
            }
         
     | 
| 
      
 673 
     | 
    
         
            +
            /**
         
     | 
| 
      
 674 
     | 
    
         
            +
             * Output specification for text generation.
         
     | 
| 
      
 675 
     | 
    
         
            +
             * This is the default output mode that generates plain text.
         
     | 
| 
      
 676 
     | 
    
         
            +
             *
         
     | 
| 
      
 677 
     | 
    
         
            +
             * @returns An output specification for generating text.
         
     | 
| 
      
 678 
     | 
    
         
            +
             */
         
     | 
| 
       673 
679 
     | 
    
         
             
            declare const text: () => Output<string, string>;
         
     | 
| 
      
 680 
     | 
    
         
            +
            /**
         
     | 
| 
      
 681 
     | 
    
         
            +
             * Output specification for typed object generation using schemas.
         
     | 
| 
      
 682 
     | 
    
         
            +
             * When the model generates a text response, it will return an object that matches the schema.
         
     | 
| 
      
 683 
     | 
    
         
            +
             *
         
     | 
| 
      
 684 
     | 
    
         
            +
             * @param schema - The schema of the object to generate.
         
     | 
| 
      
 685 
     | 
    
         
            +
             *
         
     | 
| 
      
 686 
     | 
    
         
            +
             * @returns An output specification for generating objects with the specified schema.
         
     | 
| 
      
 687 
     | 
    
         
            +
             */
         
     | 
| 
       674 
688 
     | 
    
         
             
            declare const object: <OUTPUT>({ schema: inputSchema, }: {
         
     | 
| 
       675 
689 
     | 
    
         
             
                schema: FlexibleSchema<OUTPUT>;
         
     | 
| 
       676 
690 
     | 
    
         
             
            }) => Output<OUTPUT, DeepPartial<OUTPUT>>;
         
     | 
| 
       677 
     | 
    
         
            -
             
     | 
| 
       678 
     | 
    
         
            -
             
     | 
| 
      
 691 
     | 
    
         
            +
            /**
         
     | 
| 
      
 692 
     | 
    
         
            +
             * Array output specification for text generation.
         
     | 
| 
      
 693 
     | 
    
         
            +
             * When the model generates a text response, it will return an array of elements.
         
     | 
| 
      
 694 
     | 
    
         
            +
             *
         
     | 
| 
      
 695 
     | 
    
         
            +
             * @param element - The schema of the element to generate.
         
     | 
| 
      
 696 
     | 
    
         
            +
             * @returns An output specification for generating an array of elements.
         
     | 
| 
      
 697 
     | 
    
         
            +
             */
         
     | 
| 
      
 698 
     | 
    
         
            +
            declare const array: <ELEMENT>({ element: inputElementSchema, }: {
         
     | 
| 
      
 699 
     | 
    
         
            +
                element: FlexibleSchema<ELEMENT>;
         
     | 
| 
      
 700 
     | 
    
         
            +
            }) => Output<Array<ELEMENT>, Array<ELEMENT>>;
         
     | 
| 
      
 701 
     | 
    
         
            +
            /**
         
     | 
| 
      
 702 
     | 
    
         
            +
             * Choice output specification for text generation.
         
     | 
| 
      
 703 
     | 
    
         
            +
             * When the model generates a text response, it will return a one of the choice options.
         
     | 
| 
      
 704 
     | 
    
         
            +
             *
         
     | 
| 
      
 705 
     | 
    
         
            +
             * @param options - The options to choose from.
         
     | 
| 
      
 706 
     | 
    
         
            +
             * @returns An output specification for generating a choice.
         
     | 
| 
      
 707 
     | 
    
         
            +
             */
         
     | 
| 
      
 708 
     | 
    
         
            +
            declare const choice: <ELEMENT extends string>({ options: choiceOptions, }: {
         
     | 
| 
      
 709 
     | 
    
         
            +
                options: Array<ELEMENT>;
         
     | 
| 
      
 710 
     | 
    
         
            +
            }) => Output<ELEMENT, ELEMENT>;
         
     | 
| 
       679 
711 
     | 
    
         | 
| 
       680 
     | 
    
         
            -
            type output_InferGenerateOutput<OUTPUT extends Output> = InferGenerateOutput<OUTPUT>;
         
     | 
| 
       681 
     | 
    
         
            -
            type output_InferStreamOutput<OUTPUT extends Output> = InferStreamOutput<OUTPUT>;
         
     | 
| 
       682 
712 
     | 
    
         
             
            type output_Output<OUTPUT = any, PARTIAL = any> = Output<OUTPUT, PARTIAL>;
         
     | 
| 
      
 713 
     | 
    
         
            +
            declare const output_array: typeof array;
         
     | 
| 
      
 714 
     | 
    
         
            +
            declare const output_choice: typeof choice;
         
     | 
| 
       683 
715 
     | 
    
         
             
            declare const output_object: typeof object;
         
     | 
| 
       684 
716 
     | 
    
         
             
            declare const output_text: typeof text;
         
     | 
| 
       685 
717 
     | 
    
         
             
            declare namespace output {
         
     | 
| 
       686 
718 
     | 
    
         
             
              export {
         
     | 
| 
       687 
     | 
    
         
            -
                output_InferGenerateOutput as InferGenerateOutput,
         
     | 
| 
       688 
     | 
    
         
            -
                output_InferStreamOutput as InferStreamOutput,
         
     | 
| 
       689 
719 
     | 
    
         
             
                output_Output as Output,
         
     | 
| 
      
 720 
     | 
    
         
            +
                output_array as array,
         
     | 
| 
      
 721 
     | 
    
         
            +
                output_choice as choice,
         
     | 
| 
       690 
722 
     | 
    
         
             
                output_object as object,
         
     | 
| 
       691 
723 
     | 
    
         
             
                output_text as text,
         
     | 
| 
       692 
724 
     | 
    
         
             
              };
         
     | 
| 
       693 
725 
     | 
    
         
             
            }
         
     | 
| 
       694 
726 
     | 
    
         | 
| 
      
 727 
     | 
    
         
            +
            type InferGenerateOutput<OUTPUT extends Output> = OUTPUT extends Output<infer T, any> ? T : never;
         
     | 
| 
      
 728 
     | 
    
         
            +
            type InferStreamOutput<OUTPUT extends Output> = OUTPUT extends Output<any, infer P> ? P : never;
         
     | 
| 
      
 729 
     | 
    
         
            +
             
     | 
| 
       695 
730 
     | 
    
         
             
            type CallSettings = {
         
     | 
| 
       696 
731 
     | 
    
         
             
                /**
         
     | 
| 
       697 
732 
     | 
    
         
             
              Maximum number of tokens to generate.
         
     | 
| 
         @@ -5004,4 +5039,4 @@ declare global { 
     | 
|
| 
       5004 
5039 
     | 
    
         
             
                var AI_SDK_LOG_WARNINGS: LogWarningsFunction | undefined | false;
         
     | 
| 
       5005 
5040 
     | 
    
         
             
            }
         
     | 
| 
       5006 
5041 
     | 
    
         | 
| 
       5007 
     | 
    
         
            -
            export { AbstractChat, Agent, AsyncIterableStream, CallSettings, CallWarning, ChatAddToolApproveResponseFunction, ChatInit, ChatOnDataCallback, ChatOnErrorCallback, ChatOnFinishCallback, ChatOnToolCallCallback, ChatRequestOptions, ChatState, ChatStatus, ChatTransport, ChunkDetector, CompletionRequestOptions, CoreAssistantMessage, CoreMessage, CoreSystemMessage, CoreToolMessage, CoreUserMessage, CreateUIMessage, DataUIPart, DeepPartial, DefaultChatTransport, DownloadError, DynamicToolCall, DynamicToolError, DynamicToolResult, DynamicToolUIPart, EmbedManyResult, EmbedResult, Embedding, EmbeddingModel, EmbeddingModelUsage, ErrorHandler, ToolLoopAgent as Experimental_Agent, ToolLoopAgentSettings as Experimental_AgentSettings, DownloadFunction as Experimental_DownloadFunction, GenerateImageResult as Experimental_GenerateImageResult, GeneratedFile as Experimental_GeneratedImage, InferAgentUIMessage as Experimental_InferAgentUIMessage, LogWarningsFunction as Experimental_LogWarningsFunction, SpeechResult as Experimental_SpeechResult, TranscriptionResult as Experimental_TranscriptionResult, Warning as Experimental_Warning, FileUIPart, FinishReason, GenerateObjectResult, GenerateTextOnFinishCallback, GenerateTextOnStepFinishCallback, GenerateTextResult, GeneratedAudioFile, GeneratedFile, HttpChatTransport, HttpChatTransportInitOptions, ImageModel, ImageGenerationWarning as ImageModelCallWarning, ImageModelProviderMetadata, ImageModelResponseMetadata, InferAgentUIMessage, InferUIDataParts, InferUIMessageChunk, InferUITool, InferUITools, InvalidArgumentError, InvalidDataContentError, InvalidMessageRoleError, InvalidStreamPartError, InvalidToolInputError, JSONRPCError, JSONRPCMessage, JSONRPCNotification, JSONRPCRequest, JSONRPCResponse, JSONValue, JsonToSseTransformStream, LanguageModel, LanguageModelMiddleware, LanguageModelRequestMetadata, LanguageModelResponseMetadata, LanguageModelUsage, MCPClientError, MCPTransport, MessageConversionError, NoImageGeneratedError, NoObjectGeneratedError, NoOutputGeneratedError, NoOutputSpecifiedError, NoSpeechGeneratedError, NoSuchProviderError, NoSuchToolError, ObjectStreamPart, output as Output, PrepareReconnectToStreamRequest, PrepareSendMessagesRequest, PrepareStepFunction, PrepareStepResult, Prompt, Provider, ProviderMetadata, ProviderRegistryProvider, ReasoningOutput, ReasoningUIPart, RepairTextFunction, RetryError, SafeValidateUIMessagesResult, SerialJobExecutor, SourceDocumentUIPart, SourceUrlUIPart, SpeechModel, SpeechModelResponseMetadata, SpeechWarning, StaticToolCall, StaticToolError, StaticToolOutputDenied, StaticToolResult, StepResult, StepStartUIPart, StopCondition, StreamObjectOnFinishCallback, StreamObjectResult, StreamTextOnChunkCallback, StreamTextOnErrorCallback, StreamTextOnFinishCallback, StreamTextOnStepFinishCallback, StreamTextResult, StreamTextTransform, TelemetrySettings, TextStreamChatTransport, TextStreamPart, TextUIPart, ToolApprovalRequestOutput, ToolCallRepairError, ToolCallRepairFunction, ToolChoice, ToolLoopAgent, ToolLoopAgentOnFinishCallback, ToolLoopAgentOnStepFinishCallback, ToolLoopAgentSettings, ToolSet, ToolUIPart, TranscriptionModel, TranscriptionModelResponseMetadata, TranscriptionWarning, TypedToolCall, TypedToolError, TypedToolOutputDenied, TypedToolResult, UIDataPartSchemas, UIDataTypes, UIMessage, UIMessageChunk, UIMessagePart, UIMessageStreamOnFinishCallback, UIMessageStreamOptions, UIMessageStreamWriter, UITool, UIToolInvocation, UITools, UI_MESSAGE_STREAM_HEADERS, UnsupportedModelVersionError, UseCompletionOptions, assistantModelMessageSchema, callCompletionApi, consumeStream, convertFileListToFileUIParts, convertToCoreMessages, convertToModelMessages, coreAssistantMessageSchema, coreMessageSchema, coreSystemMessageSchema, coreToolMessageSchema, coreUserMessageSchema, cosineSimilarity, createAgentUIStream, createAgentUIStreamResponse, createProviderRegistry, createTextStreamResponse, createUIMessageStream, createUIMessageStreamResponse, customProvider, defaultSettingsMiddleware, embed, embedMany, MCPClient as experimental_MCPClient, MCPClientConfig as experimental_MCPClientConfig, createMCPClient as experimental_createMCPClient, experimental_createProviderRegistry, experimental_customProvider, generateImage as experimental_generateImage, generateSpeech as experimental_generateSpeech, transcribe as experimental_transcribe, extractReasoningMiddleware, generateObject, generateText, getTextFromDataUrl, getToolName, getToolOrDynamicToolName, hasToolCall, isDataUIPart, isDeepEqualData, isFileUIPart, isReasoningUIPart, isTextUIPart, isToolOrDynamicToolUIPart, isToolUIPart, lastAssistantMessageIsCompleteWithApprovalResponses, lastAssistantMessageIsCompleteWithToolCalls, modelMessageSchema, parsePartialJson, pipeAgentUIStreamToResponse, pipeTextStreamToResponse, pipeUIMessageStreamToResponse, pruneMessages, readUIMessageStream, safeValidateUIMessages, simulateReadableStream, simulateStreamingMiddleware, smoothStream, stepCountIs, streamObject, streamText, systemModelMessageSchema, toolModelMessageSchema, uiMessageChunkSchema, userModelMessageSchema, validateUIMessages, wrapLanguageModel, wrapProvider };
         
     | 
| 
      
 5042 
     | 
    
         
            +
            export { AbstractChat, Agent, AsyncIterableStream, CallSettings, CallWarning, ChatAddToolApproveResponseFunction, ChatInit, ChatOnDataCallback, ChatOnErrorCallback, ChatOnFinishCallback, ChatOnToolCallCallback, ChatRequestOptions, ChatState, ChatStatus, ChatTransport, ChunkDetector, CompletionRequestOptions, CoreAssistantMessage, CoreMessage, CoreSystemMessage, CoreToolMessage, CoreUserMessage, CreateUIMessage, DataUIPart, DeepPartial, DefaultChatTransport, DownloadError, DynamicToolCall, DynamicToolError, DynamicToolResult, DynamicToolUIPart, EmbedManyResult, EmbedResult, Embedding, EmbeddingModel, EmbeddingModelUsage, ErrorHandler, ToolLoopAgent as Experimental_Agent, ToolLoopAgentSettings as Experimental_AgentSettings, DownloadFunction as Experimental_DownloadFunction, GenerateImageResult as Experimental_GenerateImageResult, GeneratedFile as Experimental_GeneratedImage, InferAgentUIMessage as Experimental_InferAgentUIMessage, LogWarningsFunction as Experimental_LogWarningsFunction, SpeechResult as Experimental_SpeechResult, TranscriptionResult as Experimental_TranscriptionResult, Warning as Experimental_Warning, FileUIPart, FinishReason, GenerateObjectResult, GenerateTextOnFinishCallback, GenerateTextOnStepFinishCallback, GenerateTextResult, GeneratedAudioFile, GeneratedFile, HttpChatTransport, HttpChatTransportInitOptions, ImageModel, ImageGenerationWarning as ImageModelCallWarning, ImageModelProviderMetadata, ImageModelResponseMetadata, InferAgentUIMessage, InferGenerateOutput, InferStreamOutput, InferUIDataParts, InferUIMessageChunk, InferUITool, InferUITools, InvalidArgumentError, InvalidDataContentError, InvalidMessageRoleError, InvalidStreamPartError, InvalidToolInputError, JSONRPCError, JSONRPCMessage, JSONRPCNotification, JSONRPCRequest, JSONRPCResponse, JSONValue, JsonToSseTransformStream, LanguageModel, LanguageModelMiddleware, LanguageModelRequestMetadata, LanguageModelResponseMetadata, LanguageModelUsage, MCPClientError, MCPTransport, MessageConversionError, NoImageGeneratedError, NoObjectGeneratedError, NoOutputGeneratedError, NoOutputSpecifiedError, NoSpeechGeneratedError, NoSuchProviderError, NoSuchToolError, ObjectStreamPart, output as Output, PrepareReconnectToStreamRequest, PrepareSendMessagesRequest, PrepareStepFunction, PrepareStepResult, Prompt, Provider, ProviderMetadata, ProviderRegistryProvider, ReasoningOutput, ReasoningUIPart, RepairTextFunction, RetryError, SafeValidateUIMessagesResult, SerialJobExecutor, SourceDocumentUIPart, SourceUrlUIPart, SpeechModel, SpeechModelResponseMetadata, SpeechWarning, StaticToolCall, StaticToolError, StaticToolOutputDenied, StaticToolResult, StepResult, StepStartUIPart, StopCondition, StreamObjectOnFinishCallback, StreamObjectResult, StreamTextOnChunkCallback, StreamTextOnErrorCallback, StreamTextOnFinishCallback, StreamTextOnStepFinishCallback, StreamTextResult, StreamTextTransform, TelemetrySettings, TextStreamChatTransport, TextStreamPart, TextUIPart, ToolApprovalRequestOutput, ToolCallRepairError, ToolCallRepairFunction, ToolChoice, ToolLoopAgent, ToolLoopAgentOnFinishCallback, ToolLoopAgentOnStepFinishCallback, ToolLoopAgentSettings, ToolSet, ToolUIPart, TranscriptionModel, TranscriptionModelResponseMetadata, TranscriptionWarning, TypedToolCall, TypedToolError, TypedToolOutputDenied, TypedToolResult, UIDataPartSchemas, UIDataTypes, UIMessage, UIMessageChunk, UIMessagePart, UIMessageStreamOnFinishCallback, UIMessageStreamOptions, UIMessageStreamWriter, UITool, UIToolInvocation, UITools, UI_MESSAGE_STREAM_HEADERS, UnsupportedModelVersionError, UseCompletionOptions, assistantModelMessageSchema, callCompletionApi, consumeStream, convertFileListToFileUIParts, convertToCoreMessages, convertToModelMessages, coreAssistantMessageSchema, coreMessageSchema, coreSystemMessageSchema, coreToolMessageSchema, coreUserMessageSchema, cosineSimilarity, createAgentUIStream, createAgentUIStreamResponse, createProviderRegistry, createTextStreamResponse, createUIMessageStream, createUIMessageStreamResponse, customProvider, defaultSettingsMiddleware, embed, embedMany, MCPClient as experimental_MCPClient, MCPClientConfig as experimental_MCPClientConfig, createMCPClient as experimental_createMCPClient, experimental_createProviderRegistry, experimental_customProvider, generateImage as experimental_generateImage, generateSpeech as experimental_generateSpeech, transcribe as experimental_transcribe, extractReasoningMiddleware, generateObject, generateText, getTextFromDataUrl, getToolName, getToolOrDynamicToolName, hasToolCall, isDataUIPart, isDeepEqualData, isFileUIPart, isReasoningUIPart, isTextUIPart, isToolOrDynamicToolUIPart, isToolUIPart, lastAssistantMessageIsCompleteWithApprovalResponses, lastAssistantMessageIsCompleteWithToolCalls, modelMessageSchema, parsePartialJson, pipeAgentUIStreamToResponse, pipeTextStreamToResponse, pipeUIMessageStreamToResponse, pruneMessages, readUIMessageStream, safeValidateUIMessages, simulateReadableStream, simulateStreamingMiddleware, smoothStream, stepCountIs, streamObject, streamText, systemModelMessageSchema, toolModelMessageSchema, uiMessageChunkSchema, userModelMessageSchema, validateUIMessages, wrapLanguageModel, wrapProvider };
         
     | 
    
        package/dist/index.d.ts
    CHANGED
    
    | 
         @@ -657,11 +657,6 @@ type PartialObject<ObjectType extends object> = { 
     | 
|
| 
       657 
657 
     | 
    
         
             
            interface Output<OUTPUT = any, PARTIAL = any> {
         
     | 
| 
       658 
658 
     | 
    
         
             
                readonly type: 'object' | 'text';
         
     | 
| 
       659 
659 
     | 
    
         
             
                responseFormat: PromiseLike<LanguageModelV3CallOptions['responseFormat']>;
         
     | 
| 
       660 
     | 
    
         
            -
                parsePartial(options: {
         
     | 
| 
       661 
     | 
    
         
            -
                    text: string;
         
     | 
| 
       662 
     | 
    
         
            -
                }): Promise<{
         
     | 
| 
       663 
     | 
    
         
            -
                    partial: PARTIAL;
         
     | 
| 
       664 
     | 
    
         
            -
                } | undefined>;
         
     | 
| 
       665 
660 
     | 
    
         
             
                parseOutput(options: {
         
     | 
| 
       666 
661 
     | 
    
         
             
                    text: string;
         
     | 
| 
       667 
662 
     | 
    
         
             
                }, context: {
         
     | 
| 
         @@ -669,29 +664,69 @@ interface Output<OUTPUT = any, PARTIAL = any> { 
     | 
|
| 
       669 
664 
     | 
    
         
             
                    usage: LanguageModelUsage;
         
     | 
| 
       670 
665 
     | 
    
         
             
                    finishReason: FinishReason;
         
     | 
| 
       671 
666 
     | 
    
         
             
                }): Promise<OUTPUT>;
         
     | 
| 
      
 667 
     | 
    
         
            +
                parsePartial(options: {
         
     | 
| 
      
 668 
     | 
    
         
            +
                    text: string;
         
     | 
| 
      
 669 
     | 
    
         
            +
                }): Promise<{
         
     | 
| 
      
 670 
     | 
    
         
            +
                    partial: PARTIAL;
         
     | 
| 
      
 671 
     | 
    
         
            +
                } | undefined>;
         
     | 
| 
       672 
672 
     | 
    
         
             
            }
         
     | 
| 
      
 673 
     | 
    
         
            +
            /**
         
     | 
| 
      
 674 
     | 
    
         
            +
             * Output specification for text generation.
         
     | 
| 
      
 675 
     | 
    
         
            +
             * This is the default output mode that generates plain text.
         
     | 
| 
      
 676 
     | 
    
         
            +
             *
         
     | 
| 
      
 677 
     | 
    
         
            +
             * @returns An output specification for generating text.
         
     | 
| 
      
 678 
     | 
    
         
            +
             */
         
     | 
| 
       673 
679 
     | 
    
         
             
            declare const text: () => Output<string, string>;
         
     | 
| 
      
 680 
     | 
    
         
            +
            /**
         
     | 
| 
      
 681 
     | 
    
         
            +
             * Output specification for typed object generation using schemas.
         
     | 
| 
      
 682 
     | 
    
         
            +
             * When the model generates a text response, it will return an object that matches the schema.
         
     | 
| 
      
 683 
     | 
    
         
            +
             *
         
     | 
| 
      
 684 
     | 
    
         
            +
             * @param schema - The schema of the object to generate.
         
     | 
| 
      
 685 
     | 
    
         
            +
             *
         
     | 
| 
      
 686 
     | 
    
         
            +
             * @returns An output specification for generating objects with the specified schema.
         
     | 
| 
      
 687 
     | 
    
         
            +
             */
         
     | 
| 
       674 
688 
     | 
    
         
             
            declare const object: <OUTPUT>({ schema: inputSchema, }: {
         
     | 
| 
       675 
689 
     | 
    
         
             
                schema: FlexibleSchema<OUTPUT>;
         
     | 
| 
       676 
690 
     | 
    
         
             
            }) => Output<OUTPUT, DeepPartial<OUTPUT>>;
         
     | 
| 
       677 
     | 
    
         
            -
             
     | 
| 
       678 
     | 
    
         
            -
             
     | 
| 
      
 691 
     | 
    
         
            +
            /**
         
     | 
| 
      
 692 
     | 
    
         
            +
             * Array output specification for text generation.
         
     | 
| 
      
 693 
     | 
    
         
            +
             * When the model generates a text response, it will return an array of elements.
         
     | 
| 
      
 694 
     | 
    
         
            +
             *
         
     | 
| 
      
 695 
     | 
    
         
            +
             * @param element - The schema of the element to generate.
         
     | 
| 
      
 696 
     | 
    
         
            +
             * @returns An output specification for generating an array of elements.
         
     | 
| 
      
 697 
     | 
    
         
            +
             */
         
     | 
| 
      
 698 
     | 
    
         
            +
            declare const array: <ELEMENT>({ element: inputElementSchema, }: {
         
     | 
| 
      
 699 
     | 
    
         
            +
                element: FlexibleSchema<ELEMENT>;
         
     | 
| 
      
 700 
     | 
    
         
            +
            }) => Output<Array<ELEMENT>, Array<ELEMENT>>;
         
     | 
| 
      
 701 
     | 
    
         
            +
            /**
         
     | 
| 
      
 702 
     | 
    
         
            +
             * Choice output specification for text generation.
         
     | 
| 
      
 703 
     | 
    
         
            +
             * When the model generates a text response, it will return a one of the choice options.
         
     | 
| 
      
 704 
     | 
    
         
            +
             *
         
     | 
| 
      
 705 
     | 
    
         
            +
             * @param options - The options to choose from.
         
     | 
| 
      
 706 
     | 
    
         
            +
             * @returns An output specification for generating a choice.
         
     | 
| 
      
 707 
     | 
    
         
            +
             */
         
     | 
| 
      
 708 
     | 
    
         
            +
            declare const choice: <ELEMENT extends string>({ options: choiceOptions, }: {
         
     | 
| 
      
 709 
     | 
    
         
            +
                options: Array<ELEMENT>;
         
     | 
| 
      
 710 
     | 
    
         
            +
            }) => Output<ELEMENT, ELEMENT>;
         
     | 
| 
       679 
711 
     | 
    
         | 
| 
       680 
     | 
    
         
            -
            type output_InferGenerateOutput<OUTPUT extends Output> = InferGenerateOutput<OUTPUT>;
         
     | 
| 
       681 
     | 
    
         
            -
            type output_InferStreamOutput<OUTPUT extends Output> = InferStreamOutput<OUTPUT>;
         
     | 
| 
       682 
712 
     | 
    
         
             
            type output_Output<OUTPUT = any, PARTIAL = any> = Output<OUTPUT, PARTIAL>;
         
     | 
| 
      
 713 
     | 
    
         
            +
            declare const output_array: typeof array;
         
     | 
| 
      
 714 
     | 
    
         
            +
            declare const output_choice: typeof choice;
         
     | 
| 
       683 
715 
     | 
    
         
             
            declare const output_object: typeof object;
         
     | 
| 
       684 
716 
     | 
    
         
             
            declare const output_text: typeof text;
         
     | 
| 
       685 
717 
     | 
    
         
             
            declare namespace output {
         
     | 
| 
       686 
718 
     | 
    
         
             
              export {
         
     | 
| 
       687 
     | 
    
         
            -
                output_InferGenerateOutput as InferGenerateOutput,
         
     | 
| 
       688 
     | 
    
         
            -
                output_InferStreamOutput as InferStreamOutput,
         
     | 
| 
       689 
719 
     | 
    
         
             
                output_Output as Output,
         
     | 
| 
      
 720 
     | 
    
         
            +
                output_array as array,
         
     | 
| 
      
 721 
     | 
    
         
            +
                output_choice as choice,
         
     | 
| 
       690 
722 
     | 
    
         
             
                output_object as object,
         
     | 
| 
       691 
723 
     | 
    
         
             
                output_text as text,
         
     | 
| 
       692 
724 
     | 
    
         
             
              };
         
     | 
| 
       693 
725 
     | 
    
         
             
            }
         
     | 
| 
       694 
726 
     | 
    
         | 
| 
      
 727 
     | 
    
         
            +
            type InferGenerateOutput<OUTPUT extends Output> = OUTPUT extends Output<infer T, any> ? T : never;
         
     | 
| 
      
 728 
     | 
    
         
            +
            type InferStreamOutput<OUTPUT extends Output> = OUTPUT extends Output<any, infer P> ? P : never;
         
     | 
| 
      
 729 
     | 
    
         
            +
             
     | 
| 
       695 
730 
     | 
    
         
             
            type CallSettings = {
         
     | 
| 
       696 
731 
     | 
    
         
             
                /**
         
     | 
| 
       697 
732 
     | 
    
         
             
              Maximum number of tokens to generate.
         
     | 
| 
         @@ -5004,4 +5039,4 @@ declare global { 
     | 
|
| 
       5004 
5039 
     | 
    
         
             
                var AI_SDK_LOG_WARNINGS: LogWarningsFunction | undefined | false;
         
     | 
| 
       5005 
5040 
     | 
    
         
             
            }
         
     | 
| 
       5006 
5041 
     | 
    
         | 
| 
       5007 
     | 
    
         
            -
            export { AbstractChat, Agent, AsyncIterableStream, CallSettings, CallWarning, ChatAddToolApproveResponseFunction, ChatInit, ChatOnDataCallback, ChatOnErrorCallback, ChatOnFinishCallback, ChatOnToolCallCallback, ChatRequestOptions, ChatState, ChatStatus, ChatTransport, ChunkDetector, CompletionRequestOptions, CoreAssistantMessage, CoreMessage, CoreSystemMessage, CoreToolMessage, CoreUserMessage, CreateUIMessage, DataUIPart, DeepPartial, DefaultChatTransport, DownloadError, DynamicToolCall, DynamicToolError, DynamicToolResult, DynamicToolUIPart, EmbedManyResult, EmbedResult, Embedding, EmbeddingModel, EmbeddingModelUsage, ErrorHandler, ToolLoopAgent as Experimental_Agent, ToolLoopAgentSettings as Experimental_AgentSettings, DownloadFunction as Experimental_DownloadFunction, GenerateImageResult as Experimental_GenerateImageResult, GeneratedFile as Experimental_GeneratedImage, InferAgentUIMessage as Experimental_InferAgentUIMessage, LogWarningsFunction as Experimental_LogWarningsFunction, SpeechResult as Experimental_SpeechResult, TranscriptionResult as Experimental_TranscriptionResult, Warning as Experimental_Warning, FileUIPart, FinishReason, GenerateObjectResult, GenerateTextOnFinishCallback, GenerateTextOnStepFinishCallback, GenerateTextResult, GeneratedAudioFile, GeneratedFile, HttpChatTransport, HttpChatTransportInitOptions, ImageModel, ImageGenerationWarning as ImageModelCallWarning, ImageModelProviderMetadata, ImageModelResponseMetadata, InferAgentUIMessage, InferUIDataParts, InferUIMessageChunk, InferUITool, InferUITools, InvalidArgumentError, InvalidDataContentError, InvalidMessageRoleError, InvalidStreamPartError, InvalidToolInputError, JSONRPCError, JSONRPCMessage, JSONRPCNotification, JSONRPCRequest, JSONRPCResponse, JSONValue, JsonToSseTransformStream, LanguageModel, LanguageModelMiddleware, LanguageModelRequestMetadata, LanguageModelResponseMetadata, LanguageModelUsage, MCPClientError, MCPTransport, MessageConversionError, NoImageGeneratedError, NoObjectGeneratedError, NoOutputGeneratedError, NoOutputSpecifiedError, NoSpeechGeneratedError, NoSuchProviderError, NoSuchToolError, ObjectStreamPart, output as Output, PrepareReconnectToStreamRequest, PrepareSendMessagesRequest, PrepareStepFunction, PrepareStepResult, Prompt, Provider, ProviderMetadata, ProviderRegistryProvider, ReasoningOutput, ReasoningUIPart, RepairTextFunction, RetryError, SafeValidateUIMessagesResult, SerialJobExecutor, SourceDocumentUIPart, SourceUrlUIPart, SpeechModel, SpeechModelResponseMetadata, SpeechWarning, StaticToolCall, StaticToolError, StaticToolOutputDenied, StaticToolResult, StepResult, StepStartUIPart, StopCondition, StreamObjectOnFinishCallback, StreamObjectResult, StreamTextOnChunkCallback, StreamTextOnErrorCallback, StreamTextOnFinishCallback, StreamTextOnStepFinishCallback, StreamTextResult, StreamTextTransform, TelemetrySettings, TextStreamChatTransport, TextStreamPart, TextUIPart, ToolApprovalRequestOutput, ToolCallRepairError, ToolCallRepairFunction, ToolChoice, ToolLoopAgent, ToolLoopAgentOnFinishCallback, ToolLoopAgentOnStepFinishCallback, ToolLoopAgentSettings, ToolSet, ToolUIPart, TranscriptionModel, TranscriptionModelResponseMetadata, TranscriptionWarning, TypedToolCall, TypedToolError, TypedToolOutputDenied, TypedToolResult, UIDataPartSchemas, UIDataTypes, UIMessage, UIMessageChunk, UIMessagePart, UIMessageStreamOnFinishCallback, UIMessageStreamOptions, UIMessageStreamWriter, UITool, UIToolInvocation, UITools, UI_MESSAGE_STREAM_HEADERS, UnsupportedModelVersionError, UseCompletionOptions, assistantModelMessageSchema, callCompletionApi, consumeStream, convertFileListToFileUIParts, convertToCoreMessages, convertToModelMessages, coreAssistantMessageSchema, coreMessageSchema, coreSystemMessageSchema, coreToolMessageSchema, coreUserMessageSchema, cosineSimilarity, createAgentUIStream, createAgentUIStreamResponse, createProviderRegistry, createTextStreamResponse, createUIMessageStream, createUIMessageStreamResponse, customProvider, defaultSettingsMiddleware, embed, embedMany, MCPClient as experimental_MCPClient, MCPClientConfig as experimental_MCPClientConfig, createMCPClient as experimental_createMCPClient, experimental_createProviderRegistry, experimental_customProvider, generateImage as experimental_generateImage, generateSpeech as experimental_generateSpeech, transcribe as experimental_transcribe, extractReasoningMiddleware, generateObject, generateText, getTextFromDataUrl, getToolName, getToolOrDynamicToolName, hasToolCall, isDataUIPart, isDeepEqualData, isFileUIPart, isReasoningUIPart, isTextUIPart, isToolOrDynamicToolUIPart, isToolUIPart, lastAssistantMessageIsCompleteWithApprovalResponses, lastAssistantMessageIsCompleteWithToolCalls, modelMessageSchema, parsePartialJson, pipeAgentUIStreamToResponse, pipeTextStreamToResponse, pipeUIMessageStreamToResponse, pruneMessages, readUIMessageStream, safeValidateUIMessages, simulateReadableStream, simulateStreamingMiddleware, smoothStream, stepCountIs, streamObject, streamText, systemModelMessageSchema, toolModelMessageSchema, uiMessageChunkSchema, userModelMessageSchema, validateUIMessages, wrapLanguageModel, wrapProvider };
         
     | 
| 
      
 5042 
     | 
    
         
            +
            export { AbstractChat, Agent, AsyncIterableStream, CallSettings, CallWarning, ChatAddToolApproveResponseFunction, ChatInit, ChatOnDataCallback, ChatOnErrorCallback, ChatOnFinishCallback, ChatOnToolCallCallback, ChatRequestOptions, ChatState, ChatStatus, ChatTransport, ChunkDetector, CompletionRequestOptions, CoreAssistantMessage, CoreMessage, CoreSystemMessage, CoreToolMessage, CoreUserMessage, CreateUIMessage, DataUIPart, DeepPartial, DefaultChatTransport, DownloadError, DynamicToolCall, DynamicToolError, DynamicToolResult, DynamicToolUIPart, EmbedManyResult, EmbedResult, Embedding, EmbeddingModel, EmbeddingModelUsage, ErrorHandler, ToolLoopAgent as Experimental_Agent, ToolLoopAgentSettings as Experimental_AgentSettings, DownloadFunction as Experimental_DownloadFunction, GenerateImageResult as Experimental_GenerateImageResult, GeneratedFile as Experimental_GeneratedImage, InferAgentUIMessage as Experimental_InferAgentUIMessage, LogWarningsFunction as Experimental_LogWarningsFunction, SpeechResult as Experimental_SpeechResult, TranscriptionResult as Experimental_TranscriptionResult, Warning as Experimental_Warning, FileUIPart, FinishReason, GenerateObjectResult, GenerateTextOnFinishCallback, GenerateTextOnStepFinishCallback, GenerateTextResult, GeneratedAudioFile, GeneratedFile, HttpChatTransport, HttpChatTransportInitOptions, ImageModel, ImageGenerationWarning as ImageModelCallWarning, ImageModelProviderMetadata, ImageModelResponseMetadata, InferAgentUIMessage, InferGenerateOutput, InferStreamOutput, InferUIDataParts, InferUIMessageChunk, InferUITool, InferUITools, InvalidArgumentError, InvalidDataContentError, InvalidMessageRoleError, InvalidStreamPartError, InvalidToolInputError, JSONRPCError, JSONRPCMessage, JSONRPCNotification, JSONRPCRequest, JSONRPCResponse, JSONValue, JsonToSseTransformStream, LanguageModel, LanguageModelMiddleware, LanguageModelRequestMetadata, LanguageModelResponseMetadata, LanguageModelUsage, MCPClientError, MCPTransport, MessageConversionError, NoImageGeneratedError, NoObjectGeneratedError, NoOutputGeneratedError, NoOutputSpecifiedError, NoSpeechGeneratedError, NoSuchProviderError, NoSuchToolError, ObjectStreamPart, output as Output, PrepareReconnectToStreamRequest, PrepareSendMessagesRequest, PrepareStepFunction, PrepareStepResult, Prompt, Provider, ProviderMetadata, ProviderRegistryProvider, ReasoningOutput, ReasoningUIPart, RepairTextFunction, RetryError, SafeValidateUIMessagesResult, SerialJobExecutor, SourceDocumentUIPart, SourceUrlUIPart, SpeechModel, SpeechModelResponseMetadata, SpeechWarning, StaticToolCall, StaticToolError, StaticToolOutputDenied, StaticToolResult, StepResult, StepStartUIPart, StopCondition, StreamObjectOnFinishCallback, StreamObjectResult, StreamTextOnChunkCallback, StreamTextOnErrorCallback, StreamTextOnFinishCallback, StreamTextOnStepFinishCallback, StreamTextResult, StreamTextTransform, TelemetrySettings, TextStreamChatTransport, TextStreamPart, TextUIPart, ToolApprovalRequestOutput, ToolCallRepairError, ToolCallRepairFunction, ToolChoice, ToolLoopAgent, ToolLoopAgentOnFinishCallback, ToolLoopAgentOnStepFinishCallback, ToolLoopAgentSettings, ToolSet, ToolUIPart, TranscriptionModel, TranscriptionModelResponseMetadata, TranscriptionWarning, TypedToolCall, TypedToolError, TypedToolOutputDenied, TypedToolResult, UIDataPartSchemas, UIDataTypes, UIMessage, UIMessageChunk, UIMessagePart, UIMessageStreamOnFinishCallback, UIMessageStreamOptions, UIMessageStreamWriter, UITool, UIToolInvocation, UITools, UI_MESSAGE_STREAM_HEADERS, UnsupportedModelVersionError, UseCompletionOptions, assistantModelMessageSchema, callCompletionApi, consumeStream, convertFileListToFileUIParts, convertToCoreMessages, convertToModelMessages, coreAssistantMessageSchema, coreMessageSchema, coreSystemMessageSchema, coreToolMessageSchema, coreUserMessageSchema, cosineSimilarity, createAgentUIStream, createAgentUIStreamResponse, createProviderRegistry, createTextStreamResponse, createUIMessageStream, createUIMessageStreamResponse, customProvider, defaultSettingsMiddleware, embed, embedMany, MCPClient as experimental_MCPClient, MCPClientConfig as experimental_MCPClientConfig, createMCPClient as experimental_createMCPClient, experimental_createProviderRegistry, experimental_customProvider, generateImage as experimental_generateImage, generateSpeech as experimental_generateSpeech, transcribe as experimental_transcribe, extractReasoningMiddleware, generateObject, generateText, getTextFromDataUrl, getToolName, getToolOrDynamicToolName, hasToolCall, isDataUIPart, isDeepEqualData, isFileUIPart, isReasoningUIPart, isTextUIPart, isToolOrDynamicToolUIPart, isToolUIPart, lastAssistantMessageIsCompleteWithApprovalResponses, lastAssistantMessageIsCompleteWithToolCalls, modelMessageSchema, parsePartialJson, pipeAgentUIStreamToResponse, pipeTextStreamToResponse, pipeUIMessageStreamToResponse, pruneMessages, readUIMessageStream, safeValidateUIMessages, simulateReadableStream, simulateStreamingMiddleware, smoothStream, stepCountIs, streamObject, streamText, systemModelMessageSchema, toolModelMessageSchema, uiMessageChunkSchema, userModelMessageSchema, validateUIMessages, wrapLanguageModel, wrapProvider };
         
     |