Class: Riffer::Providers::Anthropic
- Defined in:
- lib/riffer/providers/anthropic.rb
Overview
Anthropic provider for Claude models via the Anthropic API. Requires the anthropic gem.
Constant Summary collapse
- WEB_SEARCH_TOOL_TYPE =
: String
"web_search_20250305"- FINISH_REASONS =
{ "end_turn" => :stop, "stop_sequence" => :stop, "max_tokens" => :length, "tool_use" => :tool_calls, "refusal" => :content_filter }.freeze
Constants inherited from Base
Class Method Summary collapse
-
.semconv_provider_name ⇒ Object
The GenAI semconv well-known provider name.
-
.skills_adapter(model = nil) ⇒ Object
Returns the XML skill adapter for Anthropic/Claude.
Instance Method Summary collapse
-
#initialize(api_key: nil, **options) ⇒ Anthropic
constructor
– : (?api_key: String?, **untyped) -> void.
Methods inherited from Base
Constructor Details
#initialize(api_key: nil, **options) ⇒ Anthropic
– : (?api_key: String?, **untyped) -> void
34 35 36 37 38 39 40 |
# File 'lib/riffer/providers/anthropic.rb', line 34 def initialize(api_key: nil, **) depends_on "anthropic" api_key ||= Riffer.config.anthropic.api_key @client = ::Anthropic::Client.new(api_key: api_key, **) end |
Class Method Details
.semconv_provider_name ⇒ Object
The GenAI semconv well-known provider name. – : () -> String
28 29 30 |
# File 'lib/riffer/providers/anthropic.rb', line 28 def self.semconv_provider_name "anthropic" end |
.skills_adapter(model = nil) ⇒ Object
Returns the XML skill adapter for Anthropic/Claude.
– : (?String?) -> singleton(Riffer::Skills::Adapter)
21 22 23 |
# File 'lib/riffer/providers/anthropic.rb', line 21 def self.skills_adapter(model = nil) Riffer::Skills::XmlAdapter end |