mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-05 02:41:56 +00:00
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:
parent
b71e64446c
commit
a4fda8f0d8
1 changed files with 5 additions and 2 deletions
|
|
@ -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,
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue