Skip to content

Commit 9cbaea0

Browse files
committed
fix: prevent LLM from adding institution_id filter to course_enrollments
course_enrollments has no institution_id column; the INSTITUTION context in the prompt was causing the LLM to borrow the Institution_ID filter from the student table and apply it to course queries, producing: Error: column "institution_id" does not exist
1 parent 89ae696 commit 9cbaea0

File tree

1 file changed

+1
-0
lines changed
  • codebenders-dashboard/app/api/analyze

1 file changed

+1
-0
lines changed

codebenders-dashboard/app/api/analyze/route.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ ${Object.entries(schemaInfo.columns).map(([col, desc]) => ` - ${col}: ${desc}`
139139
140140
2. ${schemaInfo.courseTable ?? "course_enrollments"} — individual course enrollment records
141141
USE FOR: DFW/DFWI rates by course, pass rates by course, gateway course outcomes, delivery method analysis, instructor type analysis
142+
NOTE: This table has NO institution_id column. Do NOT add institution filters — data is already scoped to this institution.
142143
COLUMNS:
143144
${Object.entries(schemaInfo.courseColumns ?? {}).map(([col, desc]) => ` - ${col}: ${desc}`).join("\n")}
144145

0 commit comments

Comments
 (0)