Dagger.LLMContent (dagger v1.0.0-beta.19)

Copy Markdown View Source

An ordered run of text and media content for a model to read, built outside any conversation.

Summary

Functions

The ordered text and media blocks.

A unique identifier for this LLMContent.

Append image, audio, or PDF bytes as an inline media block. The media kind follows the MIME type.

Append an image, audio, or PDF file as an inline media block. The media kind follows the MIME type.

Append a block of text.

Types

t()

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

Functions

blocks(llm_content)

@spec blocks(t()) :: {:ok, [Dagger.LLMContentBlock.t()]} | {:error, term()}

The ordered text and media blocks.

id(llm_content)

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

A unique identifier for this LLMContent.

with_data(llm_content, data, mime_type)

@spec with_data(t(), Dagger.Bytes.t(), String.t()) :: t()

Append image, audio, or PDF bytes as an inline media block. The media kind follows the MIME type.

Prefer withFile for anything but small payloads: the bytes become part of the content's identity, so they travel with every reference to it.

with_file(llm_content, file, optional_args \\ [])

@spec with_file(t(), Dagger.File.t(), [{:mime_type, String.t() | nil}]) :: t()

Append an image, audio, or PDF file as an inline media block. The media kind follows the MIME type.

with_text(llm_content, text)

@spec with_text(t(), String.t()) :: t()

Append a block of text.