class

Grafito::AI::Providers::Anthropic

Inherits Grafito::AI::Provider < Reference < Object

Anthropic/Claude provider using the jgaskins/anthropic shard.

The shard handles:

  • API authentication
  • Request formatting
  • Response parsing

Constants

DEFAULT_MODEL = "claude-sonnet-4-5-20250929"

Default model if not overridden

KNOWN_MODELS = {"claude-sonnet-4-5-20250929" => "Claude Sonnet 4.5", "claude-opus-4-20250514" => "Claude Opus 4", "claude-sonnet-4-20250514" => "Claude Sonnet 4", "claude-3-5-sonnet-20241022" => "Claude 3.5 Sonnet", "claude-3-5-haiku-20241022" => "Claude 3.5 Haiku", "claude-3-opus-20240229" => "Claude 3 Opus", "claude-3-haiku-20240307" => "Claude 3 Haiku"}

Known Claude models (Anthropic has no public models API) Ordered by capability/recency

Log = ::Log.for(self)

Constructors

new(model : String | Nil = nil)
Source

Class methods

available?

Check if this provider can be used (has required config)

Source

Instance methods

available?

Check if this provider can be used (has required config)

Source
complete(request : Request) : Response

Execute a completion request and return normalized response

Source
current_model

Get the currently selected model ID

Source
models

Returns known Claude models (Anthropic has no public models API)

Source
name

Human-readable name for this provider instance

Source