gemini_api_ruby 1.0.0 → 1.0.2

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: d3fda2dfaf953d013491f20a1fe263ca46a1a871bdff0682f06ddfc3b2e13c0b
4
- data.tar.gz: bff4c1a38917115f3c1d87c582ee15753373cf0442fbd9b7b499f38e00e1d002
3
+ metadata.gz: ecac9fca94f9e74a6ccffc95fc258d74e28c4dd1b234293136125b9c7eb6b334
4
+ data.tar.gz: 73a053bff95ab667d3205654dd8c0249e33c2687c6f8538af4970f805c135b57
5
5
  SHA512:
6
- metadata.gz: f674a5622f0c7deb86faf0a8bc4123de9e21555efe21072803f270e1124cfca3b92c543de2b520faa14202169301b68a64ad2b95508544014224ebdd46360150
7
- data.tar.gz: 78c4a85dd312c4976197f5464f62f54c83cc3ec33a9c2ffbd7ee27935f848c05d368b052c00652fa6942e328a64de426c75f400cabd783fece32293dc2f718fc
6
+ metadata.gz: c5312431301f851c8c31aa1e48ab0241ad44935e3b420a98a938a64fba22a842b103bba3198e5f3093697d8ac8cb20849d02e1f7e5f71ca58bf918fa5f68b4f9
7
+ data.tar.gz: 1c739664d1f69dae1430552f6c26d5015a37324dcc2c6f2f4bf4f653cba89d498295b6859858d379e04dcd016519481e1e4fd64cc4297b875cacbc096ab0778e
data/CHANGELOG.md CHANGED
@@ -1,4 +1,4 @@
1
- # GeminiRuby
1
+ # GeminiApiRuby
2
2
 
3
3
  A Ruby gem to interact with the Google Gemini API.
4
4
 
@@ -7,4 +7,4 @@ A Ruby gem to interact with the Google Gemini API.
7
7
  Add this line to your application's Gemfile:
8
8
 
9
9
  ```ruby
10
- gem 'gemini_ruby'
10
+ gem 'gemini_api_ruby'
data/README.md CHANGED
@@ -1,39 +1,13 @@
1
- # GeminiRuby
1
+ # GeminiApiRuby
2
2
 
3
- TODO: Delete this and the text below, and describe your gem
4
-
5
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/gemini_ruby`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ Welcome to gemini-api-ruby!
6
4
 
7
5
  ## Installation
8
6
 
9
- TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
10
-
11
7
  Install the gem and add to the application's Gemfile by executing:
12
8
 
13
- $ bundle add UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG
9
+ $ bundle add gemini-api-ruby
14
10
 
15
11
  If bundler is not being used to manage dependencies, install the gem by executing:
16
12
 
17
- $ gem install UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG
18
-
19
- ## Usage
20
-
21
- TODO: Write usage instructions here
22
-
23
- ## Development
24
-
25
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
26
-
27
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
28
-
29
- ## Contributing
30
-
31
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/gemini_ruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/gemini_ruby/blob/master/CODE_OF_CONDUCT.md).
32
-
33
- ## License
34
-
35
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
36
-
37
- ## Code of Conduct
38
-
39
- Everyone interacting in the GeminiRuby project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/gemini_ruby/blob/master/CODE_OF_CONDUCT.md).
13
+ $ gem install gemini-api-ruby
@@ -1,10 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "lib/gemini_ruby/version"
3
+ require_relative "lib/gemini_api_ruby/version"
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "gemini_api_ruby"
7
- spec.version = GeminiRuby::VERSION
7
+ spec.version = GeminiApiRuby::VERSION
8
8
  spec.authors = ["marcelodeus98"]
9
9
  spec.email = ["marcelodeus8@gmail.com"]
10
10
 
@@ -1,17 +1,19 @@
1
- module GeminiRuby
1
+ module GeminiApiRuby
2
2
  class Client
3
3
  def initialize(api_key:)
4
4
  @api_key = api_key
5
5
  end
6
6
 
7
+ def generate_text(prompt)
8
+ response = request(:post, "/v1/generate", { prompt: prompt })
9
+
7
10
  def get_ticker(symbol)
8
- response = request(:get, "/v1/pubticker/#{symbol}")
9
- response.body
11
+ request(:get, "/v1/pubticker/#{symbol}")
10
12
  end
11
13
 
12
14
  def get_order_book(symbol)
13
- response = request(:get, "/v1/book/#{symbol}")
14
- response.body
15
+ request(:get, "/v1/book/#{symbol}")
16
+ end
15
17
 
16
18
  private
17
19
 
@@ -1,4 +1,4 @@
1
- module GeminiRuby
1
+ module GeminiApiRuby
2
2
  class AuthenticationError < StandardError; end
3
3
  class APIError < StandardError; end
4
4
  class NotFoundError < StandardError; end
@@ -1,4 +1,4 @@
1
- module GeminiRuby
1
+ module GeminiApiRuby
2
2
  class Request
3
3
  def initialize(api_key:)
4
4
  @api_key = api_key
@@ -15,7 +15,7 @@ module GeminiRuby
15
15
  private
16
16
 
17
17
  def connection
18
- @connection ||= Faraday.new(url: GeminiRuby::BASE_URL) do |faraday|
18
+ @connection ||= Faraday.new(url: GeminiApiRuby::BASE_URL) do |faraday|
19
19
  faraday.request :json
20
20
  faraday.response :json, content_type: /\bjson$/
21
21
  faraday.adapter Faraday.default_adapter
@@ -0,0 +1,3 @@
1
+ module GeminiApiRuby
2
+ VERSION = "1.0.2"
3
+ end
@@ -0,0 +1,14 @@
1
+ require "faraday"
2
+ require "faraday/retry"
3
+ require "json"
4
+
5
+ require_relative "gemini_api_ruby/version"
6
+ require_relative "gemini_api_ruby/errors"
7
+ require_relative "gemini_api_ruby/client"
8
+ require_relative "gemini_api_ruby/request"
9
+
10
+ module GeminiApiRuby
11
+ BASE_URL = "https://api.gemini.com".freeze
12
+
13
+ class Error < StandardError; end
14
+ end
data/sig/gemini_ruby.rbs CHANGED
@@ -1,4 +1,4 @@
1
- module GeminiRuby
1
+ module GeminiApiRuby
2
2
  VERSION: String
3
3
  # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
4
  end
metadata CHANGED
@@ -1,13 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gemini_api_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - marcelodeus98
8
+ autorequire:
8
9
  bindir: exe
9
10
  cert_chain: []
10
- date: 2025-03-03 00:00:00.000000000 Z
11
+ date: 2025-03-08 00:00:00.000000000 Z
11
12
  dependencies:
12
13
  - !ruby/object:Gem::Dependency
13
14
  name: faraday
@@ -122,12 +123,12 @@ files:
122
123
  - LICENSE.txt
123
124
  - README.md
124
125
  - Rakefile
125
- - gemini_ruby.gemspec
126
- - lib/gemini_ruby.rb
127
- - lib/gemini_ruby/client.rb
128
- - lib/gemini_ruby/errors.rb
129
- - lib/gemini_ruby/request.rb
130
- - lib/gemini_ruby/version.rb
126
+ - gemini_api_ruby.gemspec
127
+ - lib/gemini_api_ruby.rb
128
+ - lib/gemini_api_ruby/client.rb
129
+ - lib/gemini_api_ruby/errors.rb
130
+ - lib/gemini_api_ruby/request.rb
131
+ - lib/gemini_api_ruby/version.rb
131
132
  - sig/gemini_ruby.rbs
132
133
  homepage: https://github.com/marcelodeus98/gemini_ruby
133
134
  licenses:
@@ -136,6 +137,7 @@ metadata:
136
137
  homepage_uri: https://github.com/marcelodeus98/gemini_ruby
137
138
  source_code_uri: https://github.com/marcelodeus98/gemini_ruby
138
139
  changelog_uri: https://github.com/marcelodeus98/gemini_ruby/blob/main/CHANGELOG.md
140
+ post_install_message:
139
141
  rdoc_options: []
140
142
  require_paths:
141
143
  - lib
@@ -150,7 +152,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
150
152
  - !ruby/object:Gem::Version
151
153
  version: '0'
152
154
  requirements: []
153
- rubygems_version: 3.6.5
155
+ rubygems_version: 3.4.19
156
+ signing_key:
154
157
  specification_version: 4
155
158
  summary: Ruby gem to interact with the Google Gemini API.
156
159
  test_files: []
@@ -1,3 +0,0 @@
1
- module GeminiRuby
2
- VERSION = "1.0.0"
3
- end
data/lib/gemini_ruby.rb DELETED
@@ -1,14 +0,0 @@
1
- require "faraday"
2
- require "faraday/retry"
3
- require "json"
4
-
5
- require_relative "gemini_ruby/version"
6
- require_relative "gemini_ruby/errors"
7
- require_relative "gemini_ruby/client"
8
- require_relative "gemini_ruby/request"
9
-
10
- module GeminiRuby
11
- BASE_URL = "https://api.gemini.com".freeze
12
-
13
- class Error < StandardError; end
14
- end