forked from nulang-org/nulang
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpipeline.nula
More file actions
26 lines (23 loc) · 782 Bytes
/
Copy pathpipeline.nula
File metadata and controls
26 lines (23 loc) · 782 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
// Pipeline — demonstrates the AI runtime pipeline builtin.
// Chain LLM calls through stages for sequential processing.
//
// Run with: nulang examples/pipeline.nula
agent Researcher = {
model: "llama3.1",
system_prompt: "You are a researcher. Provide factual information.",
pricing: { input: 0.0, output: 0.0 }
}
agent Writer = {
model: "llama3.1",
system_prompt: "You are a writer. Create engaging content.",
pricing: { input: 0.0, output: 0.0 }
}
fn main() {
let researcher = spawn Researcher {} in
let writer = spawn Writer {} in
let pipeline = Pipeline.new()
|> Pipeline.stage("research", researcher, "Research: {input}")
|> Pipeline.stage("write", writer, "Write based on: {input}")
in
pipeline.run("CRDTs")
}