proposit-core
    Preparing search index...

    Type Alias TCreateOpenAiResponsesProviderOptions

    type TCreateOpenAiResponsesProviderOptions = {
        apiKey: string;
        backgroundMode?: boolean;
        backgroundPollIntervalMs?: number;
        backgroundStreamMode?: boolean;
        baseUrl?: string;
        fetch?: TOpenAiFetch;
        maxToolCallRounds?: number;
        stream?: boolean;
    }
    Index

    Properties

    apiKey: string
    backgroundMode?: boolean

    Run long reasoning calls in OpenAI background mode (submit-then-poll) so the result does not depend on a continuously-held connection. Defaults to false.

    Background mode requires store: true, which retains the response server-side (~10 min, for polling) and is NOT ZDR-compatible. Enable only where that data-retention posture is acceptable. V1 supports the no-tools path only: a request that sets backgroundMode and carries tools throws NonRetryableLlmError.

    backgroundPollIntervalMs?: number

    Poll interval (ms) for the background submit-then-poll loop. Defaults to 2000. Ignored unless backgroundMode is true.

    backgroundStreamMode?: boolean

    Combine OpenAI background mode with live SSE streaming: the request is submitted with { background: true, stream: true, store: true } so it keeps generating server-side even if the connection drops, and the SSE stream is consumed live while it runs. This is independent of the stream option (foreground- only streaming) and backgroundMode (poll-only).

    When true, backgroundMode is ignored for this provider instance. stream is also ignored (SSE is always used in this mode). V1 supports the no-tools path only: a request that sets backgroundStreamMode and carries tools throws NonRetryableLlmError.

    The response id is surfaced immediately from the submit POST body (before any SSE bytes), making it available for durable persistence by the caller. Defaults to false.

    baseUrl?: string

    Override the default https://api.openai.com/v1/responses.

    fetch?: TOpenAiFetch

    Injectable fetch. Defaults to globalThis.fetch. Tests inject mocks; runtimes without a global fetch (older Node) inject a polyfill.

    maxToolCallRounds?: number

    Cap on the number of round-trips the function-tool agent loop can take before throwing ToolLoopExhaustedError. Defaults to 6. Built-in tools (web_search / file_search / mcp) don't count against this cap — they run server-side.

    stream?: boolean

    Stream the foreground response over SSE and accumulate to the terminal envelope inside the provider. Defaults to true — gives connection-drop resilience. No data-retention implications (unlike backgroundMode). Set false to restore the blocking response.json() path.