Skip to content

Commit 9374901

Browse files
refactor: Add temperature property to POST function in chat/student/route.ts
1 parent 632ab18 commit 9374901

File tree

1 file changed

+30
-30
lines changed

1 file changed

+30
-30
lines changed

actions/dashboard/ExamPreparationActions.tsx

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,12 @@ export async function continueConversation (
7272
You and the user can discuss the exam and the student's performance
7373
7474
Messages inside [] means that it's a UI element or a user event. For example:
75-
- [showExamnForm] means that the user will see an exam form and fill it out
76-
- [showExamnResult] means that the user will see the result of the exam he took
77-
- [examnsSuggestions] means that the user will see suggestions for exams he can take
75+
- [showExamForm] means that the user will see an exam form and fill it out
76+
- [showExamResult] means that the user will see the result of the exam he took
77+
- [examsSuggestions] means that the user will see suggestions for exams he can take
7878
79-
If the user requests a exam or quiz, call \`showExamnForm\` to show the exam form. after an exan is taken, call \`showExamnResult\` to show the result of the exam.
80-
As a teacher, if the user ask for an exam but is vague, you can suggest exams to the user by calling \`examnsSuggestions\` or if the user is asking for suggestions.
79+
If the user requests a exam or quiz, call \`showExamForm\` to show the exam form. after an exan is taken, call \`showExamResult\` to show the result of the exam.
80+
As a teacher, if the user ask for an exam but is vague, you can suggest exams to the user by calling \`examsSuggestions\` or if the user is asking for suggestions.
8181
8282
Besides that, you can also chat with users about possible topics for exams, or any other topic you want to discuss with the user that goes along with the exam preparation as this is a exam preparation chat.
8383
`,
@@ -118,7 +118,7 @@ export async function continueConversation (
118118
)
119119
},
120120
tools: {
121-
showExamnForm: {
121+
showExamForm: {
122122
description: 'Show the user an exam form to fill out for an exam preparationn, this form will be sent to the user and he will anwser it',
123123
parameters: z.object({
124124
singleSelectQuestion: z.array(z.object({
@@ -182,7 +182,7 @@ export async function continueConversation (
182182
content: [
183183
{
184184
type: 'tool-call',
185-
toolName: 'showExamnForm',
185+
toolName: 'showExamForm',
186186
toolCallId,
187187
args: {
188188
singleSelectQuestion,
@@ -199,7 +199,7 @@ export async function continueConversation (
199199
content: [
200200
{
201201
type: 'tool-result',
202-
toolName: 'showExamnForm',
202+
toolName: 'showExamForm',
203203
toolCallId,
204204
result: {
205205
singleSelectQuestion,
@@ -230,7 +230,7 @@ export async function continueConversation (
230230
message: JSON.stringify([
231231
{
232232
type: 'tool-call',
233-
toolName: 'showExamnForm',
233+
toolName: 'showExamForm',
234234
toolCallId,
235235
result: {
236236
singleSelectQuestion,
@@ -248,7 +248,7 @@ export async function continueConversation (
248248
message: JSON.stringify([
249249
{
250250
type: 'tool-result',
251-
toolName: 'showExamnForm',
251+
toolName: 'showExamForm',
252252
toolCallId,
253253
result: {
254254
singleSelectQuestion,
@@ -284,7 +284,7 @@ export async function continueConversation (
284284
)
285285
}
286286
},
287-
showExamnResult: {
287+
showExamResult: {
288288
description: 'Show the user the result of the exam he took',
289289
parameters: z.object({
290290
score: z.number().int().describe('The grade of the student in the exam with a scale from 0 to 20'),
@@ -313,7 +313,7 @@ export async function continueConversation (
313313
content: [
314314
{
315315
type: 'tool-call',
316-
toolName: 'showExamnResult',
316+
toolName: 'showExamResult',
317317
toolCallId,
318318
args: {
319319
score,
@@ -329,7 +329,7 @@ export async function continueConversation (
329329
content: [
330330
{
331331
type: 'tool-result',
332-
toolName: 'showExamnResult',
332+
toolName: 'showExamResult',
333333
toolCallId,
334334
result: {
335335
score,
@@ -361,7 +361,7 @@ export async function continueConversation (
361361
message: JSON.stringify([
362362
{
363363
type: 'tool-call',
364-
toolName: 'showExamnResult',
364+
toolName: 'showExamResult',
365365
toolCallId,
366366
result: {
367367
score,
@@ -378,7 +378,7 @@ export async function continueConversation (
378378
message: JSON.stringify([
379379
{
380380
type: 'tool-result',
381-
toolName: 'showExamnResult',
381+
toolName: 'showExamResult',
382382
toolCallId,
383383
result: {
384384
score,
@@ -408,14 +408,14 @@ export async function continueConversation (
408408
)
409409
}
410410
},
411-
examnsSuggestions: {
412-
description: 'Show the user suggestions for exams he can take',
411+
examsSuggestions: {
412+
description: 'Show the user suggestions for exams forms he can take',
413413
parameters: z.object({
414414
suggestions: z.array(z.object({
415-
title: z.string().describe('The title of the suggestion'),
416-
description: z.string().describe('The description of the suggestion'),
417-
content: z.string().describe('The content of the suggestion'),
418-
difficulty: z.string().describe('The difficulty of the examn')
415+
title: z.string().describe('The title of the suggestion for the exam'),
416+
description: z.string().describe('The description of the suggestion for the exam'),
417+
content: z.string().describe('The content of the suggestion for the exam'),
418+
difficulty: z.string().describe('The difficulty of the exam')
419419
}))
420420
}),
421421
generate: async function * ({
@@ -435,7 +435,7 @@ export async function continueConversation (
435435
content: [
436436
{
437437
type: 'tool-call',
438-
toolName: 'examnsSuggestions',
438+
toolName: 'examsSuggestions',
439439
toolCallId,
440440
args: {
441441
suggestions
@@ -449,7 +449,7 @@ export async function continueConversation (
449449
content: [
450450
{
451451
type: 'tool-result',
452-
toolName: 'examnsSuggestions',
452+
toolName: 'examsSuggestions',
453453
toolCallId,
454454
result: {
455455
suggestions
@@ -468,7 +468,7 @@ export async function continueConversation (
468468
message: JSON.stringify([
469469
{
470470
type: 'tool-call',
471-
toolName: 'examnsSuggestions',
471+
toolName: 'examsSuggestions',
472472
toolCallId,
473473
result: {
474474
suggestions
@@ -483,7 +483,7 @@ export async function continueConversation (
483483
message: JSON.stringify([
484484
{
485485
type: 'tool-result',
486-
toolName: 'examnsSuggestions',
486+
toolName: 'examsSuggestions',
487487
toolCallId,
488488
result: {
489489
suggestions
@@ -600,10 +600,10 @@ export const getUIStateFromAIState = (aiState: Chat) => {
600600

601601
message.role === 'tool' ? (
602602
message.content.map(tool => {
603-
// find if the next message is a showExamnResult
603+
// find if the next message is a showExamResult
604604
// @ts-expect-error
605-
const isNextMessageAShowExamnResult = aiState?.messages[index + 1] ? aiState?.messages[index + 1].content[0]?.toolName === 'showExamnResult' : false
606-
return tool.toolName === 'showExamnForm' ? (
605+
const isNextMessageAShowExamnResult = aiState?.messages[index + 1] ? aiState?.messages[index + 1].content[0]?.toolName === 'showExamResult' : false
606+
return tool.toolName === 'showExamForm' ? (
607607
<Message
608608
sender={'assistant'}
609609
time={dayjs().format('dddd, MMMM D, YYYY h:mm A')}
@@ -621,7 +621,7 @@ export const getUIStateFromAIState = (aiState: Chat) => {
621621
hideSubmit={isNextMessageAShowExamnResult}
622622
/>
623623
</Message>
624-
) : tool.toolName === 'showExamnResult' ? (
624+
) : tool.toolName === 'showExamResult' ? (
625625
<Message
626626
sender={'assistant'}
627627
time={dayjs().format('dddd, MMMM D, YYYY h:mm A')}
@@ -636,7 +636,7 @@ export const getUIStateFromAIState = (aiState: Chat) => {
636636
questionAndAnswerFeedback={tool.result.questionAndAnswerFeedback}
637637
/>
638638
</Message>
639-
) : tool.toolName === 'examnsSuggestions' ? (
639+
) : tool.toolName === 'examsSuggestions' ? (
640640
<Message
641641
sender={'assistant'}
642642
time={dayjs().format('dddd, MMMM D, YYYY h:mm A')}

0 commit comments

Comments
 (0)