Class: Google::Genai::Client
- Inherits:
-
Object
- Object
- Google::Genai::Client
- Defined in:
- lib/google/genai/client.rb
Instance Method Summary collapse
- #batches ⇒ Object
- #caches ⇒ Object
- #chats ⇒ Object
- #files ⇒ Object
-
#initialize(api_key: nil, vertexai: nil, credentials: nil, project: nil, location: nil, http_options: nil) ⇒ Client
constructor
A new instance of Client.
- #live ⇒ Object
- #models ⇒ Object
- #operations ⇒ Object
- #tokens ⇒ Object
- #tunings ⇒ Object
Constructor Details
#initialize(api_key: nil, vertexai: nil, credentials: nil, project: nil, location: nil, http_options: nil) ⇒ Client
Returns a new instance of Client.
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/google/genai/client.rb', line 8 def initialize(api_key: nil, vertexai: nil, credentials: nil, project: nil, location: nil, http_options: nil) api_key ||= ENV['GOOGLE_API_KEY'] || ENV['GEMINI_API_KEY'] @api_client = ApiClient.new( api_key: api_key, vertexai: vertexai, project: project, location: location, http_options: ) end |
Instance Method Details
#batches ⇒ Object
39 40 41 |
# File 'lib/google/genai/client.rb', line 39 def batches @batches ||= Batches.new(@api_client) end |
#caches ⇒ Object
35 36 37 |
# File 'lib/google/genai/client.rb', line 35 def caches @caches ||= Caches.new(@api_client) end |
#chats ⇒ Object
23 24 25 |
# File 'lib/google/genai/client.rb', line 23 def chats @chats ||= Chats.new(self) end |
#files ⇒ Object
27 28 29 |
# File 'lib/google/genai/client.rb', line 27 def files @files ||= Files.new(@api_client) end |
#live ⇒ Object
51 52 53 |
# File 'lib/google/genai/client.rb', line 51 def live @live ||= Live.new(@api_client) end |
#models ⇒ Object
19 20 21 |
# File 'lib/google/genai/client.rb', line 19 def models @models ||= Models.new(@api_client) end |
#operations ⇒ Object
43 44 45 |
# File 'lib/google/genai/client.rb', line 43 def operations @operations ||= Operations.new(@api_client) end |
#tokens ⇒ Object
47 48 49 |
# File 'lib/google/genai/client.rb', line 47 def tokens @tokens ||= Tokens.new(@api_client) end |
#tunings ⇒ Object
31 32 33 |
# File 'lib/google/genai/client.rb', line 31 def tunings @tunings ||= Tunings.new(@api_client) end |