model selector

This commit is contained in:
2026-06-16 18:40:08 +02:00
parent 865ef0b316
commit 54f108ac8d
5 changed files with 116 additions and 12 deletions

View File

@@ -32,6 +32,7 @@ export async function POST(req: Request) {
if (!session) return new Response('Session not found', { status: 404 })
const systemPrompt = await servTrpc.chat.getSystemPrompt() || 'You are an AI recruiter assistant.'
const model = await servTrpc.chat.getModel()
// Save the latest user message
const lastMessage = messages[messages.length - 1]
@@ -46,7 +47,7 @@ export async function POST(req: Request) {
}
const result = streamText({
model: openai('gpt-5-mini'),
model: openai(model),
system: systemPrompt,
messages: await convertToModelMessages(messages),
tools: {