Creates a new Document object from an input file, text content, or chunks. The chosen ingestion_mode
determines
how the ingestion process is configured:
Ingestion Modes:
hi-res
: Comprehensive parsing and enrichment, including summaries and possibly more thorough parsing.fast
: Speed-focused ingestion that skips certain enrichment steps like summaries.custom
: Provide a full ingestion_config
to customize the entire ingestion process.Either a file or text content must be provided, but not both. Documents are shared through Collections
which allow for tightly specified cross-user interactions.
The ingestion process runs asynchronously and its progress can be tracked using the returned task_id.
The file to ingest. Exactly one of file, raw_text, or chunks must be provided.
Raw text content to ingest. Exactly one of file, raw_text, or chunks must be provided.
Pre-processed text chunks to ingest. Exactly one of file, raw_text, or chunks must be provided.
The ID of the document. If not provided, a new ID will be generated.
Collection IDs to associate with the document. If none are provided, the document will be assigned to the user’s default collection.
Metadata to associate with the document, such as title, description, or custom fields.
Ingestion modes:
hi-res
: Thorough ingestion with full summaries and enrichment.fast
: Quick ingestion with minimal enrichment and no summaries.custom
: Full control via ingestion_config
.If filters
or limit
(in ingestion_config
) are provided alongside hi-res
or fast
, they will override the default settings for that mode.
An optional dictionary to override the default chunking configuration for the ingestion process. If not provided, the system will use the default server-side chunking configuration.
Whether or not ingestion runs with orchestration, default is True
. When set to False
, the ingestion process will run synchronous and directly return the result.
Successful Response