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 +4 -4
- data/Gemfile +5 -5
- data/Gemfile.lock +62 -55
- data/README.md +19 -4
- data/controllers/client.rb +6 -4
- data/gemini-ai.gemspec +1 -1
- data/static/gem.rb +1 -1
- data/template.md +18 -4
- metadata +10 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5ad19a7cfc87b01f59e5b9eeb11241d63f68a843da3c1f1f8a2784fc20c55cd4
|
4
|
+
data.tar.gz: 2527dda3745613f278c1164aa4625ad447564e22853737e3bce69d423a076fcc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
9
|
-
gem 'pry-byebug', '~> 3.
|
10
|
-
gem 'rspec', '~> 3.13'
|
11
|
-
gem 'rubocop', '~> 1.
|
12
|
-
gem 'rubocop-rspec', '~> 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.
|
4
|
+
gemini-ai (4.3.0)
|
5
5
|
event_stream_parser (~> 1.0)
|
6
|
-
faraday (~> 2.
|
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.
|
17
|
-
base64 (0.
|
18
|
-
byebug (
|
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.
|
21
|
-
dotenv (3.1.
|
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.
|
26
|
-
faraday-net_http (>= 2.0, < 3.
|
25
|
+
faraday (2.13.2)
|
26
|
+
faraday-net_http (>= 2.0, < 3.5)
|
27
|
+
json
|
27
28
|
logger
|
28
|
-
faraday-net_http (3.1
|
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.
|
34
|
-
google-cloud-env (2.
|
34
|
+
ffi (1.17.2)
|
35
|
+
google-cloud-env (2.3.1)
|
36
|
+
base64 (~> 0.2)
|
35
37
|
faraday (>= 1.0, < 3.a)
|
36
|
-
|
38
|
+
google-logging-utils (0.2.0)
|
39
|
+
googleauth (1.14.0)
|
37
40
|
faraday (>= 1.0, < 3.a)
|
38
|
-
google-cloud-env (~> 2.
|
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.
|
44
|
-
jwt (2.
|
47
|
+
json (2.12.2)
|
48
|
+
jwt (2.10.2)
|
45
49
|
base64
|
46
|
-
language_server-protocol (3.17.0.
|
47
|
-
|
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.
|
55
|
+
net-http (0.6.0)
|
51
56
|
uri
|
52
57
|
os (1.1.4)
|
53
|
-
parallel (1.
|
54
|
-
parser (3.3.
|
58
|
+
parallel (1.27.0)
|
59
|
+
parser (3.3.8.0)
|
55
60
|
ast (~> 2.4.1)
|
56
61
|
racc
|
57
|
-
|
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.
|
61
|
-
byebug (~>
|
62
|
-
pry (>= 0.13, < 0.
|
63
|
-
public_suffix (6.0.
|
64
|
-
racc (1.8.
|
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.
|
67
|
-
|
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.
|
77
|
+
rspec-core (3.13.5)
|
74
78
|
rspec-support (~> 3.13.0)
|
75
|
-
rspec-expectations (3.13.
|
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.
|
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.
|
82
|
-
rubocop (1.
|
85
|
+
rspec-support (3.13.4)
|
86
|
+
rubocop (1.78.0)
|
83
87
|
json (~> 2.3)
|
84
|
-
language_server-protocol (
|
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.
|
89
|
-
|
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, <
|
93
|
-
rubocop-ast (1.
|
94
|
-
parser (>= 3.3.
|
95
|
-
|
96
|
-
|
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.
|
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 (
|
107
|
-
|
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.
|
120
|
+
dotenv (~> 3.1, >= 3.1.8)
|
114
121
|
gemini-ai!
|
115
|
-
pry-byebug (~> 3.
|
116
|
-
rspec (~> 3.13)
|
117
|
-
rubocop (~> 1.
|
118
|
-
rubocop-rspec (~> 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.
|
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.
|
148
|
+
gem install gemini-ai -v 4.3.0
|
142
149
|
```
|
143
150
|
|
144
151
|
```sh
|
145
|
-
gem 'gemini-ai', '~> 4.
|
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.
|
1458
|
+
gem push gemini-ai-4.3.0.gem
|
1444
1459
|
```
|
1445
1460
|
|
1446
1461
|
### Updating the README
|
data/controllers/client.rb
CHANGED
@@ -56,7 +56,11 @@ module Gemini
|
|
56
56
|
|
57
57
|
@base_address = case @service
|
58
58
|
when 'vertex-ai-api'
|
59
|
-
|
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.
|
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.
|
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.
|
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.
|
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.
|
97
|
+
gem install gemini-ai -v 4.3.0
|
92
98
|
```
|
93
99
|
|
94
100
|
```sh
|
95
|
-
gem 'gemini-ai', '~> 4.
|
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.
|
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.
|
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:
|
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.
|
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.
|
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
|