Package com.tnsai.agents.orchestration
Interface AgentOrchestrator.OrchestratorContext
- All Known Implementing Classes:
Agent,ConfigurableAgent
- Enclosing class:
AgentOrchestrator
public static interface AgentOrchestrator.OrchestratorContext
Bridge interface implemented by
Agent to provide core
data and callbacks to the orchestrator.-
Method Summary
Modifier and TypeMethodDescriptionvoidvoidfireOnAfterChat(String result, long latencyMs) voidfireOnAfterToolCall(String toolName, Object result, boolean success, long latencyMs) voidfireOnBeforeChat(String message) voidfireOnBeforeToolCall(String toolName, Map<String, Object> arguments) voidfireOnError(Exception e, String context) Class<?> default List<KnowledgeEntry> default Optional<KnowledgeScope> default List<KnowledgeSourceConfig> booleanbooleanvoidvoidrecordToolOutcome(String toolName, Object result, boolean success, long latencyMs) default voidreportKnowledgeUsage(String scope, List<KnowledgeUsage> usage) Receives what each knowledge source gave onescope: an action name, or"chat"for a chat turn.voidrestartAgent(String reason) void
-
Method Details
-
getAgentId
String getAgentId() -
getAgentName
String getAgentName() -
getAgentClass
Class<?> getAgentClass() -
getAgentLLM
LLMClient getAgentLLM() -
getAgentMemoryStore
MemoryStore getAgentMemoryStore() -
getAgentActionExecutor
ActionExecutor getAgentActionExecutor() -
getAgentSchemaGenerator
ToolSchemaGenerator getAgentSchemaGenerator() -
getAgentRoles
-
getAgentKnowledgeSources
- Returns:
- the sources of the agent's action-level knowledge
- Since:
- 0.13.0
-
getAgentKnowledgeEntries
- Returns:
- the agent's knowledge with each entry's
use; by default everygetAgentKnowledgeSources()source, searched - Since:
- 0.18.0
-
getAgentActionKnowledge
- Returns:
- entry names by action name that replace an action's own knowledge; empty by default
- Since:
- 0.18.0
-
getAgentKnowledgeScope
-
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
-
getMaxContextTokensDirect
Integer getMaxContextTokensDirect() -
getSystemPrompt
String getSystemPrompt() -
getErrorRecoveryScenariosDirect
List<ErrorRecoveryScenario> getErrorRecoveryScenariosDirect() -
getEventPublisher
TnsAIEventPublisher getEventPublisher() -
getEventHandlerRegistry
EventHandlerRegistry getEventHandlerRegistry() -
notifyActivity
void notifyActivity() -
restartAgent
-
ensureEvalContext
void ensureEvalContext() -
getEvalContext
EvalContext getEvalContext() -
fireOnBeforeChat
-
fireOnAfterChat
-
fireOnError
-
fireOnBeforeToolCall
-
fireOnAfterToolCall
-
recordToolOutcome
-
isReasoningEnabled
boolean isReasoningEnabled() -
getReasoningStrategyRaw
ReasoningStrategyHandle getReasoningStrategyRaw() -
setLastReasoningResult
-
isContextGraphEnabled
boolean isContextGraphEnabled() -
getContextManagerDirect
ContextManagerHandle getContextManagerDirect()
-