klue-langcraft 0.0.6 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.builders/generators/project-plan.rb +5 -0
- data/CHANGELOG.md +14 -0
- data/README.md +0 -2
- data/docs/dsl-examples.md +105 -0
- data/docs/dsl-rules.md +155 -0
- data/docs/dsl-samples/index.md +4 -0
- data/docs/dsl-samples/youtube-launch-optimizer-old.klue +300 -0
- data/docs/dsl-samples/youtube-launch-optimizer-strawberry.json +132 -0
- data/docs/dsl-samples/youtube-launch-optimizer-strawberry.klue +47 -0
- data/docs/dsl-samples/youtube-launch-optimizer.defn.klue +51 -0
- data/docs/dsl-samples/youtube-launch-optimizer.json +337 -0
- data/docs/dsl-samples/youtube-launch-optimizer.klue +47 -0
- data/docs/project-plan/project.drawio +27 -21
- data/docs/project-plan/project_done.svg +1 -1
- data/docs/project-plan/project_in_progress.svg +1 -1
- data/docs/project-plan/project_todo.svg +1 -1
- data/lib/klue/langcraft/-brief.md +357 -0
- data/lib/klue/langcraft/parser.rb +78 -0
- data/lib/klue/langcraft/sample_usage.rb +15 -0
- data/lib/klue/langcraft/tokenizer.rb +20 -0
- data/lib/klue/langcraft/version.rb +1 -1
- data/package-lock.json +2 -2
- data/package.json +1 -1
- metadata +15 -2
@@ -0,0 +1,132 @@
|
|
1
|
+
{
|
2
|
+
"definition": {
|
3
|
+
"name": "workflow",
|
4
|
+
"params": [
|
5
|
+
{
|
6
|
+
"name": "name",
|
7
|
+
"type": "positional"
|
8
|
+
}
|
9
|
+
],
|
10
|
+
"nodes": [
|
11
|
+
{
|
12
|
+
"name": "description",
|
13
|
+
"params": [
|
14
|
+
{
|
15
|
+
"name": "description",
|
16
|
+
"type": "positional"
|
17
|
+
}
|
18
|
+
]
|
19
|
+
},
|
20
|
+
{
|
21
|
+
"name": "settings",
|
22
|
+
"nodes": [
|
23
|
+
{
|
24
|
+
"name": "setting",
|
25
|
+
"repeat": true,
|
26
|
+
"params": [
|
27
|
+
{
|
28
|
+
"name": "key",
|
29
|
+
"type": "declarative"
|
30
|
+
},
|
31
|
+
{
|
32
|
+
"name": "value",
|
33
|
+
"type": "positional"
|
34
|
+
}
|
35
|
+
]
|
36
|
+
}
|
37
|
+
]
|
38
|
+
},
|
39
|
+
{
|
40
|
+
"name": "prompts",
|
41
|
+
"nodes": [
|
42
|
+
{
|
43
|
+
"name": "prompt",
|
44
|
+
"repeat": true,
|
45
|
+
"params": [
|
46
|
+
{
|
47
|
+
"name": "key",
|
48
|
+
"type": "positional"
|
49
|
+
},
|
50
|
+
{
|
51
|
+
"name": "content",
|
52
|
+
"type": "named",
|
53
|
+
"default": ""
|
54
|
+
}
|
55
|
+
]
|
56
|
+
}
|
57
|
+
]
|
58
|
+
},
|
59
|
+
{
|
60
|
+
"name": "section",
|
61
|
+
"repeat": true,
|
62
|
+
"params": [
|
63
|
+
{
|
64
|
+
"name": "name",
|
65
|
+
"type": "positional"
|
66
|
+
}
|
67
|
+
],
|
68
|
+
"nodes": [
|
69
|
+
{
|
70
|
+
"name": "step",
|
71
|
+
"repeat": true,
|
72
|
+
"params": [
|
73
|
+
{
|
74
|
+
"name": "key",
|
75
|
+
"type": "positional"
|
76
|
+
}
|
77
|
+
],
|
78
|
+
"nodes": [
|
79
|
+
{
|
80
|
+
"name": "input",
|
81
|
+
"repeat": true,
|
82
|
+
"params": [
|
83
|
+
{
|
84
|
+
"name": "key",
|
85
|
+
"type": "positional"
|
86
|
+
}
|
87
|
+
]
|
88
|
+
},
|
89
|
+
{
|
90
|
+
"name": "prompt",
|
91
|
+
"params": [
|
92
|
+
{
|
93
|
+
"name": "key",
|
94
|
+
"type": "positional"
|
95
|
+
}
|
96
|
+
]
|
97
|
+
},
|
98
|
+
{
|
99
|
+
"name": "output",
|
100
|
+
"repeat": true,
|
101
|
+
"params": [
|
102
|
+
{
|
103
|
+
"name": "key",
|
104
|
+
"type": "positional"
|
105
|
+
}
|
106
|
+
]
|
107
|
+
}
|
108
|
+
]
|
109
|
+
}
|
110
|
+
]
|
111
|
+
},
|
112
|
+
{
|
113
|
+
"name": "actions",
|
114
|
+
"nodes": [
|
115
|
+
{
|
116
|
+
"name": "save",
|
117
|
+
"params": []
|
118
|
+
},
|
119
|
+
{
|
120
|
+
"name": "save_json",
|
121
|
+
"params": [
|
122
|
+
{
|
123
|
+
"name": "path",
|
124
|
+
"type": "positional"
|
125
|
+
}
|
126
|
+
]
|
127
|
+
}
|
128
|
+
]
|
129
|
+
}
|
130
|
+
]
|
131
|
+
}
|
132
|
+
}
|
@@ -0,0 +1,47 @@
|
|
1
|
+
workflow :youtube_launch_optimizer do
|
2
|
+
description 'Optimize video publishing for YouTube titles, descriptions, thumbnails, and social content'
|
3
|
+
|
4
|
+
settings do
|
5
|
+
prompt_path 'prompts/youtube/launch_optimizer'
|
6
|
+
default_llm :gpt4o
|
7
|
+
end
|
8
|
+
|
9
|
+
prompts do
|
10
|
+
prompt :title_generator, content: 'Generate an engaging YouTube video title based on the following description.'
|
11
|
+
prompt :description_generator, content: 'Create a detailed YouTube video description.'
|
12
|
+
prompt :thumbnail_idea, content: 'Suggest creative thumbnail ideas for the video.'
|
13
|
+
end
|
14
|
+
|
15
|
+
section :title_optimization do
|
16
|
+
step :generate_title do
|
17
|
+
input :video_description
|
18
|
+
|
19
|
+
prompt :title_generator
|
20
|
+
|
21
|
+
output :video_title
|
22
|
+
end
|
23
|
+
step :generate_description do
|
24
|
+
input :video_title
|
25
|
+
input :video_keywords
|
26
|
+
|
27
|
+
prompt :description_generator
|
28
|
+
|
29
|
+
output :video_description
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
section :thumbnail_optimization do
|
34
|
+
step :generate_thumbnail_ideas do
|
35
|
+
input :video_description
|
36
|
+
|
37
|
+
prompt :thumbnail_idea
|
38
|
+
|
39
|
+
output :thumbnail_suggestions
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
actions do
|
44
|
+
save
|
45
|
+
save_json 'outputs/youtube_launch_optimizer.json'
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
definition :workflow do
|
2
|
+
param :name, type: :positional
|
3
|
+
|
4
|
+
node :description do
|
5
|
+
param :description, type: :positional
|
6
|
+
end
|
7
|
+
|
8
|
+
node :settings do
|
9
|
+
node :setting, repeat: true do
|
10
|
+
param :key, type: :declarative # Allows method name to be used as the key
|
11
|
+
param :value, type: :positional
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
node :prompts do
|
16
|
+
node :prompt, repeat: true do
|
17
|
+
param :key, type: :positional
|
18
|
+
param :content, type: :named, default: ''
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
# Section node with repeatable steps
|
23
|
+
node :section, repeat: true do
|
24
|
+
param :name, type: :positional
|
25
|
+
|
26
|
+
node :step, repeat: true do
|
27
|
+
param :key, type: :positional
|
28
|
+
|
29
|
+
node :input, repeat: true do
|
30
|
+
param :key, type: :positional
|
31
|
+
end
|
32
|
+
|
33
|
+
node :prompt do
|
34
|
+
param :key, type: :positional
|
35
|
+
end
|
36
|
+
|
37
|
+
node :output, repeat: true do
|
38
|
+
param :key, type: :positional
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
node :actions do
|
44
|
+
node :save do
|
45
|
+
end
|
46
|
+
|
47
|
+
node :save_json do
|
48
|
+
param :path, type: :positional
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,337 @@
|
|
1
|
+
{
|
2
|
+
"definition": {
|
3
|
+
"name": "workflow",
|
4
|
+
"type": "root",
|
5
|
+
"parameters": [
|
6
|
+
{
|
7
|
+
"name": "name",
|
8
|
+
"type": "positional",
|
9
|
+
"value": "youtube_launch_optimizer"
|
10
|
+
}
|
11
|
+
],
|
12
|
+
"nodes": [
|
13
|
+
{
|
14
|
+
"name": "description",
|
15
|
+
"type": "node",
|
16
|
+
"parameters": [
|
17
|
+
{
|
18
|
+
"name": "description",
|
19
|
+
"type": "positional",
|
20
|
+
"value": "This workflow optimizes video launch by analyzing, preparing, and generating content for various platforms."
|
21
|
+
}
|
22
|
+
]
|
23
|
+
},
|
24
|
+
{
|
25
|
+
"name": "settings",
|
26
|
+
"type": "node",
|
27
|
+
"repeat": true,
|
28
|
+
"nodes": [
|
29
|
+
{
|
30
|
+
"name": "setting",
|
31
|
+
"parameters": [
|
32
|
+
{
|
33
|
+
"name": "key",
|
34
|
+
"type": "declarative",
|
35
|
+
"value": "prompt_path"
|
36
|
+
},
|
37
|
+
{
|
38
|
+
"name": "value",
|
39
|
+
"type": "positional",
|
40
|
+
"value": "prompts/youtube/launch_optimizer"
|
41
|
+
}
|
42
|
+
]
|
43
|
+
},
|
44
|
+
{
|
45
|
+
"name": "setting",
|
46
|
+
"parameters": [
|
47
|
+
{
|
48
|
+
"name": "key",
|
49
|
+
"type": "declarative",
|
50
|
+
"value": "default_llm"
|
51
|
+
},
|
52
|
+
{
|
53
|
+
"name": "value",
|
54
|
+
"type": "positional",
|
55
|
+
"value": "gpt4o"
|
56
|
+
}
|
57
|
+
]
|
58
|
+
}
|
59
|
+
]
|
60
|
+
},
|
61
|
+
{
|
62
|
+
"name": "prompts",
|
63
|
+
"type": "node",
|
64
|
+
"repeat": true,
|
65
|
+
"nodes": [
|
66
|
+
{
|
67
|
+
"name": "prompt",
|
68
|
+
"parameters": [
|
69
|
+
{
|
70
|
+
"name": "key",
|
71
|
+
"type": "positional",
|
72
|
+
"value": "some_prompt"
|
73
|
+
},
|
74
|
+
{
|
75
|
+
"name": "content",
|
76
|
+
"type": "named",
|
77
|
+
"default": "",
|
78
|
+
"value": "1-1-some.txt"
|
79
|
+
}
|
80
|
+
]
|
81
|
+
},
|
82
|
+
{
|
83
|
+
"name": "prompt",
|
84
|
+
"parameters": [
|
85
|
+
{
|
86
|
+
"name": "key",
|
87
|
+
"type": "positional",
|
88
|
+
"value": "another_prompt"
|
89
|
+
},
|
90
|
+
{
|
91
|
+
"name": "content",
|
92
|
+
"type": "named",
|
93
|
+
"default": "",
|
94
|
+
"value": "1-2-another.txt"
|
95
|
+
}
|
96
|
+
]
|
97
|
+
},
|
98
|
+
{
|
99
|
+
"name": "prompt",
|
100
|
+
"parameters": [
|
101
|
+
{
|
102
|
+
"name": "key",
|
103
|
+
"type": "positional",
|
104
|
+
"value": "yet_another_prompt"
|
105
|
+
},
|
106
|
+
{
|
107
|
+
"name": "content",
|
108
|
+
"type": "named",
|
109
|
+
"default": "",
|
110
|
+
"value": "1-3-yet-another.txt"
|
111
|
+
}
|
112
|
+
]
|
113
|
+
}
|
114
|
+
]
|
115
|
+
},
|
116
|
+
{
|
117
|
+
"name": "sections",
|
118
|
+
"type": "node",
|
119
|
+
"repeat": true,
|
120
|
+
"nodes": [
|
121
|
+
{
|
122
|
+
"name": "section",
|
123
|
+
"parameters": [
|
124
|
+
{
|
125
|
+
"name": "name",
|
126
|
+
"type": "positional",
|
127
|
+
"value": "Section 1"
|
128
|
+
}
|
129
|
+
],
|
130
|
+
"nodes": [
|
131
|
+
{
|
132
|
+
"name": "step",
|
133
|
+
"parameters": [
|
134
|
+
{
|
135
|
+
"name": "key",
|
136
|
+
"type": "positional",
|
137
|
+
"value": "Step 1"
|
138
|
+
}
|
139
|
+
],
|
140
|
+
"nodes": [
|
141
|
+
{
|
142
|
+
"name": "input",
|
143
|
+
"parameters": [
|
144
|
+
{
|
145
|
+
"name": "key",
|
146
|
+
"type": "positional",
|
147
|
+
"value": "attribute1"
|
148
|
+
}
|
149
|
+
]
|
150
|
+
},
|
151
|
+
{
|
152
|
+
"name": "input",
|
153
|
+
"parameters": [
|
154
|
+
{
|
155
|
+
"name": "key",
|
156
|
+
"type": "positional",
|
157
|
+
"value": "attribute2"
|
158
|
+
}
|
159
|
+
]
|
160
|
+
}
|
161
|
+
]
|
162
|
+
},
|
163
|
+
{
|
164
|
+
"name": "step",
|
165
|
+
"parameters": [
|
166
|
+
{
|
167
|
+
"name": "key",
|
168
|
+
"type": "positional",
|
169
|
+
"value": "Step 2"
|
170
|
+
}
|
171
|
+
],
|
172
|
+
"nodes": [
|
173
|
+
{
|
174
|
+
"name": "input",
|
175
|
+
"parameters": [
|
176
|
+
{
|
177
|
+
"name": "key",
|
178
|
+
"type": "positional",
|
179
|
+
"value": "attribute1"
|
180
|
+
}
|
181
|
+
]
|
182
|
+
},
|
183
|
+
{
|
184
|
+
"name": "prompt",
|
185
|
+
"parameters": [
|
186
|
+
{
|
187
|
+
"name": "key",
|
188
|
+
"type": "positional",
|
189
|
+
"value": "some_prompt"
|
190
|
+
}
|
191
|
+
]
|
192
|
+
},
|
193
|
+
{
|
194
|
+
"name": "output",
|
195
|
+
"parameters": [
|
196
|
+
{
|
197
|
+
"name": "key",
|
198
|
+
"type": "positional",
|
199
|
+
"value": "attribute3"
|
200
|
+
}
|
201
|
+
]
|
202
|
+
}
|
203
|
+
]
|
204
|
+
},
|
205
|
+
{
|
206
|
+
"name": "step",
|
207
|
+
"parameters": [
|
208
|
+
{
|
209
|
+
"name": "key",
|
210
|
+
"type": "positional",
|
211
|
+
"value": "Step 3"
|
212
|
+
}
|
213
|
+
],
|
214
|
+
"nodes": [
|
215
|
+
{
|
216
|
+
"name": "input",
|
217
|
+
"parameters": [
|
218
|
+
{
|
219
|
+
"name": "key",
|
220
|
+
"type": "positional",
|
221
|
+
"value": "attribute2"
|
222
|
+
}
|
223
|
+
]
|
224
|
+
},
|
225
|
+
{
|
226
|
+
"name": "input",
|
227
|
+
"parameters": [
|
228
|
+
{
|
229
|
+
"name": "key",
|
230
|
+
"type": "positional",
|
231
|
+
"value": "attribute3"
|
232
|
+
}
|
233
|
+
]
|
234
|
+
},
|
235
|
+
{
|
236
|
+
"name": "prompt",
|
237
|
+
"parameters": [
|
238
|
+
{
|
239
|
+
"name": "key",
|
240
|
+
"type": "positional",
|
241
|
+
"value": "another_prompt"
|
242
|
+
}
|
243
|
+
]
|
244
|
+
},
|
245
|
+
{
|
246
|
+
"name": "output",
|
247
|
+
"parameters": [
|
248
|
+
{
|
249
|
+
"name": "key",
|
250
|
+
"type": "positional",
|
251
|
+
"value": "attribute4"
|
252
|
+
}
|
253
|
+
]
|
254
|
+
}
|
255
|
+
]
|
256
|
+
}
|
257
|
+
]
|
258
|
+
},
|
259
|
+
{
|
260
|
+
"name": "section",
|
261
|
+
"parameters": [
|
262
|
+
{
|
263
|
+
"name": "name",
|
264
|
+
"type": "positional",
|
265
|
+
"value": "Section 2"
|
266
|
+
}
|
267
|
+
],
|
268
|
+
"nodes": [
|
269
|
+
{
|
270
|
+
"name": "step",
|
271
|
+
"parameters": [
|
272
|
+
{
|
273
|
+
"name": "key",
|
274
|
+
"type": "positional",
|
275
|
+
"value": "Other Step 1"
|
276
|
+
}
|
277
|
+
],
|
278
|
+
"nodes": [
|
279
|
+
{
|
280
|
+
"name": "input",
|
281
|
+
"parameters": [
|
282
|
+
{
|
283
|
+
"name": "key",
|
284
|
+
"type": "positional",
|
285
|
+
"value": "attribute1"
|
286
|
+
}
|
287
|
+
]
|
288
|
+
},
|
289
|
+
{
|
290
|
+
"name": "prompt",
|
291
|
+
"parameters": [
|
292
|
+
{
|
293
|
+
"name": "key",
|
294
|
+
"type": "positional",
|
295
|
+
"value": "yet_another_prompt"
|
296
|
+
}
|
297
|
+
]
|
298
|
+
},
|
299
|
+
{
|
300
|
+
"name": "output",
|
301
|
+
"parameters": [
|
302
|
+
{
|
303
|
+
"name": "key",
|
304
|
+
"type": "positional",
|
305
|
+
"value": "attribute5"
|
306
|
+
}
|
307
|
+
]
|
308
|
+
}
|
309
|
+
]
|
310
|
+
}
|
311
|
+
]
|
312
|
+
}
|
313
|
+
]
|
314
|
+
},
|
315
|
+
{
|
316
|
+
"name": "actions",
|
317
|
+
"type": "node",
|
318
|
+
"nodes": [
|
319
|
+
{
|
320
|
+
"name": "save",
|
321
|
+
"type": "node"
|
322
|
+
},
|
323
|
+
{
|
324
|
+
"name": "save_json",
|
325
|
+
"parameters": [
|
326
|
+
{
|
327
|
+
"name": "path",
|
328
|
+
"type": "positional",
|
329
|
+
"value": "~/gpt-workflows/youtube-launch-optimizer.json"
|
330
|
+
}
|
331
|
+
]
|
332
|
+
}
|
333
|
+
]
|
334
|
+
}
|
335
|
+
]
|
336
|
+
}
|
337
|
+
}
|
@@ -0,0 +1,47 @@
|
|
1
|
+
workflow :youtube_launch_optimizer do
|
2
|
+
description 'This workflow optimizes video launch by analyzing, preparing, and generating content for various platforms.'
|
3
|
+
|
4
|
+
settings do
|
5
|
+
prompt_path 'prompts/youtube/launch_optimizer'
|
6
|
+
default_llm :gpt4o
|
7
|
+
end
|
8
|
+
|
9
|
+
prompts do
|
10
|
+
prompt :some_prompt , content: '1-1-some.txt'
|
11
|
+
prompt :another_prompt , content: '1-2-another.txt'
|
12
|
+
prompt :yet_another_prompt , content: '1-3-yet-another.txt'
|
13
|
+
end
|
14
|
+
|
15
|
+
section 'Section 1' do
|
16
|
+
step 'Step 1' do
|
17
|
+
input :attribute1
|
18
|
+
input :attribute2
|
19
|
+
end
|
20
|
+
|
21
|
+
step 'Step 2' do
|
22
|
+
input :attribute1
|
23
|
+
prompt :some_prompt
|
24
|
+
output :attribute3
|
25
|
+
end
|
26
|
+
|
27
|
+
step 'Step 3' do
|
28
|
+
input :attribute2
|
29
|
+
input :attribute3
|
30
|
+
prompt :another_prompt
|
31
|
+
output :attribute4
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
section 'Section 2' do
|
36
|
+
step 'Other Step 1' do
|
37
|
+
input :attribute1
|
38
|
+
prompt :yet_another_prompt
|
39
|
+
output :attribute5
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
actions do
|
44
|
+
save
|
45
|
+
save_json '~/gpt-workflows/youtube-launch-optimizer.json'
|
46
|
+
end
|
47
|
+
end
|