paperap.models.document.suggestions.model module
Document suggestions module for Paperless-NgX.
This module provides the DocumentSuggestions model which represents AI-generated suggestions for document metadata based on document content analysis.
- class paperap.models.document.suggestions.model.DocumentSuggestions(**data)[source]
Bases:
StandardModel
Represents AI-generated suggestions for a Paperless-NgX document.
The DocumentSuggestions model contains lists of suggested metadata IDs that Paperless-NgX’s AI has determined might be appropriate for a document based on its content analysis. These suggestions can be used to quickly apply metadata to documents during processing.
All fields in this model are read-only as they are generated by the Paperless-NgX server and cannot be modified by clients.
- correspondents
List of suggested correspondent IDs that might be associated with this document.
- Type:
list[int]
- tags
List of suggested tag IDs that might be relevant to this document’s content.
- Type:
list[int]
- document_types
List of suggested document type IDs that might categorize this document.
- Type:
list[int]
- storage_paths
List of suggested storage path IDs where this document might be stored.
- Type:
list[int]
- dates
List of suggested relevant dates extracted from the document content.
- Type:
list[date]
Examples
>>> # Get suggestions for a document >>> doc = client.documents.get(123) >>> suggestions = client.document_suggestions.get(doc.id) >>> >>> # Apply suggested tags to the document >>> if suggestions.tags: ... doc.tags.extend(suggestions.tags) ... doc.save()
- Parameters:
data (
Any
)
- correspondents: list[int]
- tags: list[int]
- document_types: list[int]
- storage_paths: list[int]
- dates: list[date]
- class Meta(model)[source]
Bases:
Meta
Metadata for the DocumentSuggestions model.
This class defines metadata for the DocumentSuggestions model, including which fields are read-only.
- Parameters:
model (type[_Self])
- read_only_fields: ClassVar[set[str]] = {'correspondents', 'dates', 'document_types', 'id', 'storage_paths', 'tags'}
- blacklist_filtering_params: ClassVar[set[str]] = {}
- field_map: dict[str, str] = {}
- filtering_disabled: ClassVar[set[str]] = {}
- filtering_fields: ClassVar[set[str]] = {'_resource', 'correspondents', 'dates', 'document_types', 'id', 'storage_paths', 'tags'}
- supported_filtering_params: ClassVar[set[str]] = {'id', 'id__in', 'limit'}
- model: type[_Self]
- name: str
- model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': True, 'extra': 'ignore', 'populate_by_name': True, 'use_enum_values': True, 'validate_assignment': True, 'validate_default': True}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_post_init(context: Any, /) None
We need to both initialize private attributes and call the user-defined model_post_init method.
- id: int