I'm using the useInterrupt hook (version 2) to render an approval card in the ChatbotSidebar, but when I submit the card, it disappears from the chatbot.
Is there any alternative to prevent the card from disappearing after submission? 😩
Code snippets follow:
useInterrupt({
agentId: "conreq-multiagent",
enabled: (event) => JSON.parse(event.value).type === 'hitl_brief_description',
render: ({ event, resolve }) => {
const quantity_req_batch = JSON.parse(event.value).quantity_req_batch || settings.quantity_req_batch;
return (
<InterruptFormPositiveImpactDescription
inputCount={quantity_req_batch}
onSubmit={resolve}
/>
)
}
});
async def node(state: WorkflowState, config: Optional[RunnableConfig] = None):
payload = interrupt(
{"type": "hitl_brief_description", "quantity_req_batch": quantity_req_batch},
)
print(f"[Elicitation] payload: {payload}")
# ------
# internal processing
# ------
return Command(update={
"messages": state.get("messages", []) + messages_to_add
})