export_html()

Export a conversation capture as a human-readable HTML transcript.

Usage

Source

export_html(
    capture,
    path,
    *,
    title="",
    metadata=None,
)

The output is a self-contained HTML file with styled event blocks, suitable for review, printing, or archival.

Parameters

capture: ConversationCapture

The conversation capture to export.

path: str | Path

File path to write the HTML export to.

title: str = ""

Optional title override for the HTML page.

metadata: dict[str, Any] | None = None
Additional metadata to display in the header (e.g., {"reviewer": "Jane Doe"}).

Returns

Path
The path the file was written to.

Examples

import talk_box as tb

capture = tb.ConversationCapture(session_id="audit-001")
capture.record_prompt("Summarize the Q4 report.")
capture.record_response("Revenue increased 12%.", model="openai:gpt-4o")

tb.export_html(capture, "transcript.html", metadata={"reviewer": "Jane Doe"})