Interface AgentToolExecutor.AgentContext

All Known Implementing Classes:
AgentOrchestrator
Enclosing class:
AgentToolExecutor

public static interface AgentToolExecutor.AgentContext
Context interface for Agent - provides access to agent internals. This avoids circular dependency while allowing the executor to access what it needs.

Note: Method names use "getAgent*" pattern to avoid conflicts with Agent's protected abstract template methods.

  • Method Details

    • getAgentId

      String getAgentId()
    • getAgentName

      String getAgentName()
    • getAgentRoles

      List<Role> getAgentRoles()
    • getAgentLLM

      LLMClient getAgentLLM()
    • getAgentMemoryStore

      MemoryStore getAgentMemoryStore()
    • getAgentActionExecutor

      ActionExecutor getAgentActionExecutor()
    • getAgentSchemaGenerator

      ToolSchemaGenerator getAgentSchemaGenerator()
    • getAgentKnowledgeSources

      default List<KnowledgeSourceConfig> getAgentKnowledgeSources()
      The sources of the agent's action-level knowledge.
      Returns:
      action-level knowledge sources
      Since:
      0.13.0
    • getAgentKnowledgeEntries

      default List<KnowledgeEntry> getAgentKnowledgeEntries()
      The agent's action-level knowledge with each entry's use. By default every getAgentKnowledgeSources() source, searched.
      Returns:
      the agent's knowledge entries
      Since:
      0.18.0
    • getAgentActionKnowledge

      default Map<String,List<String>> getAgentActionKnowledge()
      The knowledge some actions use instead of what their @ActionSpec names: entry names by action name.
      Returns:
      entry names by action name; empty by default
      Since:
      0.18.0
    • getAgentKnowledgeScope

      default Optional<KnowledgeScope> getAgentKnowledgeScope()
    • reportKnowledgeUsage

      default void reportKnowledgeUsage(String scope, List<KnowledgeUsage> usage)
      Receives what each knowledge source gave one scope: an action name, or "chat" for a chat turn. Does nothing by default.
      Parameters:
      scope - the action name or "chat"
      usage - one row per source, in declaration order
      Since:
      0.18.0
    • executeWithSpinner

      <T> T executeWithSpinner(Supplier<T> operation)
      Callback for executing spinner-wrapped operations
    • chatInternal

      String chatInternal(String message, boolean useHistory)
      Callback for follow-up chat after tool execution (tools disabled, prevents recursion)
    • chatInternalWithTools

      default Object chatInternalWithTools(String message, boolean useHistory)
      Callback for follow-up chat with tools enabled (for multi-turn tool loops). Returns raw Object (ChatResponse or String) so caller can check for more tool calls.
    • chatInternalWithTools

      default Object chatInternalWithTools(String message, boolean useHistory, String retrievalQuery, ChatRetrievalContext retrievalContext)
      Tool-loop follow-up preserving the originating RAG turn.
    • chatInternal

      default String chatInternal(String message, boolean useHistory, String retrievalQuery, ChatRetrievalContext retrievalContext)
      No-tools follow-up preserving the originating RAG turn.
    • restartAgent

      void restartAgent(String reason)
      Callback for agent restart
    • getEvalContext

      default EvalContext getEvalContext()
      Gets the evaluation context for metric collection
    • fireOnBeforeToolCall

      default void fireOnBeforeToolCall(String toolName, Map<String,Object> arguments)
      Fires onBeforeToolCall hook
    • fireOnAfterToolCall

      default void fireOnAfterToolCall(String toolName, Object result, boolean success, long latencyMs)
      Fires onAfterToolCall hook