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
@@ -30,6 +58,7 @@ export function buildSmartPrompt(
30
58
doc: Document,
31
59
strategy?: CardStrategy|null,
32
60
imageAlts?: string[],
61
+
recentCardSummaries?: string[],
33
62
): string{
34
63
constdocLabel=doc.title??"Untitled";
35
64
@@ -76,8 +105,10 @@ You are a reading companion AI. Analyze the ${isCodeChunk ? "code sample" : "pas
76
105
77
106
SUGGESTED CARD TYPES (you may adjust based on the content):
78
107
${typeDescriptions}
79
-
${codeInstructions}${imageBlock}
80
-
INSTRUCTIONS:
108
+
${codeInstructions}${imageBlock}${recentCardSummaries&&recentCardSummaries.length>0 ? `ALREADY GENERATED (do NOT repeat these topics — find a fresh angle or skip if the passage covers the same ground):
1. First, understand what kind of content this is (prose, reference table, notation, formula, code sample, exercises/questions, table of contents, etc.).
82
113
2. If the content TEACHES something (explains a concept, presents an argument, demonstrates a technique), generate a "discover" card first when it is in the suggested types — it is the primary card type. Then add other types only if the content warrants them.
83
114
3. If the content is primarily exercises, homework questions, discussion prompts, review questions, or a table of contents/index — do NOT generate a "discover" card. These are questions, not teachings. Instead, generate flashcard or quiz cards that ANSWER the most important questions if possible, or return an empty array if the questions are too open-ended or require external work.
@@ -29,6 +57,7 @@ export function buildSmartPrompt(
29
57
prevChunk: Chunk|null,
30
58
doc: Document,
31
59
strategy?: CardStrategy|null,
60
+
recentCardSummaries?: string[],
32
61
): string{
33
62
constdocLabel=doc.title??"Untitled";
34
63
@@ -68,8 +97,10 @@ You are a reading companion AI. Analyze the ${isCodeChunk ? "code sample" : "pas
68
97
69
98
SUGGESTED CARD TYPES (you may adjust based on the content):
70
99
${typeDescriptions}
71
-
${codeInstructions}
72
-
INSTRUCTIONS:
100
+
${codeInstructions}${recentCardSummaries&&recentCardSummaries.length>0 ? `ALREADY GENERATED (do NOT repeat these topics — find a fresh angle or skip if the passage covers the same ground):
1. First, understand what kind of content this is (prose, reference table, notation, formula, code sample, exercises/questions, table of contents, etc.).
74
105
2. If the content TEACHES something (explains a concept, presents an argument, demonstrates a technique), generate a "discover" card first when it is in the suggested types — it is the primary card type. Then add other types only if the content warrants them.
75
106
3. If the content is primarily exercises, homework questions, discussion prompts, review questions, or a table of contents/index — do NOT generate a "discover" card. These are questions, not teachings. Instead, generate flashcard or quiz cards that ANSWER the most important questions if possible, or return an empty array if the questions are too open-ended or require external work.
0 commit comments