ExAthena.Request (ExAthena v0.4.0)

Copy Markdown View Source

A normalised inference request.

Every provider receives an ExAthena.Request and is responsible for mapping it to its own wire format. Keeping the shared shape here means callers don't need to think about whether they're talking to Ollama, OpenAI, or Claude.

Summary

Functions

Build a request from a raw user prompt and options.

Types

t()

@type t() :: %ExAthena.Request{
  max_tokens: pos_integer() | nil,
  messages: [ExAthena.Messages.Message.t()],
  metadata: map() | nil,
  model: String.t() | nil,
  provider_opts: keyword() | nil,
  response_format: :text | :json | map() | nil,
  stop: [String.t()] | String.t() | nil,
  system_prompt: String.t() | nil,
  temperature: float() | nil,
  timeout_ms: pos_integer() | nil,
  tool_choice: :auto | :any | :none | map() | nil,
  tools: [map()] | nil,
  top_p: float() | nil
}

Functions

new(prompt, opts)

@spec new(
  String.t() | nil,
  keyword()
) :: t()

Build a request from a raw user prompt and options.

The prompt is prepended to opts[:messages] as a user message. Pass nil to start from a pre-built message list.