Class: Google::Genai::Client

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

Instance Method Summary collapse

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: http_options
  )
end

Instance Method Details

#batchesObject



39
40
41
# File 'lib/google/genai/client.rb', line 39

def batches
  @batches ||= Batches.new(@api_client)
end

#cachesObject



35
36
37
# File 'lib/google/genai/client.rb', line 35

def caches
  @caches ||= Caches.new(@api_client)
end

#chatsObject



23
24
25
# File 'lib/google/genai/client.rb', line 23

def chats
  @chats ||= Chats.new(self)
end

#filesObject



27
28
29
# File 'lib/google/genai/client.rb', line 27

def files
  @files ||= Files.new(@api_client)
end

#liveObject



51
52
53
# File 'lib/google/genai/client.rb', line 51

def live
  @live ||= Live.new(@api_client)
end

#modelsObject



19
20
21
# File 'lib/google/genai/client.rb', line 19

def models
  @models ||= Models.new(@api_client)
end

#operationsObject



43
44
45
# File 'lib/google/genai/client.rb', line 43

def operations
  @operations ||= Operations.new(@api_client)
end

#tokensObject



47
48
49
# File 'lib/google/genai/client.rb', line 47

def tokens
  @tokens ||= Tokens.new(@api_client)
end

#tuningsObject



31
32
33
# File 'lib/google/genai/client.rb', line 31

def tunings
  @tunings ||= Tunings.new(@api_client)
end