mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-02 22:14:50 +00:00
refactor(ai): remove generic providers and hardcode gemini-embedding-2 in embedding activity
This commit is contained in:
@@ -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,
|
||||
}
|
||||
},
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user