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 +4 -4
- data/CHANGELOG.md +2 -2
- data/README.md +4 -30
- data/{gemini_ruby.gemspec → gemini_api_ruby.gemspec} +2 -2
- data/lib/{gemini_ruby → gemini_api_ruby}/client.rb +7 -5
- data/lib/{gemini_ruby → gemini_api_ruby}/errors.rb +1 -1
- data/lib/{gemini_ruby → gemini_api_ruby}/request.rb +2 -2
- data/lib/gemini_api_ruby/version.rb +3 -0
- data/lib/gemini_api_ruby.rb +14 -0
- data/sig/gemini_ruby.rbs +1 -1
- metadata +12 -9
- data/lib/gemini_ruby/version.rb +0 -3
- data/lib/gemini_ruby.rb +0 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ecac9fca94f9e74a6ccffc95fc258d74e28c4dd1b234293136125b9c7eb6b334
|
4
|
+
data.tar.gz: 73a053bff95ab667d3205654dd8c0249e33c2687c6f8538af4970f805c135b57
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c5312431301f851c8c31aa1e48ab0241ad44935e3b420a98a938a64fba22a842b103bba3198e5f3093697d8ac8cb20849d02e1f7e5f71ca58bf918fa5f68b4f9
|
7
|
+
data.tar.gz: 1c739664d1f69dae1430552f6c26d5015a37324dcc2c6f2f4bf4f653cba89d498295b6859858d379e04dcd016519481e1e4fd64cc4297b875cacbc096ab0778e
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,39 +1,13 @@
|
|
1
|
-
#
|
1
|
+
# GeminiApiRuby
|
2
2
|
|
3
|
-
|
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
|
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
|
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/
|
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 =
|
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
|
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
|
-
|
9
|
-
response.body
|
11
|
+
request(:get, "/v1/pubticker/#{symbol}")
|
10
12
|
end
|
11
13
|
|
12
14
|
def get_order_book(symbol)
|
13
|
-
|
14
|
-
|
15
|
+
request(:get, "/v1/book/#{symbol}")
|
16
|
+
end
|
15
17
|
|
16
18
|
private
|
17
19
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
module
|
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:
|
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,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
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.
|
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-
|
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
|
-
-
|
126
|
-
- lib/
|
127
|
-
- lib/
|
128
|
-
- lib/
|
129
|
-
- lib/
|
130
|
-
- lib/
|
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.
|
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: []
|
data/lib/gemini_ruby/version.rb
DELETED
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
|