Class: SavvyOpenrouter::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/savvy_openrouter/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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, **options)
  @config = Configuration.new(config_path: config_path, **options)
  @connection = Connection.new(@config)
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



26
27
28
# File 'lib/savvy_openrouter/client.rb', line 26

def config
  @config
end

#connectionObject (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

#analyticsObject



73
74
75
# File 'lib/savvy_openrouter/client.rb', line 73

def analytics
  @analytics ||= Resources::Analytics.new(self)
end

#anthropic_messagesObject



41
42
43
# File 'lib/savvy_openrouter/client.rb', line 41

def anthropic_messages
  @anthropic_messages ||= Resources::AnthropicMessages.new(self)
end

#api_keysObject



89
90
91
# File 'lib/savvy_openrouter/client.rb', line 89

def api_keys
  @api_keys ||= Resources::ApiKeys.new(self)
end

#audioObject



77
78
79
# File 'lib/savvy_openrouter/client.rb', line 77

def audio
  @audio ||= Resources::Audio.new(self)
end

#chatObject



33
34
35
# File 'lib/savvy_openrouter/client.rb', line 33

def chat
  @chat ||= Resources::Chat.new(self)
end

#creditsObject



57
58
59
# File 'lib/savvy_openrouter/client.rb', line 57

def credits
  @credits ||= Resources::Credits.new(self)
end

#embeddingsObject



45
46
47
# File 'lib/savvy_openrouter/client.rb', line 45

def embeddings
  @embeddings ||= Resources::Embeddings.new(self)
end

#endpointsObject



69
70
71
# File 'lib/savvy_openrouter/client.rb', line 69

def endpoints
  @endpoints ||= Resources::Endpoints.new(self)
end

#generationsObject



65
66
67
# File 'lib/savvy_openrouter/client.rb', line 65

def generations
  @generations ||= Resources::Generations.new(self)
end

#guardrailsObject



97
98
99
# File 'lib/savvy_openrouter/client.rb', line 97

def guardrails
  @guardrails ||= Resources::Guardrails.new(self)
end

#modelsObject



53
54
55
# File 'lib/savvy_openrouter/client.rb', line 53

def models
  @models ||= Resources::Models.new(self)
end

#oauthObject



85
86
87
# File 'lib/savvy_openrouter/client.rb', line 85

def oauth
  @oauth ||= Resources::OAuth.new(self)
end

#organizationObject



93
94
95
# File 'lib/savvy_openrouter/client.rb', line 93

def organization
  @organization ||= Resources::Organization.new(self)
end

#providersObject



61
62
63
# File 'lib/savvy_openrouter/client.rb', line 61

def providers
  @providers ||= Resources::Providers.new(self)
end

#rerankObject



49
50
51
# File 'lib/savvy_openrouter/client.rb', line 49

def rerank
  @rerank ||= Resources::Rerank.new(self)
end

#responsesObject



37
38
39
# File 'lib/savvy_openrouter/client.rb', line 37

def responses
  @responses ||= Resources::Responses.new(self)
end

#videosObject



81
82
83
# File 'lib/savvy_openrouter/client.rb', line 81

def videos
  @videos ||= Resources::Videos.new(self)
end

#workspacesObject



101
102
103
# File 'lib/savvy_openrouter/client.rb', line 101

def workspaces
  @workspaces ||= Resources::Workspaces.new(self)
end