Skip to content

Commit 2b7cf55

Browse files
committed
fix: start event
1 parent c9c663a commit 2b7cf55

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

src/uipath_llamaindex/_cli/_runtime/_runtime.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import logging
33
from typing import Optional
44

5+
from llama_index.core.workflow import StartEvent
56
from uipath import UiPath
67
from uipath._cli._runtime._contracts import (
78
UiPathBaseRuntime,
@@ -39,7 +40,14 @@ async def execute(self) -> Optional[UiPathRuntimeResult]:
3940
await self.validate()
4041

4142
try:
42-
output = await self.context.workflow.run(self.context.input_json)
43+
ev = StartEvent(**self.context.input_json)
44+
45+
handler = self.context.workflow.run(start_event=ev)
46+
47+
async for event in handler.stream_events():
48+
print(event)
49+
50+
output = await handler
4351

4452
self.context.result = UiPathRuntimeResult(
4553
output=self._serialize_object(output)
@@ -171,4 +179,4 @@ def _serialize_object(self, obj):
171179
return obj
172180
# Return primitive types as is
173181
else:
174-
return obj
182+
return {"result": obj}

0 commit comments

Comments
 (0)