Class: OmniAI::Anthropic::Config
- Inherits:
-
Config
- Object
- Config
- OmniAI::Anthropic::Config
- Defined in:
- lib/omniai/anthropic/config.rb
Overview
Configuration for Anthropic.
Constant Summary collapse
- DEFAULT_HOST =
'https://api.anthropic.com'
- DEFAULT_VERSION =
'2023-06-01'
Instance Attribute Summary collapse
-
#beta ⇒ String?
Passed as ‘anthropic-beta` if specified.
-
#version ⇒ String?
Passed as ‘anthropic-version` if specified.
Instance Method Summary collapse
-
#initialize(api_key: ENV.fetch('ANTHROPIC_API_KEY', nil), host: ENV.fetch('ANTHROPIC_HOST', DEFAULT_HOST), version: ENV.fetch('ANTHROPIC_VERSION', DEFAULT_VERSION), beta: ENV.fetch('ANTHROPIC_BETA', nil), logger: nil, timeout: nil) ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize(api_key: ENV.fetch('ANTHROPIC_API_KEY', nil), host: ENV.fetch('ANTHROPIC_HOST', DEFAULT_HOST), version: ENV.fetch('ANTHROPIC_VERSION', DEFAULT_VERSION), beta: ENV.fetch('ANTHROPIC_BETA', nil), logger: nil, timeout: nil) ⇒ Config
Returns a new instance of Config.
24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/omniai/anthropic/config.rb', line 24 def initialize( api_key: ENV.fetch('ANTHROPIC_API_KEY', nil), host: ENV.fetch('ANTHROPIC_HOST', DEFAULT_HOST), version: ENV.fetch('ANTHROPIC_VERSION', DEFAULT_VERSION), beta: ENV.fetch('ANTHROPIC_BETA', nil), logger: nil, timeout: nil ) super(api_key:, host:, logger:, timeout:) @version = version @beta = beta @chat_options[:max_tokens] = 4096 end |
Instance Attribute Details
#beta ⇒ String?
Returns passed as ‘anthropic-beta` if specified.
16 17 18 |
# File 'lib/omniai/anthropic/config.rb', line 16 def beta @beta end |
#version ⇒ String?
Returns passed as ‘anthropic-version` if specified.
12 13 14 |
# File 'lib/omniai/anthropic/config.rb', line 12 def version @version end |