# items_to_messages

> **Function** in `langchain_azure_ai`

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

Translate resolved Responses API items into LangChain messages.

Accepts the typed ``Item`` subtypes returned by
:meth:`ResponseContext.get_input_items`. Items that do not map cleanly
to a LangChain message type are skipped.

HITL wire-protocol items are *always* dropped, whether or not the
caller lists them in *skip_call_ids*: the ``function_call`` sentinel
this host emits for a pending interrupt and the
``function_call_output`` answering it are transport plumbing, and
replaying them as a tool-call round trip would put a reserved internal
function name into the model's context. See :func:`.hitl_call_ids`.

## Signature

```python
items_to_messages(
    items: Sequence[Any],
    *,
    skip_call_ids: Iterable[str] = (),
) -> list[AnyMessage]
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `items` | `Sequence[Any]` | Yes | Resolved input items from the request. |
| `skip_call_ids` | `Iterable[str]` | No | ``function_call`` / ``function_call_output`` items whose ``call_id`` is in this set are skipped. Used by the HITL resume path to keep the resume ``function_call_output`` out of the regular message channel. (default: `()`) |

## Returns

`list[AnyMessage]`

A list of LangChain messages suitable for a ``MessagesState`` graph.

---

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