Files
Files are binary attachments (images, PDFs, audio) that can be associated with Tests and TestResults. They are managed through a dedicated upload API rather than the standard push() method.
Note: As of version 0.8.0, file bytes are stored in object storage (GCS/S3) rather than Postgres. Downloads return a 302 redirect to a presigned URL; the SDK File.download() method follows the redirect transparently.
File
A File represents a binary attachment stored on the platform.
Properties
| Property | Type | Description |
|---|---|---|
id | str | Unique identifier (assigned on upload) |
filename | str | Original file name |
content_type | str | MIME type (e.g., image/png) |
size_bytes | int | File size in bytes |
description | str | Optional description |
entity_id | str | ID of the parent entity |
entity_type | str | Parent type (Test, TestResult, Trace, or ArchitectSession) |
position | int | Ordering position within the entity |
content_hash | str | SHA-256 hex digest of the file bytes (useful for deduplication) |
extracted_text | str | Text extracted from the file at upload time (OCR/text-layer) |
extraction_status | str | pending | done | failed | not_applicable |
Note: storage_path (the internal object-storage key) is intentionally not exposed in API responses.
Limits
- Max file size: 10 MB per file
- Max total per entity: 20 MB
- Max files per request: 10
- Allowed types: images, PDFs, audio files
Uploading Files
Via Test Entity
The simplest way to attach files is through the Test entity:
Via File.add()
Use File.add() directly for more control:
Base64 Upload
For programmatic uploads without local files:
Downloading Files
Download file content to a local directory:
Managing Files
Listing Files
Deleting Files
Note - File.push() is not supported. Use File.add() or test.add_files() to upload files.