Tool Result
class ToolResult(val toolCallId: String, val toolName: String, val output: JsonElement, val isError: Boolean = false, val modelVisible: JsonElement = output, val dynamic: Boolean = false, val providerExecuted: Boolean = false, val providerMetadata: ProviderMetadata = ProviderMetadata.None) : ContentPart(source)
Tool execution result. output is the canonical FULL payload — persisted, dispatched to UI converters, rendered as the rich card. modelVisible is what the LLM provider includes in the prompt on subsequent turns — defaults to output, but tools with a toModelOutput callback (see Tool.toModelOutput) supply a short summary so multi-turn conversations don't keep re-feeding 10k+ tokens of structured payload into the model's KV cache. The two are intentionally separate: rehydrating the UI card needs the full schema; the model only needs enough context to compose a follow-up response.
Constructors
Link copied to clipboard
constructor(toolCallId: String, toolName: String, output: JsonElement, isError: Boolean = false, modelVisible: JsonElement = output, dynamic: Boolean = false, providerExecuted: Boolean = false, providerMetadata: ProviderMetadata = ProviderMetadata.None)