Class: Anthropic::Configuration
- Inherits:
-
Object
- Object
- Anthropic::Configuration
- Defined in:
- lib/anthropic.rb
Constant Summary collapse
- DEFAULT_API_VERSION =
"v1".freeze
- DEFAULT_ANTHROPIC_VERSION =
"2023-06-01".freeze
- DEFAULT_URI_BASE =
"https://api.anthropic.com/".freeze
- DEFAULT_REQUEST_TIMEOUT =
120
Instance Attribute Summary collapse
- #access_token ⇒ Object
-
#anthropic_version ⇒ Object
Returns the value of attribute anthropic_version.
-
#api_version ⇒ Object
Returns the value of attribute api_version.
-
#extra_headers ⇒ Object
Returns the value of attribute extra_headers.
-
#request_timeout ⇒ Object
Returns the value of attribute request_timeout.
-
#uri_base ⇒ Object
Returns the value of attribute uri_base.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
38 39 40 41 42 43 44 45 |
# File 'lib/anthropic.rb', line 38 def initialize @access_token = nil @api_version = DEFAULT_API_VERSION @anthropic_version = DEFAULT_ANTHROPIC_VERSION @uri_base = DEFAULT_URI_BASE @request_timeout = DEFAULT_REQUEST_TIMEOUT @extra_headers = {} end |
Instance Attribute Details
#access_token ⇒ Object
47 48 49 50 51 52 |
# File 'lib/anthropic.rb', line 47 def access_token return @access_token if @access_token error_text = "Anthropic access token missing! See https://github.com/alexrudall/anthropic#usage" raise ConfigurationError, error_text end |
#anthropic_version ⇒ Object
Returns the value of attribute anthropic_version.
30 31 32 |
# File 'lib/anthropic.rb', line 30 def anthropic_version @anthropic_version end |
#api_version ⇒ Object
Returns the value of attribute api_version.
30 31 32 |
# File 'lib/anthropic.rb', line 30 def api_version @api_version end |
#extra_headers ⇒ Object
Returns the value of attribute extra_headers.
30 31 32 |
# File 'lib/anthropic.rb', line 30 def extra_headers @extra_headers end |
#request_timeout ⇒ Object
Returns the value of attribute request_timeout.
30 31 32 |
# File 'lib/anthropic.rb', line 30 def request_timeout @request_timeout end |
#uri_base ⇒ Object
Returns the value of attribute uri_base.
30 31 32 |
# File 'lib/anthropic.rb', line 30 def uri_base @uri_base end |