Edit: fix is to upgrade to newer version.
This trivial workflow isn't working; fails with
llama_index.core.workflow.errors.WorkflowValidationError: The following events are consumed but never produced: {<class 'llama_index.core.workflow.events.StopEvent'>}
Note that workflows with 2+ steps fail the same way too.
llama-index==0.10.59
llama-index-core==0.10.59
from llama_index.core.workflow import (
StartEvent,
StopEvent,
Workflow,
step,
Event,
)
import asyncio
class QueryEvent(Event):
query: str
class TrivialFlow(Workflow):
@step
async def query(self, ev: StartEvent) -> StopEvent:
result = f"The answer to your query <{ev.query}> is 42."
return StopEvent(result=result)
async def get_result():
g = TrivialFlow(timeout=10, verbose=True)
result = await g.run(query="What's LlamaIndex?")
print(result)
if __name__ == "__main__":
asyncio.run(get_result())