mokkku 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mokkku/generators/builder.rb +3 -0
- data/lib/mokkku/generators/gemini.rb +23 -0
- data/lib/mokkku/version.rb +1 -1
- metadata +16 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3069dcc17521f52cabc1f043476f7d0c01e657460f7a756f8e3c9dc0e7e27d23
|
4
|
+
data.tar.gz: b7cb51c7bf5d8a45604dd17c7143a3657c857901a22fad09819eed548b05046a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 01cc5b791e4d82c189c9d36491bb5d0f9eb52a7170fb536a53c0957188de8a40bf22a03b6ecc14c111995440629663d7b7f9dc96bfaede49a0986e725eafccd0
|
7
|
+
data.tar.gz: a5f1111d24cbbb13b959ca1cc4b85c4a08fd8643359027ea9b672c57e1ea4c21e6d42dd6be1fd4ebb70d2c56dcbb40557b9c1b91e9870721d3de5c2f80b0377c
|
@@ -1,5 +1,6 @@
|
|
1
1
|
require_relative 'gpt'
|
2
2
|
require_relative 'claude'
|
3
|
+
require_relative 'gemini'
|
3
4
|
|
4
5
|
module Mokkku
|
5
6
|
module Generators
|
@@ -12,6 +13,8 @@ module Mokkku
|
|
12
13
|
Mokkku::Generators::Gpt
|
13
14
|
when 'claude'
|
14
15
|
Mokkku::Generators::Claude
|
16
|
+
when 'gemini'
|
17
|
+
Mokkku::Generators::Gemini
|
15
18
|
else
|
16
19
|
raise UnsupportedGenerator
|
17
20
|
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'gemini-ai'
|
2
|
+
|
3
|
+
module Mokkku
|
4
|
+
module Generators
|
5
|
+
class Gemini
|
6
|
+
def self.call(api_key:, prompt:)
|
7
|
+
client = ::Gemini.new(
|
8
|
+
credentials: {
|
9
|
+
service: 'generative-language-api',
|
10
|
+
api_key: api_key
|
11
|
+
},
|
12
|
+
options: { model: 'gemini-pro', server_sent_events: false }
|
13
|
+
)
|
14
|
+
|
15
|
+
result = client.generate_content({
|
16
|
+
contents: { role: 'user', parts: { text: prompt } }
|
17
|
+
})
|
18
|
+
|
19
|
+
result['candidates'].first['content']['parts'].first['text']
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/lib/mokkku/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mokkku
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paweł Dąbrowski
|
@@ -72,6 +72,20 @@ dependencies:
|
|
72
72
|
- - "~>"
|
73
73
|
- !ruby/object:Gem::Version
|
74
74
|
version: 0.3.0
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
name: gemini-ai
|
77
|
+
requirement: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - "~>"
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '4.2'
|
82
|
+
type: :runtime
|
83
|
+
prerelease: false
|
84
|
+
version_requirements: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - "~>"
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '4.2'
|
75
89
|
description: Generate mock data that is unique for your application
|
76
90
|
email: contact@paweldabrowski.com
|
77
91
|
executables:
|
@@ -86,6 +100,7 @@ files:
|
|
86
100
|
- lib/mokkku/cli/validator.rb
|
87
101
|
- lib/mokkku/generators/builder.rb
|
88
102
|
- lib/mokkku/generators/claude.rb
|
103
|
+
- lib/mokkku/generators/gemini.rb
|
89
104
|
- lib/mokkku/generators/gpt.rb
|
90
105
|
- lib/mokkku/mocked_object.rb
|
91
106
|
- lib/mokkku/utils.rb
|