Skip to content

Commit 037da20

Browse files
committed
Add link generate and tooltip in UI for /timetable
1 parent 23c291a commit 037da20

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,4 @@ export const CHATBOT_MEMORY_THRESHOLD = 3;
5151

5252
export const CHATBOT_TIMETABLE_CMD = "/timetable";
5353

54-
export const CHATBOT_TOOL_CALL_MAX_STEPS = 3;
54+
export const CHATBOT_TOOL_CALL_MAX_STEPS = 5;

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,10 @@ export const chat = asyncHandler(async (req: Request, res: Response) => {
244244
- Include course codes when referencing specific courses
245245
- 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
246246
- For unrelated questions, politely explain that you're specialized in UTSC academic information
247+
248+
## Tool call guidelines
249+
- Include the timetable ID in all getTimetbles tool call responses
250+
- If the tool call is a getTimetables call, then at the end of each timetable listed, include a link 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.
247251
`,
248252
messages,
249253
tools: {

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
ChevronLeftIcon,
1313
ChevronRightIcon,
1414
CopyIcon,
15+
Info,
1516
PencilIcon,
1617
RefreshCwIcon,
1718
SendHorizontalIcon,
@@ -81,6 +82,7 @@ const ThreadWelcome: FC = () => {
8182
Hi my name is <span className="text-primary">Morpheus</span>. How
8283
can I help you today?
8384
</p>
85+
<p className="mt-4 text-sm text-gray-300"><strong>Tip: </strong> Use /timetable to work with your timetables</p>
8486
</div>
8587
<ThreadWelcomeSuggestions />
8688
</div>
@@ -111,6 +113,16 @@ const ThreadWelcomeSuggestions: FC = () => {
111113
What is Course Matrix?
112114
</span>
113115
</ThreadPrimitive.Suggestion>
116+
<ThreadPrimitive.Suggestion
117+
className="hover:bg-muted/80 flex max-w-sm grow basis-0 flex-col items-center justify-center rounded-lg border p-3 transition-colors ease-in"
118+
prompt="/timetable show my timetables"
119+
method="replace"
120+
autoSend
121+
>
122+
<span className="line-clamp-2 text-ellipsis text-sm font-semibold">
123+
<span className="text-green-500">/timetable</span> show my timetables
124+
</span>
125+
</ThreadPrimitive.Suggestion>
114126
</div>
115127
);
116128
};

0 commit comments

Comments
 (0)