Tidier imports

This commit is contained in:
Laurie Voss
2025-04-20 17:15:17 -07:00
parent 8c183d61e6
commit 968b300512
2 changed files with 3 additions and 5 deletions
+2 -3
View File
@@ -1,5 +1,4 @@
import { createWorkflow } from "@llama-flow/core";
import { workflowEvent } from "@llama-flow/core";
import { createWorkflow, workflowEvent } from "@llama-flow/core";
import { pipeline } from "node:stream/promises";
////////// define the workflow
@@ -32,7 +31,7 @@ sendEvent(startEvent.with("I am some data"));
// Process the stream to get the result
const result = await pipeline(stream, async function (source) {
for await (const event of source) {
console.log(`Event: ${event.data}`);
console.log(`Event: ${event} ${event.data}`);
if (stopEvent.include(event)) {
return `Result: ${event.data}`;
}
+1 -2
View File
@@ -1,5 +1,4 @@
import { createWorkflow } from "@llama-flow/core";
import { workflowEvent } from "@llama-flow/core";
import { createWorkflow, workflowEvent } from "@llama-flow/core";
import { pipeline } from "node:stream/promises";
////////// define the workflow