Replies: 1 comment
-
It's not calling the chat route on your server from your frontend. Maybe some file names or directory structure is off. Check this out for reference: https://github.com/vercel/ai/tree/main/examples/next-openai |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello.
I have the standard route.ts in app/api/
import { mistral } from '@ai-sdk/mistral';
import { streamText, convertToCoreMessages } from 'ai';
// Allow streaming responses up to 30 seconds
export const maxDuration = 30;
export async function POST(req: Request) {
const { messages } = await req.json();
const result = await streamText({
model: mistral('mistral-large-latest'),
messages: convertToCoreMessages(messages),
});
return result.toDataStreamResponse();
}
A valid API key is in .env.local
Still, when I type text in the form I get the following error in the console:
POST /api/chat 404 in 21ms
What could be wrong here?
Beta Was this translation helpful? Give feedback.
All reactions