(no title)
lyjackal | 8 months ago
class MyWorkflow(Workflow):
@step
async def start(self, ctx: Context, ev: StartEvent) -> MyEvent:
num_runs = await ctx.get("num_runs", default=0)
whereas TS is sort of builder/function based import { createWorkflow } from "@llamaindex/workflow-core";
const convertEvent = workflowEvent();
const workflow = createWorkflow();
workflow.handle([startEvent], (start) => {
return convertEvent.with(Number.parseInt(start.data, 10));
Is there reason for this?
});
cheesyFish|8 months ago
So instead, the goal was to capture the spirit of event-driven workflows, and implement them in a more TS-native way and improve the dev-ux for those developers. This means it might be harder to jump between the two, but I'd argue most people are not doing that anyways.