Skip to content

Commit 4b1d8fc

Browse files
committed
feat(ai-search): include similarity scores in returned chunks for backend ranking
1 parent 8444797 commit 4b1d8fc

File tree

2 files changed

+284
-73
lines changed

2 files changed

+284
-73
lines changed

apps/backend/src/controllers/search.controller.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,19 @@ export const searchDocUtil = async (
2020
const { input } = req.query;
2121

2222
if (!input || typeof input !== 'string') {
23-
res.status(400).json(formatResponse({ error: 'Missing search input' }));
23+
res.status(400).json(
24+
formatResponse({
25+
error: {
26+
code: 'MISSING_INPUT',
27+
title: 'Missing Input',
28+
message: 'Missing search input',
29+
},
30+
status: 400,
31+
data: null,
32+
message: null,
33+
description: null,
34+
})
35+
);
2436
return;
2537
}
2638

0 commit comments

Comments
 (0)