Skip to content

Commit

Permalink
Add getRagSettings function to rag-settings.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
n4ze3m committed Apr 21, 2024
1 parent 3f9ebbf commit 15b38c9
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions server/src/utils/rag-settings.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { PrismaClient } from "@prisma/client";

export const getRagSettings = async (prisma: PrismaClient) => {
const data = await prisma.dialoqbaseSettings.findFirst({
select: {
defaultChunkSize: true,
defaultChunkOverlap: true,
},
});

return {
chunkSize: data?.defaultChunkSize || 1000,
chunkOverlap: data?.defaultChunkOverlap || 200,
};
};

0 comments on commit 15b38c9

Please sign in to comment.