tiny_gemini 2.2.0 → 3.0.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/lib/tiny_gemini.rb +2 -7
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b5f56e4cbc05e3d459f13871f6cd6bdddd3468b7cea23777c8361b08f802a07c
|
|
4
|
+
data.tar.gz: a1ef17332bd9433a72dce319e0048a5d34826fc8685e985b28088a0c80d67a6e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9d70f2652d4ffee8a1022e456b11f588034c9a8b9f6e090628392463bc924d172f8f33f2354fb6dd264a9f02c115989a674c2a90a5d770de134faf6be0bdce8f
|
|
7
|
+
data.tar.gz: a876b8793468acbd501491098acf12c23f696c529853c81c289ca530f9c74018220753ccdc465476184ede058aabfbe819ac9cc38cac18caff7912efed3f0191
|
data/lib/tiny_gemini.rb
CHANGED
|
@@ -24,6 +24,7 @@ class TinyGemini
|
|
|
24
24
|
end
|
|
25
25
|
|
|
26
26
|
# sends a request to POST generateContent
|
|
27
|
+
# returns the parsed JSON reply
|
|
27
28
|
#
|
|
28
29
|
# messages: an array of hashes in the following format:
|
|
29
30
|
# [
|
|
@@ -76,13 +77,7 @@ class TinyGemini
|
|
|
76
77
|
parsed_response = JSON.parse(response.body)
|
|
77
78
|
raise(TinyGeminiModelError, "No condidates in Gemini response") unless parsed_response['candidates']
|
|
78
79
|
|
|
79
|
-
|
|
80
|
-
raise(TinyGeminiModelError, "No first candidate response in Gemini response") unless first_candidate_response
|
|
81
|
-
|
|
82
|
-
text_response = first_candidate_response&.dig('content', 'parts')&.first&.dig('text')&.strip
|
|
83
|
-
raise(TinyGeminiModelError, "Text response is nil or empty: `#{text_response.inspect}`") if text_response.nil? || text_response.length == 0
|
|
84
|
-
|
|
85
|
-
text_response
|
|
80
|
+
parsed_response
|
|
86
81
|
end
|
|
87
82
|
end
|
|
88
83
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: tiny_gemini
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 3.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jeff Lunt
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2024-09-
|
|
11
|
+
date: 2024-09-06 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: a tiny gem for using Google Gemini's generative models for chat
|
|
14
14
|
email: jefflunt@gmail.com
|