Class: RubyLLM::Providers::GitLab::AnthropicDelegate
- Inherits:
-
Anthropic
- Object
- Anthropic
- RubyLLM::Providers::GitLab::AnthropicDelegate
- Includes:
- Chat
- Defined in:
- lib/ruby_llm/providers/gitlab/anthropic_delegate.rb
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Chat
Class Method Details
.configuration_options ⇒ Object
32 33 34 |
# File 'lib/ruby_llm/providers/gitlab/anthropic_delegate.rb', line 32 def i[gitlab_api_key gitlab_instance_url gitlab_gateway_url] end |
.configuration_requirements ⇒ Object
28 29 30 |
# File 'lib/ruby_llm/providers/gitlab/anthropic_delegate.rb', line 28 def configuration_requirements i[gitlab_api_key] end |
Instance Method Details
#api_base ⇒ Object
9 10 11 |
# File 'lib/ruby_llm/providers/gitlab/anthropic_delegate.rb', line 9 def api_base token_manager.anthropic_base_url end |
#complete ⇒ Object
20 21 22 23 24 25 |
# File 'lib/ruby_llm/providers/gitlab/anthropic_delegate.rb', line 20 def complete(...) super rescue RubyLLM:: token_manager.invalidate! super end |
#headers ⇒ Object
13 14 15 16 17 18 |
# File 'lib/ruby_llm/providers/gitlab/anthropic_delegate.rb', line 13 def headers { 'Authorization' => "Bearer #{token_manager.token}", 'anthropic-version' => '2023-06-01' }.merge(token_manager.gateway_headers) end |