View Source LlmComposer.LlmResponse (llm_composer v0.19.2)

Normalized representation of a response coming from any provider.

Parser modules are responsible for translating provider-specific HTTP results into this normalized struct so the rest of the library can stay provider-agnostic.

Summary

Functions

Returns the function calls from the main response message.

Types

@type provider() ::
  :open_ai | :open_ai_responses | :ollama | :open_router | :bedrock | :google
@type t() :: %LlmComposer.LlmResponse{
  cached_tokens: non_neg_integer() | nil,
  cost_info: LlmComposer.CostInfo.t() | nil,
  input_tokens: non_neg_integer() | nil,
  main_response: LlmComposer.Message.t() | nil,
  metadata: map(),
  output_tokens: non_neg_integer() | nil,
  previous_response: map() | nil,
  provider: provider(),
  provider_model: String.t() | nil,
  raw: any(),
  reasoning_tokens: non_neg_integer() | nil,
  response_id: String.t() | nil,
  status: :ok | :error,
  stream: nil | Enumerable.t()
}

Functions

Link to this function

function_calls(llm_response)

View Source
@spec function_calls(t()) :: [LlmComposer.FunctionCall.t()] | nil

Returns the function calls from the main response message.

Delegates to main_response.function_calls for convenience.

@spec new(map()) :: t()