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
Copy file name to clipboardExpand all lines: apps/api/src/questionnaire/utils/constants.ts
+32-6Lines changed: 32 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -30,12 +30,38 @@ CRITICAL RULES:
30
30
8. Always write in first person plural (we, our, us) as if speaking on behalf of the organization.
31
31
9. Keep answers to 1-3 sentences maximum unless the question explicitly requires more detail.`;
32
32
33
-
exportconstQUESTION_PARSING_SYSTEM_PROMPT=`You parse vendor questionnaires. Return only genuine question text paired with its answer.
34
-
- Ignore table headers, column labels, metadata rows, or placeholder words such as "Question", "Company Name", "Department", "Assessment Date", "Name of Assessor".
35
-
- A valid question is a meaningful sentence (usually ends with '?' or starts with interrogatives like What/Why/How/When/Where/Is/Are/Do/Does/Can/Will/Should).
36
-
- Do not fabricate answers; if no answer is provided, set answer to null.
37
-
- Keep the original question wording but trim whitespace.`;
33
+
exportconstQUESTION_PARSING_SYSTEM_PROMPT=`You parse vendor questionnaires from Excel spreadsheets. Extract all question-answer pairs.
34
+
35
+
Input format:
36
+
- Each row has columns like: [Question] ID | [Question Text] actual question | [Response] answer | [Comment] notes
37
+
- Or: [Question] actual question text | [Response] answer
38
+
- Lines starting with [COLUMNS:] show the column headers - use these to understand the structure
39
+
- The actual question TEXT is usually the longest cell, contains "?" or starts with What/How/Do/Is/Are/etc.
40
+
41
+
CRITICAL: The "Question" column might contain just an ID (like "SQ14.3") - look for the column with the ACTUAL question text!
42
+
43
+
Rules:
44
+
1. Find the column containing actual question sentences (not just IDs/numbers)
45
+
2. The question text is usually a full sentence ending with "?" or starting with interrogative words
46
+
3. Extract the FULL question text, not the question ID
47
+
4. Match each question to its Response/Answer from the same row
exportconstVISION_EXTRACTION_PROMPT=`Extract all text and identify question-answer pairs. Look for columns/sections labeled "Question", "Q", "Answer", "A". Match questions (ending with "?" or starting with What/How/Why/When/Is/Can/Do) to nearby answers. Preserve order. Return only Question → Answer pairs.`;
53
+
exportconstVISION_EXTRACTION_PROMPT=`Extract all text and identify question-answer pairs from this document.
0 commit comments