proposit-core
    Preparing search index...

    Function reconnectStream

    • Reconnect to a stored, still-generating background response and stream it to completion. This is what actually drives a dropped background response forward: a passive retrieveResponse GET only reads the current state and leaves a queued / in_progress response sitting where it is, whereas reconnecting with stream=true resumes consumption so the response reaches a terminal status.

      Issues GET /responses/{id}?stream=true&starting_after=<cursor> and consumes the SSE stream to its terminal event, returning the same TRetrievedResponse shape as retrieveResponse.

      Throws ResponseNotFoundError when the response is not found (HTTP 404 — typically the ~10-minute retention window elapsed). Honors signal: an abort propagates as an AbortError from the underlying stream read.

      Parameters

      • id: string

        The OpenAI response id to reconnect to.

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

        apiKey, optional startingAfter SSE cursor (defaults to 0 — replay from the start of the stored stream), optional baseUrl, fetch, and signal.

      Returns Promise<TRetrievedResponse>