# render_ask_user_transcript_for_display

> **Function** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/_ask_user_types/render_ask_user_transcript_for_display)

Re-render a transcript with `multi_select` answers unpacked for a human.

The transcript is built for the model, where a `multi_select` answer is a
JSON array. A person reading the same text sees the quoting and, worse, sees
a multi-line custom answer flattened to a literal `\n`. This unpacks those
answers back to one value per line, leaving every other answer untouched.

Recovering the answers means splitting the transcript, which
`format_ask_user_transcript` warns is not unambiguously decodable. So this
anchors on the known question text, the mitigation that docstring
prescribes, and gives up rather than guessing: a transcript that does not
match the questions exactly returns `None` and must be rendered literally.
An answer may itself contain a later `Q: ...` block verbatim (pasting
transcript-like text into a text answer is legitimate), so a separator must
be unique to be trusted — with duplicates, the first occurrence would
swallow the real blocks into the wrong answer and misattribute the rest.
The result is display-only and feeds no trust decision.

Two things this deliberately does not do. It does not reject trailing
content: the last answer runs to the end of the transcript, so junk appended
after the final block is indistinguishable from answer text and is
re-emitted verbatim. And it does not handle three or more identically worded
questions — their shared anchor makes the separator non-unique, so a
perfectly well-formed transcript falls back to literal rendering. Both are
display-only outcomes.

## Signature

```python
render_ask_user_transcript_for_display(
    questions: list[Question],
    transcript: str,
) -> str | None
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `questions` | `list[Question]` | Yes | The questions that produced `transcript`, in order. |
| `transcript` | `str` | Yes | Output of `format_ask_user_transcript` for those questions. |

## Returns

`str | None`

The re-rendered transcript, or `None` when `transcript` does not parse
as exactly these questions — including when no answer needed
unpacking, so the caller keeps its literal rendering. The two
cases share one sentinel because the caller wants the same literal
rendering either way. A caller that wants to report an unexpected
`None` should first check that a `multi_select` is present at all,
which is what the TUI row does.

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/e4c1ffe9ee63d7854147de490ca27495ef157a7b/libs/code/deepagents_code/_ask_user_types.py#L612)