Transcript
ATranscript object represents a sequence of chat messages (user, assistant, system, tool) from the perspective of a single agent. See here for more details on the chat message schemas.
TranscriptGroup
Bases:BaseModel
Represents a group of transcripts that are logically related.
A transcript group can contain multiple transcripts and can have a hierarchical
structure with parent groups. This is useful for organizing transcripts into
logical units like experiments, tasks, or sessions.
Attributes:
| Name | Type | Description | |
|---|---|---|---|
id | str | Unique identifier for the transcript group, auto-generated by default. | |
name | `str | None` | Optional human-readable name for the transcript group. |
description | `str | None` | Optional description of the transcript group. |
collection_id | `str | None` | ID of the collection this transcript group belongs to. |
agent_run_id | str | ID of the agent run this transcript group belongs to. | |
parent_transcript_group_id | `str | None` | Optional ID of the parent transcript group. |
metadata | dict[str, Any] | Additional structured metadata about the transcript group. |
docent/data_models/transcript.py
docent/data_models/transcript.py
to_text
| Name | Type | Description | Default |
|---|---|---|---|
children_text | str | Pre-rendered text of this group’s children (groups/transcripts). | required |
indent | int | Number of spaces to indent the rendered output. | 0 |
render_metadata | bool | Whether to include metadata in the output. | True |
| Name | Type | Description |
|---|---|---|
str | str | XML-like wrapped text including the group’s metadata. |
docent/data_models/transcript.py
docent/data_models/transcript.py
Transcript
Bases:BaseModel
Represents a transcript of messages in a conversation with an AI agent.
A transcript contains a sequence of messages exchanged between different roles
(system, user, assistant, tool) and provides methods to organize these messages
into logical units of action.
Attributes:
| Name | Type | Description | |
|---|---|---|---|
id | str | Unique identifier for the transcript, auto-generated by default. | |
name | `str | None` | Optional human-readable name for the transcript. |
description | `str | None` | Optional description of the transcript. |
transcript_group_id | `str | None` | Optional ID of the transcript group this transcript belongs to. |
messages | list[ChatMessage] | List of chat messages in the transcript. | |
metadata | dict[str, Any] | Additional structured metadata about the transcript. |
docent/data_models/transcript.py
docent/data_models/transcript.py
to_text
| Name | Type | Description | Default | |
|---|---|---|---|---|
transcript_alias | `int | str` | Identifier for the transcript (e.g., 0 becomes “T0”). | 0 |
indent | int | Number of spaces to indent nested content. | 0 | |
render_metadata | bool | Whether to include transcript metadata in the output. | True | |
transcript_metadata_comments | `list[Comment] | None` | Comments on this transcript’s metadata. Rendered after the transcript metadata block. | None |
block_metadata_comments | `dict[int, list[Comment]] | None` | Mapping from block index to comments on that block’s metadata. Keyed by block index because comments need to be rendered inline with each block at the correct position. | None |
block_content_comments | `dict[int, list[Comment]] | None` | Mapping from block index to comments on that block’s content. Keyed by block index because comments need to be rendered inline with each block, and may include text range selections that highlight specific portions of the block content. | None |
| Type | Description |
|---|---|
str | Formatted text representation of the transcript. |
docent/data_models/transcript.py
docent/data_models/transcript.py
render_metadata_comments
| Name | Type | Description | Default |
|---|---|---|---|
comments | list[Comment] | List of Comment objects targeting metadata. | required |
| Type | Description |
|---|---|
str | Formatted string with all comments. |
docent/data_models/transcript.py
docent/data_models/transcript.py
render_block_content_comments
| Name | Type | Description | Default |
|---|---|---|---|
comments | list[Comment] | List of Comment objects targeting block content. | required |
content | str | The block content text to annotate. | required |
comment_index_offset | int | Starting index for comment numbering (local to message). | 0 |
| Type | Description |
|---|---|
str | Tuple of (annotated_content, comments_text) where annotated_content has |
str | selection tags inserted and comments_text contains the rendered comments. |
docent/data_models/transcript.py
docent/data_models/transcript.py

