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