geminiext 0.0.3 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/geminiext/cache.rb +8 -2
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 226e4ae21c091df3b4f0a02141097e2f55d475e0b34336fe7415e3517c8d7c73
4
- data.tar.gz: 99d3eba31272bd7a04095e9fa1b9b56a897ecf058fd5c3ed67bc1e3530e489b1
3
+ metadata.gz: 06c950bcdc066e3a29b824226c9ce351a3555aece1cb6169526e7a350124ce98
4
+ data.tar.gz: a60ec80c78df74698c81bfbf5c009be396255ba51cc772d5541947e36c9c8db3
5
5
  SHA512:
6
- metadata.gz: cdd1c32369e78fd98d74a432b85035f55bc2e2104bfd5d98ecfc5e3dd8c5066313767e7ad6d307cda80a41a37aa57723ff78214dae319f3e97cc4fb8a3d9a86c
7
- data.tar.gz: 344c36bd43bddd92d7867e7d14789a0bd2919de308f86c2ed7dc1f8b7be36c8b62a4707a71d832e5375580802eb7c5fd776838c40f92ffa6cc5736c529433074
6
+ metadata.gz: be97a24aa8df7fff3a54d53c0c236460db69910bdeb9b2760b9bb6099610f19870d7ed36c9626fb2ff6ef48d95b7f26207a7ceeb5d4df99c79e43440dbd9409e
7
+ data.tar.gz: 138f4a593288ae8593bf91900101bba8e37c0bbc2cadd48b82122c07d9ec1e67cb47896862d3fc4f77ad8c6cd64b3e2cb511a86017933f290bb52ebeedd890ac
@@ -63,13 +63,19 @@ module GeminiExt
63
63
  cached_content: self['name']
64
64
  }.to_json
65
65
  end
66
-
67
- return JSON.parse(response.body) if response.status == 200
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geminiext
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gedean Dias