tiny_gemini 2.0.1 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tiny_gemini.rb +2 -2
- 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: 6bc87254a4490924b2ba4193d0f4edd021154bc7fea87e5ed37fc1eea48ef036
|
4
|
+
data.tar.gz: 0ae2c5d4c6c27a216a467e192502c7e654eba1aa16dd530705271ce31f9928b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4824f52f7359feb61dad5c0c627a51913d2c032ddaca279a5a0bb4805c6048216004e0272ea19794db5b86d7d55c64afe42dad9c1ec83ba9a434e8894b2c4fde
|
7
|
+
data.tar.gz: 7f8f17fd55c0ffb3dde4792ae092009f1fb9c667ead63b1a6ff137a7c6696b9d10f2d203b754be52e4bbde0f92c2a39057c07c00fafdcf3e522b7d2ddbc185ac
|
data/lib/tiny_gemini.rb
CHANGED
@@ -78,8 +78,8 @@ class TinyGemini
|
|
78
78
|
first_candidate_response = parsed_response['candidates'].first
|
79
79
|
raise(TinyGeminiModelError, "No first candidate response in Gemini response") unless first_candidate_response
|
80
80
|
|
81
|
-
text_response = first_candidate_response&.dig('content', 'parts')&.first&.dig('text')
|
82
|
-
raise(TinyGeminiModelError, "Text response is nil or empty: `#{text_response.inspect}`")
|
81
|
+
text_response = first_candidate_response&.dig('content', 'parts')&.first&.dig('text')&.strip
|
82
|
+
raise(TinyGeminiModelError, "Text response is nil or empty: `#{text_response.inspect}`") if text_reponse.nil? || text_response.length == 0
|
83
83
|
|
84
84
|
text_response
|
85
85
|
end
|
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: 2.0
|
4
|
+
version: 2.1.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-
|
11
|
+
date: 2024-08-01 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
|