Result

data class Result @JvmOverloads constructor(val id: String? = null, val tool: String, val parts: List<MessagePart.ContentPart>, val isError: Boolean = false, val cacheControl: CacheControl? = null) : MessagePart.Tool, MessagePart.RequestPart(source)

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

Constructors

Link copied to clipboard
constructor(id: String? = null, tool: String, parts: List<MessagePart.ContentPart>, isError: Boolean = false, cacheControl: CacheControl? = null)
constructor(id: String? = null, tool: String, output: String, isError: Boolean = false, cacheControl: CacheControl? = null)

Convenience constructor for a single text output.

Properties

Link copied to clipboard
open override val cacheControl: CacheControl?

Optional cache-control directive for the provider's prompt-caching feature.

Link copied to clipboard
val id: String?

The unique identifier of the tool result.

Link copied to clipboard

Whether this tool result represents an error. Defaults to false.

Link copied to clipboard

Returns the concatenated text content of all text parts.

Link copied to clipboard

The parts of the tool result. May contain text and attachment parts such as images or files. Note that not all LLM providers support non-text content in tool results.

Link copied to clipboard
open override val tool: String

The name of the tool that provided the result.