ToolCall

@Serializable
data class ToolCall(val id: String, val name: String, val input: JsonObject, val invalidInput: String? = null)

A model's request to run the tool named name with input.

Constructors

Link copied to clipboard
constructor(id: String, name: String, input: JsonObject, invalidInput: String? = null)

Properties

Link copied to clipboard
val id: String

identifies the call, so its ChatMessage.ToolResult can refer to it.

Link copied to clipboard
val input: JsonObject

the arguments, in the shape of the tool's ToolSpec.inputSchema.

Link copied to clipboard

the text the model sent as the arguments when it is not a JSON object, and null when it is one. input is then empty, and List.execute answers the call with an error that quotes this text instead of running the tool, so the model can send the call again.

Link copied to clipboard