Dagger.LLMTokenUsage (dagger v1.0.0-beta.13)

Copy Markdown View Source

A count of tokens consumed by LLM API calls.

Summary

Functions

Input tokens served from the provider's prompt cache.

Input tokens written to the provider's prompt cache.

A unique identifier for this LLMTokenUsage.

Uncached input tokens sent to the model.

Tokens received from the model, including text and tool calls.

Total tokens consumed, as reported by the provider.

Types

t()

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

Functions

cached_token_reads(llm_token_usage)

@spec cached_token_reads(t()) :: {:ok, integer()} | {:error, term()}

Input tokens served from the provider's prompt cache.

cached_token_writes(llm_token_usage)

@spec cached_token_writes(t()) :: {:ok, integer()} | {:error, term()}

Input tokens written to the provider's prompt cache.

id(llm_token_usage)

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

A unique identifier for this LLMTokenUsage.

input_tokens(llm_token_usage)

@spec input_tokens(t()) :: {:ok, integer()} | {:error, term()}

Uncached input tokens sent to the model.

output_tokens(llm_token_usage)

@spec output_tokens(t()) :: {:ok, integer()} | {:error, term()}

Tokens received from the model, including text and tool calls.

total_tokens(llm_token_usage)

@spec total_tokens(t()) :: {:ok, integer()} | {:error, term()}

Total tokens consumed, as reported by the provider.