geminiext 0.0.3 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/geminiext/cache.rb +8 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 06c950bcdc066e3a29b824226c9ce351a3555aece1cb6169526e7a350124ce98
|
4
|
+
data.tar.gz: a60ec80c78df74698c81bfbf5c009be396255ba51cc772d5541947e36c9c8db3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be97a24aa8df7fff3a54d53c0c236460db69910bdeb9b2760b9bb6099610f19870d7ed36c9626fb2ff6ef48d95b7f26207a7ceeb5d4df99c79e43440dbd9409e
|
7
|
+
data.tar.gz: 138f4a593288ae8593bf91900101bba8e37c0bbc2cadd48b82122c07d9ec1e67cb47896862d3fc4f77ad8c6cd64b3e2cb511a86017933f290bb52ebeedd890ac
|
data/lib/geminiext/cache.rb
CHANGED
@@ -63,13 +63,19 @@ module GeminiExt
|
|
63
63
|
cached_content: self['name']
|
64
64
|
}.to_json
|
65
65
|
end
|
66
|
-
|
67
|
-
|
66
|
+
|
67
|
+
if response.status == 200
|
68
|
+
resp = JSON.parse(response.body)
|
69
|
+
def resp.content = dig('candidates', 0, 'content', 'parts', 0, 'text')
|
70
|
+
return resp
|
71
|
+
end
|
68
72
|
|
69
73
|
raise "Erro ao gerar conteúdo: #{response.body}"
|
70
74
|
rescue Faraday::Error => e
|
71
75
|
raise "Erro na requisição: #{e.message}"
|
72
76
|
end
|
77
|
+
|
78
|
+
def item.single_prompt(prompt) = generate_content(contents: [{ parts: [{ text: prompt }], role: 'user' }])
|
73
79
|
|
74
80
|
item
|
75
81
|
end
|