feat(server): global embedding gql endpoint (#11809)

fix AI-30
fix AI-31
fix PD-2487
This commit is contained in:
darkskygit
2025-04-23 11:25:40 +00:00
parent 5d9a3aac5b
commit 5397fba897
25 changed files with 665 additions and 60 deletions
@@ -104,22 +104,18 @@ test('should manage copilot workspace ignored docs', async t => {
test('should insert and search embedding', async t => {
{
await t.context.copilotWorkspace.addWorkspaceFile(
workspace.id,
const { fileId } = await t.context.copilotWorkspace.addFile(workspace.id, {
fileName: 'file1',
mimeType: 'text/plain',
size: 1,
});
await t.context.copilotWorkspace.addFileEmbeddings(workspace.id, fileId, [
{
fileName: 'file1',
mimeType: 'text/plain',
size: 1,
index: 0,
content: 'content',
embedding: Array.from({ length: 1024 }, () => 1),
},
[
{
index: 0,
content: 'content',
embedding: Array.from({ length: 1024 }, () => 1),
},
]
);
]);
{
const ret = await t.context.copilotWorkspace.matchWorkspaceFileEmbedding(