Documents
The Python SDK exposes the canonical document viewer throughclient.documents. Use it when you need full parsed text for a preview, editor, or custom document UI.
Attachments
agent:
client.attachments.content(file_id, agent=...) returns the same model and uses the canonical viewer endpoint under the hood.
Knowledge Base Documents
Preferdocument_id from client.knowledge_bases.list_files(...) or client.knowledge_bases.list_documents(...).
file_path only when the caller has a source path but no document ID:
Response Model
All viewer helpers returnDocumentContent.
| Field | Type | Description |
|---|---|---|
filename | str | Display filename |
file_path | str | None | Source path or viewer path |
content | str | Full parsed text |
size | int | Source file size in bytes when available |
last_modified | datetime | None | Last modified timestamp when available |
file_type | str | None | File extension/type label |
encoding | str | None | Text encoding |
summary | str | None | Attachment summary when available |

