FunctionResponse

@Serializable
class FunctionResponse(val name: String, val arguments: String?) : ToolFunction

Function invocation emitted by the model inside a ToolCall.

Constructors

Link copied to clipboard
constructor(name: String, arguments: String?)

Properties

Link copied to clipboard

Arguments the model generated, as a raw JSON string. Not guaranteed to be valid JSON, nor to match the schema declared in the corresponding FunctionRequest.parameters; argumentsAsJsonOrNull parses it defensively.

Link copied to clipboard
open override val name: String

Name of the function the model asked to call.

Functions

Link copied to clipboard
fun FunctionResponse.argumentsAsJsonOrNull(json: Json = Json): JsonObject?

Parses FunctionResponse.arguments into a JsonObject, or returns null when the model produced no arguments, malformed JSON, or a JSON value that is not an object.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String