Class MessagesAgentHook
java.lang.Object
com.alibaba.cloud.ai.graph.agent.hook.messages.MessagesAgentHook
- All Implemented Interfaces:
Hook
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classInternal static class that proxies MessagesAgentHook and implements AsyncNodeActionWithConfig interface for afterAgent hook.static classInternal static class that proxies MessagesAgentHook and implements AsyncNodeActionWithConfig interface. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionafterAgent(List<org.springframework.ai.chat.messages.Message> previousMessages, RunnableConfig config) Creates an AfterAgentAction instance for the given MessagesAgentHook.beforeAgent(List<org.springframework.ai.chat.messages.Message> previousMessages, RunnableConfig config) Creates a BeforeAgentAction instance for the given MessagesAgentHook.voidsetAgentName(String agentName) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.alibaba.cloud.ai.graph.agent.hook.Hook
canJumpTo, getAgent, getHookPositions, getKeyStrategys, getName, setAgent
-
Constructor Details
-
MessagesAgentHook
public MessagesAgentHook()
-
-
Method Details
-
beforeAgent
public AgentCommand beforeAgent(List<org.springframework.ai.chat.messages.Message> previousMessages, RunnableConfig config) -
afterAgent
public AgentCommand afterAgent(List<org.springframework.ai.chat.messages.Message> previousMessages, RunnableConfig config) -
setAgentName
- Specified by:
setAgentNamein interfaceHook
-
getAgentName
- Specified by:
getAgentNamein interfaceHook
-
beforeAgentAction
Creates a BeforeAgentAction instance for the given MessagesAgentHook.- Parameters:
hook- the MessagesAgentHook instance to proxy- Returns:
- a BeforeAgentAction instance
-
afterAgentAction
Creates an AfterAgentAction instance for the given MessagesAgentHook.- Parameters:
hook- the MessagesAgentHook instance to proxy- Returns:
- an AfterAgentAction instance
-