Skip to content

Commit 2ecb3c0

Browse files
format the ai response with markdown
1 parent de91298 commit 2ecb3c0

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

src/controllers/pdf/pdf-upload.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ export const pdfUploadFilesController = async (
1414
const files = req.files as Express.Multer.File[];
1515

1616
try {
17-
console.log(files);
18-
1917
await cleanUpPreviousData();
2018

2119
for (const file of files) {

src/service/ai-response-service.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,14 @@ export async function generateChatResponse(
1313
): Promise<string> {
1414
// Construct a detailed prompt for the AI
1515
const prompt = `You are an expert assistant.
16-
Using ONLY the following context from documents,
17-
please answer the user's question.
18-
The context is provided in a JSON array.
19-
If the answer is not in the context, say 'I cannot find that information in the provided documents.'
16+
Using ONLY the following context from documents,
17+
please answer the user's question.
18+
**make sure you Format your entire response using Markdown.**
19+
This includes using bullet points, bold text code block, table, etc., where appropriate.
20+
If the answer is not in the context, say 'I cannot find that information in the provided documents.'
2021
2122
Context:
22-
${JSON.stringify(context)}
23+
${context}
2324
2425
User's Question:
2526
${question}`;

0 commit comments

Comments
 (0)