Spaces:
Runtime error
Runtime error
File size: 388 Bytes
4d860a2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
def parse_interrupt(final_state: dict):
if "__interrupt__" not in final_state:
return None
interrupt_state = final_state["__interrupt__"]
if not interrupt_state:
return None
interrupt = interrupt_state[0]
value = getattr(interrupt, "value", {}) or {}
return {
"action": value.get("action"),
"data": value.get("data", {})
} |