Dagger.LLMMessage (dagger v1.0.0-beta.18)

Copy Markdown View Source

A single message in an LLM conversation.

Summary

Functions

The message's content blocks, in the order the model produced them.

A unique identifier for this LLMMessage.

Who put this message on the record, when it arrived through an agent mailbox.

The role that produced this message.

Token usage reported by the provider for the API call that produced this message; all zeros except on assistant responses.

Types

t()

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

Functions

content(llm_message)

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

The message's content blocks, in the order the model produced them.

id(llm_message)

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

A unique identifier for this LLMMessage.

origin(llm_message)

@spec origin(t()) :: {:ok, Dagger.LLMMessageOrigin.t() | nil} | {:error, term()}

Who put this message on the record, when it arrived through an agent mailbox.

Null for the user's own prompts and for everything the model or tools produced.

Experimental

"Agent APIs are likely to change."

role(llm_message)

@spec role(t()) :: {:ok, Dagger.LLMMessageRole.t()} | {:error, term()}

The role that produced this message.

token_usage(llm_message)

@spec token_usage(t()) :: Dagger.LLMTokenUsage.t()

Token usage reported by the provider for the API call that produced this message; all zeros except on assistant responses.