Class LangChain4jChatProvider

java.lang.Object
com.axelor.ai.chat.provider.LangChain4jChatProvider
All Implemented Interfaces:
ChatProvider

public class LangChain4jChatProvider extends Object implements ChatProvider
Adapts a LangChain4j StreamingChatModel to the ChatProvider interface.

Converts UIMessage history to LangChain4j message types, streams the response via ChatProvider.Listener callbacks, and blocks until the LLM finishes.

  • Field Details

    • DEFAULT_SILENCE

      public static final Duration DEFAULT_SILENCE
      How long a model may send nothing when its own timeout does not say.
  • Constructor Details

    • LangChain4jChatProvider

      public LangChain4jChatProvider(dev.langchain4j.model.chat.StreamingChatModel model, List<dev.langchain4j.agent.tool.ToolSpecification> toolSpecs, String modelCode, String providerCode, Integer rateLimit, AiRateLimiter rateLimiter, Duration silence)
      Parameters:
      silence - how long the call may send nothing before it is given up; a call that keeps writing, a long reasoning one included, runs for as long as it writes
  • Method Details