For the complete documentation index, see llms.txt. This page is also available as Markdown.

Parser Auto-Detection Results

When the system automatically detects the parser for a knowledge base file, parserAutoDetection in the file response includes the selected parser, reason category, and metrics used for the decision. T

When you upload a file to a knowledge base without specifying parser (leaving the parser set to “Auto-detect (default)”), the system selects a parser based on the file's content. In the responses from List files in a knowledge base and Retrieve file details, each file's parserAutoDetection reports which parser was selected, why, and the metrics calculated during detection. Use it in your own system to distinguish automatically selected parsers from user-selected parsers and display the reason for the selection.

Fields

Field
Type
Description

parser

object

The parser selected by auto-detection and currently used for this file. Its fields match parser in the file response (id, name, provider, isTimestampSttProvider)

reason

string

Reason category; see Reason categories

facts

object

Metrics calculated during detection; see Detection metrics. An empty object {} when no metrics are available

detectedAt

string

Detection time as a Unix timestamp in milliseconds, represented as a string (see Field format)

The metrics in facts are calculated at detection time and are not recalculated afterward. Reparsing with the same parser does not trigger detection again, so the original metrics and detection time are retained.

When the result is null

A null value for parserAutoDetection means that the file's current parser was not selected by auto-detection, or no detection result is available yet:

  • A parser was explicitly specified during upload or reparsing (selected by the user).

  • “Batch reparse files” was used to replace the automatically selected parser with another parser. Reparsing with the same parser retains the original result.

  • “Batch reparse files” was used to switch back to auto-detection (the file's entry explicitly includes "parser": null), and the new detection is still queued or incomplete. Once detection finishes, the new result replaces it.

  • The file was uploaded before this feature was introduced (existing files are not backfilled).

When switching back to auto-detection through Batch reparse files, explicitly include "parser": null in the file's entry. If the entry has no parser key, the file's parser is not changed, the file is not reparsed, and parserAutoDetection remains unchanged. During upload, you can simply omit parser.

Response examples

The PDF has many scanned pages, so the system selects the Vision parser:

The user selected a parser during upload:

These examples show only the relevant fields. See each endpoint's response schema for other file fields.

Reason categories

reason

Meaning

facts

scanned

The content is mostly scanned pages (PDF or Word), requiring image interpretation

PDF or Word metrics

image_pages

The PDF has enough pages requiring image interpretation (scanned pages or other pages dominated by images)

PDF metrics

large_images

The Word document contains enough large images in its body

Word metrics

unmeasurable_images

The Word document contains images whose dimensions cannot be measured, so it is treated as requiring image interpretation

Word metrics, possibly an empty object

presentation

A presentation file (PPTX)

Empty object

no_image_content

No pages require image interpretation and there are no large images in the body

PDF or Word metrics; an empty object for Word files with no images at all

below_threshold

Some pages require image interpretation or the body contains large images, but the threshold for selecting the Vision parser is not met

PDF or Word metrics

no_content

All PDF pages analyzed are blank

PDF metrics

file_type_not_detected

Content detection is not performed for this file type (such as legacy PPT presentations); the system uses the default parser for the type

Empty object

detection_failed

An error occurred during detection; the system uses the default parser for the file type

Empty object

vision_unavailable

The content requires image interpretation, but no Vision parser is available; parser is the parser actually used

Same as the content category (PDF or Word metrics; an empty object for PPTX)

Detection metrics

The keys in facts vary by file type. As shown above, facts is an empty object {} for PPTX, Word files with no images at all, file types that do not undergo content detection, and detection failures.

PDF

Key
Type
Description

analyzedPages

integer

Number of pages examined during detection

partial

boolean

Whether only the first pages were examined (true when the file exceeds the detection limit, currently the first 50 pages)

nonBlankPages

integer

Number of nonblank pages among the examined pages

scannedPages

integer

Number of scanned pages among the examined pages

imagePages

integer

Number of examined pages requiring image interpretation (including scanned pages)

Word (DOCX)

Key
Type
Description

figures

integer

Number of large images in the body

textChars

integer

Number of characters in the body

For Word files with no images at all (no_image_content) or whose image dimensions cannot be measured (unmeasurable_images), facts may be an empty object. Treat each key as optional when reading it.

Last updated

Was this helpful?