Find answers from the community

Updated 4 months ago

In workflows, how can i dispatch an

In workflows, how can i dispatch an event (i.e using send_event) to two methods of same signature (add(self, ev: ProcessEvent) and multiply(self, ev: ProcessEvent)) ? I'm seeing all the examples have a StartEvent, 1 intermediate event of some method and finally a StopEvent. How can i actually control the flow somthing like a graph builder ?
L
l
b
12 comments
If two steps have the same signature, they will automatically both get the event
every event that is emitted automatically goes to every step that accepts that event
intersting, I see, thx @Logan M
Hey @llm_dev would you be open to sharing what you are looking to build?
@biswaroop sure i can give you a realtime use case. I'm working for a hedge fund. the current version is built on top of llama_index query engine on our internal research notes. I'm expanding to PR's and SEC filings. so I'm seeing parallel execution workflow does that. But the confusing part is event dispatch, its too generic and not sure how to control the flow. I'm seeing in Langchain they do that as a graphbuilder, but in llama_index is very free flowing but not sure if it'll cause problem in future.
@llm_dev this is the fundamentals of event driven programming you are seeing.

Events get emitted, and it's trusted that they get handled. You can think of it like building a execution graph on the fly based on conditions.

I'd be curious to hear your exact use case, happy to help you build out your workflow a bit.
@Logan M thanks for offering the help. That's what i love about llama_index, there's ample set of examples in the workflow section, I'm working on it currently, I have to get myself familiar with it, i got myself so comfortable coding it the usual llama_index way haha, If i run into a non-blocker, I'll ping ya for some help. Thx again for the help.
Cool! Sounds good good :LlamaIndex:
@llm_dev would love to get your feedback too. would you be up for a call this week?
@biswaroop sure I'm in ET, my calendar is pretty open from 10AM ET, let me know a time that works for you best.
sending you a DM to coordinate
Add a reply
Sign up and join the conversation on Discord