smoltalk
    Preparing search index...

    Type Alias PromptConfig

    type PromptConfig = {
        abortSignal?: AbortSignal;
        maxMessages?: number;
        maxTokens?: number;
        messages: Message[];
        numSuggestions?: number;
        parallelToolCalls?: boolean;
        rawAttributes?: Record<string, any>;
        reasoningEffort?: "low" | "medium" | "high";
        responseFormat?: ZodType;
        responseFormatOptions?: Partial<
            {
                allowExtraKeys: boolean;
                name: string;
                numRetries: number;
                strict: boolean;
            },
        >;
        stream?: boolean;
        temperature?: number;
        thinking?: { budgetTokens?: number; enabled: boolean };
        toolLoopDetection?: ToolLoopDetection;
        tools?: { description?: string; name: string; schema: ZodType }[];
    }
    Index

    Properties

    abortSignal?: AbortSignal

    An AbortSignal for cancelling the request.

    maxMessages?: number

    If set, returns a failure when the number of messages exceeds this limit.

    maxTokens?: number

    Maximum number of tokens the model can generate in its response.

    messages: Message[]

    The conversation messages to send to the model.

    numSuggestions?: number

    Number of alternative completions to generate. Not currently used by any provider.

    parallelToolCalls?: boolean

    Whether the model can call multiple tools in a single turn. (OpenAI Responses API only)

    rawAttributes?: Record<string, any>

    Arbitrary provider-specific attributes passed directly to the underlying API call.

    reasoningEffort?: "low" | "medium" | "high"

    Provider-agnostic reasoning effort level.

    • OpenAI: passed as reasoning_effort / reasoning.effort
    • Anthropic: mapped to thinking budget (low=2048, medium=5000, high=10000)
    • Google: mapped to thinkingBudget (low=2048, medium=8192, high=16384) If thinking is also set, it takes precedence for Anthropic/Google.
    responseFormat?: ZodType

    A Zod schema to constrain the model's output to structured JSON matching the schema.

    responseFormatOptions?: Partial<
        {
            allowExtraKeys: boolean;
            name: string;
            numRetries: number;
            strict: boolean;
        },
    >
    stream?: boolean

    If true, returns an AsyncGenerator of StreamChunks instead of a single result.

    temperature?: number

    Sampling temperature (0-2). Higher values make output more random, lower values more deterministic. (OpenAI only)

    thinking?: { budgetTokens?: number; enabled: boolean }

    Enable extended thinking / thought signatures. When enabled, the model returns its reasoning process alongside the response. (Anthropic and Google only — OpenAI reasoning tokens are not exposed)

    Type Declaration

    • OptionalbudgetTokens?: number

      Token budget for the thinking process. Defaults to 5000. (Anthropic only)

    • enabled: boolean

      Whether to enable extended thinking.

    toolLoopDetection?: ToolLoopDetection

    Define behavior if too many repeated tool calls are detected (loop prevention).

    tools?: { description?: string; name: string; schema: ZodType }[]

    Tools (functions) the model can call. Each tool has a name, optional description, and a Zod schema defining its parameters.