ElixirLLM.Response (ElixirLLM v0.3.0)

Copy Markdown View Source

Represents a complete response from an LLM provider.

Contains the assistant's message along with usage statistics and metadata.

Summary

Functions

Returns true if the response contains tool calls.

Creates a new response from provider data.

Types

t()

@type t() :: %ElixirLLM.Response{
  content: String.t() | nil,
  finish_reason: atom() | nil,
  input_tokens: non_neg_integer() | nil,
  model: String.t(),
  output_tokens: non_neg_integer() | nil,
  tool_calls: [ElixirLLM.ToolCall.t()] | nil,
  total_tokens: non_neg_integer() | nil
}

Functions

has_tool_calls?(response)

@spec has_tool_calls?(t()) :: boolean()

Returns true if the response contains tool calls.

new(attrs)

@spec new(keyword()) :: t()

Creates a new response from provider data.