Tool

@Serializable
sealed interface Tool : Message(source)

Represents messages exchanged with tools, either as calls or results.

Inheritors

Types

Link copied to clipboard
@Serializable
data class Call(val id: String?, val tool: String, val content: String) : Message.Tool, Message.Response

Represents a tool call message sent as a response.

Link copied to clipboard
@Serializable
data class Result(val id: String?, val tool: String, val content: String) : Message.Tool, Message.Request

Represents the result of a tool call sent as a request.

Properties

Link copied to clipboard
abstract val content: String

The content of the message.

Link copied to clipboard
abstract val id: String?

The unique identifier of the tool call.

Link copied to clipboard
abstract val role: Message.Role

The role associated with the message.

Link copied to clipboard
abstract val tool: String

The name of the tool used.