Protected ReadonlyloggerProtected ReadonlyreasoningModel ids whose organization rejected reasoning.summary (OpenAI requires a verified organization for summaries).
Later requests to these models omit the field.
Converts ToolRequest objects to the format expected by the Response API.
Optionaltools: ToolRequest<ToolInvocationContext>[]OptionaldeferredToolIds: string[]OptionalserverTools: string[]ProtectedcreateOptionalcancellationToken: CancellationTokenProtectedhandleReturns 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.
Handles Response API requests with proper tool calling cycles. Works for both streaming and non-streaming cases.
OptionalcancellationToken: CancellationTokenProcesses 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.
the list of messages to process.
how system and developer messages are handled during processing.
the OpenAI model identifier. Currently not used, but allows subclasses to implement model-specific behavior.
an object containing instructions and input formatted for the Response API.
ProtectedprocessMaps 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.
Streaming counterpart of sendWithReasoningSummaryFallback. The rejection arrives before any event, so nothing is emitted twice.
Protectedwithout
Utility class for handling OpenAI Response API requests and tool calling cycles.
This class encapsulates the complexity of the Response API's multi-turn conversation patterns for tool calling, keeping the main language model class clean and focused.