Theia API Documentation v1.77.0
    Preparing search index...

    Adapts the OpenAI Response API request to the additional constraints of the ChatGPT endpoint. Bound under its own symbol so the plain OpenAI models keep using OpenAiResponseApiUtils.

    Hierarchy (View Summary)

    Index
    compactionProvider: "chatgpt-responses" = 'chatgpt-responses'

    Provider identity used for compaction emission and replay; encrypted context is not portable across backends.

    logger: ILogger
    reasoningSummaryRejectedModels: Set<string>

    Model ids whose organization rejected reasoning.summary (OpenAI requires a verified organization for summaries). Later requests to these models omit the field.

    streamingRetry: OpenAiStreamingRetry
    toolCallExecutor: ToolCallExecutor
    • Returns true and remembers the rejection when error is the 400 an unverified organization gets for reasoning.summary, so the request can be sent once more without it.

      Parameters

      • error: unknown
      • sentSettings: Record<string, unknown>
      • modelId: string

      Returns boolean

    • Processes the provided list of messages by applying system message adjustments and converting them directly to the format expected by the OpenAI Response API.

      This method converts messages directly without going through ChatCompletionMessageParam types.

      Parameters

      • messages: LanguageModelMessage[]

        the list of messages to process.

      • developerMessageSettings: DeveloperMessageSettings

        how system and developer messages are handled during processing.

      • model: string

        the OpenAI model identifier. Currently not used, but allows subclasses to implement model-specific behavior.

      Returns { input: ResponseInputItem[]; instructions?: string }

      an object containing instructions and input formatted for the Response API.

    • Maps a reasoning-summary stream event to a thinking part. With reasoning.summary set, the Responses API streams one or more summary_text parts per reasoning item; parts after the first are separated by a blank line.

      Parameters

      • event: ResponseStreamEvent

      Returns ThinkingResponsePart | undefined

    • Sends a Responses API request, retrying once without reasoning.summary if the organization is not allowed to request it.

      Type Parameters

      • T

      Parameters

      • settings: Record<string, unknown>
      • modelId: string
      • send: (settings: Record<string, unknown>) => Promise<T>

      Returns Promise<T>

    • Parameters

      • openai: OpenAI
      • parameters: ResponseCreateParamsStreaming
      • OptionalcancellationToken: CancellationToken

      Returns AsyncIterable<ResponseStreamEvent>

    • Streaming counterpart of sendWithReasoningSummaryFallback. The rejection arrives before any event, so nothing is emitted twice.

      Parameters

      • settings: Record<string, unknown>
      • modelId: string
      • open: (settings: Record<string, unknown>) => AsyncIterable<ResponseStreamEvent>

      Returns AsyncIterable<ResponseStreamEvent>

    • Parameters

      • settings: Record<string, unknown>
      • modelId: string

      Returns Record<string, unknown>