Tool

@Serializable
sealed class Tool : AgentMessage(source)

表示一次工具调用。

Inheritors

Types

Link copied to clipboard
@Serializable
data class Call(val id: UUID, val timestamp: Instant, val callId: String, val callName: String, val arguments: String, val reason: String?, val validatedToolName: String?, val validatedArgs: JsonElement?, val resolvedRequest: JsonElement?, val presentation: ToolPresentation?) : AgentMessage.Tool

工具调用请求,来自 LLM。

Link copied to clipboard
@Serializable
data class Result(val id: UUID, val timestamp: Instant, val callId: String, val content: String, val data: JsonElement?, val presentation: ToolPresentation, val status: ToolResultStatus) : AgentMessage.Tool

工具调用响应,来自程序。

Properties

Link copied to clipboard
abstract val callId: String

工具调用的 id,来自大模型 api,用于帮助模型匹配 CallResult

Link copied to clipboard
@Serializable(with = UuidSerializer::class)
abstract val id: UUID

消息 id,每种消息都有。

Link copied to clipboard
abstract val timestamp: Instant

消息时间戳,每种消息都有。