Package com.axelor.ai.chat.plugin
Class AgentResolverPlugin
java.lang.Object
com.axelor.ai.chat.plugin.AgentResolverPlugin
- All Implemented Interfaces:
ChatPlugin
Resolves the agent/model/provider config from the DB and builds a real
LangChain4jChatProvider so the LLM actually responds.-
Method Summary
Modifier and TypeMethodDescriptiondecorateProvider(ChatRequest request, ChatProvider provider) Wraps the provider to intercept or enrich LLM calls (e.g.intestimateInjectedTokens(ChatRequest request) Estimates the number of tokens this plugin will inject into the message list duringChatPlugin.decorateProvider(com.axelor.ai.chat.ChatRequest, com.axelor.ai.chat.ChatProvider).onRequest(ChatRequest request) Called before the loop starts.intpriority()Execution priority.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.axelor.ai.chat.ChatPlugin
decorateToolExecutor, decorateWriter, onComplete, onError, onMessage
-
Method Details
-
priority
public int priority()Description copied from interface:ChatPluginExecution priority. Lower values run first. Default is 100.- Specified by:
priorityin interfaceChatPlugin
-
onRequest
Description copied from interface:ChatPluginCalled before the loop starts. May inspect or transform the request (e.g. resolve agent config, check rate limits).- Specified by:
onRequestin interfaceChatPlugin
-
estimateInjectedTokens
Description copied from interface:ChatPluginEstimates the number of tokens this plugin will inject into the message list duringChatPlugin.decorateProvider(com.axelor.ai.chat.ChatRequest, com.axelor.ai.chat.ChatProvider). Used by the context window plugin to compute an accurate budget that accounts for system prompts, RAG context, skill content, etc.Implementations should return a conservative (high) estimate. Return 0 if this plugin does not inject content.
- Specified by:
estimateInjectedTokensin interfaceChatPlugin
-
decorateProvider
Description copied from interface:ChatPluginWraps the provider to intercept or enrich LLM calls (e.g. RAG, system prompt injection).- Specified by:
decorateProviderin interfaceChatPlugin
-