FunctionCallItem

@Serializable
class FunctionCallItem(val callId: String, val name: String, val arguments: String, val id: String? = null, val status: ResponseStatus? = null) : ResponseItem

A function the model asked to call.

Answer it with a FunctionCallOutputItem carrying the same callId; every call in the history must have its matching output, or the API answers 400.

Constructors

Link copied to clipboard
constructor(callId: String, name: String, arguments: String, id: String? = null, status: ResponseStatus? = null)

Properties

Link copied to clipboard

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

Link copied to clipboard

Identifier pairing the call with its output. Must be non-empty and unique.

Link copied to clipboard
val id: String?

Identifier the API assigned to the item; null on an item the caller built.

Link copied to clipboard

Name of the function to call.

Link copied to clipboard

Generation state of the item; null on an item the caller built.

Link copied to clipboard
open override val type: String

Raw type discriminator of the item.

Functions

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

Parses FunctionCallItem.arguments into a JsonObject, or returns null when the model produced 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