From f161cc3194949f319644909a656ea9260739f81f 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 12de57617..4ee5e3a17 100644 --- a/cognee/infrastructure/databases/vector/embeddings/LiteLLMEmbeddingEngine.py +++ b/cognee/infrastructure/databases/vector/embeddings/LiteLLMEmbeddingEngine.py @@ -114,7 +114,7 @@ class LiteLLMEmbeddingEngine(EmbeddingEngine): response = await 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, )