mokkku 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/bin/mokkku +14 -0
- 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: 9dd97441b73b6ba8795909cfc1115ff90ca6b63a16fe0a2e9ea00a3d75f44933
|
4
|
+
data.tar.gz: 79041506c510a3c642c8cf0e9b0db97117df43f6b8a3e09257dcd8e6ded08721
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa603c3e83ee372173558dfeabbb0969f9eb6cd45a313c447555e71961446fa97416c9a563f54bd3f810a7e5aa984881a419d01208e163a166b59dbcacf0d186
|
7
|
+
data.tar.gz: 94d08b8ea75f384f78f473794a5862e614c53fa50388fee8b51bdc4283fdc869f81394e66d0873740fad795a007f119fb4231c6311d78c39c97e5848eee5a4ee
|
data/bin/mokkku
CHANGED
@@ -38,4 +38,18 @@ OptionParser.new do |opts|
|
|
38
38
|
end
|
39
39
|
end.parse!
|
40
40
|
|
41
|
+
# Load Rails project
|
42
|
+
begin
|
43
|
+
require File.join(base_dir, 'config', 'boot')
|
44
|
+
require File.join(base_dir, 'config', 'environment')
|
45
|
+
rescue LoadError
|
46
|
+
puts "\nUh-oh! You must be in the root directory of a Rails project.\n"
|
47
|
+
raise
|
48
|
+
end
|
49
|
+
|
50
|
+
# Load Rails models
|
51
|
+
Rails.application.eager_load! if defined?(Rails)
|
52
|
+
# Rails 6 support
|
53
|
+
Zeitwerk::Loader.eager_load_all if defined?(Zeitwerk)
|
54
|
+
|
41
55
|
Mokkku::Cli::Runner.start(options)
|
@@ -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.5
|
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
|