ExOutlines.Backend behaviour (ExOutlines v0.1.0)

Copy Markdown View Source

Behaviour for LLM backend adapters.

Implementations handle communication with specific LLM providers.

Summary

Callbacks

Call the LLM with a list of messages.

Types

call_opts()

@type call_opts() :: [
  model: String.t(),
  temperature: float(),
  max_tokens: pos_integer()
]

message()

@type message() :: %{role: String.t(), content: String.t()}

Callbacks

call_llm(messages, opts)

@callback call_llm(messages :: [message()], opts :: call_opts()) ::
  {:ok, String.t()} | {:error, term()}

Call the LLM with a list of messages.

Returns the assistant's response content or an error.