LemonAgent. Types. AgentToolResult
(lemon_agent v0.1.0)
View Source
Result returned from tool execution.
Contains content blocks (text/images) to be displayed, optional details for UI rendering or logging, and trust metadata.
:content is what the model sees — it becomes the tool-result message in
the transcript, so it should read as an answer rather than as a status
line. :details is not sent to the model: it is for the UI and the logs,
and is the right place for structured data (ids, counts, the raw response)
that would only cost tokens in :content.
:trust marks content the tool did not author. Anything fetched from the
network, read from a user-supplied file, or returned by a third-party API
is :untrusted, which tells downstream rendering that instructions inside
it must not be obeyed. LemonAgent.Security.ExternalContent wraps such
content with the right framing and metadata — use it rather than setting
the field by hand.
Summary
Types
@type content_block() :: LemonAi.Types.TextContent.t() | LemonAi.Types.ImageContent.t()
@type t() :: %LemonAgent.Types.AgentToolResult{ content: [content_block()], details: any(), trust: LemonAi.Types.trust_level() }