From 2c79d693fd28217a42c3c8a3c78c68dd4c4c9f3b Mon Sep 17 00:00:00 2001 From: maozhen Date: Mon, 29 Dec 2025 11:15:33 +0800 Subject: [PATCH] ``` fix(embeddings): handle empty API key in LiteLLMEmbeddingEngine - Add conditional check for empty API key to prevent authentication errors- Set default API key to "EMPTY" when no valid key is provided- This ensures proper fallback behavior when API key is not configured ``` --- .../databases/vector/embeddings/LiteLLMEmbeddingEngine.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cognee/infrastructure/databases/vector/embeddings/LiteLLMEmbeddingEngine.py b/cognee/infrastructure/databases/vector/embeddings/LiteLLMEmbeddingEngine.py index 558b11538..28fa22b4f 100644 --- a/cognee/infrastructure/databases/vector/embeddings/LiteLLMEmbeddingEngine.py +++ b/cognee/infrastructure/databases/vector/embeddings/LiteLLMEmbeddingEngine.py @@ -134,7 +134,7 @@ class LiteLLMEmbeddingEngine(EmbeddingEngine): litellm.aembedding( model=self.model, input=text, - api_key=self.api_key, + api_key=self.api_key if self.api_key and self.api_key.strip() != "" else "EMPTY", api_base=self.endpoint, api_version=self.api_version, ),