Add dimensions parameter to embedding request
Fixes LiteLLMEmbeddingEngine not passing EMBEDDING_DIMENSIONS to litellm. **Changes:** - Added `dimensions=self.dimensions` parameter to the `litellm.aembedding()` call in the `embed_text()` method of `LiteLLMEmbeddingEngine.py`. **Why?** This ensures that custom embedding dimensions configured in cognee (e.g., 512 instead of default 3072) are respected by LiteLLM, preventing dimension mismatches in downstream vector databases like Qdrant or Pinecone. **Impact:** - Actual embeddings now match the configured `self.dimensions`. - Only affects production mode; mock mode remains unchanged. - Tested with OpenAI models that support the `dimensions` parameter. Fixes #1961 .
This commit is contained in:
parent
b339529621
commit
343099386c
1 changed files with 1 additions and 0 deletions
|
|
@ -117,6 +117,7 @@ class LiteLLMEmbeddingEngine(EmbeddingEngine):
|
|||
api_key=self.api_key,
|
||||
api_base=self.endpoint,
|
||||
api_version=self.api_version,
|
||||
dimensions=self.dimensions,
|
||||
)
|
||||
|
||||
return [data["embedding"] for data in response.data]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue