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
-
#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), 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), logger: nil, timeout: nil) ⇒ Config
Returns a new instance of Config.
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/omniai/anthropic/config.rb', line 19 def initialize( api_key: ENV.fetch('ANTHROPIC_API_KEY', nil), host: ENV.fetch('ANTHROPIC_HOST', DEFAULT_HOST), version: ENV.fetch('ANTHROPIC_VERSION', DEFAULT_VERSION), logger: nil, timeout: nil ) super(api_key:, host:, logger:, timeout:) @version = version @chat_options[:max_tokens] = 4096 end |
Instance Attribute Details
#version ⇒ String?
Returns passed as ‘anthropic-version` if specified.
12 13 14 |
# File 'lib/omniai/anthropic/config.rb', line 12 def version @version end |