Sense Service
Bases: Service
Processes and analyzes documents to extract semantic content for the Engramic system.
This service listens for document submission events, initializes a scan process that parses the media resource, and notifies the system of newly created inputs. Currently only supports document-based inputs, with other formats planned for future releases.
Attributes:
Name | Type | Description |
---|---|---|
sense_initial_summary |
Plugin
|
Plugin for generating an initial summary of the document. |
sense_scan_page |
Plugin
|
Plugin for scanning and interpreting document content. |
sense_full_summary |
Plugin
|
Plugin for producing full document summaries. |
Methods:
Name | Description |
---|---|
init_async |
Initializes the service asynchronously by calling the parent's init_async method. |
start |
Subscribes to the SUBMIT_DOCUMENT topic and starts the service. |
on_document_submit |
dict[Any, Any]) -> None: Extracts document and overwrite flag from message and submits the document for processing. |
submit_document |
Document, *, overwrite: bool = False) -> Document | None: Checks if document processing should proceed, updates mock data, sends async notification, and triggers document scanning. Returns None if document is already complete and overwrite is False. |
on_document_created_sent |
Future[Any]) -> None: Callback function that creates a Scan instance and initiates document parsing after the document creation notification is sent. |
Source code in src/engramic/application/sense/sense_service.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
|