proposit-core
    Preparing search index...

    Function submitBackgroundResponse

    • Submit a background OpenAI response and return its responseId + submit-time status without polling or streaming to completion.

      This is the submit-only half of the existing backgroundMode (runBackground): it POSTs { background: true, store: true }, parses the submit envelope, and returns immediately — the caller drives the response to completion later via retrieveResponse (typically after a durable suspend keyed on the returned responseId). It is the provider capability the pipeline's launchStage needs.

      Terminal-on-submit fast-path: a small/cached request can come back already terminal (completed/failed/incomplete/cancelled) on the submit POST. This function still returns { responseId, status } for that case (no throw, no poll); the caller proceeds to retrieveResponse(responseId), which sees the terminal state immediately.

      No-tools precondition: background mode does not support function tools here — a tool-bearing request throws NonRetryableLlmError, matching respond's background guard.

      Type Parameters

      • T

      Parameters

      • req: TLlmRequest<T>

        The structured-output request (system/user prompts + outputSchema + model knobs). Tools are rejected.

      • options: { apiKey: string; baseUrl?: string; fetch?: TOpenAiFetch; signal?: AbortSignal }

        apiKey, optional baseUrl, fetch, and signal.

      Returns Promise<{ responseId: string; status: TResponseStatus }>