Dagger.LLMContentBlock (dagger v1.0.0-beta.12)

Copy Markdown View Source

A single piece of content within an LLM message.

Summary

Functions

The arguments passed to the tool, JSON-encoded (for TOOL_CALL kind).

The unique ID of a tool call (for TOOL_CALL or TOOL_RESULT kinds).

Whether the tool call resulted in an error (for TOOL_RESULT kind).

A unique identifier for this LLMContentBlock.

The kind of content block, which determines the other populated fields.

Provider-specific opaque data (e.g. Anthropic thinking signature). Preserve it when reconstructing a conversation.

Text content (for TEXT, THINKING, or TOOL_RESULT kinds).

The name of the tool called (for TOOL_CALL kind).

Types

t()

@type t() :: %Dagger.LLMContentBlock{client: term(), query_builder: term()}

Functions

arguments(llm_content_block)

@spec arguments(t()) :: {:ok, Dagger.JSON.t()} | {:error, term()}

The arguments passed to the tool, JSON-encoded (for TOOL_CALL kind).

call_id(llm_content_block)

@spec call_id(t()) :: {:ok, String.t()} | {:error, term()}

The unique ID of a tool call (for TOOL_CALL or TOOL_RESULT kinds).

errored(llm_content_block)

@spec errored(t()) :: {:ok, boolean()} | {:error, term()}

Whether the tool call resulted in an error (for TOOL_RESULT kind).

id(llm_content_block)

@spec id(t()) :: {:ok, String.t()} | {:error, term()}

A unique identifier for this LLMContentBlock.

kind(llm_content_block)

@spec kind(t()) :: {:ok, Dagger.LLMContentBlockKind.t()} | {:error, term()}

The kind of content block, which determines the other populated fields.

signature(llm_content_block)

@spec signature(t()) :: {:ok, String.t()} | {:error, term()}

Provider-specific opaque data (e.g. Anthropic thinking signature). Preserve it when reconstructing a conversation.

text(llm_content_block)

@spec text(t()) :: {:ok, String.t()} | {:error, term()}

Text content (for TEXT, THINKING, or TOOL_RESULT kinds).

tool_name(llm_content_block)

@spec tool_name(t()) :: {:ok, String.t()} | {:error, term()}

The name of the tool called (for TOOL_CALL kind).