Skip to content

Commit 15b38c9

Browse files
committed
Add getRagSettings function to rag-settings.ts
1 parent 3f9ebbf commit 15b38c9

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

server/src/utils/rag-settings.ts

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { PrismaClient } from "@prisma/client";
2+
3+
export const getRagSettings = async (prisma: PrismaClient) => {
4+
const data = await prisma.dialoqbaseSettings.findFirst({
5+
select: {
6+
defaultChunkSize: true,
7+
defaultChunkOverlap: true,
8+
},
9+
});
10+
11+
return {
12+
chunkSize: data?.defaultChunkSize || 1000,
13+
chunkOverlap: data?.defaultChunkOverlap || 200,
14+
};
15+
};

0 commit comments

Comments
 (0)