Class SkillPlugin

java.lang.Object
com.axelor.ai.chat.plugin.SkillPlugin
All Implemented Interfaces:
ChatPlugin

public class SkillPlugin extends Object implements ChatPlugin
Keeps the agent's skill catalog in the system prompt, and backfills skill content the history does not carry.

use_skill returns the skill's content as its result, so a loaded skill lives in the conversation at the point it was loaded. The catalog is therefore the same every turn, and a provider can cache everything after it.

A use_skill result that carries no content — recorded before results did, or cleared — is backfilled from the database, so such a skill stays loaded. ContextWindowPlugin exempts use_skill results from output compression for the same reason.

Priority 35: runs after KnowledgePlugin (30) and before ToolExecutorPlugin (40).

  • Method Details

    • priority

      public int priority()
      Description copied from interface: ChatPlugin
      Execution priority. Lower values run first. Default is 100.
      Specified by:
      priority in interface ChatPlugin
    • estimateInjectedTokens

      public int estimateInjectedTokens(ChatRequest request)
      Estimate: the catalog when no skill is active, otherwise the skill content this turn will inject, measured from the history as it stands before trimming.

      Measured rather than assumed: a skill plus a few references runs to several thousand tokens, and a flat guess under-reserves the budget, which makes ContextWindowPlugin trim too little and push the request over the model's window.

      Specified by:
      estimateInjectedTokens in interface ChatPlugin
    • decorateProvider

      public ChatProvider decorateProvider(ChatRequest request, ChatProvider provider)
      Description copied from interface: ChatPlugin
      Wraps the provider to intercept or enrich LLM calls (e.g. RAG, system prompt injection).
      Specified by:
      decorateProvider in interface ChatPlugin