Not listening post request on production server , #65095
Unanswered
Bhogeshwarj
asked this question in
App Router
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
import { GoogleGenerativeAI } from '@google/generative-ai';
import { GoogleGenerativeAIStream, Message, StreamingTextResponse } from 'ai';
const genAI = new GoogleGenerativeAI(process.env.GOOGLE_API_KEY);
export const runtime = 'edge';
const buildGoogleGenAIPrompt = (messages: Message[]) => ({
contents: messages
.filter(message => message.role === 'user' || message.role === 'assistant')
.map(message => ({
role: message.role === 'user' ? 'user' : 'model',
parts: [{ text: message.content }],
})),
});
export async function POST(req: Request,res:Response) {
try {
} catch (error) {
console.error("Internal server error:", error);
return new Response("Internal server error", { status: 500 });
}
}
this is my post request function , and i am getting the following error Internal server error: Error: [403 Forbidden] Method doesn't allow unregistered callers (callers without established identity). Please use API Key or other form of API consumer identity to call this API. So to remove this error i have to pass the API key assigned to a query parameter named key. how to do that ,
Beta Was this translation helpful? Give feedback.
All reactions