mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-17 01:56:27 +08:00
feat(server): workspace doc update event from indexer (#12186)
fix AI-108 fix AI-109 fix AI-13
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
# Snapshot report for `src/__tests__/models/copilot-context.spec.ts`
|
||||
|
||||
The actual snapshot is saved in `copilot-context.spec.ts.snap`.
|
||||
|
||||
Generated by [AVA](https://avajs.dev).
|
||||
|
||||
## should insert embedding by doc id
|
||||
|
||||
> should return empty array when embedding deleted
|
||||
|
||||
[]
|
||||
BIN
Binary file not shown.
@@ -116,7 +116,7 @@ test('should insert embedding by doc id', async t => {
|
||||
}
|
||||
|
||||
{
|
||||
await t.context.copilotContext.deleteEmbedding(contextId, 'file-id');
|
||||
await t.context.copilotContext.deleteFileEmbedding(contextId, 'file-id');
|
||||
const ret = await t.context.copilotContext.matchFileEmbedding(
|
||||
Array.from({ length: 1024 }, () => 0.9),
|
||||
contextId,
|
||||
@@ -169,6 +169,20 @@ test('should insert embedding by doc id', async t => {
|
||||
t.is(ret.length, 1);
|
||||
t.is(ret[0].content, 'content');
|
||||
}
|
||||
|
||||
{
|
||||
await t.context.copilotContext.deleteWorkspaceEmbedding(
|
||||
workspace.id,
|
||||
docId
|
||||
);
|
||||
const ret = await t.context.copilotContext.matchWorkspaceEmbedding(
|
||||
Array.from({ length: 1024 }, () => 0.9),
|
||||
workspace.id,
|
||||
1,
|
||||
1
|
||||
);
|
||||
t.snapshot(ret, 'should return empty array when embedding deleted');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user