AfterToolCallContext

data class AfterToolCallContext(val toolCall: ToolCall, val result: Tool.Result, val resultAsString: String, val durationMs: Long) : ToolResultContext

Context provided after tool execution.

Lightweight context without conversation history or iteration state. Used in both streaming and non-streaming modes.

Implements ToolResultContext for shared access to tool result fields. Check result type to determine success (Tool.Result.Text, Tool.Result.WithArtifact) or failure (Tool.Result.Error).

Constructors

Link copied to clipboard
constructor(toolCall: ToolCall, result: Tool.Result, resultAsString: String, durationMs: Long)

Properties

Link copied to clipboard

Execution duration in milliseconds

Link copied to clipboard
open override val result: Tool.Result

The typed tool result (may be Tool.Result.Error on failure)

Link copied to clipboard
open override val resultAsString: String

String representation of the result

Link copied to clipboard
open override val toolCall: ToolCall

The tool call that was executed