Package com.tnsai.agents.chat
Interface AgentChatOrchestrator.ChatContext
- All Known Implementing Classes:
AgentOrchestrator
- Enclosing class:
AgentChatOrchestrator
public static interface AgentChatOrchestrator.ChatContext
Context interface for Agent - provides access to agent internals needed for chat.
This avoids circular dependency while allowing the orchestrator to access what it needs.
-
Method Summary
Modifier and TypeMethodDescriptionexecuteToolCalls(ChatResponse response, boolean useHistory) Executes tool calls from a ChatResponsedefault StringexecuteToolCalls(ChatResponse response, boolean useHistory, String retrievalQuery, ChatRetrievalContext retrievalContext) Executes tool calls while preserving the originating RAG turn.<T> TexecuteWithSpinner(Supplier<T> operation) Executes an operation with a spinner (for non-LLM operations)Class<?> Returns the agent's concrete class (for annotation inspection)Returns the agent's unique identifierReturns the LLM client for chat operationsReturns the memory store for conversation historyReturns the agent's display namedefault Optional<ChatKnowledgeBinding> Returns the canonical chat retrieval binding, if configured.default List<ChatKnowledgeBinding> Returns every chat retrieval binding a turn searches, in the order their evidence renders: the binding of the SEARCH knowledge other than MEMORY, then the MEMORY binding.default Optional<ChatKnowledgeContext> Returns the DIRECT and SEQUENTIAL knowledge each chat turn gives, if the agent declares any.Returns the system prompt for the agentReturns the tools available for LLM function calling (List<Map<String, Object>>JSON-Schema fragments).default voidreportKnowledgeUsage(String scope, List<KnowledgeUsage> usage) Receives what each knowledge source gave onescope: an action name, or"chat"for a chat turn.
-
Method Details
-
getAgentId
String getAgentId()Returns the agent's unique identifier -
getAgentName
String getAgentName()Returns the agent's display name -
getAgentLLM
LLMClient getAgentLLM()Returns the LLM client for chat operations -
getAgentMemoryStore
MemoryStore getAgentMemoryStore()Returns the memory store for conversation history -
getSystemPrompt
String getSystemPrompt()Returns the system prompt for the agent -
getToolsForLLM
Returns the tools available for LLM function calling (List<Map<String, Object>>JSON-Schema fragments). -
executeToolCalls
Executes tool calls from a ChatResponse -
executeToolCalls
default String executeToolCalls(ChatResponse response, boolean useHistory, String retrievalQuery, ChatRetrievalContext retrievalContext) Executes tool calls while preserving the originating RAG turn. -
executeWithSpinner
Executes an operation with a spinner (for non-LLM operations) -
getAgentClass
Class<?> getAgentClass()Returns the agent's concrete class (for annotation inspection) -
getChatKnowledgeBinding
Returns the canonical chat retrieval binding, if configured. -
getChatKnowledgeBindings
Returns every chat retrieval binding a turn searches, in the order their evidence renders: the binding of the SEARCH knowledge other than MEMORY, then the MEMORY binding. The default givesgetChatKnowledgeBinding()alone.- Since:
- 0.18.6
-
getChatKnowledgeContext
Returns the DIRECT and SEQUENTIAL knowledge each chat turn gives, if the agent declares any.- Since:
- 0.18.0
-
reportKnowledgeUsage
Receives what each knowledge source gave onescope: 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
-