Export¶
ExportConfig¶
class ExportConfig(format: Literal['markdown', 'html'], include_tool_calls: bool = True, include_thinking: bool = True, include_timestamps: bool = False)
tau_agent_core.export.ExportConfig
Configuration for session export.
Controls what content is included when exporting a session to markdown or HTML format.
Constructor parameters
format: Literal['markdown', 'html']— Export format. "markdown" for plain text, "html" for HTML.include_tool_calls: bool = True— Whether to include tool call results in the export.include_thinking: bool = True— Whether to include thinking blocks in the export.include_timestamps: bool = False— Whether to include timestamps in the export.
from_dict¶
from_dict(data: dict[str, Any]) -> ExportConfig
tau_agent_core.export.ExportConfig.from_dict
Create an ExportConfig from a dictionary.
Parameters
data: dict[str, Any]— Dict with export configuration keys.
Returns
A new ExportConfig instance.
is_html¶
is_html() -> bool
tau_agent_core.export.ExportConfig.is_html
Check if this config is for HTML export.
is_markdown¶
is_markdown() -> bool
tau_agent_core.export.ExportConfig.is_markdown
Check if this config is for markdown export.
to_dict¶
to_dict() -> dict[str, Any]
tau_agent_core.export.ExportConfig.to_dict
Serialize to a dictionary.
Returns
A dict with all export configuration fields.
HTMLExporter¶
tau_agent_core.export.HTMLExporter
Export session messages to HTML format.
Produces a styled HTML document with sections for user, assistant, and (optionally) tool messages.
export¶
export(messages: list[dict], config: ExportConfig) -> str
tau_agent_core.export.HTMLExporter.export
Export a session's messages to HTML.
Parameters
messages: list[dict]— List of message dicts representing the session.config: ExportConfig— Export configuration controlling what to include.
Returns
HTML formatted string.
MarkdownExporter¶
tau_agent_core.export.MarkdownExporter
Export session messages to Markdown format.
Produces a readable Markdown document with sections for user, assistant, and (optionally) tool messages.
export¶
export(messages: list[dict], config: ExportConfig) -> str
tau_agent_core.export.MarkdownExporter.export
Export a session's messages to Markdown.
Parameters
messages: list[dict]— List of message dicts representing the session.config: ExportConfig— Export configuration controlling what to include.
Returns
Markdown formatted string.
export_session¶
export_session(messages: list[dict], config: ExportConfig | None = None) -> str
tau_agent_core.export.export_session
Export a session's messages to a human-readable string.
Supports exporting to markdown and HTML formats with configurable inclusion of tool calls, thinking blocks, and timestamps.
Parameters
messages: list[dict]— List of message dicts representing the session. Each dict should have 'role' and 'content' keys, matching the tau_llm message types.config: ExportConfig | None = None— Export configuration. Defaults to ExportConfig(format="markdown") if not provided.
Returns
Formatted string in the requested export format.
Raises
ValueError— If the export format in config is invalid.