Class ComposedAgentListener
java.lang.Object
dev.langchain4j.agentic.observability.ComposedAgentListener
- All Implemented Interfaces:
AgentListener
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(AgentListener listener) voidafterAgenticScopeCreated(AgenticScope agenticScope) voidafterAgentInvocation(AgentResponse agentResponse) voidafterAgentToolExecution(AfterAgentToolExecution afterAgentToolExecution) voidbeforeAgenticScopeDestroyed(AgenticScope agenticScope) voidbeforeAgentInvocation(AgentRequest agentRequest) voidbeforeAgentToolExecution(BeforeAgentToolExecution beforeAgentToolExecution) static AgentListenercomposeWithInherited(AgentListener localListener, AgentListener parentListener) booleancontains(AgentListener listener) booleanIndicates whether this listener should be used only to the agent where it is registered (default) or also inherited by its subagents.voidonAgentInvocationError(AgentInvocationError agentInvocationError)
-
Constructor Details
-
ComposedAgentListener
-
-
Method Details
-
addListener
-
listeners
-
beforeAgentInvocation
- Specified by:
beforeAgentInvocationin interfaceAgentListener
-
afterAgentInvocation
- Specified by:
afterAgentInvocationin interfaceAgentListener
-
onAgentInvocationError
- Specified by:
onAgentInvocationErrorin interfaceAgentListener
-
afterAgentToolExecution
- Specified by:
afterAgentToolExecutionin interfaceAgentListener
-
beforeAgentToolExecution
- Specified by:
beforeAgentToolExecutionin interfaceAgentListener
-
afterAgenticScopeCreated
- Specified by:
afterAgenticScopeCreatedin interfaceAgentListener
-
beforeAgenticScopeDestroyed
- Specified by:
beforeAgenticScopeDestroyedin interfaceAgentListener
-
composeWithInherited
public static AgentListener composeWithInherited(AgentListener localListener, AgentListener parentListener) -
contains
-
inheritedBySubagents
public boolean inheritedBySubagents()Description copied from interface:AgentListenerIndicates whether this listener should be used only to the agent where it is registered (default) or also inherited by its subagents.- Specified by:
inheritedBySubagentsin interfaceAgentListener- Returns:
- true if the listener should be inherited by sub-agents, false otherwise
-