-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvariants.weave
More file actions
33 lines (26 loc) · 774 Bytes
/
Copy pathvariants.weave
File metadata and controls
33 lines (26 loc) · 774 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// variants.weave
// Shows parallel generation, a budget, and a human review gate.
// Two variants are written at the same time, both must be non-empty, then a
// human approves one before it ships (auto-approves when run non-interactively).
type Post = {
headline: text
body: text
}
agent writer {
model: claude
persona: "Punchy brand copywriter. No em dashes. No hashtags."
budget: 4
}
flow variants(topic: text) -> Post {
require topic != ""
// generate two takes at once
parallel {
writer("Write variant A: a bold take on {topic}") -> a: Post
writer("Write variant B: a calm take on {topic}") -> b: Post
}
ensure a.body != ""
ensure b.body != ""
// a human picks before it ships
review a -> chosen: Post
return chosen
}