Class: Riffer::Providers::Anthropic

Inherits:
Base
  • Object
show all
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"

Constants inherited from Base

Base::WIRE_SEPARATOR

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#generate_text, #stream_text

Constructor Details

#initialize(api_key: nil, **options) ⇒ Anthropic

– : (?api_key: String?, **untyped) -> void



19
20
21
22
23
24
25
# File 'lib/riffer/providers/anthropic.rb', line 19

def initialize(api_key: nil, **options)
  depends_on "anthropic"

  api_key ||= Riffer.config.anthropic.api_key

  @client = ::Anthropic::Client.new(api_key: api_key, **options)
end

Class Method Details

.skills_adapter(model = nil) ⇒ Object

Returns the XML skill adapter for Anthropic/Claude.

– : (?String?) -> singleton(Riffer::Skills::Adapter)



13
14
15
# File 'lib/riffer/providers/anthropic.rb', line 13

def self.skills_adapter(model = nil)
  Riffer::Skills::XmlAdapter
end