Class: Gemini::Client

Inherits:
Object
  • Object
show all
Extended by:
HTTP
Defined in:
lib/gemini/client.rb

Instance Method Summary collapse

Methods included from HTTP

delete, get, json_post, multipart_post

Constructor Details

#initialize(access_token: nil, organization_id: nil, uri_base: nil, request_timeout: nil, extra_headers: {}) ⇒ Client

Returns a new instance of Client.



5
6
7
8
9
10
11
12
# File 'lib/gemini/client.rb', line 5

def initialize(access_token: nil, organization_id: nil, uri_base: nil, request_timeout: nil,
               extra_headers: {})
  Gemini.configuration.access_token = access_token if access_token
  Gemini.configuration.organization_id = organization_id if organization_id
  Gemini.configuration.uri_base = uri_base if uri_base
  Gemini.configuration.request_timeout = request_timeout if request_timeout
  Gemini.configuration.extra_headers = extra_headers
end

Instance Method Details

#generate_content(parameters: {}) ⇒ Object



14
15
16
# File 'lib/gemini/client.rb', line 14

def generate_content(parameters: {})
  Gemini::Client.json_post(path: "generateContent", parameters: adjusted_parameters(parameters))
end