Skip to content

Commit 7ca53d6

Browse files
committed
Prevent changing semester using chatbot
1 parent 4337de1 commit 7ca53d6

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

course-matrix/backend/src/controllers/aiController.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ export const chat = asyncHandler(async (req: Request, res: Response) => {
255255
- If the user provides a course code of length 6 like CSCA08, then assume they mean CSCA08H3 (H3 appended)
256256
- If the user wants to create a timetable, first call getCourses to get course information on the requested courses, then call generateTimetable.
257257
- Do not make up fake courses or offerings.
258+
- You can only edit title of the timetable, nothing else. If a user tries to edit something else, acknowledge this limitation.
258259
`,
259260
messages,
260261
tools: {
@@ -267,13 +268,10 @@ export const chat = asyncHandler(async (req: Request, res: Response) => {
267268
},
268269
}),
269270
updateTimetable: tool({
270-
description: "Update a user's timetable by title and/or semester",
271+
description: "Update a user's timetable's title",
271272
parameters: z.object({
272273
id: z.number().positive(),
273274
timetable_title: z.string().optional(),
274-
semester: z
275-
.enum(["Fall 2025", "Summer 2025", "Winter 2026"])
276-
.optional(),
277275
}),
278276
execute: async (args) => {
279277
return await availableFunctions.updateTimetable(args, req);

0 commit comments

Comments
 (0)