LlmComposer.ProviderResponse protocol (llm_composer v0.19.4)

Copy Markdown View Source

Protocol that turns provider-specific raw responses into LlmComposer.LlmResponse structs.

Each provider adapter must wrap its raw HTTP result into a dedicated struct and implement this protocol. The protocol implementation is responsible for parsing the provider payload, extracting function calls, tokens, stream handles, etc., and returning the normalized response.

Summary

Types

t()

All the types that implement this protocol.

Types

t()

@type t() :: term()

All the types that implement this protocol.

Functions

to_llm_response(raw_response, opts)

@spec to_llm_response(
  t(),
  keyword()
) :: {:ok, LlmComposer.LlmResponse.t()} | {:error, term()}