Agentic.LLM.ErrorClassifier (agentic v0.2.2)

Copy Markdown

Unified error classification combining three sources:

  1. Provider-specific override via Provider.classify_http_error/3
  2. HTTP status code baseline lookup
  3. Pattern-based fallback via ErrorPatterns.classify_message/1
  4. Always test for :context_overflow separately (can happen on any status)

If none match, falls through to :permanent.

Summary

Functions

Classify an error from HTTP status, body, and headers.

Types

classification()

@type classification() :: Agentic.LLM.Error.classification()

Functions

classify(status, body, headers, provider \\ nil)

@spec classify(non_neg_integer() | nil, term(), term(), module() | nil) ::
  {atom(), term()}

Classify an error from HTTP status, body, and headers.

provider is the provider module (e.g. Agentic.LLM.Provider.Groq). When the provider implements the optional classify_http_error/3 callback, its result takes precedence over the generic baseline.