55from collections .abc import Sequence
66from typing import Any , ClassVar , Generic , TypeVar
77
8- from semantic_kernel .utils .experimental_decorator import experimental_class
9-
108if sys .version_info >= (3 , 12 ):
119 from typing import override # pragma: no cover
1210else :
1311 from typing_extensions import override # pragma: no cover
1412
15- import chromadb
13+ from chromadb import Client , Collection , QueryResult
1614from chromadb .api import ClientAPI
1715from chromadb .config import Settings
1816
3230 VectorStoreInitializationException ,
3331 VectorStoreModelValidationError ,
3432)
33+ from semantic_kernel .utils .experimental_decorator import experimental_class
3534
3635logger = logging .getLogger (__name__ )
3736
@@ -72,7 +71,7 @@ def __init__(
7271 if persist_directory is not None :
7372 settings .is_persistent = True
7473 settings .persist_directory = persist_directory
75- client = chromadb . Client (settings )
74+ client = Client (settings )
7675 super ().__init__ (
7776 collection_name = collection_name ,
7877 data_model_type = data_model_type ,
@@ -82,7 +81,7 @@ def __init__(
8281 ** kwargs ,
8382 )
8483
85- def _get_collection (self ) -> chromadb . Collection :
84+ def _get_collection (self ) -> Collection :
8685 try :
8786 return self .client .get_collection (name = self .collection_name )
8887 except Exception as e :
@@ -200,7 +199,7 @@ async def _inner_get(self, keys: Sequence[str], **kwargs: Any) -> Sequence[Any]:
200199 return self ._unpack_results (results , include_vectors )
201200
202201 def _unpack_results (
203- self , results : chromadb . QueryResult , include_vectors : bool , include_distances : bool = False
202+ self , results : QueryResult , include_vectors : bool , include_distances : bool = False
204203 ) -> Sequence [dict [str , Any ]]:
205204 try :
206205 if isinstance (results ["ids" ][0 ], str ):
@@ -330,7 +329,7 @@ def __init__(
330329 settings .is_persistent = True
331330 settings .persist_directory = persist_directory
332331 if client is None :
333- client = chromadb . Client (settings )
332+ client = Client (settings )
334333 super ().__init__ (client = client , managed_client = managed_client , ** kwargs )
335334
336335 @override
0 commit comments