gemini-ai 4.2.0 → 4.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7fa034b81983b8925267cdc2bb4cbf6170b7d5ecccfb26a705d70a1643f1e7ad
4
- data.tar.gz: 077eec4e066836c80d8e0d6e26940086588876548f8d0e38b01a0a89aaf74646
3
+ metadata.gz: 5ad19a7cfc87b01f59e5b9eeb11241d63f68a843da3c1f1f8a2784fc20c55cd4
4
+ data.tar.gz: 2527dda3745613f278c1164aa4625ad447564e22853737e3bce69d423a076fcc
5
5
  SHA512:
6
- metadata.gz: e2be4160caa66645c8baa9519f69059caa36e4c699098e2138e713736d1f7a1aaba27d6ca9a62ba64ee350e313cea5c0bee27eaf9685f576a33527c0f837d563
7
- data.tar.gz: f4561c6e6cef7cfc3daa6e2c8c534d03624993cfbce3f9a75ae4eff55b081de694aa30d261c891eaf0acf463b3fd883b48317d142856131fc8253957d0ef9ef5
6
+ metadata.gz: 51da36a047e941a324de2ee0d7c110aef52c379c63d8e38af219bdd4bae7b61952648933abf06608c75558cd439168304549d8c6d6e0a347f5f8aa6e190cac95
7
+ data.tar.gz: d967a7c1ec04f3dd6f9959de82fa4c6295c5e79a2d1a8c9f442902a0147bcd0ecd11beec3599e8550247c6d91b7c0b8ef854b29ba638fcb08b6f826f21f9aac8
data/Gemfile CHANGED
@@ -5,9 +5,9 @@ source 'https://rubygems.org'
5
5
  gemspec
6
6
 
7
7
  group :test, :development do
8
- gem 'dotenv', '~> 3.1', '>= 3.1.2'
9
- gem 'pry-byebug', '~> 3.10', '>= 3.10.1'
10
- gem 'rspec', '~> 3.13'
11
- gem 'rubocop', '~> 1.65'
12
- gem 'rubocop-rspec', '~> 3.0', '>= 3.0.3'
8
+ gem 'dotenv', '~> 3.1', '>= 3.1.8'
9
+ gem 'pry-byebug', '~> 3.11'
10
+ gem 'rspec', '~> 3.13', '>= 3.13.1'
11
+ gem 'rubocop', '~> 1.78'
12
+ gem 'rubocop-rspec', '~> 3.6'
13
13
  end
data/Gemfile.lock CHANGED
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gemini-ai (4.2.0)
4
+ gemini-ai (4.3.0)
5
5
  event_stream_parser (~> 1.0)
6
- faraday (~> 2.10)
6
+ faraday (~> 2.13, >= 2.13.2)
7
7
  faraday-typhoeus (~> 1.1)
8
8
  googleauth (~> 1.8)
9
9
  typhoeus (~> 1.4, >= 1.4.1)
@@ -13,109 +13,116 @@ GEM
13
13
  specs:
14
14
  addressable (2.8.7)
15
15
  public_suffix (>= 2.0.2, < 7.0)
16
- ast (2.4.2)
17
- base64 (0.2.0)
18
- byebug (11.1.3)
16
+ ast (2.4.3)
17
+ base64 (0.3.0)
18
+ byebug (12.0.0)
19
19
  coderay (1.1.3)
20
- diff-lcs (1.5.1)
21
- dotenv (3.1.2)
20
+ diff-lcs (1.6.2)
21
+ dotenv (3.1.8)
22
22
  ethon (0.16.0)
23
23
  ffi (>= 1.15.0)
24
24
  event_stream_parser (1.0.0)
25
- faraday (2.10.0)
26
- faraday-net_http (>= 2.0, < 3.2)
25
+ faraday (2.13.2)
26
+ faraday-net_http (>= 2.0, < 3.5)
27
+ json
27
28
  logger
28
- faraday-net_http (3.1.0)
29
- net-http
29
+ faraday-net_http (3.4.1)
30
+ net-http (>= 0.5.0)
30
31
  faraday-typhoeus (1.1.0)
31
32
  faraday (~> 2.0)
32
33
  typhoeus (~> 1.4)
33
- ffi (1.17.0)
34
- google-cloud-env (2.1.1)
34
+ ffi (1.17.2)
35
+ google-cloud-env (2.3.1)
36
+ base64 (~> 0.2)
35
37
  faraday (>= 1.0, < 3.a)
36
- googleauth (1.11.0)
38
+ google-logging-utils (0.2.0)
39
+ googleauth (1.14.0)
37
40
  faraday (>= 1.0, < 3.a)
38
- google-cloud-env (~> 2.1)
41
+ google-cloud-env (~> 2.2)
42
+ google-logging-utils (~> 0.1)
39
43
  jwt (>= 1.4, < 3.0)
40
44
  multi_json (~> 1.11)
41
45
  os (>= 0.9, < 2.0)
42
46
  signet (>= 0.16, < 2.a)
43
- json (2.7.2)
44
- jwt (2.8.2)
47
+ json (2.12.2)
48
+ jwt (2.10.2)
45
49
  base64
46
- language_server-protocol (3.17.0.3)
47
- logger (1.6.0)
50
+ language_server-protocol (3.17.0.5)
51
+ lint_roller (1.1.0)
52
+ logger (1.7.0)
48
53
  method_source (1.1.0)
49
54
  multi_json (1.15.0)
50
- net-http (0.4.1)
55
+ net-http (0.6.0)
51
56
  uri
52
57
  os (1.1.4)
53
- parallel (1.25.1)
54
- parser (3.3.4.0)
58
+ parallel (1.27.0)
59
+ parser (3.3.8.0)
55
60
  ast (~> 2.4.1)
56
61
  racc
57
- pry (0.14.2)
62
+ prism (1.4.0)
63
+ pry (0.15.2)
58
64
  coderay (~> 1.1)
59
65
  method_source (~> 1.0)
60
- pry-byebug (3.10.1)
61
- byebug (~> 11.0)
62
- pry (>= 0.13, < 0.15)
63
- public_suffix (6.0.0)
64
- racc (1.8.0)
66
+ pry-byebug (3.11.0)
67
+ byebug (~> 12.0)
68
+ pry (>= 0.13, < 0.16)
69
+ public_suffix (6.0.2)
70
+ racc (1.8.1)
65
71
  rainbow (3.1.1)
66
- regexp_parser (2.9.2)
67
- rexml (3.3.2)
68
- strscan
69
- rspec (3.13.0)
72
+ regexp_parser (2.10.0)
73
+ rspec (3.13.1)
70
74
  rspec-core (~> 3.13.0)
71
75
  rspec-expectations (~> 3.13.0)
72
76
  rspec-mocks (~> 3.13.0)
73
- rspec-core (3.13.0)
77
+ rspec-core (3.13.5)
74
78
  rspec-support (~> 3.13.0)
75
- rspec-expectations (3.13.1)
79
+ rspec-expectations (3.13.5)
76
80
  diff-lcs (>= 1.2.0, < 2.0)
77
81
  rspec-support (~> 3.13.0)
78
- rspec-mocks (3.13.1)
82
+ rspec-mocks (3.13.5)
79
83
  diff-lcs (>= 1.2.0, < 2.0)
80
84
  rspec-support (~> 3.13.0)
81
- rspec-support (3.13.1)
82
- rubocop (1.65.0)
85
+ rspec-support (3.13.4)
86
+ rubocop (1.78.0)
83
87
  json (~> 2.3)
84
- language_server-protocol (>= 3.17.0)
88
+ language_server-protocol (~> 3.17.0.2)
89
+ lint_roller (~> 1.1.0)
85
90
  parallel (~> 1.10)
86
91
  parser (>= 3.3.0.2)
87
92
  rainbow (>= 2.2.2, < 4.0)
88
- regexp_parser (>= 2.4, < 3.0)
89
- rexml (>= 3.2.5, < 4.0)
90
- rubocop-ast (>= 1.31.1, < 2.0)
93
+ regexp_parser (>= 2.9.3, < 3.0)
94
+ rubocop-ast (>= 1.45.1, < 2.0)
91
95
  ruby-progressbar (~> 1.7)
92
- unicode-display_width (>= 2.4.0, < 3.0)
93
- rubocop-ast (1.31.3)
94
- parser (>= 3.3.1.0)
95
- rubocop-rspec (3.0.3)
96
- rubocop (~> 1.61)
96
+ unicode-display_width (>= 2.4.0, < 4.0)
97
+ rubocop-ast (1.45.1)
98
+ parser (>= 3.3.7.2)
99
+ prism (~> 1.4)
100
+ rubocop-rspec (3.6.0)
101
+ lint_roller (~> 1.1)
102
+ rubocop (~> 1.72, >= 1.72.1)
97
103
  ruby-progressbar (1.13.0)
98
- signet (0.19.0)
104
+ signet (0.20.0)
99
105
  addressable (~> 2.8)
100
106
  faraday (>= 0.17.5, < 3.a)
101
107
  jwt (>= 1.5, < 3.0)
102
108
  multi_json (~> 1.10)
103
- strscan (3.1.0)
104
109
  typhoeus (1.4.1)
105
110
  ethon (>= 0.9.0)
106
- unicode-display_width (2.5.0)
107
- uri (0.13.0)
111
+ unicode-display_width (3.1.4)
112
+ unicode-emoji (~> 4.0, >= 4.0.4)
113
+ unicode-emoji (4.0.4)
114
+ uri (1.0.3)
108
115
 
109
116
  PLATFORMS
110
117
  x86_64-linux
111
118
 
112
119
  DEPENDENCIES
113
- dotenv (~> 3.1, >= 3.1.2)
120
+ dotenv (~> 3.1, >= 3.1.8)
114
121
  gemini-ai!
115
- pry-byebug (~> 3.10, >= 3.10.1)
116
- rspec (~> 3.13)
117
- rubocop (~> 1.65)
118
- rubocop-rspec (~> 3.0, >= 3.0.3)
122
+ pry-byebug (~> 3.11)
123
+ rspec (~> 3.13, >= 3.13.1)
124
+ rubocop (~> 1.78)
125
+ rubocop-rspec (~> 3.6)
119
126
 
120
127
  BUNDLED WITH
121
128
  2.4.22
data/README.md CHANGED
@@ -9,7 +9,7 @@ A Ruby Gem for interacting with [Gemini](https://deepmind.google/technologies/ge
9
9
  ## TL;DR and Quick Start
10
10
 
11
11
  ```ruby
12
- gem 'gemini-ai', '~> 4.2.0'
12
+ gem 'gemini-ai', '~> 4.3.0'
13
13
  ```
14
14
 
15
15
  ```ruby
@@ -59,6 +59,12 @@ result = client.stream_generate_content({
59
59
  })
60
60
  ```
61
61
 
62
+ Google now supports a [global endpoint](https://cloud.google.com/vertex-ai/generative-ai/docs/learn/locations#global-endpoint):
63
+
64
+ ```ruby
65
+ Gemini.new(credentials: { region: 'global' })
66
+ ```
67
+
62
68
  Result:
63
69
  ```ruby
64
70
  [{ 'candidates' =>
@@ -91,6 +97,7 @@ Result:
91
97
  - [Option 3: Application Default Credentials (Vertex AI API)](#option-3-application-default-credentials-vertex-ai-api)
92
98
  - [Required Data](#required-data)
93
99
  - [Custom Version](#custom-version)
100
+ - [Global Endpoint](#global-endpoint)
94
101
  - [Available Models](#available-models)
95
102
  - [Usage](#usage)
96
103
  - [Client](#client)
@@ -138,11 +145,11 @@ Result:
138
145
  ### Installing
139
146
 
140
147
  ```sh
141
- gem install gemini-ai -v 4.2.0
148
+ gem install gemini-ai -v 4.3.0
142
149
  ```
143
150
 
144
151
  ```sh
145
- gem 'gemini-ai', '~> 4.2.0'
152
+ gem 'gemini-ai', '~> 4.3.0'
146
153
  ```
147
154
 
148
155
  ### Credentials
@@ -359,6 +366,14 @@ client = Gemini.new(
359
366
  )
360
367
  ```
361
368
 
369
+ ### Global Endpoint
370
+
371
+ Google now supports a [global endpoint](https://cloud.google.com/vertex-ai/generative-ai/docs/learn/locations#global-endpoint):
372
+
373
+ ```ruby
374
+ Gemini.new(credentials: { region: 'global' })
375
+ ```
376
+
362
377
  ## Available Models
363
378
 
364
379
  These models are accessible to the repository **author** as of June 2025 in the `us-east4` region. Access to models may vary by region, user, and account. All models here are expected to work, if you can access them. This is just a reference of what a "typical" user may expect to have access to right away:
@@ -1440,7 +1455,7 @@ gem build gemini-ai.gemspec
1440
1455
 
1441
1456
  gem signin
1442
1457
 
1443
- gem push gemini-ai-4.2.0.gem
1458
+ gem push gemini-ai-4.3.0.gem
1444
1459
  ```
1445
1460
 
1446
1461
  ### Updating the README
@@ -56,7 +56,11 @@ module Gemini
56
56
 
57
57
  @base_address = case @service
58
58
  when 'vertex-ai-api'
59
- "https://#{config[:credentials][:region]}-aiplatform.googleapis.com/#{@service_version}/projects/#{@project_id}/locations/#{config[:credentials][:region]}"
59
+ if config[:credentials][:region] == 'global'
60
+ "https://aiplatform.googleapis.com/#{@service_version}/projects/#{@project_id}/locations/#{config[:credentials][:region]}"
61
+ else
62
+ "https://#{config[:credentials][:region]}-aiplatform.googleapis.com/#{@service_version}/projects/#{@project_id}/locations/#{config[:credentials][:region]}"
63
+ end
60
64
  when 'generative-language-api'
61
65
  "https://generativelanguage.googleapis.com/#{@service_version}"
62
66
  end
@@ -75,9 +79,7 @@ module Gemini
75
79
  @faraday_adapter = config.dig(:options, :connection, :adapter) || DEFAULT_FARADAY_ADAPTER
76
80
 
77
81
  @request_options = if @request_options.is_a?(Hash)
78
- @request_options.select do |key, _|
79
- ALLOWED_REQUEST_OPTIONS.include?(key)
80
- end
82
+ @request_options.slice(*ALLOWED_REQUEST_OPTIONS)
81
83
  else
82
84
  {}
83
85
  end
data/gemini-ai.gemspec CHANGED
@@ -30,7 +30,7 @@ Gem::Specification.new do |spec|
30
30
  spec.require_paths = ['ports/dsl']
31
31
 
32
32
  spec.add_dependency 'event_stream_parser', '~> 1.0'
33
- spec.add_dependency 'faraday', '~> 2.10'
33
+ spec.add_dependency 'faraday', '~> 2.13', '>= 2.13.2'
34
34
  spec.add_dependency 'faraday-typhoeus', '~> 1.1'
35
35
 
36
36
  # Before upgrading, check this:
data/static/gem.rb CHANGED
@@ -3,7 +3,7 @@
3
3
  module Gemini
4
4
  GEM = {
5
5
  name: 'gemini-ai',
6
- version: '4.2.0',
6
+ version: '4.3.0',
7
7
  author: 'gbaptista',
8
8
  summary: "Interact with Google's Gemini AI.",
9
9
  description: "A Ruby Gem for interacting with Gemini through Vertex AI, Generative Language API, or AI Studio, Google's generative AI services.",
data/template.md CHANGED
@@ -9,7 +9,7 @@ A Ruby Gem for interacting with [Gemini](https://deepmind.google/technologies/ge
9
9
  ## TL;DR and Quick Start
10
10
 
11
11
  ```ruby
12
- gem 'gemini-ai', '~> 4.2.0'
12
+ gem 'gemini-ai', '~> 4.3.0'
13
13
  ```
14
14
 
15
15
  ```ruby
@@ -59,6 +59,12 @@ result = client.stream_generate_content({
59
59
  })
60
60
  ```
61
61
 
62
+ Google now supports a [global endpoint](https://cloud.google.com/vertex-ai/generative-ai/docs/learn/locations#global-endpoint):
63
+
64
+ ```ruby
65
+ Gemini.new(credentials: { region: 'global' })
66
+ ```
67
+
62
68
  Result:
63
69
  ```ruby
64
70
  [{ 'candidates' =>
@@ -88,11 +94,11 @@ Result:
88
94
  ### Installing
89
95
 
90
96
  ```sh
91
- gem install gemini-ai -v 4.2.0
97
+ gem install gemini-ai -v 4.3.0
92
98
  ```
93
99
 
94
100
  ```sh
95
- gem 'gemini-ai', '~> 4.2.0'
101
+ gem 'gemini-ai', '~> 4.3.0'
96
102
  ```
97
103
 
98
104
  ### Credentials
@@ -309,6 +315,14 @@ client = Gemini.new(
309
315
  )
310
316
  ```
311
317
 
318
+ ### Global Endpoint
319
+
320
+ Google now supports a [global endpoint](https://cloud.google.com/vertex-ai/generative-ai/docs/learn/locations#global-endpoint):
321
+
322
+ ```ruby
323
+ Gemini.new(credentials: { region: 'global' })
324
+ ```
325
+
312
326
  ## Available Models
313
327
 
314
328
  These models are accessible to the repository **author** as of June 2025 in the `us-east4` region. Access to models may vary by region, user, and account. All models here are expected to work, if you can access them. This is just a reference of what a "typical" user may expect to have access to right away:
@@ -1390,7 +1404,7 @@ gem build gemini-ai.gemspec
1390
1404
 
1391
1405
  gem signin
1392
1406
 
1393
- gem push gemini-ai-4.2.0.gem
1407
+ gem push gemini-ai-4.3.0.gem
1394
1408
  ```
1395
1409
 
1396
1410
  ### Updating the README
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gemini-ai
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.0
4
+ version: 4.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - gbaptista
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-07-21 00:00:00.000000000 Z
11
+ date: 2025-07-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: event_stream_parser
@@ -30,14 +30,20 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '2.10'
33
+ version: '2.13'
34
+ - - ">="
35
+ - !ruby/object:Gem::Version
36
+ version: 2.13.2
34
37
  type: :runtime
35
38
  prerelease: false
36
39
  version_requirements: !ruby/object:Gem::Requirement
37
40
  requirements:
38
41
  - - "~>"
39
42
  - !ruby/object:Gem::Version
40
- version: '2.10'
43
+ version: '2.13'
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: 2.13.2
41
47
  - !ruby/object:Gem::Dependency
42
48
  name: faraday-typhoeus
43
49
  requirement: !ruby/object:Gem::Requirement