4 ms·
Workflows 1.0: A Lightweight Framework for Agentic systems
- lyjackal 1y agoI notice that the python versions and typescript versions are pretty different. Python is sort of class based, with python magic decorators 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 1y agoyea good callout -- python workflows came first, and while we could have directly translated these, the ergonomics around classes in python are not exactly what JS/TS devs expect. 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.