Smart, composable AI workflows in a single declarative Stof file.
Simple, modular, and composable Stof workflows with built-in validation, defaults, units, logic, and more, with no extra glue code required.
import "@weave";
Weave workflow: {
str out: ""
jobs: [
() => {
let out = &self.out;
out.push("first");
},
{
#[run]
fn fourth() {
self.async_handle(async {
sleep(5ms);
let out = &self.weave().out;
out.push("\nfourth");
});
}
},
{
#[run(0)]
fn second() {
let out = &self.weave().out;
out.push("\nsecond");
}
#[run(1)]
fn third() {
let out = &self.weave().out;
out.push("\nthird");
}
},
]
finalize: () => {
let out = &self.out;
out.push("\nfinal");
}
}
#[main]
fn run_workflow() {
self.workflow.run();
pln(self.workflow.out);
}stof run example.stof
first
second
third
fourth
final- Simplicity
- Built-in Validation & Healing
- No Glue Code
- Composability
- Stof units, types, logic, etc.
Apache 2.0. See LICENSE for details.
Run this Stof CLI command to create a pkg file for use.
stof pkg . dist/weave.pkg
Run this Stof CLI command to unpack the weave.pkg file into you "stof" folder.
After execution, StofWeave will be available as import '@weave'; in your Stof code.
stof unpkg dist/weave.pkg
- Open issues or discussions on GitHub
- Chat with us on Discord
- Star the project to support future development!
Reach out to info@stof.dev to contact us directly