Skip to content

Commit 9a60192

Browse files
committed
fix: pass hitl models to processor
1 parent 3a9f131 commit 9a60192

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/uipath_llamaindex/_cli/_runtime/_runtime.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
UiPathRuntimeStatus,
2323
)
2424
from uipath._cli._runtime._hitl import HitlProcessor, HitlReader
25+
from uipath.models import CreateAction, WaitAction, InvokeProcess, WaitJob
2526

2627
from .._utils._config import LlamaIndexConfig
2728
from ._context import UiPathLlamaIndexRuntimeContext
@@ -78,9 +79,13 @@ async def execute(self) -> Optional[UiPathRuntimeResult]:
7879
response_applied = False
7980
async for event in handler.stream_events():
8081
# log the received event on trace level
82+
allowed_hitl_models = [CreateAction, WaitAction, InvokeProcess, WaitJob]
8183
if isinstance(event, InputRequiredEvent):
82-
# for api trigger hitl scenarios only pass the str input for processing
83-
hitl_processor = HitlProcessor(value=event.prefix)
84+
if any([isinstance(event, allowed_hitl_model) for allowed_hitl_model in allowed_hitl_models]):
85+
hitl_processor = HitlProcessor(value=event.prefix)
86+
else:
87+
# for api trigger hitl scenarios only pass the str input for processing
88+
hitl_processor = HitlProcessor(value=event.prefix)
8489
if self.context.resume and not response_applied:
8590
# If we are resuming, we need to apply the response to the event stream.
8691
response_applied = True

0 commit comments

Comments
 (0)