Class OpenAiResponsesChatModel
- All Implemented Interfaces:
ChatModel,StreamingChatModel,Model<Prompt,,ChatResponse> StreamingModel<Prompt,ChatResponse>
ChatModel backed by OpenAI's Responses API (/v1/responses), the
endpoint where new OpenAI capability lands. Notably, it is the only way to combine
reasoning with tool calling on GPT-5.4 and later, which Chat Completions no longer
supports.
This model is stateless. Every call sends the whole Prompt;
OpenAI is never asked to remember the conversation, so
ChatMemory, advisors, RAG all
keep working exactly as they do with OpenAiChatModel. The stateful modes are
not supported.
Like OpenAiChatModel since 2.0.0, this model runs no tool loop:
multi-round tool calling belongs to ToolCallingAdvisor, which is what keeps the
behaviour identical across providers.
Known limitations: audio input and output, n, stop sequences, frequency and
presence penalties, seed and logit_bias have no equivalent here; many
OpenAI-compatible backends implement /v1/chat/completions but not
/v1/responses; and reasoning continuity across turns depends on the chat memory
repository in use, since none of them persists
message parts yet - see
the reference documentation for the details.
- Since:
- 2.1.0
- Author:
- Dimitar Proynov
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder forOpenAiResponsesChatModelinstances. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Executes a method call to the AI model.Gets the chat options for this model.voidsetObservationConvention(ChatModelObservationConvention observationConvention) Use the provided convention for reporting observation data.reactor.core.publisher.Flux<ChatResponse>Executes a method call to the AI model.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.ai.chat.model.ChatModel
call, call, getDefaultOptionsMethods inherited from interface org.springframework.ai.chat.model.StreamingChatModel
stream, stream
-
Method Details
-
builder
-
getOptions
Description copied from interface:ChatModelGets the chat options for this model.- Specified by:
getOptionsin interfaceChatModel- Returns:
- the chat options
-
call
Description copied from interface:ModelExecutes a method call to the AI model. -
stream
Description copied from interface:StreamingModelExecutes a method call to the AI model.- Specified by:
streamin interfaceChatModel- Specified by:
streamin interfaceStreamingChatModel- Specified by:
streamin interfaceStreamingModel<Prompt,ChatResponse> - Parameters:
prompt- the request object to be sent to the AI model- Returns:
- the streaming response from the AI model
-
setObservationConvention
Use the provided convention for reporting observation data.- Parameters:
observationConvention- the provided convention
-