Class: ActiveAgent::Providers::Anthropic::Options

Inherits:
Common::BaseModel show all
Defined in:
lib/active_agent/providers/anthropic/options.rb

Instance Method Summary collapse

Methods inherited from Common::BaseModel

#<=>, #==, attribute, #deep_compact, #deep_dup, delegate_attributes, drop_attributes, inherited, #inspect, keys, #merge!, required_attributes, #to_h, #to_hash

Constructor Details

#initialize(kwargs = {}) ⇒ Options

Returns a new instance of Options.



22
23
24
25
26
27
28
# File 'lib/active_agent/providers/anthropic/options.rb', line 22

def initialize(kwargs = {})
  kwargs = kwargs.deep_symbolize_keys if kwargs.respond_to?(:deep_symbolize_keys)

  super(**deep_compact(kwargs.except(:default_url_options).merge(
    api_key: kwargs[:api_key] || resolve_access_token(kwargs),
  )))
end

Instance Method Details

#extra_headersObject

Anthropic gem handles beta headers differently via client.beta rather than via extra_headers in request_options



36
37
38
# File 'lib/active_agent/providers/anthropic/options.rb', line 36

def extra_headers
  {}
end

#serializeObject



30
31
32
# File 'lib/active_agent/providers/anthropic/options.rb', line 30

def serialize
  super.except(:anthropic_beta)
end