I'm glad to receive your reply. Here are the new issues I've discovered:
- The
self._validate()
raises a WorkflowValidationError:
Copyllama_index.core.workflow.errors.WorkflowValidationError: The following events are consumed but never produced: {<class '
main.LLMEvent'>}
I suspect this is because none of the steps' output types are LLMEvent. After I marked it off, it ran normally.
- There's an issue with the implementation of
collect_events
:
Since
self._events_buffer[type(ev)] = ev
uses the type rather than something like an event_id, it causes later LLMEvents to overwrite earlier results. I'm not sure if this is intentional.
Moreover, the following code:
for e_type in expected:
e_instance = self._events_buffer.get(e_type)
if e_instance:
retval.append(e_instance)
leads to the first incoming LLMEvent triggering a StopEvent because expected contains three consecutive same LLMEvents, it keeps append retval and finally causing
len(self._events_retval) == len(expected).