Merge pull request #5452 from BerriAI/litellm_allow_qdrant_api_key_to_be_optional

[Fix-Proxy] - Allow Qdrant API Key to be optional
This commit is contained in:
Ishaan Jaff 2024-08-30 12:07:57 -07:00 committed by GitHub
commit 281b183c7c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1276,10 +1276,12 @@ class QdrantSemanticCache(BaseCache):
qdrant_api_base or os.getenv("QDRANT_URL") or os.getenv("QDRANT_API_BASE")
)
qdrant_api_key = qdrant_api_key or os.getenv("QDRANT_API_KEY")
headers = {"api-key": qdrant_api_key, "Content-Type": "application/json"}
headers = {"Content-Type": "application/json"}
if qdrant_api_key:
headers["api-key"] = qdrant_api_key
if qdrant_api_key is None or qdrant_api_base is None:
raise ValueError("Qdrant url and api_key must be")
if qdrant_api_base is None:
raise ValueError("Qdrant url must be provided")
self.qdrant_api_base = qdrant_api_base
self.qdrant_api_key = qdrant_api_key