Class: SavvyOpenrouter::Client
- Inherits:
-
Object
- Object
- SavvyOpenrouter::Client
- Defined in:
- lib/savvy_openrouter/client.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
Instance Method Summary collapse
- #analytics ⇒ Object
- #anthropic_messages ⇒ Object
- #api_keys ⇒ Object
- #audio ⇒ Object
- #chat ⇒ Object
- #credits ⇒ Object
- #embeddings ⇒ Object
- #endpoints ⇒ Object
- #generations ⇒ Object
- #guardrails ⇒ Object
-
#initialize(config_path: nil, **options) ⇒ Client
constructor
A new instance of Client.
- #models ⇒ Object
- #oauth ⇒ Object
- #organization ⇒ Object
- #providers ⇒ Object
- #rerank ⇒ Object
- #responses ⇒ Object
- #videos ⇒ Object
- #workspaces ⇒ Object
Constructor Details
#initialize(config_path: nil, **options) ⇒ Client
Returns a new instance of Client.
28 29 30 31 |
# File 'lib/savvy_openrouter/client.rb', line 28 def initialize(config_path: nil, **) @config = Configuration.new(config_path: config_path, **) @connection = Connection.new(@config) end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
26 27 28 |
# File 'lib/savvy_openrouter/client.rb', line 26 def config @config end |
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
26 27 28 |
# File 'lib/savvy_openrouter/client.rb', line 26 def connection @connection end |
Instance Method Details
#analytics ⇒ Object
73 74 75 |
# File 'lib/savvy_openrouter/client.rb', line 73 def analytics @analytics ||= Resources::Analytics.new(self) end |
#anthropic_messages ⇒ Object
41 42 43 |
# File 'lib/savvy_openrouter/client.rb', line 41 def @anthropic_messages ||= Resources::AnthropicMessages.new(self) end |
#api_keys ⇒ Object
89 90 91 |
# File 'lib/savvy_openrouter/client.rb', line 89 def api_keys @api_keys ||= Resources::ApiKeys.new(self) end |
#audio ⇒ Object
77 78 79 |
# File 'lib/savvy_openrouter/client.rb', line 77 def audio @audio ||= Resources::Audio.new(self) end |
#chat ⇒ Object
33 34 35 |
# File 'lib/savvy_openrouter/client.rb', line 33 def chat @chat ||= Resources::Chat.new(self) end |
#credits ⇒ Object
57 58 59 |
# File 'lib/savvy_openrouter/client.rb', line 57 def credits @credits ||= Resources::Credits.new(self) end |
#embeddings ⇒ Object
45 46 47 |
# File 'lib/savvy_openrouter/client.rb', line 45 def @embeddings ||= Resources::Embeddings.new(self) end |
#endpoints ⇒ Object
69 70 71 |
# File 'lib/savvy_openrouter/client.rb', line 69 def endpoints @endpoints ||= Resources::Endpoints.new(self) end |
#generations ⇒ Object
65 66 67 |
# File 'lib/savvy_openrouter/client.rb', line 65 def generations @generations ||= Resources::Generations.new(self) end |
#guardrails ⇒ Object
97 98 99 |
# File 'lib/savvy_openrouter/client.rb', line 97 def guardrails @guardrails ||= Resources::Guardrails.new(self) end |
#models ⇒ Object
53 54 55 |
# File 'lib/savvy_openrouter/client.rb', line 53 def models @models ||= Resources::Models.new(self) end |
#oauth ⇒ Object
85 86 87 |
# File 'lib/savvy_openrouter/client.rb', line 85 def oauth @oauth ||= Resources::OAuth.new(self) end |
#organization ⇒ Object
93 94 95 |
# File 'lib/savvy_openrouter/client.rb', line 93 def organization @organization ||= Resources::Organization.new(self) end |
#providers ⇒ Object
61 62 63 |
# File 'lib/savvy_openrouter/client.rb', line 61 def providers @providers ||= Resources::Providers.new(self) end |
#rerank ⇒ Object
49 50 51 |
# File 'lib/savvy_openrouter/client.rb', line 49 def rerank @rerank ||= Resources::Rerank.new(self) end |
#responses ⇒ Object
37 38 39 |
# File 'lib/savvy_openrouter/client.rb', line 37 def responses @responses ||= Resources::Responses.new(self) end |
#videos ⇒ Object
81 82 83 |
# File 'lib/savvy_openrouter/client.rb', line 81 def videos @videos ||= Resources::Videos.new(self) end |
#workspaces ⇒ Object
101 102 103 |
# File 'lib/savvy_openrouter/client.rb', line 101 def workspaces @workspaces ||= Resources::Workspaces.new(self) end |