Teach Service
Bases: Service
Service that generates educational lessons from documents.
Monitors document insertions and metadata completion to create learning materials based on document content.
Attributes:
Name | Type | Description |
---|---|---|
teach_generate_questions |
Plugin for generating questions from documents. |
|
meta_cache |
dict[str, Meta]
|
Cache for document metadata. |
Methods:
Name | Description |
---|---|
init_async |
Initializes asynchronous components. |
start |
Starts the service and subscribes to relevant topics. |
on_meta_complete |
Handles metadata completion events. |
on_document_inserted |
Processes newly inserted documents to create lessons. |
Source code in src/engramic/application/teach/teach_service.py
18 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 92 93 94 |
|
__init__(host)
Initializes the TeachService.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
host
|
Host
|
The host system providing access to plugins and services. |
required |
Source code in src/engramic/application/teach/teach_service.py
40 41 42 43 44 45 46 47 48 49 |
|
init_async()
Initializes asynchronous components of the service.
Source code in src/engramic/application/teach/teach_service.py
51 52 53 |
|
on_document_inserted(msg)
Processes newly inserted documents to create lessons.
When a document is inserted and its metadata is available, creates a new lesson for the document.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
msg
|
dict[Any, Any]
|
The document insertion message. |
required |
Source code in src/engramic/application/teach/teach_service.py
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
|
on_meta_complete(msg)
Handles metadata completion events.
Stores document metadata in the cache for later processing.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
msg
|
dict[Any, Any]
|
The metadata message. |
required |
Source code in src/engramic/application/teach/teach_service.py
66 67 68 69 70 71 72 73 74 75 76 77 |
|
start()
Starts the service and subscribes to relevant topics.
Subscribes to META_COMPLETE and DOCUMENT_INSERTED topics to monitor document processing events.
Source code in src/engramic/application/teach/teach_service.py
55 56 57 58 59 60 61 62 63 64 |
|