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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 04c69427e72610fa1be06c75060a255eb0ab45c64b3e1a65a5649aa2420552f7
4
- data.tar.gz: efc88cd532cd54f28ae0dc4fb2c8cfba8fb0d3e674183494fdc47ef8adcfef15
3
+ metadata.gz: 3069dcc17521f52cabc1f043476f7d0c01e657460f7a756f8e3c9dc0e7e27d23
4
+ data.tar.gz: b7cb51c7bf5d8a45604dd17c7143a3657c857901a22fad09819eed548b05046a
5
5
  SHA512:
6
- metadata.gz: afc7eb5280d025becdd44e0bd65412645a15bea68812ccc3c09a9179f79b2327faed3937c326c5da56f484a29cafc65e2d1f7bdf98550fff3d8a40995698f864
7
- data.tar.gz: e07d24c250a66e1550da05e37a4961c3d4ad0e389e905aa662ca514ac9b96af48c263d3c24fab1e5281884f267381c5fbe588d8c67cd1540981388e81d707e81
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
@@ -3,7 +3,7 @@ module Mokkku
3
3
  module_function
4
4
 
5
5
  def to_s
6
- '0.0.3'
6
+ '0.0.4'
7
7
  end
8
8
  end
9
9
  end
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.3
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