import { Al as LanguageModelUsage, Ao as ToolApprovalStatus, Ba as GenerateTextOnEndCallback, Bc as Instructions, Ca as TelemetryDispatcher, Dl as Warning, Eo as ResolvedToolCallers, Fc as ToolModelMessage$1, Ga as GenerateTextOnStepFinishCallback, Go as StoppedBy, Gs as DefaultStepResult, Ha as GenerateTextOnStartCallback, Hl as ResponseMessage, Jl as LanguageModel, Jo as InferCompleteOutput, Ka as GenerateTextOnStepStartCallback, Ko as StaticToolOutputDenied, Ml as asLanguageModelUsage, Nl as createNullLanguageModelUsage, Qo as createAsyncIterableStream, Qs as TypedToolResult, So as ToolCallRepairFunction, Tc as AssistantModelMessage$1, Tl as logWarnings, Ua as GenerateTextOnStepEndCallback, Ul as LanguageModelRequestMetadata, Vl as LanguageModelResponseMetadata, Vo as ToolOrder, Wa as GenerateTextOnStepErrorCallback, Xs as DynamicToolResult, Yl as ToolChoice, Ys as ContentPart, Zs as StaticToolResult, _a as LanguageModelStreamPart, _c as Callback, _o as OnToolExecutionEndCallback, ac as StaticToolCall, cc as ReasoningOutput, dc as GeneratedFile, el as LanguageModelCallOptions, fc as IncludedContext, ga as GenerateTextResult, ic as DynamicToolCall, jl as addLanguageModelUsage, ko as ToolApprovalConfiguration, mc as TelemetryOptions, mo as ToolInputRefinement, nc as ToolApprovalResponseOutput, oc as TypedToolCall, pc as IncludedToolsContext, po as ToolsContextSettings, ql as FinishReason, qs as StepResult, rc as ToolApprovalRequestOutput, sc as ReasoningFileOutput, to as Output, vc as StandardizedPrompt, vl as DownloadFunction, vo as OnToolExecutionStartCallback, wl as LogWarningsFunction, wo as InvalidToolInputError, xo as ToolOutput, yc as standardizePrompt, yl as createDefaultDownloadFunction, za as GenerateTextOnAbortCallback } from "../index-CKEJqCzY.js"; import { Arrayable, Context, Experimental_SandboxSession, FlexibleSchema, IdGenerator, InferToolSetContext, ModelMessage, RetryFunction, ShouldRetryFunction, Tool, ToolApprovalRequest, ToolApprovalResponse, ToolResultOutput, ToolResultPart, ToolSet, convertAsyncIteratorToReadableStream } from "@ai-sdk/provider-utils"; import { EmbeddingModelV4, Experimental_DecisionModelV4, Experimental_ExtractionModelV4, Experimental_SpeechTranslationModelV4, Experimental_VideoModelV4, ImageModelV4, LanguageModelV4, LanguageModelV4Content, LanguageModelV4FunctionTool, LanguageModelV4Prompt, LanguageModelV4ProviderTool, LanguageModelV4ToolCall, LanguageModelV4ToolChoice, LanguageModelV4ToolResultOutput, RerankingModelV4, SharedV4Warning, SpeechModelV4, TranscriptionModelV4 } from "@ai-sdk/provider"; //#region src/prompt/convert-to-language-model-prompt.d.ts export declare function convertToLanguageModelPrompt({ prompt, supportedUrls, download, abortSignal, provider, warnings }: { prompt: StandardizedPrompt; supportedUrls: Record; download: DownloadFunction | undefined; abortSignal?: AbortSignal; provider?: string; warnings?: Warning[]; }): Promise; /** * Downloads files from URLs in the user messages. */ export declare function downloadAssets(messages: ModelMessage[], download: DownloadFunction, supportedUrls: Record, abortSignal?: AbortSignal): Promise>; export declare function mapToolResultOutput({ output, provider, warnings, downloadedAssets }: { output: ToolResultOutput; provider?: string; warnings?: Warning[]; downloadedAssets: Record; }): LanguageModelV4ToolResultOutput; //#endregion //#region src/prompt/create-tool-model-output.d.ts export declare function createToolModelOutput({ toolCallId, input, output, tool, errorMode }: { toolCallId: string; input: unknown; output: unknown; tool: Tool | undefined; errorMode: 'none' | 'text' | 'json'; }): Promise; //#endregion //#region src/prompt/prepare-tool-choice.d.ts export declare function prepareToolChoice({ toolChoice }: { toolChoice: ToolChoice | undefined; }): LanguageModelV4ToolChoice; //#endregion //#region src/prompt/prepare-tools.d.ts export declare function prepareTools({ tools, toolOrder, toolsContext, experimental_sandbox: sandbox }: { tools: TOOLS | undefined; toolOrder?: ToolOrder; toolsContext?: InferToolSetContext; experimental_sandbox?: Experimental_SandboxSession; }): Promise | undefined>; //#endregion //#region src/prompt/prepare-language-model-call-options.d.ts /** * Validates model call options and returns a new object with normalized values. */ export declare function prepareLanguageModelCallOptions({ maxOutputTokens, temperature, topP, topK, presencePenalty, frequencyPenalty, seed, stopSequences, reasoning }: LanguageModelCallOptions): LanguageModelCallOptions; //#endregion //#region src/util/prepare-retries.d.ts /** * Validate and prepare retries. */ export declare function prepareRetries({ maxRetries, abortSignal, additionalRetryableError, parameter, defaultMaxRetries }: { maxRetries: number | undefined; abortSignal: AbortSignal | undefined; additionalRetryableError?: ShouldRetryFunction; parameter?: string; defaultMaxRetries?: number; }): { maxRetries: number; retry: RetryFunction; }; //#endregion //#region src/model/resolve-model.d.ts export declare function resolveLanguageModel(model: LanguageModel, onWarning?: LogWarningsFunction): LanguageModelV4; //#endregion //#region src/util/merge-abort-signals.d.ts /** * Merges multiple abort sources into a single `AbortSignal`. * The returned signal will abort when any input signal aborts or when any * numeric timeout elapses, using the reason from the first source to abort. * * @param signals - Abort signals or timeout durations in milliseconds. * `null` and `undefined` values are ignored. * @returns An `AbortSignal` that aborts when any valid source aborts, * or `undefined` if no valid sources are provided. */ export declare function mergeAbortSignals(...signals: (AbortSignal | null | undefined | number)[]): AbortSignal | undefined; //#endregion //#region src/util/set-abort-timeout.d.ts /** * Schedules a timeout that aborts the given controller with a `TimeoutError` * `DOMException`, matching the reason produced by `AbortSignal.timeout(ms)`. * * @param abortController - The controller to abort when the timeout elapses. * If undefined, no timeout is scheduled. * @param label - Human-readable label included in the error message * (e.g. "Step", "Chunk"). * @param timeoutMs - Duration in milliseconds before the controller is aborted. * If undefined, no timeout is scheduled. * @returns The timeout id (suitable for passing to `clearTimeout`), or * `undefined` if no timeout was scheduled. */ export declare function setAbortTimeout({ abortController, label, timeoutMs }: { abortController: AbortController | undefined; label: string; timeoutMs: number | undefined; }): ReturnType | undefined; //#endregion //#region src/util/merge-callbacks.d.ts /** * Creates an async callback that invokes the provided callbacks in parallel. * Undefined callbacks are skipped, and thrown or rejected callback errors are * ignored. * * @param callbacks The callbacks to invoke for each event. * @returns A callback that forwards each event to all callbacks and waits for * them to settle. */ export declare function mergeCallbacks(...callbacks: Array | undefined>): Callback; //#endregion //#region src/util/merge-objects.d.ts /** * Deeply merges two objects together. * - Properties from the `overrides` object override those in the `base` object with the same key. * - For nested objects, the merge is performed recursively (deep merge). * - Arrays are replaced, not merged. * - Primitive values are replaced. * - If both `base` and `overrides` are undefined, returns undefined. * - If one of `base` or `overrides` is undefined, returns the other. * * @param base The target object to merge into * @param overrides The source object to merge from * @returns A new object with the merged properties, or undefined if both inputs are undefined */ export declare function mergeObjects(base: T | undefined, overrides: U | undefined): (T & U) | T | U | undefined; //#endregion //#region src/telemetry/create-telemetry-dispatcher.d.ts /** * Creates a telemetry dispatcher that sends telemetry events * to the resolved set of integrations. * * When per-call integrations are provided, they take precedence over the globally * registered integrations for that call. When no per-call integrations are * provided, the globally registered integrations are used. * * @param args.telemetry - Optional per-call telemetry settings and integrations. * * @returns A telemetry dispatcher that fans out lifecycle events to the * resolved set of integrations. */ export declare function createTelemetryDispatcher({ telemetry }: { telemetry?: TelemetryOptions; }): TelemetryDispatcher; //#endregion //#region src/telemetry/filter-included-context.d.ts /** * Returns a shallow copy of the runtime context with only top-level * properties marked for telemetry inclusion. */ export declare function filterIncludedContext({ context, includeContext }: { context: CONTEXT; includeContext: IncludedContext; }): Context; //#endregion //#region src/generate-text/restricted-telemetry-dispatcher.d.ts /** * Telemetry dispatcher for text generation with callbacks typed to the * operation-specific tool set, runtime context, and output shape. */ type RestrictedTelemetryDispatcher = Omit & { onStart: GenerateTextOnStartCallback; onStepStart: GenerateTextOnStepStartCallback; onStepEnd: GenerateTextOnStepEndCallback; /** @deprecated Use `onStepEnd` instead. */ onStepFinish: GenerateTextOnStepFinishCallback; onStepError: GenerateTextOnStepErrorCallback; onEnd: GenerateTextOnEndCallback; onAbort?: GenerateTextOnAbortCallback; onToolExecutionStart?: OnToolExecutionStartCallback; onToolExecutionEnd?: OnToolExecutionEndCallback; }; /** * Creates a telemetry dispatcher that only includes configured runtime context * properties in text-generation lifecycle events before dispatching them. */ export declare function createRestrictedTelemetryDispatcher({ telemetry, includeRuntimeContext, includeToolsContext }: { telemetry?: TelemetryOptions; includeRuntimeContext: IncludedContext; includeToolsContext?: IncludedToolsContext; }): RestrictedTelemetryDispatcher; //#endregion //#region src/generate-text/parse-tool-call.d.ts export declare function parseToolCall({ toolCall, tools, repairToolCall, refineToolInput, messages, instructions, abortSignal }: { toolCall: LanguageModelV4ToolCall; tools: TOOLS | undefined; repairToolCall: ToolCallRepairFunction | undefined; refineToolInput?: ToolInputRefinement | undefined; instructions: Instructions | undefined; messages: ModelMessage[]; abortSignal?: AbortSignal; }): Promise>; //#endregion //#region src/generate-text/stream-retry-attempt-boundary.d.ts declare const streamRetryAttemptBoundarySymbol: unique symbol; type StreamRetryAttemptBoundaryPart = { [streamRetryAttemptBoundarySymbol]: true; warnings: Array; }; //#endregion //#region src/generate-text/execute-tools-from-stream.d.ts type ToolExecutionEndStreamPart = { type: 'tool-execution-end'; toolCallId: string; toolExecutionMs: number; }; type ExecuteToolsStreamPart = LanguageModelStreamPart | StaticToolOutputDenied | ToolExecutionEndStreamPart | StreamRetryAttemptBoundaryPart; //#endregion //#region src/generate-text/is-output-chunk.d.ts export declare function isOutputChunk(chunk: Exclude): boolean; //#endregion //#region src/generate-text/validate-tool-context.d.ts /** * Validates a tool context value against the tool's optional context schema. * * When no context schema is defined, the original context value is returned as-is. * Otherwise, the context is validated and normalized through the schema before * being passed into tool execution and approval hooks. * * @throws {TypeValidationError} When the provided tool context does not match * the tool's declared `contextSchema`. */ export declare function validateToolContext({ toolName, context, contextSchema }: { toolName: string; context: unknown; contextSchema: FlexibleSchema | undefined; }): Promise; //#endregion //#region src/tool-search/prepare-tool-search.d.ts /** Create discovery state for one generation, never for a shared tool instance. */ export declare function createToolSearchState({ tools, toolCallers }: { tools: ToolSet | undefined; toolCallers: ResolvedToolCallers | undefined; }): (activeTools: ToolSet | undefined, options?: { toolsContext?: InferToolSetContext; experimental_sandbox?: Experimental_SandboxSession; }) => ToolSet | undefined; //#endregion //#region src/agent/default-stop-condition.d.ts /** * Logs the warning for the default stopWhen condition. */ export declare function logDefaultStopConditionWarning({ stepCount, provider, modelId, onWarning }: { stepCount: number; provider: string; modelId: string; onWarning?: LogWarningsFunction; }): void; //#endregion //#region src/generate-text/collect-tool-approvals.d.ts type CollectedToolApprovals = { approvalRequest: ToolApprovalRequest; approvalResponse: ToolApprovalResponse; toolCall: TypedToolCall; existingToolResult?: ToolResultPart; }; /** * If the last message is a tool message, this function collects all tool approvals * from that message. */ export declare function collectToolApprovals({ messages }: { messages: ModelMessage[]; }): { approvedToolApprovals: Array>; deniedToolApprovals: Array>; }; //#endregion //#region src/generate-text/tool-approval-signature.d.ts export declare function signToolApproval({ secret, approvalId, toolCallId, toolName, input }: { secret: string | Uint8Array; approvalId: string; toolCallId: string; toolName: string; input: unknown; }): Promise; export declare function verifyToolApprovalSignature({ secret, signature, approvalId, toolCallId, toolName, input }: { secret: string | Uint8Array; signature: string; approvalId: string; toolCallId: string; toolName: string; input: unknown; }): Promise; //#endregion //#region src/generate-text/validate-tool-approvals.d.ts /** * Re-validates approved tool approvals reconstructed from client-supplied * message history before they are executed. Checks HMAC signature (when * configured), input schema, and approval policy. */ export declare function validateApprovedToolApprovals({ approvedToolApprovals, tools, toolApproval, messages, toolsContext, runtimeContext, toolApprovalSecret, refineToolInput }: { approvedToolApprovals: Array>; tools: TOOLS | undefined; toolApproval: ToolApprovalConfiguration | undefined; messages: ModelMessage[]; toolsContext: InferToolSetContext; runtimeContext: RUNTIME_CONTEXT; toolApprovalSecret?: string | Uint8Array; refineToolInput?: ToolInputRefinement; }): Promise<{ approvedToolApprovals: Array>; deniedToolApprovals: Array>; invalidToolApprovals: Array & { error: InvalidToolInputError; }>; }>; //#endregion //#region src/generate-text/resolve-tool-approval.d.ts /** * Resolves the approval state for a tool call by checking user-supplied and tool-defined * approval settings, and normalizes the result to the object status shape. * User-defined approval settings take precedence over tool-defined settings. * If no approval settings are provided, the tool call does not require approval. */ export declare function resolveToolApproval({ tools, toolCall, toolApproval, messages, toolsContext, runtimeContext }: { /** * Tools that are available for the model to call. */ tools: TOOLS | undefined; /** * Valid tool call. */ toolCall: TypedToolCall; /** * User-defined approval configuration for tools. * * This configuration takes precedence over tool-defined approval settings. */ toolApproval: ToolApprovalConfiguration | undefined; /** * Messages that were sent to the language model to initiate the response that contained the tool call. */ messages: ModelMessage[]; /** * Tool context as defined by the tool's context schema. */ toolsContext: InferToolSetContext; /** * User-defined runtime context (same as `runtimeContext` on `generateText` / `streamText`). */ runtimeContext: RUNTIME_CONTEXT; }): Promise>; //#endregion //#region src/generate-text/to-response-messages.d.ts /** * Converts the result of a `generateText` or `streamText` call to a list of response messages. */ export declare function toResponseMessages({ content: inputContent, tools }: { content: Array>; tools: TOOLS | undefined; }): Promise>; //#endregion //#region src/generate-text/default-generate-text-result.d.ts export declare class DefaultGenerateTextResult implements GenerateTextResult { readonly steps: GenerateTextResult['steps']; readonly totalUsage: LanguageModelUsage; readonly stoppedBy: StoppedBy | undefined; private readonly _output; constructor(options: { initialResponseMessages: Array; steps: GenerateTextResult['steps']; output: InferCompleteOutput | undefined; totalUsage: LanguageModelUsage; stoppedBy?: StoppedBy; }); private readonly initialResponseMessages; get finalStep(): StepResult; get content(): ContentPart[]; get text(): string; get files(): GeneratedFile[]; get reasoningText(): string | undefined; get reasoning(): (ReasoningOutput | ReasoningFileOutput)[]; get toolCalls(): TypedToolCall[]; get staticToolCalls(): StaticToolCall[]; get dynamicToolCalls(): DynamicToolCall[]; get toolResults(): TypedToolResult[]; get staticToolResults(): StaticToolResult[]; get dynamicToolResults(): DynamicToolResult[]; get sources(): import("@ai-sdk/provider").LanguageModelV4Source[]; get finishReason(): FinishReason; get rawFinishReason(): string | undefined; get warnings(): import("@ai-sdk/provider").SharedV4Warning[]; get providerMetadata(): import("@ai-sdk/provider").SharedV4ProviderMetadata | undefined; get response(): LanguageModelResponseMetadata; get responseMessages(): ResponseMessage[]; get request(): LanguageModelRequestMetadata; get usage(): LanguageModelUsage; get output(): NonNullable>; } //#endregion //#region src/generate-text/resolve-generated-file-data.d.ts type GeneratedFileData = Extract['data']; type GeneratedFileDataCache = WeakMap; //#endregion //#region src/generate-text/convert-language-model-content.d.ts export declare function convertLanguageModelContent({ content, toolCalls, toolOutputs, toolApprovalRequests, toolApprovalResponses, tools, download, abortSignal, generatedFileDataCache }: { content: Array; toolCalls: Array>; toolOutputs: Array>; toolApprovalRequests: Array>; toolApprovalResponses: Array>; tools: TOOLS | undefined; download?: DownloadFunction; abortSignal?: AbortSignal; generatedFileDataCache?: GeneratedFileDataCache; }): Promise>>; //#endregion //#region src/generate-text/calculate-tokens-per-second.d.ts /** * Calculates a token rate in tokens per second. * * Returns 0 when the token count is unknown, the duration is unknown or 0, or * the computed rate cannot be represented as a finite JSON-safe number. */ export declare function calculateTokensPerSecond({ tokens, durationMs }: { tokens: number | undefined; durationMs: number | undefined; }): number; //#endregion //#region src/generate-text/tool-call-concurrency.d.ts /** * Validates the maximum number of tool calls that may execute concurrently. */ export declare function prepareToolCallConcurrency(toolCallConcurrency: number | undefined): number | undefined; /** * Maps items with an optional concurrency limit while preserving result order. * * Workers claim items in input order. When the signal is aborted or an * execution rejects, no additional queued items are started. */ export declare function mapWithConcurrency({ items, concurrency, abortSignal, execute }: { items: Array; concurrency: number | undefined; abortSignal?: AbortSignal; execute: (item: INPUT, index: number) => Promise; }): Promise>; //#endregion export { type CollectedToolApprovals, DefaultStepResult, type DownloadFunction, type ToolsContextSettings, addLanguageModelUsage, asLanguageModelUsage, convertAsyncIteratorToReadableStream, createAsyncIterableStream, createDefaultDownloadFunction, createNullLanguageModelUsage, logWarnings, prepareLanguageModelCallOptions as prepareCallSettings, standardizePrompt }; //# sourceMappingURL=index.d.ts.map