Record Class AgentInvocation

java.lang.Object
java.lang.Record
dev.langchain4j.agentic.scope.AgentInvocation
Record Components:
skipReason - why the agent was not invoked, because its activation condition was false or because it is optional and one of its arguments was missing, or null when it was invoked. The output of a skipped agent is the current value of its output key. Skipped invocations are not registered in the AgenticScope.

public record AgentInvocation(Class<?> agentType, String agentName, String agentId, Map<String,Object> input, Object output, String skipReason) extends Record
The invocation of an agent, as notified to the planner of its parent.
  • Constructor Details

    • AgentInvocation

      public AgentInvocation(Class<?> agentType, String agentName, String agentId, Map<String,Object> input, Object output)
    • AgentInvocation

      public AgentInvocation(Class<?> agentType, String agentName, String agentId, Map<String,Object> input, Object output, String skipReason)
      Creates an instance of a AgentInvocation record class.
      Parameters:
      agentType - the value for the agentType record component
      agentName - the value for the agentName record component
      agentId - the value for the agentId record component
      input - the value for the input record component
      output - the value for the output record component
      skipReason - the value for the skipReason record component
  • Method Details

    • skipped

      public boolean skipped()
      Returns true if the agent was skipped instead of being invoked.
    • output

      public Object output()
      Returns the value of the output record component.
      Returns:
      the value of the output record component
    • toString

      public String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • agentType

      public Class<?> agentType()
      Returns the value of the agentType record component.
      Returns:
      the value of the agentType record component
    • agentName

      public String agentName()
      Returns the value of the agentName record component.
      Returns:
      the value of the agentName record component
    • agentId

      public String agentId()
      Returns the value of the agentId record component.
      Returns:
      the value of the agentId record component
    • input

      public Map<String,Object> input()
      Returns the value of the input record component.
      Returns:
      the value of the input record component
    • skipReason

      public String skipReason()
      Returns the value of the skipReason record component.
      Returns:
      the value of the skipReason record component