Package akka.javasdk.agent
Record Class Agent.AgentReply<T>
- Type Parameters:
T- The type of the result value- Record Components:
value- The result of the agent calltokenUsage- The token usage from the AI model interaction
- Enclosing class:
Agent
A detailed reply from an agent component call, containing both the result and additional
information, like token usage.
-
Constructor Summary
ConstructorsConstructorDescriptionAgentReply(T value, Agent.TokenUsage tokenUsage) Creates an instance of aAgentReplyrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thetokenUsagerecord component.final StringtoString()Returns a string representation of this record class.value()Returns the value of thevaluerecord component.
-
Constructor Details
-
AgentReply
Creates an instance of aAgentReplyrecord class.- Parameters:
value- the value for thevaluerecord componenttokenUsage- the value for thetokenUsagerecord 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. All components in this record class are compared withObjects::equals(Object,Object). -
value
Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-
tokenUsage
Returns the value of thetokenUsagerecord component.- Returns:
- the value of the
tokenUsagerecord component
-