refactor(cache-qdrant-semantic): reuse immutable indexing params

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
Yujong Lee 2026-09-21 21:48:24 +00:00
parent b71e64446c
commit a4fda8f0d8

View file

@ -12,6 +12,7 @@ import ast
import asyncio
import json
import os
from types import MappingProxyType
from typing import TYPE_CHECKING, Any, Final, Protocol, cast
import litellm
@ -36,6 +37,8 @@ from ._embedding_router import (
)
from .base_cache import BaseCache
_WAIT_FOR_INDEXING: Final = MappingProxyType({"wait": "true"})
if TYPE_CHECKING:
from litellm.router import Router
@ -313,7 +316,7 @@ class QdrantSemanticCache(BaseCache):
self.sync_client.put(
url=f"{self.qdrant_api_base}/collections/{self.collection_name}/points",
headers=self.headers,
params={"wait": "true"}, # mutable-ok: Qdrant requires an explicit indexing wait
params=_WAIT_FOR_INDEXING,
json=data,
)
@ -423,7 +426,7 @@ class QdrantSemanticCache(BaseCache):
await self.async_client.put(
url=f"{self.qdrant_api_base}/collections/{self.collection_name}/points",
headers=self.headers,
params={"wait": "true"}, # mutable-ok: Qdrant requires an explicit indexing wait
params=_WAIT_FOR_INDEXING,
json=data,
)