gemini-ai 3.1.2 → 3.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9bd73b705a0583ff417c3e27341d49dc4847d7ecda287d5ce3f3e501dce0d784
4
- data.tar.gz: af6e6f982b09a4787303c03e02f6bbf67c10520b7852d8398d87f14d1b72a947
3
+ metadata.gz: 4c4cbfd3191a65f27ae580b99a8774309f552f288b5e2bbe339d761ad199615a
4
+ data.tar.gz: 0616acf06021892ec8ef85088c8c0ae6f486e8c73d774e72ad9a6a961d02c398
5
5
  SHA512:
6
- metadata.gz: 67bd3d6acbf83b7e9d2da8e8082f5bc412b0390822cc71884e40e4e2e93d1abbd01c2c6d7413b76a37f4c4dc2250064f00862cb64fc07851458685375af78619
7
- data.tar.gz: ef46dd2bee2c1329c1c2a50a3f409f8a6205f81279add1c1bce409304790c018bcc0041676a11809ede5df12e008cdf56cd2064592e30c3384808e748cd7deb2
6
+ metadata.gz: e68c49731057a162bd9ada268c1343b166593acd74dccc6be4bdd59cdbdef2401400618073df7e24781e7e5d00f23bb277b77d083e168afe20959a6a5a937dcc
7
+ data.tar.gz: 98bb928f6e8ee5e0bea7b9001868efd17079513da54fbf4a3084f1a75d0a07504220174d001ae4bde77fbedee083d3943e873ee6ad46760e8c34ee2794eed272
data/.gitignore CHANGED
@@ -1,2 +1,3 @@
1
1
  *.gem
2
2
  .devcontainer
3
+ .env
data/Gemfile CHANGED
@@ -5,6 +5,7 @@ source 'https://rubygems.org'
5
5
  gemspec
6
6
 
7
7
  group :test, :development do
8
+ gem 'dotenv', '~> 2.8', '>= 2.8.1'
8
9
  gem 'pry-byebug', '~> 3.10', '>= 3.10.1'
9
10
  gem 'rubocop', '~> 1.58'
10
11
  end
data/Gemfile.lock CHANGED
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gemini-ai (3.1.2)
4
+ gemini-ai (3.1.3)
5
5
  event_stream_parser (~> 1.0)
6
- faraday (~> 2.8, >= 2.8.1)
6
+ faraday (~> 2.9)
7
7
  googleauth (~> 1.8)
8
8
 
9
9
  GEM
@@ -12,15 +12,14 @@ GEM
12
12
  addressable (2.8.6)
13
13
  public_suffix (>= 2.0.2, < 6.0)
14
14
  ast (2.4.2)
15
- base64 (0.2.0)
16
15
  byebug (11.1.3)
17
16
  coderay (1.1.3)
17
+ dotenv (2.8.1)
18
18
  event_stream_parser (1.0.0)
19
- faraday (2.8.1)
20
- base64
21
- faraday-net_http (>= 2.0, < 3.1)
22
- ruby2_keywords (>= 0.0.4)
23
- faraday-net_http (3.0.2)
19
+ faraday (2.9.0)
20
+ faraday-net_http (>= 2.0, < 3.2)
21
+ faraday-net_http (3.1.0)
22
+ net-http
24
23
  google-cloud-env (2.1.0)
25
24
  faraday (>= 1.0, < 3.a)
26
25
  googleauth (1.9.1)
@@ -35,9 +34,11 @@ GEM
35
34
  language_server-protocol (3.17.0.3)
36
35
  method_source (1.0.0)
37
36
  multi_json (1.15.0)
37
+ net-http (0.4.1)
38
+ uri
38
39
  os (1.1.4)
39
40
  parallel (1.24.0)
40
- parser (3.3.0.0)
41
+ parser (3.3.0.3)
41
42
  ast (~> 2.4.1)
42
43
  racc
43
44
  pry (0.14.2)
@@ -49,7 +50,7 @@ GEM
49
50
  public_suffix (5.0.4)
50
51
  racc (1.7.3)
51
52
  rainbow (3.1.1)
52
- regexp_parser (2.8.3)
53
+ regexp_parser (2.9.0)
53
54
  rexml (3.2.6)
54
55
  rubocop (1.59.0)
55
56
  json (~> 2.3)
@@ -65,18 +66,19 @@ GEM
65
66
  rubocop-ast (1.30.0)
66
67
  parser (>= 3.2.1.0)
67
68
  ruby-progressbar (1.13.0)
68
- ruby2_keywords (0.0.5)
69
69
  signet (0.18.0)
70
70
  addressable (~> 2.8)
71
71
  faraday (>= 0.17.5, < 3.a)
72
72
  jwt (>= 1.5, < 3.0)
73
73
  multi_json (~> 1.10)
74
74
  unicode-display_width (2.5.0)
75
+ uri (0.13.0)
75
76
 
76
77
  PLATFORMS
77
78
  x86_64-linux
78
79
 
79
80
  DEPENDENCIES
81
+ dotenv (~> 2.8, >= 2.8.1)
80
82
  gemini-ai!
81
83
  pry-byebug (~> 3.10, >= 3.10.1)
82
84
  rubocop (~> 1.58)
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', '~> 3.1.2'
12
+ gem 'gemini-ai', '~> 3.1.3'
13
13
  ```
14
14
 
15
15
  ```ruby
@@ -114,11 +114,11 @@ Result:
114
114
  ### Installing
115
115
 
116
116
  ```sh
117
- gem install gemini-ai -v 3.1.2
117
+ gem install gemini-ai -v 3.1.3
118
118
  ```
119
119
 
120
120
  ```sh
121
- gem 'gemini-ai', '~> 3.1.2'
121
+ gem 'gemini-ai', '~> 3.1.3'
122
122
  ```
123
123
 
124
124
  ### Credentials
@@ -967,6 +967,8 @@ RequestError
967
967
  ```bash
968
968
  bundle
969
969
  rubocop -A
970
+
971
+ bundle exec ruby spec/tasks/run-client.rb
970
972
  ```
971
973
 
972
974
  ### Purpose
@@ -980,7 +982,7 @@ gem build gemini-ai.gemspec
980
982
 
981
983
  gem signin
982
984
 
983
- gem push gemini-ai-3.1.2.gem
985
+ gem push gemini-ai-3.1.3.gem
984
986
  ```
985
987
 
986
988
  ### Updating the README
@@ -5,7 +5,7 @@ require 'faraday'
5
5
  require 'json'
6
6
  require 'googleauth'
7
7
 
8
- require_relative '../ports/dsl/gemini-ai/errors'
8
+ require_relative '../components/errors'
9
9
 
10
10
  module Gemini
11
11
  module Controllers
@@ -30,7 +30,7 @@ module Gemini
30
30
  if @authentication == :service_account || @authentication == :default_credentials
31
31
  @project_id = config[:credentials][:project_id] || @authorizer.project_id || @authorizer.quota_project_id
32
32
 
33
- raise MissingProjectIdError, 'Could not determine project_id, which is required.' if @project_id.nil?
33
+ raise Errors::MissingProjectIdError, 'Could not determine project_id, which is required.' if @project_id.nil?
34
34
  end
35
35
 
36
36
  @service = config[:credentials][:service]
@@ -41,7 +41,7 @@ module Gemini
41
41
  when 'generative-language-api'
42
42
  "https://generativelanguage.googleapis.com/v1/models/#{config[:options][:model]}"
43
43
  else
44
- raise UnsupportedServiceError, "Unsupported service: #{@service}"
44
+ raise Errors::UnsupportedServiceError, "Unsupported service: #{@service}"
45
45
  end
46
46
 
47
47
  @server_sent_events = config.dig(:options, :server_sent_events)
@@ -80,7 +80,7 @@ module Gemini
80
80
  url += "?#{params.join('&')}" if params.size.positive?
81
81
 
82
82
  if !callback.nil? && !server_sent_events_enabled
83
- raise BlockWithoutServerSentEventsError,
83
+ raise Errors::BlockWithoutServerSentEventsError,
84
84
  'You are trying to use a block without Server Sent Events (SSE) enabled.'
85
85
  end
86
86
 
@@ -132,7 +132,7 @@ module Gemini
132
132
 
133
133
  results.map { |result| result[:event] }
134
134
  rescue Faraday::ServerError => e
135
- raise RequestError.new(e.message, request: e, payload:)
135
+ raise Errors::RequestError.new(e.message, request: e, payload:)
136
136
  end
137
137
 
138
138
  def safe_parse_json(raw)
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.8', '>= 2.8.1'
33
+ spec.add_dependency 'faraday', '~> 2.9'
34
34
  spec.add_dependency 'googleauth', '~> 1.8'
35
35
 
36
36
  spec.metadata['rubygems_mfa_required'] = 'true'
data/static/gem.rb CHANGED
@@ -3,7 +3,7 @@
3
3
  module Gemini
4
4
  GEM = {
5
5
  name: 'gemini-ai',
6
- version: '3.1.2',
6
+ version: '3.1.3',
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', '~> 3.1.2'
12
+ gem 'gemini-ai', '~> 3.1.3'
13
13
  ```
14
14
 
15
15
  ```ruby
@@ -77,11 +77,11 @@ Result:
77
77
  ### Installing
78
78
 
79
79
  ```sh
80
- gem install gemini-ai -v 3.1.2
80
+ gem install gemini-ai -v 3.1.3
81
81
  ```
82
82
 
83
83
  ```sh
84
- gem 'gemini-ai', '~> 3.1.2'
84
+ gem 'gemini-ai', '~> 3.1.3'
85
85
  ```
86
86
 
87
87
  ### Credentials
@@ -930,6 +930,8 @@ RequestError
930
930
  ```bash
931
931
  bundle
932
932
  rubocop -A
933
+
934
+ bundle exec ruby spec/tasks/run-client.rb
933
935
  ```
934
936
 
935
937
  ### Purpose
@@ -943,7 +945,7 @@ gem build gemini-ai.gemspec
943
945
 
944
946
  gem signin
945
947
 
946
- gem push gemini-ai-3.1.2.gem
948
+ gem push gemini-ai-3.1.3.gem
947
949
  ```
948
950
 
949
951
  ### 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: 3.1.2
4
+ version: 3.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - gbaptista
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-06 00:00:00.000000000 Z
11
+ date: 2024-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: event_stream_parser
@@ -30,20 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '2.8'
34
- - - ">="
35
- - !ruby/object:Gem::Version
36
- version: 2.8.1
33
+ version: '2.9'
37
34
  type: :runtime
38
35
  prerelease: false
39
36
  version_requirements: !ruby/object:Gem::Requirement
40
37
  requirements:
41
38
  - - "~>"
42
39
  - !ruby/object:Gem::Version
43
- version: '2.8'
44
- - - ">="
45
- - !ruby/object:Gem::Version
46
- version: 2.8.1
40
+ version: '2.9'
47
41
  - !ruby/object:Gem::Dependency
48
42
  name: googleauth
49
43
  requirement: !ruby/object:Gem::Requirement