Skip to content

Commit 75310b8

Browse files
committed
azure openai vector store file attributes dont work, retreat
1 parent 710f606 commit 75310b8

File tree

2 files changed

+5
-39
lines changed

2 files changed

+5
-39
lines changed

src/server/routes/rag/rag.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { ApplicationError } from '../../util/ApplicationError'
77
import { getAzureOpenAIClient } from '../../util/azure/client'
88
import { TEST_COURSES } from '../../util/config'
99
import ragIndexRouter, { ragIndexMiddleware } from './ragIndex'
10-
import { getPrimaryVectorStoreId } from '../../services/azureFileSearch/vectorStore'
1110
import { randomUUID } from 'node:crypto'
1211

1312
const router = Router()
@@ -53,14 +52,17 @@ router.post('/indices', async (req, res) => {
5352
throw ApplicationError.Forbidden('Cannot create index, index already exists on the course')
5453
}
5554

56-
const vectorStoreId = await getPrimaryVectorStoreId()
55+
const client = getAzureOpenAIClient()
56+
const vectorStore = await client.vectorStores.create({
57+
name: `${name}-${user.id}-${chatInstance.id}`,
58+
})
5759

5860
const ragIndex = await RagIndex.create({
5961
userId: user.id,
6062
metadata: {
6163
name,
6264
dim,
63-
azureVectorStoreId: vectorStoreId,
65+
azureVectorStoreId: vectorStore.id,
6466
ragIndexFilterValue: randomUUID(),
6567
},
6668
})

src/server/services/azureFileSearch/vectorStore.ts

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)