Class OpenAiChatModel
java.lang.Object
dev.langchain4j.model.openai.OpenAiChatModel
- All Implemented Interfaces:
ChatModel
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuilder()doChat(ChatRequest chatRequest) doChatAsync(ChatRequest chatRequest) SPI hook for a genuinely non-blocking chat implementation, invoked byChatModel.chatAsync(ChatRequest).provider()
-
Constructor Details
-
OpenAiChatModel
-
-
Method Details
-
defaultRequestParameters
- Specified by:
defaultRequestParametersin interfaceChatModel
-
supportedCapabilities
- Specified by:
supportedCapabilitiesin interfaceChatModel
-
doChat
-
doChatAsync
Description copied from interface:ChatModelSPI hook for a genuinely non-blocking chat implementation, invoked byChatModel.chatAsync(ChatRequest).The default returns a failed future carrying
AsyncNotSupportedExceptionto signal that this model has no native asynchronous implementation. Callers on the asynchronous and reactive path (for example the non-blocking RAG stages) detect this and either offload the blockingChatModel.doChat(ChatRequest)or fail loudly with an actionable message. A model backed by remote HTTP I/O overrides this with a genuinely asynchronous call (no thread parked).- Specified by:
doChatAsyncin interfaceChatModel- Parameters:
chatRequest- aChatRequest, containing all the inputs to the LLM- Returns:
- a
CompletableFutureof theChatResponse
-
listeners
-
provider
-
builder
-