mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
fix: correct Gemini embedding model dimensions
- Fix gemini-embedding-001 dimension from 3072 to 768 in embeddingModels.ts - Update documentation comment in gemini.ts to reflect correct dimension - Update test expectations in service-factory.spec.ts This fixes the vector dimension mismatch error when using Gemini text-embedding-004 with Qdrant, where vectors with incorrect dimensions (1024 or 3072) were being sent to Qdrant which expects 768-dimensional vectors. Fixes #7348
This commit is contained in:
parent
8e4c0ae99d
commit
44302b0812
3 changed files with 6 additions and 6 deletions
|
|
@ -566,7 +566,7 @@ describe("CodeIndexServiceFactory", () => {
|
|||
qdrantApiKey: "test-key",
|
||||
}
|
||||
mockConfigManager.getConfig.mockReturnValue(testConfig as any)
|
||||
mockGetModelDimension.mockReturnValue(3072)
|
||||
mockGetModelDimension.mockReturnValue(768)
|
||||
|
||||
// Act
|
||||
factory.createVectorStore()
|
||||
|
|
@ -576,7 +576,7 @@ describe("CodeIndexServiceFactory", () => {
|
|||
expect(MockedQdrantVectorStore).toHaveBeenCalledWith(
|
||||
"/test/workspace",
|
||||
"http://localhost:6333",
|
||||
3072,
|
||||
768,
|
||||
"test-key",
|
||||
)
|
||||
})
|
||||
|
|
@ -590,7 +590,7 @@ describe("CodeIndexServiceFactory", () => {
|
|||
}
|
||||
mockConfigManager.getConfig.mockReturnValue(testConfig as any)
|
||||
mockGetDefaultModelId.mockReturnValue("gemini-embedding-001")
|
||||
mockGetModelDimension.mockReturnValue(3072)
|
||||
mockGetModelDimension.mockReturnValue(768)
|
||||
|
||||
// Act
|
||||
factory.createVectorStore()
|
||||
|
|
@ -601,7 +601,7 @@ describe("CodeIndexServiceFactory", () => {
|
|||
expect(MockedQdrantVectorStore).toHaveBeenCalledWith(
|
||||
"/test/workspace",
|
||||
"http://localhost:6333",
|
||||
3072,
|
||||
768,
|
||||
"test-key",
|
||||
)
|
||||
})
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import { TelemetryService } from "@roo-code/telemetry"
|
|||
*
|
||||
* Supported models:
|
||||
* - text-embedding-004 (dimension: 768)
|
||||
* - gemini-embedding-001 (dimension: 2048)
|
||||
* - gemini-embedding-001 (dimension: 768)
|
||||
*/
|
||||
export class GeminiEmbedder implements IEmbedder {
|
||||
private readonly openAICompatibleEmbedder: OpenAICompatibleEmbedder
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ export const EMBEDDING_MODEL_PROFILES: EmbeddingModelProfiles = {
|
|||
},
|
||||
gemini: {
|
||||
"text-embedding-004": { dimension: 768 },
|
||||
"gemini-embedding-001": { dimension: 3072, scoreThreshold: 0.4 },
|
||||
"gemini-embedding-001": { dimension: 768, scoreThreshold: 0.4 },
|
||||
},
|
||||
mistral: {
|
||||
"codestral-embed-2505": { dimension: 1536, scoreThreshold: 0.4 },
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue