Package com.tnsai.coordination
Record Class ScatterGather.AgentResponse
java.lang.Object
java.lang.Record
com.tnsai.coordination.ScatterGather.AgentResponse
- Enclosing class:
ScatterGather
public static record ScatterGather.AgentResponse(String agentId, String agentName, String response, long durationMs, boolean success, String error)
extends Record
Response from a single agent.
-
Constructor Summary
ConstructorsConstructorDescriptionAgentResponse(String agentId, String agentName, String response, long durationMs, boolean success, String error) Creates an instance of aAgentResponserecord class. -
Method Summary
Modifier and TypeMethodDescriptionagentId()Returns the value of theagentIdrecord component.Returns the value of theagentNamerecord component.longReturns the value of thedurationMsrecord component.final booleanIndicates whether some other object is "equal to" this one.error()Returns the value of theerrorrecord component.static ScatterGather.AgentResponsestatic ScatterGather.AgentResponsefinal inthashCode()Returns a hash code value for this object.response()Returns the value of theresponserecord component.booleansuccess()Returns the value of thesuccessrecord component.static ScatterGather.AgentResponsefinal StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
AgentResponse
public AgentResponse(String agentId, String agentName, String response, long durationMs, boolean success, String error) Creates an instance of aAgentResponserecord class.- Parameters:
agentId- the value for theagentIdrecord componentagentName- the value for theagentNamerecord componentresponse- the value for theresponserecord componentdurationMs- the value for thedurationMsrecord componentsuccess- the value for thesuccessrecord componenterror- the value for theerrorrecord component
-
-
Method Details
-
success
public static ScatterGather.AgentResponse success(com.tnsai.agents.Agent agent, String response, long durationMs) -
failure
public static ScatterGather.AgentResponse failure(com.tnsai.agents.Agent agent, String error, long durationMs) -
failure
-
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 '=='. -
agentId
Returns the value of theagentIdrecord component.- Returns:
- the value of the
agentIdrecord component
-
agentName
Returns the value of theagentNamerecord component.- Returns:
- the value of the
agentNamerecord component
-
response
Returns the value of theresponserecord component.- Returns:
- the value of the
responserecord component
-
durationMs
public long durationMs()Returns the value of thedurationMsrecord component.- Returns:
- the value of the
durationMsrecord component
-
success
public boolean success()Returns the value of thesuccessrecord component.- Returns:
- the value of the
successrecord component
-
error
Returns the value of theerrorrecord component.- Returns:
- the value of the
errorrecord component
-