ai.events.ToolCompleted

A tool's result: its output text, plus any media the tool produced (a screenshot from a computer-use tool, a rendered chart).

Reference version

Signature

class ai.events.ToolCompleted

A tool's result: its output text, plus any media the tool produced (a screenshot from a computer-use tool, a rendered chart).

Source:<builtin>/ai/ns_events/events.bamlbytes 18202712

Fields

id

string

Static methods

function

new

(id: string, output: string) -> ai.events.ToolCompleted

output is the tool's result serialized as JSON text.

function

of

(
id: string,
items: (string | image | audio | video | pdf | ai.content.Text | ai.content.Media)[]
) -> ai.events.ToolCompleted

A result from ordinary values: text, the image / audio / video / pdf primitives, or blocks already built (see root.content.blocks).

Instance methods

function

text

(self) -> string

The Text blocks joined — the tool's text output; a media block contributes a [image]-style placeholder.