Skip to content

Commit 20d6eff

Browse files
kevin-lanngithub-actions[bot]
authored andcommitted
Auto-formatted the code using Prettier
1 parent 8e462d4 commit 20d6eff

File tree

3 files changed

+29
-33
lines changed

3 files changed

+29
-33
lines changed

course-matrix/backend/src/constants/availableFunctions.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,5 @@ export const availableFunctions: AvailableFunctions = {
169169
return { status: 500, error: error };
170170
}
171171
},
172-
generateTimetable: async (args: any, req: Request) => {
173-
174-
}
172+
generateTimetable: async (args: any, req: Request) => {},
175173
};

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -283,12 +283,13 @@ export const chat = asyncHandler(async (req: Request, res: Response) => {
283283
},
284284
}),
285285
generateTimetable: tool({
286-
description: "Generate a timetable based on selected courses and restrictions",
286+
description:
287+
"Generate a timetable based on selected courses and restrictions",
287288
parameters: TimetableFormSchema,
288289
execute: async (args) => {
289-
return await availableFunctions.generateTimetable(args, req)
290-
}
291-
})
290+
return await availableFunctions.generateTimetable(args, req);
291+
},
292+
}),
292293
},
293294
maxSteps: CHATBOT_TOOL_CALL_MAX_STEPS, // Controls how many back and forths the model can take with user or calling multiple tools
294295
experimental_repairToolCall: async ({

course-matrix/backend/src/models/timetable-form.ts

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -56,30 +56,27 @@ export const CourseSchema = z.object({
5656
name: z.string(),
5757
});
5858

59-
export const RestrictionSchema = z
60-
.object({
61-
type: z.string().min(1, "Restriction type is required"),
62-
days: z.array(z.string()).optional(),
63-
numDays: z
64-
.number()
65-
.positive()
66-
.max(4, "Cannot block all days of the week")
67-
.optional(),
68-
startTime: z.date().optional(),
69-
endTime: z.date().optional(),
70-
disabled: z.boolean().optional(),
71-
})
72-
73-
export const TimetableFormSchema = z
74-
.object({
75-
name: z
76-
.string()
77-
.max(100, "Name cannot exceed 100 characters")
78-
.min(1, "Name cannot be empty"),
79-
date: z.date(),
80-
semester: SemesterEnum,
81-
search: z.string(),
82-
courses: z.array(CourseSchema),
83-
restrictions: z.array(RestrictionSchema),
84-
});
59+
export const RestrictionSchema = z.object({
60+
type: z.string().min(1, "Restriction type is required"),
61+
days: z.array(z.string()).optional(),
62+
numDays: z
63+
.number()
64+
.positive()
65+
.max(4, "Cannot block all days of the week")
66+
.optional(),
67+
startTime: z.date().optional(),
68+
endTime: z.date().optional(),
69+
disabled: z.boolean().optional(),
70+
});
8571

72+
export const TimetableFormSchema = z.object({
73+
name: z
74+
.string()
75+
.max(100, "Name cannot exceed 100 characters")
76+
.min(1, "Name cannot be empty"),
77+
date: z.date(),
78+
semester: SemesterEnum,
79+
search: z.string(),
80+
courses: z.array(CourseSchema),
81+
restrictions: z.array(RestrictionSchema),
82+
});

0 commit comments

Comments
 (0)