lesson
Represents an educational lesson generated from a document.
Handles the generation of questions and educational prompts based on document content and metadata.
Attributes:
Name | Type | Description |
---|---|---|
id |
str
|
Unique identifier for the lesson. |
doc_id |
str
|
Identifier of the source document. |
tracking_id |
str
|
ID for tracking the lesson's progress. |
service |
TeachService
|
Parent service managing this lesson. |
meta |
Meta
|
Metadata about the source document. |
Methods:
Name | Description |
---|---|
run_lesson |
Initiates the lesson generation process. |
generate_questions |
Generates educational questions based on document content. |
on_questions_generated |
Processes generated questions and creates prompts. |
_on_send_prompt_complete |
Handles completion of prompt submission. |
Source code in src/engramic/application/teach/lesson.py
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 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 |
|
__init__(parent_service, lesson_id, tracking_id, doc_id)
Initializes a new Lesson instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
parent_service
|
TeachService
|
The service managing this lesson. |
required |
lesson_id
|
str
|
Unique identifier for the lesson. |
required |
tracking_id
|
str
|
ID for tracking the lesson's progress. |
required |
doc_id
|
str
|
Identifier of the source document. |
required |
Source code in src/engramic/application/teach/lesson.py
50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
|
generate_questions()
async
Generates educational questions based on document content.
Uses an LLM plugin to generate study questions from the document metadata.
Returns:
Name | Type | Description |
---|---|---|
dict |
Any
|
The generated questions and study actions. |
Source code in src/engramic/application/teach/lesson.py
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
|
on_questions_generated(future)
Processes generated questions and creates learning prompts.
Takes the questions from the generator and submits them as learning prompts. Also adds document-specific questions and notifies about lesson creation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
future
|
Future[Any]
|
Future containing the generated questions. |
required |
Source code in src/engramic/application/teach/lesson.py
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 |
|
run_lesson(meta_in)
Initiates the lesson generation process.
Stores the document metadata and starts the question generation task.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
meta_in
|
Meta
|
Metadata about the source document. |
required |
Source code in src/engramic/application/teach/lesson.py
65 66 67 68 69 70 71 72 73 74 75 76 |
|