Package com.axelor.ai.chat.plugin
package com.axelor.ai.chat.plugin
-
ClassDescriptionResolves the agent/model/provider config from the DB and builds a real
LangChain4jChatProviderso the LLM actually responds.Places per-turn context beside the message it serves, not at the top of the prompt.Manages the LLM context window by transparently trimming message history when it exceeds the model's input token limit.Condenses the stretch of conversation that is rolling out of the context window.Names the fields a user message was sent with.Defends against prompt injection by injecting security rules into the conversation.Resolves structured user mentions into trusted model context.Summarizes by asking a model, on whatever provider the conversation already uses.The third layer of the confused-deputy defence: before the target agent consumes a discussion containing other members' text, an internal risk-assessor agent screens the fresh span (the human messages since the agent's last reply) for manipulation attempts.Incrementally builds structured session notes during a conversation.Keeps the agent's skill catalog in the system prompt, and backfills skill content the history does not carry.Pins the record a conversation is about.Pinned fields resolved once per model and path for one reader: a chat listing shows many chats pinned on the same few fields, and each resolve reads permissions and metadata.Titles a new chat once its first answer is in: a short model call over the user's message and the reply, run after the stream ends so the reader never waits on it, and announced to the chat's room like any other change.Estimates token counts forUIMessagelists using provider-specific tokenizers when available, falling back to a character-based heuristic for providers without public tokenizers.