klue-langcraft 0.0.7 → 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/CHANGELOG.md +7 -0
- data/docs/dsl-examples.md +105 -0
- data/docs/dsl-rules.md +0 -107
- 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 +1 -8
- data/docs/dsl-samples/youtube-launch-optimizer.json +337 -0
- 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 +12 -2
@@ -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
|
@@ -15,7 +15,7 @@ definition :workflow do
|
|
15
15
|
node :prompts do
|
16
16
|
node :prompt, repeat: true do
|
17
17
|
param :key, type: :positional
|
18
|
-
param :content, type: :named,
|
18
|
+
param :content, type: :named, default: ''
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
@@ -47,12 +47,5 @@ definition :workflow do
|
|
47
47
|
node :save_json do
|
48
48
|
param :path, type: :positional
|
49
49
|
end
|
50
|
-
|
51
|
-
node :action, repeat: true do
|
52
|
-
param :name, type: :positional # Action name (e.g., save, save_json)
|
53
|
-
|
54
|
-
# Named parameters for actions
|
55
|
-
param :args, type: :named, name: 'args', repeat: true, optional: true # Optional args like file path for save_json
|
56
|
-
end
|
57
50
|
end
|
58
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
|
+
}
|