agents.document_modifiers.tnt.models

Data models for taxonomy generation.

This module defines the core data structures used in the taxonomy generation process, particularly the document model that represents individual pieces of content being processed.

Examples

Basic usage of document model:

doc = Doc(
    id="doc1",
    content="Sample text",
    summary="Brief summary",
    explanation="Summary rationale",
    category="Technology"
)

Classes

Doc

Represents a single document or chat log in the taxonomy generation process.

Module Contents

class agents.document_modifiers.tnt.models.Doc(/, **data)

Bases: pydantic.BaseModel

Represents a single document or chat log in the taxonomy generation process.

This class serves as the fundamental data structure for content being processed through the taxonomy generation workflow. It tracks both the original content and metadata added during processing.

Parameters:

data (Any)

id

Unique identifier for the document, used for tracking and reference.

Type:

str

content

Original text content of the document or chat log.

Type:

str

summary

Condensed version of the content, generated in the first step of processing. Defaults to empty string.

Type:

Optional[str]

explanation

Rationale for how the summary was generated, added alongside the summary. Defaults to empty string.

Type:

Optional[str]

category

Taxonomy category assigned to the document in later stages of processing. Defaults to empty string.

Type:

Optional[str]

Examples

>>> doc = Doc(
...     id="chat_123",
...     content="User asked about Python installation",
...     summary="Python setup inquiry",
...     explanation="Focused on main topic",
...     category="Technical Support"
... )

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

classmethod from_document(document)

From Document.

Parameters:

document (langchain_core.documents.Document) – [TODO: Add description]

Returns:

Add return description]

Return type:

[TODO