# emit_interrupts

> **Function** in `langchain_azure_ai`

📖 [View in docs](https://reference.langchain.com/python/langchain-azure-ai/agents/hosting/_converters/_hitl/emit_interrupts)

Yield Responses API events that surface pending interrupts.

Each interrupt produces *two* output items in the same response:

1. A ``function_call`` item (name :data:`HITL_FUNCTION_NAME`,
   ``call_id`` = ``interrupt.id``, ``arguments`` = the JSON envelope
   from :func:`interrupt_arguments_json`).
 2. An ``mcp_approval_request`` item with a generated ``mcpr_*`` id,
     ``server_label`` = :data:`HITL_MCP_SERVER_LABEL`, same ``name`` and
     ``arguments``).

Both items carry the same ``interrupt.id`` so the inbound resume
matches the same logical pause regardless of which channel the
client chose.

## Signature

```python
emit_interrupts(
    interrupts: Iterable[Interrupt],
    stream: ResponseEventStream,
) -> AsyncIterator[Any]
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `interrupts` | `Iterable[Interrupt]` | Yes | The interrupts to emit (typically from :func:`detect_pending_interrupts`). |
| `stream` | `ResponseEventStream` | Yes | The :class:`ResponseEventStream` to emit through. |

---

[View source on GitHub](https://github.com/langchain-ai/langchain-azure/blob/7a6a664d617264df8dcb12fcfb1bacc09f21d504/libs/azure-ai/langchain_azure_ai/agents/hosting/_converters/_hitl.py#L605)