Package dyntabs.ai.agent
Record Class AgentStep
java.lang.Object
java.lang.Record
dyntabs.ai.agent.AgentStep
- Record Components:
stepNumber- the sequence number of this step, starting from 1toolName- the name of the service method that was called (e.g."checkStock")arguments- the JSON string of arguments passed to the methodresult- the string result returned by the method, or a structured error message
public record AgentStep(int stepNumber, String toolName, String arguments, String result)
extends Record
Represents a single tool call made by the agent during task execution.
Each time the agent calls one of your registered service methods,
an AgentStep is created and passed to the StepListener
(if one was registered via AgentBuilder.withStepListener()).
EasyAgent agent = EasyAI.agent()
.withServices(orderService, inventoryService)
.withStepListener(step ->
log.info("[AGENT] Step {}: {}({}) -> {}",
step.stepNumber(), step.toolName(),
step.arguments(), step.result()))
.build();
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theargumentsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.result()Returns the value of theresultrecord component.intReturns the value of thestepNumberrecord component.toolName()Returns the value of thetoolNamerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
AgentStep
Creates an instance of aAgentSteprecord class.- Parameters:
stepNumber- the value for thestepNumberrecord componenttoolName- the value for thetoolNamerecord componentarguments- the value for theargumentsrecord componentresult- the value for theresultrecord component
-
-
Method Details
-
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. -
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. -
equals
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
stepNumber
public int stepNumber()Returns the value of thestepNumberrecord component.- Returns:
- the value of the
stepNumberrecord component
-
toolName
Returns the value of thetoolNamerecord component.- Returns:
- the value of the
toolNamerecord component
-
arguments
Returns the value of theargumentsrecord component.- Returns:
- the value of the
argumentsrecord component
-
result
Returns the value of theresultrecord component.- Returns:
- the value of the
resultrecord component
-