Documentation
    Preparing search index...

    Interface OpenAiGenerateOptions

    Execution options passed to generate calls.

    interface OpenAiGenerateOptions {
        headers?: Record<string, string>;
        maxTokens?: number;
        messages?: OpenAiMessage[];
        model?: string;
        onUsage?: (usage: unknown) => void;
        responseFormat?:
            | Record<string, unknown>
            | { type: "text" | "json_object" | "json_schema" }
            | null;
        systemPrompt?: string;
        temperature?: number;
        timeoutMs?: number;
    }
    Index

    Properties

    headers?: Record<string, string>

    Additional HTTP headers for this specific call.

    maxTokens?: number

    Maximum tokens to generate in the completion.

    messages?: OpenAiMessage[]

    Explicit message array overriding prompt building.

    model?: string

    Model identifier overriding the default model.

    onUsage?: (usage: unknown) => void

    Optional usage callback to collect token counts and metrics.

    responseFormat?:
        | Record<string, unknown>
        | { type: "text" | "json_object" | "json_schema" }
        | null

    Response format configuration (e.g. { type: 'json_object' }). Pass null to explicitly omit response_format payload.

    systemPrompt?: string

    Optional system prompt prepended before user message.

    temperature?: number

    Sampling temperature (0.0 to 2.0).

    timeoutMs?: number

    Per-call timeout override in milliseconds.