ExAgent.ModelSettings (ExAgent v3.0.0)

View Source

Per-request model settings. Non-nil fields override agent defaults. Custom models can read :extra, which merges by top-level key with request values taking precedence. ExAgent.Models.ReqLLM rejects nonempty :extra and documents the provider options supported by each profile.

Stability — Stable.

For ReqLLM, timeout is receive inactivity: non-nil request settings override the instance HTTP default, then 60 seconds. This struct does not expose a total-call deadline or pool-checkout timeout; those are distinct transport budgets, not aliases for timeout. Stock ReqLLM nevertheless derives its pool default from the receive value. The adapter's separate per-instance total_timeout bounds a single operation, buffered or streamed, not the whole agent run.

Summary

Functions

Merge two settings, overrides winning on non-nil values.

Build settings from a keyword list or map of fields, ignoring nils. A settings struct follows the same validation. Unknown or duplicate fields and values of the wrong type raise ArgumentError.

Types

t()

@type t() :: %ExAgent.ModelSettings{
  extra: map(),
  frequency_penalty: number() | nil,
  max_tokens: pos_integer() | nil,
  presence_penalty: number() | nil,
  temperature: number() | nil,
  timeout: pos_integer() | :infinity | nil,
  top_p: number() | nil
}

Functions

merge(base, overrides)

@spec merge(t(), t() | nil) :: t()

Merge two settings, overrides winning on non-nil values.

new(settings)

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

Build settings from a keyword list or map of fields, ignoring nils. A settings struct follows the same validation. Unknown or duplicate fields and values of the wrong type raise ArgumentError.