You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Ensure assistant content fits within context window
62
67
constassistantMessage: CoreMessage={
@@ -112,7 +117,9 @@ export async function generateCourseContent(
112
117
113
118
constmetadataUserMessage: CoreMessage={
114
119
role: 'user',
115
-
content: `Generate the title, learning outcomes, and at least 5-10 key terms for a ${difficultyLevel} level ${contentType} on "${topicName}" based STRICTLY on the provided source materials above.`,
120
+
content: sourceMetadata.usingCourseContext
121
+
? `Generate the title, learning outcomes, and at least 5-10 key terms for a ${difficultyLevel} level ${contentType} on "${topicName}" based on standard academic knowledge and best practices for this subject area.`
122
+
: `Generate the title, learning outcomes, and at least 5-10 key terms for a ${difficultyLevel} level ${contentType} on "${topicName}" based STRICTLY on the provided source materials above.`,
@@ -137,10 +144,17 @@ export async function generateCourseContent(
137
144
constintroSystemPrompt=`You are an expert educational content developer. Continue creating a ${difficultyLevel} level ${contentType} on "${topicName}" designed for a ${sessionLength}-minute session.
138
145
139
146
IMPORTANT INSTRUCTIONS:
140
-
1. You MUST base your content ENTIRELY on the source materials provided.
147
+
${
148
+
sourceMetadata.usingCourseContext
149
+
? `1. Since no specific source materials were provided, base your content on standard academic knowledge for the topic.
150
+
2. Draw from established educational practices and common curriculum content for this subject area.
151
+
3. Create content appropriate for the specified difficulty level and session length.
152
+
4. Ensure the introduction provides context and importance of the topic based on general knowledge.`
153
+
: `1. You MUST base your content ENTIRELY on the source materials provided.
141
154
2. Extract key concepts, terminology, examples, and explanations directly from the source materials.
142
155
3. Do not introduce concepts or information that is not present in the source materials.
143
-
4. Create an engaging introduction that provides context and importance of the topic.
156
+
4. Create an engaging introduction that provides context and importance of the topic.`
157
+
}
144
158
145
159
RESPONSE FORMAT:
146
160
Your response MUST be a valid JSON object with EXACTLY these fields:
@@ -157,7 +171,9 @@ CRITICAL: Your response MUST be valid JSON only. Do not include any text, markdo
157
171
158
172
constintroUserMessage: CoreMessage={
159
173
role: 'user',
160
-
content: `Generate an engaging introduction for a ${difficultyLevel} level ${contentType} on "${topicName}" with title "${metadataResponse.title}" based STRICTLY on the provided source materials above.`,
174
+
content: sourceMetadata.usingCourseContext
175
+
? `Generate an engaging introduction for a ${difficultyLevel} level ${contentType} on "${topicName}" with title "${metadataResponse.title}" based on standard academic knowledge and best practices for this subject area.`
176
+
: `Generate an engaging introduction for a ${difficultyLevel} level ${contentType} on "${topicName}" with title "${metadataResponse.title}" based STRICTLY on the provided source materials above.`,
@@ -179,9 +195,15 @@ CRITICAL: Your response MUST be valid JSON only. Do not include any text, markdo
179
195
constspecialSlidesSystemPrompt=`You are an expert educational content developer. Continue creating a ${difficultyLevel} level ${contentType} on "${topicName}" designed for a ${sessionLength}-minute session.
180
196
181
197
IMPORTANT INSTRUCTIONS:
182
-
1. You MUST base your content ENTIRELY on the source materials provided.
198
+
${
199
+
sourceMetadata.usingCourseContext
200
+
? `1. Since no specific source materials were provided, base your content on standard academic knowledge for the topic.
201
+
2. Draw from established educational practices and common curriculum content for this subject area.
202
+
3. Create content appropriate for the specified difficulty level and session length.`
203
+
: `1. You MUST base your content ENTIRELY on the source materials provided.
183
204
2. Extract key concepts, terminology, examples, and explanations directly from the source materials.
184
-
3. Do not introduce concepts or information that is not present in the source materials.
205
+
3. Do not introduce concepts or information that is not present in the source materials.`
206
+
}
185
207
4. Create ONLY the following special slides:
186
208
- Introduction slide (first slide that introduces the topic)
187
209
- Agenda/Overview slide (outlines what will be covered)
@@ -228,7 +250,9 @@ CRITICAL: Your response MUST be valid JSON only. Do not include any text, markdo
228
250
229
251
constspecialSlidesUserMessage: CoreMessage={
230
252
role: 'user',
231
-
content: `Generate the introduction, agenda, assessment, and conclusion slides for a ${difficultyLevel} level ${contentType} on "${topicName}" with title "${metadataResponse.title}" based STRICTLY on the provided source materials above.`,
253
+
content: sourceMetadata.usingCourseContext
254
+
? `Generate the introduction, agenda, assessment, and conclusion slides for a ${difficultyLevel} level ${contentType} on "${topicName}" with title "${metadataResponse.title}" based on standard academic knowledge and best practices for this subject area.`
255
+
: `Generate the introduction, agenda, assessment, and conclusion slides for a ${difficultyLevel} level ${contentType} on "${topicName}" with title "${metadataResponse.title}" based STRICTLY on the provided source materials above.`,
232
256
}
233
257
234
258
constspecialSlidesMessages=[
@@ -291,9 +315,15 @@ CRITICAL: Your response MUST be valid JSON only. Do not include any text, markdo
291
315
constcontentSlidesSystemPrompt=`You are generating content slides ${startSlideNum} through ${endSlideNum} of a total of ${totalContentSlidesNeeded} content slides. Ensure all slides are unique.
292
316
293
317
IMPORTANT INSTRUCTIONS:
294
-
1. You MUST base your content ENTIRELY on the source materials provided.
318
+
${
319
+
sourceMetadata.usingCourseContext
320
+
? `1. Since no specific source materials were provided, base your content on standard academic knowledge for the topic.
321
+
2. Draw from established educational practices and common curriculum content for this subject area.
322
+
3. Create content appropriate for the specified difficulty level and session length.`
323
+
: `1. You MUST base your content ENTIRELY on the source materials provided.
295
324
2. Extract key concepts, terminology, examples, and explanations directly from the source materials.
296
-
3. Do not introduce concepts or information that is not present in the source materials.
325
+
3. Do not introduce concepts or information that is not present in the source materials.`
326
+
}
297
327
4. Create detailed teaching slides with substantial content on each slide.
298
328
5. Focus ONLY on core teaching content slides.
299
329
6. Each slide should have comprehensive speaker notes with additional details and examples.
@@ -324,7 +354,11 @@ CRITICAL: Your response MUST be valid JSON only. Do not include any text, markdo
324
354
325
355
constcontentSlidesUserMessage: CoreMessage={
326
356
role: 'user',
327
-
content: `Generate content slides ${startSlideNum} through ${endSlideNum} for a ${difficultyLevel} level ${contentType} on "${topicName}" with title "${metadataResponse.title}" based STRICTLY on the provided source materials above.
357
+
content: sourceMetadata.usingCourseContext
358
+
? `Generate content slides ${startSlideNum} through ${endSlideNum} for a ${difficultyLevel} level ${contentType} on "${topicName}" with title "${metadataResponse.title}" based on standard academic knowledge and best practices for this subject area.
359
+
360
+
DO NOT create introduction, agenda, assessment, or conclusion slides. Focus ONLY on core teaching content slides.`
361
+
: `Generate content slides ${startSlideNum} through ${endSlideNum} for a ${difficultyLevel} level ${contentType} on "${topicName}" with title "${metadataResponse.title}" based STRICTLY on the provided source materials above.
328
362
329
363
DO NOT create introduction, agenda, assessment, or conclusion slides. Focus ONLY on core teaching content slides.`,
330
364
}
@@ -381,7 +415,9 @@ DO NOT create introduction, agenda, assessment, or conclusion slides. Focus ONLY
381
415
382
416
constactivitiesUserMessage: CoreMessage={
383
417
role: 'user',
384
-
content: `Generate the activities for a ${difficultyLevel} level ${contentType} on "${topicName}" with title "${metadataResponse.title}" based STRICTLY on the provided source materials above.`,
418
+
content: sourceMetadata.usingCourseContext
419
+
? `Generate the activities for a ${difficultyLevel} level ${contentType} on "${topicName}" with title "${metadataResponse.title}" based on standard academic knowledge and best practices for this subject area.`
420
+
: `Generate the activities for a ${difficultyLevel} level ${contentType} on "${topicName}" with title "${metadataResponse.title}" based STRICTLY on the provided source materials above.`,
@@ -417,7 +453,9 @@ DO NOT create introduction, agenda, assessment, or conclusion slides. Focus ONLY
417
453
418
454
constassessmentUserMessage: CoreMessage={
419
455
role: 'user',
420
-
content: `Generate assessment ideas (without example questions) for a ${difficultyLevel} level ${contentType} on "${topicName}" with title "${metadataResponse.title}" based STRICTLY on the provided source materials above.`,
456
+
content: sourceMetadata.usingCourseContext
457
+
? `Generate assessment ideas (without example questions) for a ${difficultyLevel} level ${contentType} on "${topicName}" with title "${metadataResponse.title}" based on standard academic knowledge and best practices for this subject area.`
458
+
: `Generate assessment ideas (without example questions) for a ${difficultyLevel} level ${contentType} on "${topicName}" with title "${metadataResponse.title}" based STRICTLY on the provided source materials above.`,
@@ -479,7 +517,9 @@ DO NOT create introduction, agenda, assessment, or conclusion slides. Focus ONLY
479
517
480
518
constreadingsUserMessage: CoreMessage={
481
519
role: 'user',
482
-
content: `Generate further reading suggestions for a ${difficultyLevel} level ${contentType} on "${topicName}" with title "${metadataResponse.title}" based STRICTLY on the provided source materials above.`,
520
+
content: sourceMetadata.usingCourseContext
521
+
? `Generate further reading suggestions for a ${difficultyLevel} level ${contentType} on "${topicName}" with title "${metadataResponse.title}" based on standard academic knowledge and best practices for this subject area.`
522
+
: `Generate further reading suggestions for a ${difficultyLevel} level ${contentType} on "${topicName}" with title "${metadataResponse.title}" based STRICTLY on the provided source materials above.`,
0 commit comments