Class StreamingChatModelFactory

java.lang.Object
com.axelor.ai.chat.provider.StreamingChatModelFactory

public class StreamingChatModelFactory extends Object
Builds a LangChain4j StreamingChatModel from the DB-stored provider/model/agent config.

Request/response logging is controlled via axelor-config.properties:

 ai.logging.requests = true
 ai.logging.responses = true
 
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    dev.langchain4j.model.chat.StreamingChatModel
    create(AiProvider provider, AiModel model, AiAgent agent)
    A streaming model is always for a reply someone is waiting on — a chat turn, or a workflow step holding the request that saved its record — so it runs at the standard tier.
    static Integer
    replyTokens(AiProviderType type, AiModel model, AiAgent agent)
    The most tokens a reply may take, as the request asks for them: the agent's limit, else the model's, else on Anthropic the ANTHROPIC_MAX_TOKENS its API requires; null where the provider's own default applies.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • StreamingChatModelFactory

      public StreamingChatModelFactory()
  • Method Details

    • replyTokens

      public static Integer replyTokens(AiProviderType type, AiModel model, AiAgent agent)
      The most tokens a reply may take, as the request asks for them: the agent's limit, else the model's, else on Anthropic the ANTHROPIC_MAX_TOKENS its API requires; null where the provider's own default applies.
    • create

      public dev.langchain4j.model.chat.StreamingChatModel create(AiProvider provider, AiModel model, AiAgent agent)
      A streaming model is always for a reply someone is waiting on — a chat turn, or a workflow step holding the request that saved its record — so it runs at the standard tier.