Module: Anthropic::Api::Concerns::Requestable
- Included in:
- Base
- Defined in:
- lib/anthropic/api/concerns/requestable.rb
Overview
Provides helpers for sending API requests
Instance Method Summary collapse
- #additional_headers ⇒ Object
- #beta_headers ⇒ Object
- #post(params) ⇒ Object
- #post_as_stream(params) ⇒ Object
- #uri ⇒ Object
Instance Method Details
#additional_headers ⇒ Object
21 22 23 |
# File 'lib/anthropic/api/concerns/requestable.rb', line 21 def additional_headers {}.merge(beta_headers) end |
#beta_headers ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'lib/anthropic/api/concerns/requestable.rb', line 25 def beta_headers return {} unless beta header = beta_config['header'] raise Anthropic::Api::InvalidBetaConfigurationError, "Missing header: #{beta}" unless header header end |
#post(params) ⇒ Object
9 10 11 |
# File 'lib/anthropic/api/concerns/requestable.rb', line 9 def post(params) Anthropic::Client::Standard.post(uri, params, additional_headers) end |