diff --git a/app/api/chat/route.js b/app/api/chat/route.js index f6ebf44..9713b10 100644 --- a/app/api/chat/route.js +++ b/app/api/chat/route.js @@ -8,7 +8,6 @@ export async function POST(req) { try { // Parse the request body const data = await req.json(); - console.log('Received request body:', data); // Fetch chat completion from Groq const chatCompletion = await groq.chat.completions.create({ @@ -18,7 +17,6 @@ export async function POST(req) { // Prepare the response const responseContent = chatCompletion.choices[0]?.message?.content || "No content returned"; - console.log('Chat completion content:', responseContent); // Return the response as a stream const encoder = new TextEncoder(); @@ -36,7 +34,6 @@ export async function POST(req) { return new NextResponse(stream); } catch (error) { - console.error('Error in POST /api/chat:', error); // Return an error response const errorResponse = JSON.stringify({ diff --git a/app/api/rag/route.js b/app/api/rag/route.js index a13284f..a4fa8b5 100644 --- a/app/api/rag/route.js +++ b/app/api/rag/route.js @@ -33,7 +33,6 @@ async function fetchDocuments() { // Check if the request was successful if (!response.ok) { - console.log('Docs call failing') throw new Error(`Failed to fetch documents: ${response.statusText}`); } @@ -67,10 +66,8 @@ export async function POST(req, res) { try { // Fetch query embeddings const queryEmbedding = await fetchEmbeddings(question); - console.log('Embeddings fetched') // Fetch documents from MongoDB const docs = await fetchDocuments(); - console.log('Docs fetched') // Calculate similarity scores const scores = docs.map((doc) => ({ @@ -90,7 +87,6 @@ export async function POST(req, res) { "${context}". Here is the user question: "${question}"`; - console.log(`prompt given: ${context}`) return NextResponse.json({ prompt }, { status: 200 }); } catch (error) { return NextResponse.json({ message: "An error occurred" }, { status: 500 });