Skip to content

Commit 92899a3

Browse files
committed
analytics: Log ragIndexId and name when used
1 parent f93c888 commit 92899a3

File tree

1 file changed

+3
-0
lines changed
  • src/server/routes/ai

1 file changed

+3
-0
lines changed

src/server/routes/ai/v3.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@ router.post('/stream', upload.single('file'), async (r, res) => {
123123
if (prompt.ragIndex) {
124124
const searchTool = generationInfo.model === 'mock' ? getMockRagIndexSearchTool(prompt.ragIndex) : getRagIndexSearchTool(prompt.ragIndex)
125125
tools.push(searchTool)
126+
127+
res.locals.chatCompletionMeta.ragIndexId = prompt.ragIndex.id
128+
res.locals.chatCompletionMeta.ragIndex = prompt.ragIndex.metadata.name
126129
}
127130

128131
res.locals.chatCompletionMeta.promptId = prompt.id

0 commit comments

Comments
 (0)