Skip to content

Commit 09193dc

Browse files
committed
fix: init history db
1 parent 79ac86e commit 09193dc

File tree

4 files changed

+17
-0
lines changed

4 files changed

+17
-0
lines changed

infra/main.bicep

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,17 @@ module cosmosDb 'br/public:avm/res/document-db/database-account:0.12.0' = {
459459
]
460460
name: 'userDB'
461461
}
462+
{
463+
containers: [
464+
{
465+
name: 'history'
466+
paths: [
467+
'/id'
468+
]
469+
}
470+
]
471+
name: 'historyDB'
472+
}
462473
]
463474
sqlRoleDefinitions: [
464475
{

packages/agent-api/src/functions/chats-delete.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ async function deleteChats(request: HttpRequest, context: InvocationContext): Pr
3737
sessionId,
3838
userId,
3939
credentials,
40+
containerName: 'history',
41+
databaseName: 'historyDB',
4042
});
4143

4244
await chatHistory.clear();

packages/agent-api/src/functions/chats-get.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ async function getChats(request: HttpRequest, context: InvocationContext): Promi
3333
sessionId,
3434
userId,
3535
credentials,
36+
containerName: 'history',
37+
databaseName: 'historyDB',
3638
});
3739

3840
if (sessionId) {

packages/agent-api/src/functions/chats-post.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ export async function postChats(request: HttpRequest, context: InvocationContext
8484
sessionId,
8585
userId,
8686
credentials,
87+
containerName: 'history',
88+
databaseName: 'historyDB',
8789
});
8890

8991
const client = new Client({

0 commit comments

Comments
 (0)