refactor(ai): remove generic providers and hardcode gemini-embedding-2 in embedding activity

This commit is contained in:
yiling
2026-05-28 14:55:59 +08:00
parent 5425f095fd
commit a04392da41
7 changed files with 64 additions and 302 deletions
+14 -3
View File
@@ -11,10 +11,21 @@ vi.mock('@/services/s3/s3', () => ({
},
}))
vi.mock('@/services/ai/provider/gemini', () => {
const mockEmbedContent = vi.fn().mockResolvedValue({
embeddings: [
{
values: [0.1, 0.2, 0.3],
},
],
})
vi.mock('@google/genai', () => {
return {
GeminiProvider: class {
generateImageEmbedding = vi.fn().mockResolvedValue([0.1, 0.2, 0.3])
// eslint-disable-next-line @typescript-eslint/naming-convention
GoogleGenAI: class {
models = {
embedContent: mockEmbedContent,
}
},
}
})