Package com.axelor.ai.chat
Interface ChatProvider
- All Known Implementing Classes:
LangChain4jChatProvider,NoOpChatProvider
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Abstraction for calling an LLM and receiving streaming chunks via callbacks.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceReceives streaming chunks from an LLM response. -
Method Summary
Modifier and TypeMethodDescriptionvoidstream(List<UIMessage> messages, ChatProvider.Listener listener) Sends the conversation history to the LLM and streams the response back via the listener.
-
Method Details
-
stream
Sends the conversation history to the LLM and streams the response back via the listener.Implementations must call
ChatProvider.Listener.onFinish(com.axelor.ai.chat.ChatResult)exactly once, after all content callbacks. This method blocks until the LLM response is fully consumed.- Parameters:
messages- the conversation history to sendlistener- receives streaming deltas and the finish signal
-