Adeen commited on
Commit ·
1974805
1
Parent(s): 59ee42c
feat: adopt Clean Professional (Turbo AI) style for notes
Browse files
src/components/UploadDialog.tsx
CHANGED
|
@@ -50,10 +50,9 @@ export default function UploadDialog({ open, onOpenChange }: { open: boolean; on
|
|
| 50 |
try {
|
| 51 |
// EXPERT OVERRIDE
|
| 52 |
const EXPERT_PREFIX = `[EXPERT ADVISORY: ACT AS AN EXPERT ACADEMIC DATA EXTRACTION AGENT.
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
ALWAYS EXPAND LISTS INTO FULL SECTIONS.]\n\n`;
|
| 57 |
|
| 58 |
const finalContent = EXPERT_PREFIX + textContent;
|
| 59 |
|
|
@@ -133,10 +132,9 @@ ALWAYS EXPAND LISTS INTO FULL SECTIONS.]\n\n`;
|
|
| 133 |
|
| 134 |
// EXPERT OVERRIDE: Prepend instructions to ensure lossless extraction even if backend is old
|
| 135 |
const EXPERT_PREFIX = `[EXPERT ADVISORY: ACT AS AN EXPERT ACADEMIC DATA EXTRACTION AGENT.
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
ALWAYS EXPAND LISTS INTO FULL SECTIONS.]\n\n`;
|
| 140 |
|
| 141 |
const finalRawText = EXPERT_PREFIX + extractedText;
|
| 142 |
|
|
|
|
| 50 |
try {
|
| 51 |
// EXPERT OVERRIDE
|
| 52 |
const EXPERT_PREFIX = `[EXPERT ADVISORY: ACT AS AN EXPERT ACADEMIC DATA EXTRACTION AGENT.
|
| 53 |
+
STYLE: PROFESSIONAL, CLEAN MARKDOWN. NO EMOJIS ALLOWED.
|
| 54 |
+
DIRECTIVE: LOSSLESS EXTRACTION. ZERO OMISSION.
|
| 55 |
+
TEMPLATE: Overview -> Key Points -> Tables for Frameworks -> Sub-headings for Detailed Terms.]\n\n`;
|
|
|
|
| 56 |
|
| 57 |
const finalContent = EXPERT_PREFIX + textContent;
|
| 58 |
|
|
|
|
| 132 |
|
| 133 |
// EXPERT OVERRIDE: Prepend instructions to ensure lossless extraction even if backend is old
|
| 134 |
const EXPERT_PREFIX = `[EXPERT ADVISORY: ACT AS AN EXPERT ACADEMIC DATA EXTRACTION AGENT.
|
| 135 |
+
STYLE: PROFESSIONAL, CLEAN MARKDOWN. NO EMOJIS ALLOWED.
|
| 136 |
+
DIRECTIVE: LOSSLESS EXTRACTION. ZERO OMISSION.
|
| 137 |
+
TEMPLATE: Overview -> Key Points -> Tables for Frameworks -> Sub-headings for Detailed Terms.]\n\n`;
|
|
|
|
| 138 |
|
| 139 |
const finalRawText = EXPERT_PREFIX + extractedText;
|
| 140 |
|
supabase/functions/generate_notes/index.ts
CHANGED
|
@@ -8,38 +8,48 @@ const corsHeaders = {
|
|
| 8 |
"authorization, x-client-info, apikey, content-type, x-supabase-client-platform, x-supabase-client-platform-version, x-supabase-client-runtime, x-supabase-client-runtime-version",
|
| 9 |
};
|
| 10 |
|
| 11 |
-
const SYSTEM_PROMPT = `You are an Expert Academic Data Extraction Agent. Your
|
| 12 |
|
| 13 |
-
**
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
4. **ZERO OMISSION:** If a slide provides a "Scenario" and "Solution" for a specific sub-item (like "Observation"), that Scenario/Solution MUST appear directly under that item's H3 heading.
|
| 18 |
|
| 19 |
-
**
|
| 20 |
-
# [Document Title / Main Topic]
|
| 21 |
|
| 22 |
-
|
| 23 |
|
| 24 |
-
|
| 25 |
-
[Introduction to the section]
|
| 26 |
|
| 27 |
-
##
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
|
| 33 |
-
##
|
| 34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
|
| 36 |
## Key Scenarios & Practical Applications
|
| 37 |
-
*
|
|
|
|
| 38 |
|
| 39 |
## Final Summary & Synthesis
|
| 40 |
-
[
|
| 41 |
|
| 42 |
-
**FINAL
|
| 43 |
|
| 44 |
Deno.serve(async (req) => {
|
| 45 |
if (req.method === "OPTIONS") return new Response("ok", { headers: corsHeaders });
|
|
|
|
| 8 |
"authorization, x-client-info, apikey, content-type, x-supabase-client-platform, x-supabase-client-platform-version, x-supabase-client-runtime, x-supabase-client-runtime-version",
|
| 9 |
};
|
| 10 |
|
| 11 |
+
const SYSTEM_PROMPT = `You are an Expert Academic Data Extraction Agent. Your directive is to perform a **lossless, exhaustive extraction** of the provided educational document into a professional, clean Markdown format.
|
| 12 |
|
| 13 |
+
**STYLE CONSTRAINTS:**
|
| 14 |
+
- **NO EMOJIS:** You are strictly forbidden from using any emojis in the output.
|
| 15 |
+
- **PROFESSIONAL TONE:** Use clear, academic language.
|
| 16 |
+
- **EXHAUSTIVE DETAIL:** Do not summarize. Capture every definition, example, and scenario in full.
|
|
|
|
| 17 |
|
| 18 |
+
**REQUIRED OUTPUT STRUCTURE:**
|
|
|
|
| 19 |
|
| 20 |
+
# [Document Title]
|
| 21 |
|
| 22 |
+
**Overview:** This note covering [Topic] was created from a [Page Count] page document. It provides a structured walk-through of [Primary Goal of Document].
|
|
|
|
| 23 |
|
| 24 |
+
## Key Points
|
| 25 |
+
- [High-level topic 1]
|
| 26 |
+
- [High-level topic 2]
|
| 27 |
+
- [High-level topic 3]
|
| 28 |
+
- [High-level topic 4]
|
| 29 |
|
| 30 |
+
## [Section Heading]
|
| 31 |
+
[Detailed introduction to the section]
|
| 32 |
+
|
| 33 |
+
### [Sub-topic or Framework Item]
|
| 34 |
+
**Full Definition:** [Extract exhaustive definition word-for-word]
|
| 35 |
+
**Detailed Example/Context:** [Extract full context and examples]
|
| 36 |
+
|
| 37 |
+
**Question:** [If a scenario is presented, format the question here]
|
| 38 |
+
**Answer:** [Format the solution/result here]
|
| 39 |
+
|
| 40 |
+
*(Use Tables for Frameworks like SHAPES or Ancillary Skills lists)*
|
| 41 |
+
| Item | Meaning/Why Important | Example |
|
| 42 |
+
|------|----------------------|---------|
|
| 43 |
+
| [X] | [Y] | [Z] |
|
| 44 |
|
| 45 |
## Key Scenarios & Practical Applications
|
| 46 |
+
**Scenario:** [Extract general scenarios]
|
| 47 |
+
**Solution/Takeaway:** [Extract solution]
|
| 48 |
|
| 49 |
## Final Summary & Synthesis
|
| 50 |
+
[A comprehensive wrap-up of the document's value]
|
| 51 |
|
| 52 |
+
**FINAL DIRECTIVE:** Maintain 100% fidelity to the source text. Every sub-topic from the document must have its own detailed heading. Never group distinct items into a single paragraph.`;
|
| 53 |
|
| 54 |
Deno.serve(async (req) => {
|
| 55 |
if (req.method === "OPTIONS") return new Response("ok", { headers: corsHeaders });
|