ToolContext

class ToolContext(val invocationContext: InvocationContext, val actions: EventActions = EventActions(), val functionCallId: String? = null, val toolConfirmation: ToolConfirmation? = null, val eventId: String? = null) : ReadonlyToolContext

ToolContext provides a structured context for executing tools or functions.

Constructors

Link copied to clipboard
constructor(invocationContext: InvocationContext, actions: EventActions = EventActions(), functionCallId: String? = null, toolConfirmation: ToolConfirmation? = null, eventId: String? = null)

Properties

Link copied to clipboard
Link copied to clipboard
open override val context: ReadonlyContext

The readonly invocation context.

Link copied to clipboard
open override val eventId: String? = null

The unique ID of the event that triggered this tool call.

Link copied to clipboard
open override val functionCallId: String? = null

The unique ID of the function call.

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard

Requests the current LLM agent to stop after the current step completes.

Link copied to clipboard
open suspend override fun listArtifacts(): List<String>

Lists the artifacts available in the current session.

Link copied to clipboard
open suspend override fun loadArtifact(name: String, version: Int?): Part?

Loads a specific artifact from the current session.

Link copied to clipboard
fun requestConfirmation(hint: String? = null, payload: Any? = null)
Link copied to clipboard
suspend fun saveArtifact(name: String, artifact: Part): Int