Skip to content

Commit 632ab18

Browse files
refactor: Add temperature property to POST function in chat/student/route.ts
This commit adds a temperature property with a value of 0.5 to the POST function in the chat/student/route.ts file. The temperature property is used to control the randomness of the AI-generated responses in the chat feature. This addition enhances the functionality of the chat system by allowing for more controlled and predictable AI responses.
1 parent d4b77c9 commit 632ab18

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

app/api/lessons/chat/student/route.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export async function POST (req: Request) {
3535
})
3636
}
3737
},
38+
temperature: 0.5,
3839
// model: ollama('llama3'),
3940
messages: convertToCoreMessages(messages),
4041
tools: {
@@ -76,6 +77,7 @@ export async function POST (req: Request) {
7677
// Respond with the stream
7778
return result.toAIStreamResponse()
7879
} catch (error) {
80+
console.log('Error:', error)
7981
return new Response('Error', { status: 500 })
8082
}
8183
}

0 commit comments

Comments
 (0)