Perception reference
Format support
Which file types each document operation reads.
An operation refuses a file type it doesn't read with 422, code unsupported_file_type, when the job is created. How the document service tells the type depends on the source:
- Uploaded files (
workspace_file): when it's uploaded, from its extension, checked against its first bytes. A file whose bytes clearly say another type (a PDF named.bmp) is refused at upload with422 unsupported_file_type. A file with no supported extension gets the type its bytes show, and one whose bytes are inconclusive, such as plain text, keeps its extension's type. - Links (
url): from the extension of the source'sfile_name, since nothing has been downloaded yet. Name the file with an extension from the table below. The SDKs and the CLI takefile_namefrom the URL when it ends in one; see Sources.
| File type | Extensions | Parse | Split | Classify | Extract | Ground |
|---|---|---|---|---|---|---|
.pdf | ✅ | ✅ | ✅ | ✅ | ✅ | |
| Spreadsheet | .xlsx .xlsm .xls .csv | ✅ | ✅ | ✅ | ✅ | ✅ |
| Parquet | .parquet | ✅ | ❌ | ✅ | ✅ | ✅ |
| Word document | .docx .doc .docm | ✅ | ✅ | ✅ | ✅ | ✅ |
| Image | .png .jpg .jpeg .tiff .tif .webp | ✅ | ✅ | ✅ | ✅ | ✅ |
| Bitmap | .bmp | ❌ | ✅ | ✅ | ✅ | ✅ |
| Presentation | .pptx .ppt | ✅ | ✅ | ✅ | ✅ | ✅ |
| HTML | .html .htm | ✅ | ✅ | ✅ | ✅ | ✅ |
| Plain text | .txt .log .xml | ✅ | ✅ | ✅ | ✅ | ✅ |
| Diagram | .vsdx .vsd | ✅ | ✅ | ✅ | ✅ | ✅ |
| Markdown | .md .mdx | ✅ | ✅ | ✅ | ✅ | ✅ |
| JSON | .json | ✅ | ✅ | ✅ | ✅ | ✅ |
| JSON Lines | .jsonl | ❌ | ❌ | ❌ | ❌ | ✅ |
.eml .msg .oft | ✅ | ✅ | ✅ | ✅ | ✅ | |
| Video | .mp4 .mov .avi .mkv | ✅ | ❌ | ❌ | ❌ | ✅ |
| Audio | .mp3 .wav .m4a .flac .mpga .oga .ogg | ✅ | ❌ | ❌ | ❌ | ✅ |
- Audio and video: Parse transcribes them. See Parse.
- Markdown is read as it is, not OCR'd. Parse returns its text unchanged except for tables, which follow
output.table_format: HTML by default, so pass"markdown"to keep pipe tables. - Large plain text: Parse reads
.txtfiles up to 1 GiB and returns the complete text throughdocument.content_url. Split, Extract and Ground read.txtfiles up to 256 MiB.