Skip to content

Commit 96655f1

Browse files
authored
Kl/scrum 148 chatbot fixes (#102)
Co-authored-by: kevin-lann <[email protected]>
1 parent d00d315 commit 96655f1

File tree

3 files changed

+46
-167
lines changed

3 files changed

+46
-167
lines changed

course-matrix/backend/package-lock.json

Lines changed: 37 additions & 164 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,14 +247,20 @@ export const chat = asyncHandler(async (req: Request, res: Response) => {
247247
- Include course codes when referencing specific courses
248248
- If information is missing from the context but likely exists, try to use info from web to answer. If still not able to form a decent response, acknowledge the limitation
249249
- For unrelated questions, politely explain that you're specialized in UTSC academic information
250-
- Format long lists of timetables as a table
250+
- Format long lists of timetables as a table
251251
252252
## Tool call guidelines
253253
- Include the timetable ID in all getTimetables tool call responses
254254
- Link: For every tool call, for each timetable that it gets/deletes/modifies/creates, include a link with it displayed as "View Timetable" to ${process.env.CLIENT_APP_URL}/dashboard/timetable?edit=[[TIMETABLE_ID]] , where TIMETABLE_ID is the id of the respective timetable.
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+
- For delete timetable requests, if the user asks to delete an ambiguous timetable name (i.e many with similar name exist) then ask them to clarify which one
259+
- For delete timetable requests, first check that the timetable the user is refering to exists
260+
- For delete timetable requests, ask for user confirmation with command "/timetable confirm" before proceeding. If their next message is anything other than "/timetable confim" then cancel the deletion.
261+
- After a deletion has been cancelled, /timetable confirm will do nothing. If the user wants to delete again after cancelling, they must specify so.
262+
- Do not create multiple timetables for a single user query. Each user query can create at most 1 timetable
263+
- If you try to update or create a timetable but you get an error saying a timetable with the same name already exists, then ask the user to rename
258264
`,
259265
messages,
260266
tools: {
@@ -293,7 +299,7 @@ export const chat = asyncHandler(async (req: Request, res: Response) => {
293299
"Return a list of possible timetables based on provided courses and restrictions.",
294300
parameters: TimetableFormSchema,
295301
execute: async (args) => {
296-
// console.log("Args for generate: ", args)
302+
console.log("Args for generate: ", args);
297303
console.log("restrictions :", JSON.stringify(args.restrictions));
298304
const data = await availableFunctions.generateTimetable(
299305
args,

course-matrix/frontend/src/components/assistant-ui/thread-list.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const ThreadListItem: FC = () => {
4848

4949
const ThreadListItemTitle: FC = () => {
5050
return (
51-
<p className="text-sm overflow-hidden text-ellipsis whitespace-nowrap max-w-[150px]">
51+
<p className="text-sm overflow-hidden text-ellipsis max-w-[150px]">
5252
<ThreadListItemPrimitive.Title fallback="New Chat" />
5353
</p>
5454
);

0 commit comments

Comments
 (0)