Tool

abstract class Tool<TInput, TOutput, TContext>(source)

Since

0.3.0-beta01

Inheritors

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract val schema: ToolSchema
Link copied to clipboard

Functions

Link copied to clipboard

Flow-first executor: emit one ToolResult.Success per value. The LAST emission is the final result that feeds the model; earlier emissions surface as preliminary tool results. Extend StreamingTool and override StreamingTool.executeStream for the streaming case.

Link copied to clipboard
open suspend fun needsApproval(input: TInput, options: ToolPredicateOptions<TContext>): Boolean

Approval gate — return true to pause the loop for host approval. Default: never gates.

Link copied to clipboard
open suspend fun onInputAvailable(toolCallId: String, input: TInput)
Link copied to clipboard
open suspend fun onInputDelta(streamingId: String, delta: String)
Link copied to clipboard
open suspend fun onInputStart(streamingId: String)
Link copied to clipboard

Model-visible summary. Return null to send raw output as-is.