sublayer 0.0.7 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +15 -1
- data/lib/sublayer/version.rb +1 -1
- data/sublayer.gemspec +1 -1
- metadata +7 -11
- data/lib/sublayer/generators/examples/code_from_blueprint_generator.rb +0 -30
- data/lib/sublayer/generators/examples/code_from_description_generator.rb +0 -26
- data/lib/sublayer/generators/examples/description_from_code_generator.rb +0 -23
- data/lib/sublayer/generators/examples/invalid_to_valid_json_generator.rb +0 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0353b3446a610be215fd6fb1da6fbbf4bcf256de04ac5be24fb1e81da4c30aa5
|
4
|
+
data.tar.gz: 71a807c0e6d9aeb6c5af1a8b8d96fb6cbf3613064afebbb2a8af1f7aab469749
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 71a12929da5eea7c578bb682d2fa76e3293bc8ae288581ad33b5267f762ac7c454b61e3794ce386000b82013f1c76907f74a79efb8fe231148d756aefc8a0174
|
7
|
+
data.tar.gz: 49527df3972fa76c9e9e4bae501571264d440c95a082f29c9df68402803eecfc88d78b07531f6e5baa4e5a24a8a0532ae5744279db4e7fc2cf226969508f25ac
|
data/README.md
CHANGED
@@ -6,6 +6,20 @@ powered applications in Ruby.
|
|
6
6
|
|
7
7
|
For more detailed documentation visit our documentation site: [https://docs.sublayer.com](https://docs.sublayer.com).
|
8
8
|
|
9
|
+
## Note on Versioning
|
10
|
+
|
11
|
+
Pre-1.0 we anticipate many breaking changes to the API. Our current plan is to
|
12
|
+
keep breaking changes to minor, 0.x releases, and patch releases (0.x.y) will be used
|
13
|
+
for new features and bug fixes.
|
14
|
+
|
15
|
+
To maintain stability in your application, we recommend pinning the version of
|
16
|
+
Sublayer in your Gemfile to a specific minor version. For example, to pin to
|
17
|
+
version 0.0.x, you would add the following line to your Gemfile:
|
18
|
+
|
19
|
+
```ruby
|
20
|
+
gem 'sublayer', '~> 0.0'
|
21
|
+
```
|
22
|
+
|
9
23
|
## Installation
|
10
24
|
|
11
25
|
Install the gem by running the following commands:
|
@@ -15,7 +29,7 @@ Install the gem by running the following commands:
|
|
15
29
|
Or add this line to your application's Gemfile:
|
16
30
|
|
17
31
|
```ruby
|
18
|
-
gem 'sublayer'
|
32
|
+
gem 'sublayer', '~> 0.0'
|
19
33
|
```
|
20
34
|
|
21
35
|
## Choose your AI Model
|
data/lib/sublayer/version.rb
CHANGED
data/sublayer.gemspec
CHANGED
@@ -34,7 +34,7 @@ Gem::Specification.new do |spec|
|
|
34
34
|
spec.add_dependency "colorize"
|
35
35
|
spec.add_dependency "activesupport"
|
36
36
|
spec.add_dependency "zeitwerk"
|
37
|
-
spec.add_dependency "nokogiri"
|
37
|
+
spec.add_dependency "nokogiri", "~> 1.16.5"
|
38
38
|
spec.add_dependency "httparty"
|
39
39
|
|
40
40
|
spec.add_development_dependency "rspec", "~> 3.12"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sublayer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scott Werner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-05-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby-openai
|
@@ -70,16 +70,16 @@ dependencies:
|
|
70
70
|
name: nokogiri
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - "
|
73
|
+
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
75
|
+
version: 1.16.5
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - "
|
80
|
+
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
82
|
+
version: 1.16.5
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: httparty
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -181,10 +181,6 @@ files:
|
|
181
181
|
- lib/sublayer/components/output_adapters.rb
|
182
182
|
- lib/sublayer/components/output_adapters/single_string.rb
|
183
183
|
- lib/sublayer/generators/base.rb
|
184
|
-
- lib/sublayer/generators/examples/code_from_blueprint_generator.rb
|
185
|
-
- lib/sublayer/generators/examples/code_from_description_generator.rb
|
186
|
-
- lib/sublayer/generators/examples/description_from_code_generator.rb
|
187
|
-
- lib/sublayer/generators/examples/invalid_to_valid_json_generator.rb
|
188
184
|
- lib/sublayer/providers/claude.rb
|
189
185
|
- lib/sublayer/providers/gemini.rb
|
190
186
|
- lib/sublayer/providers/groq.rb
|
@@ -216,7 +212,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
216
212
|
- !ruby/object:Gem::Version
|
217
213
|
version: '0'
|
218
214
|
requirements: []
|
219
|
-
rubygems_version: 3.3
|
215
|
+
rubygems_version: 3.5.3
|
220
216
|
signing_key:
|
221
217
|
specification_version: 4
|
222
218
|
summary: A model-agnostic Ruby GenerativeAI DSL and Framework
|
@@ -1,30 +0,0 @@
|
|
1
|
-
class CodeFromBlueprintGenerator < Sublayer::Generators::Base
|
2
|
-
llm_output_adapter type: :single_string,
|
3
|
-
name: "generated_code",
|
4
|
-
description: "The generated code for the description"
|
5
|
-
|
6
|
-
def initialize(blueprint_description:, blueprint_code:, description:)
|
7
|
-
@blueprint_description = blueprint_description
|
8
|
-
@blueprint_code = blueprint_code
|
9
|
-
@description = description
|
10
|
-
end
|
11
|
-
|
12
|
-
def generate
|
13
|
-
super
|
14
|
-
end
|
15
|
-
|
16
|
-
def prompt
|
17
|
-
<<-PROMPT
|
18
|
-
You are an expert programmer and are great at looking at and understanding existing patterns and applying them to new situations.
|
19
|
-
|
20
|
-
The blueprint we're working with is: #{@blueprint_description}.
|
21
|
-
The code for that blueprint is:
|
22
|
-
#{@blueprint_code}
|
23
|
-
|
24
|
-
You need to use the blueprint above and modify it so that it satisfied the following description:
|
25
|
-
#{@description}
|
26
|
-
|
27
|
-
Take a deep breath and think step by step before you start coding.
|
28
|
-
PROMPT
|
29
|
-
end
|
30
|
-
end
|
@@ -1,26 +0,0 @@
|
|
1
|
-
class CodeFromDescriptionGenerator < Sublayer::Generators::Base
|
2
|
-
llm_output_adapter type: :single_string,
|
3
|
-
name: "generated_code",
|
4
|
-
description: "The generated code in the requested language"
|
5
|
-
|
6
|
-
def initialize(description:, technologies:)
|
7
|
-
@description = description
|
8
|
-
@technologies = technologies
|
9
|
-
end
|
10
|
-
|
11
|
-
def generate
|
12
|
-
super
|
13
|
-
end
|
14
|
-
|
15
|
-
def prompt
|
16
|
-
<<-PROMPT
|
17
|
-
You are an expert programmer in #{@technologies.join(", ")}.
|
18
|
-
|
19
|
-
You are tasked with writing code using the following technologies: #{@technologies.join(", ")}.
|
20
|
-
|
21
|
-
The description of the task is #{@description}
|
22
|
-
|
23
|
-
Take a deep breath and think step by step before you start coding.
|
24
|
-
PROMPT
|
25
|
-
end
|
26
|
-
end
|
@@ -1,23 +0,0 @@
|
|
1
|
-
class DescriptionFromCodeGenerator < Sublayer::Generators::Base
|
2
|
-
llm_output_adapter type: :single_string,
|
3
|
-
name: "code_description",
|
4
|
-
description: "A description of what the code in the file does"
|
5
|
-
|
6
|
-
def initialize(code:)
|
7
|
-
@code = code
|
8
|
-
end
|
9
|
-
|
10
|
-
def generate
|
11
|
-
super
|
12
|
-
end
|
13
|
-
|
14
|
-
def prompt
|
15
|
-
<<-PROMPT
|
16
|
-
You are an experienced software engineer. Below is a chunk of code:
|
17
|
-
|
18
|
-
#{@code}
|
19
|
-
|
20
|
-
Please read the code carefully and provide a high-level description of what this code does, including its purpose, functionalities, and any noteworthy details.
|
21
|
-
PROMPT
|
22
|
-
end
|
23
|
-
end
|
@@ -1,23 +0,0 @@
|
|
1
|
-
class InvalidToValidJsonGenerator < Sublayer::Generators::Base
|
2
|
-
llm_output_adapter type: :single_string,
|
3
|
-
name: "valid_json",
|
4
|
-
description: "The valid JSON string"
|
5
|
-
|
6
|
-
def initialize(invalid_json:)
|
7
|
-
@invalid_json = invalid_json
|
8
|
-
end
|
9
|
-
|
10
|
-
def generate
|
11
|
-
super
|
12
|
-
end
|
13
|
-
|
14
|
-
def prompt
|
15
|
-
<<-PROMPT
|
16
|
-
You are an expert in JSON parsing.
|
17
|
-
|
18
|
-
The given string is not a valid JSON: #{@invalid_json}
|
19
|
-
|
20
|
-
Please fix this and produce a valid JSON.
|
21
|
-
PROMPT
|
22
|
-
end
|
23
|
-
end
|