Package dev.dokimos.core.agents
Record Class ToolCall
java.lang.Object
java.lang.Record
dev.dokimos.core.agents.ToolCall
- Record Components:
name- the name of the tool that was calledarguments- the arguments passed to the toolresult- the tool execution result (may be null)metadata- optional metadata (latency, tokens, etc.)
public record ToolCall(String name, Map<String,Object> arguments, String result, Map<String,Object> metadata)
extends Record
Represents a single tool invocation made by an AI agent.
Contains the tool name, arguments passed, optional result, and metadata such as latency or token usage.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder for constructing tool calls. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theargumentsrecord component.static ToolCall.Builderbuilder()Creates a new builder for constructing tool calls.final booleanIndicates whether some other object is "equal to" this one.static ToolCallCreates a tool call from a map, typically when deserializing from a JSON dataset.final inthashCode()Returns a hash code value for this object.metadata()Returns the value of themetadatarecord component.name()Returns the value of thenamerecord component.static ToolCallCreates a tool call with just a name and arguments.result()Returns the value of theresultrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
of
Creates a tool call with just a name and arguments.- Parameters:
name- the tool namearguments- the arguments passed to the tool- Returns:
- a new tool call
-
fromMap
Creates a tool call from a map, typically when deserializing from a JSON dataset.Expected keys:
"name","arguments","result","metadata".- Parameters:
map- the map to create from- Returns:
- a new tool call
-
builder
Creates a new builder for constructing tool calls.- Returns:
- a new builder
-
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). -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord 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
-
metadata
Returns the value of themetadatarecord component.- Returns:
- the value of the
metadatarecord component
-