File tree Expand file tree Collapse file tree
src/uipath_llamaindex/_cli/_runtime Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2222 UiPathRuntimeStatus ,
2323)
2424from uipath ._cli ._runtime ._hitl import HitlProcessor , HitlReader
25+ from uipath .models import CreateAction , WaitAction , InvokeProcess , WaitJob
2526
2627from .._utils ._config import LlamaIndexConfig
2728from ._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
You can’t perform that action at this time.
0 commit comments