ExAgent.RequestError (ExAgent v2.0.0)

View Source

Structured error returned by providers for transport/API failures.

Every provider wraps failures in this struct so callers can pattern-match on a single shape instead of opaque tuples. ExAgent.run/3 surfaces it (wrapped in {:error, {:model_request_failed, %RequestError{}}}) rather than raising.

Summary

Types

t()

@type t() :: %ExAgent.RequestError{
  body: term() | nil,
  model: struct() | nil,
  partial_response: ExAgent.Message.Response.t() | nil,
  provider: atom(),
  reason: atom() | tuple(),
  status: pos_integer() | nil
}