Package akka.javasdk.ledger
Record Class ModelResponse
- Record Components:
id- the id of this model response, a seam for correlating finer-grained recordscontent- the text content the model producedtokenUsage- the tokens this model call consumed and produced. An interaction that an older runtime recorded reports no cache activity, andtotalInputTokensequalsinputTokens.thinking- the model's reasoning/thinking output, or empty if none was recordedtoolCalls- the tool calls the model requested within this response, in order
public record ModelResponse(String id, String content, Agent.TokenUsage tokenUsage, String thinking, List<ToolCall> toolCalls)
extends Record
A single model call within an interaction.
-
Constructor Summary
ConstructorsConstructorDescriptionModelResponse(String id, String content, int inputTokenCount, int outputTokenCount, String thinking, List<ToolCall> toolCalls) A model response with no prompt cache activity.ModelResponse(String id, String content, Agent.TokenUsage tokenUsage, String thinking, List<ToolCall> toolCalls) Creates an instance of aModelResponserecord class. -
Method Summary
Modifier and TypeMethodDescriptioncontent()Returns the value of thecontentrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.intThe number of tokens in the input to this model call, as reported by the provider.intThe number of tokens the model produced.thinking()Returns the value of thethinkingrecord component.Returns the value of thetokenUsagerecord component.Returns the value of thetoolCallsrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ModelResponse
public ModelResponse(String id, String content, int inputTokenCount, int outputTokenCount, String thinking, List<ToolCall> toolCalls) A model response with no prompt cache activity. -
ModelResponse
public ModelResponse(String id, String content, Agent.TokenUsage tokenUsage, String thinking, List<ToolCall> toolCalls) Creates an instance of aModelResponserecord class.- Parameters:
id- the value for theidrecord componentcontent- the value for thecontentrecord componenttokenUsage- the value for thetokenUsagerecord componentthinking- the value for thethinkingrecord componenttoolCalls- the value for thetoolCallsrecord component
-
-
Method Details
-
inputTokenCount
public int inputTokenCount()The number of tokens in the input to this model call, as reported by the provider. -
outputTokenCount
public int outputTokenCount()The number of tokens the model produced. -
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). -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
content
Returns the value of thecontentrecord component.- Returns:
- the value of the
contentrecord component
-
tokenUsage
Returns the value of thetokenUsagerecord component.- Returns:
- the value of the
tokenUsagerecord component
-
thinking
Returns the value of thethinkingrecord component.- Returns:
- the value of the
thinkingrecord component
-
toolCalls
Returns the value of thetoolCallsrecord component.- Returns:
- the value of the
toolCallsrecord component
-