index int64 0 731k | package stringlengths 2 98 ⌀ | name stringlengths 1 76 | docstring stringlengths 0 281k ⌀ | code stringlengths 4 8.19k | signature stringlengths 2 42.8k ⌀ | embed_func_code listlengths 768 768 |
|---|---|---|---|---|---|---|
730,345 | mmengine.utils.misc | parse | null | def _ntuple(n):
def parse(x):
if isinstance(x, collections.abc.Iterable):
return x
return tuple(repeat(x, n))
return parse
| (x) | [
-0.030709462240338326,
0.02374478057026863,
-0.007455451879650354,
-0.02021123096346855,
-0.012623483315110207,
0.04410964623093605,
-0.009619112126529217,
-0.014202485792338848,
0.01935771480202675,
-0.03330414742231369,
0.02852446399629116,
0.07797711342573166,
-0.034225944429636,
0.0381... |
730,350 | mmengine.utils.progressbar | track_iter_progress | Track the progress of tasks iteration or enumeration with a progress
bar.
Tasks are yielded with a simple for-loop.
Args:
tasks (Sequence): If tasks is a tuple, it must contain two elements,
the first being the tasks to be completed and the other being the
number of tasks. ... | def track_iter_progress(tasks: Sequence, bar_width: int = 50, file=sys.stdout):
"""Track the progress of tasks iteration or enumeration with a progress
bar.
Tasks are yielded with a simple for-loop.
Args:
tasks (Sequence): If tasks is a tuple, it must contain two elements,
the firs... | (tasks: Sequence, bar_width: int = 50, file=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>) | [
-0.0018335514469072223,
0.004421568010002375,
-0.1192815899848938,
0.03241736814379692,
0.05236927419900894,
0.07980762422084808,
0.0005820798105560243,
0.0003996201849076897,
-0.04133662208914757,
0.05548563972115517,
0.05344388261437416,
-0.04126498103141785,
-0.02220858447253704,
0.0051... |
730,351 | mmengine.utils.progressbar | track_parallel_progress | Track the progress of parallel task execution with a progress bar.
The built-in :mod:`multiprocessing` module is used for process pools and
tasks are done with :func:`Pool.map` or :func:`Pool.imap_unordered`.
Args:
func (callable): The function to be applied to each task.
tasks (Sequence):... | def track_parallel_progress(func: Callable,
tasks: Sequence,
nproc: int,
initializer: Callable = None,
initargs: tuple = None,
bar_width: int = 50,
chun... | (func: Callable, tasks: Sequence, nproc: int, initializer: Optional[Callable] = None, initargs: Optional[tuple] = None, bar_width: int = 50, chunksize: int = 1, skip_first: bool = False, keep_order: bool = True, file=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>) | [
-0.0016350317746400833,
-0.0017217835411429405,
-0.08235643804073334,
0.037843093276023865,
0.03803587332367897,
0.09168708324432373,
-0.007778750732541084,
-0.025524327531456947,
-0.01647321507334709,
-0.01803474873304367,
0.03608877584338188,
-0.02887873351573944,
0.008193232119083405,
-... |
730,352 | mmengine.utils.progressbar | track_progress | Track the progress of tasks execution with a progress bar.
Tasks are done with a simple for-loop.
Args:
func (callable): The function to be applied to each task.
tasks (Sequence): If tasks is a tuple, it must contain two elements,
the first being the tasks to be completed and the o... | def track_progress(func: Callable,
tasks: Sequence,
bar_width: int = 50,
file=sys.stdout,
**kwargs):
"""Track the progress of tasks execution with a progress bar.
Tasks are done with a simple for-loop.
Args:
func (callable... | (func: Callable, tasks: Sequence, bar_width: int = 50, file=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>, **kwargs) | [
-0.00887540727853775,
0.0172678604722023,
-0.10971242189407349,
0.03373383730649948,
0.041953157633543015,
0.08951950818300247,
-0.017559455707669258,
-0.017823712900280952,
-0.035009562969207764,
0.012356316670775414,
0.02888607792556286,
-0.02802952006459236,
-0.0056450869888067245,
-0.0... |
730,353 | mmengine.utils.progressbar_rich | track_progress_rich | Track the progress of parallel task execution with a progress bar. The
built-in :mod:`multiprocessing` module is used for process pools and tasks
are done with :func:`Pool.map` or :func:`Pool.imap_unordered`.
Args:
func (callable): The function to be applied to each task.
tasks (Iterable or... | def track_progress_rich(func: Callable,
tasks: Iterable = tuple(),
task_num: int = None,
nproc: int = 1,
chunksize: int = 1,
description: str = 'Processing',
color: str = 'blue... | (func: Callable, tasks: Iterable = (), task_num: Optional[int] = None, nproc: int = 1, chunksize: int = 1, description: str = 'Processing', color: str = 'blue') -> list | [
0.03420596569776535,
-0.009174220263957977,
-0.094380222260952,
0.04326741024851799,
0.04617020860314369,
0.08127839863300323,
0.007781661115586758,
-0.029322201386094093,
0.0027115680277347565,
-0.02012346312403679,
0.043110501021146774,
-0.014974917285144329,
0.014670907519757748,
-0.038... |
730,354 | mmengine.registry.utils | traverse_registry_tree | Traverse the whole registry tree from any given node, and collect
information of all registered modules in this registry tree.
Args:
registry (Registry): a registry node in the registry tree.
verbose (bool): Whether to print log. Defaults to True
Returns:
list: Statistic results of... | def traverse_registry_tree(registry: Registry, verbose: bool = True) -> list:
"""Traverse the whole registry tree from any given node, and collect
information of all registered modules in this registry tree.
Args:
registry (Registry): a registry node in the registry tree.
verbose (bool): Wh... | (registry: mmengine.registry.registry.Registry, verbose: bool = True) -> list | [
0.022627703845500946,
-0.03769466280937195,
-0.021755309775471687,
-0.00577960629016161,
0.05877750366926193,
0.049581024795770645,
-0.02553568035364151,
-0.04038454219698906,
0.022991200909018517,
0.03393246605992317,
0.047072891145944595,
-0.04274727404117584,
0.005397934000939131,
-0.01... |
730,355 | mmengine.utils.misc | tuple_cast | Cast elements of an iterable object into a tuple of some type.
A partial method of :func:`iter_cast`.
| def tuple_cast(inputs, dst_type):
"""Cast elements of an iterable object into a tuple of some type.
A partial method of :func:`iter_cast`.
"""
return iter_cast(inputs, dst_type, return_type=tuple)
| (inputs, dst_type) | [
-0.05630137026309967,
0.011954763904213905,
-0.022319093346595764,
-0.03046565130352974,
-0.04506230354309082,
-0.007899156771600246,
0.006489855237305164,
0.04880865663290024,
0.0389833077788353,
0.011230232194066048,
-0.00110391597263515,
0.00732041522860527,
0.00017505821597296745,
0.02... |
730,358 | datasette_query_history | extra_css_urls | null | @hookimpl
def extra_css_urls(database, table, columns, view_name, datasette):
return [
"/-/static-plugins/datasette_query_history/datasette-query-history.css",
]
| (database, table, columns, view_name, datasette) | [
-0.059667788445949554,
-0.06136450171470642,
-0.01793038286268711,
0.0035856347531080246,
-0.00009327234147349373,
0.03845885768532753,
-0.003709353506565094,
0.006221286021173,
0.024920491501688957,
0.03895373269915581,
0.033722199499607086,
0.02469072863459587,
-0.0015277056954801083,
-0... |
730,359 | datasette_query_history | extra_js_urls | null | @hookimpl
def extra_js_urls(database, table, columns, view_name, datasette):
return [
"/-/static-plugins/datasette_query_history/datasette-query-history.js",
]
| (database, table, columns, view_name, datasette) | [
-0.06074512377381325,
-0.04019792377948761,
0.008471685461699963,
0.02872304804623127,
-0.016674429178237915,
0.06612396985292435,
-0.023989662528038025,
0.030103620141744614,
-0.0015755542553961277,
0.0382615402340889,
0.019632795825600624,
0.021425744518637657,
-0.0036329636350274086,
-0... |
730,360 | jupytercad_freecad | _jupyter_labextension_paths | null | def _jupyter_labextension_paths():
return [{"src": "labextension", "dest": "@jupytercad/jupytercad-freecad"}]
| () | [
0.014859013259410858,
-0.04559677466750145,
0.024291573092341423,
0.015177680179476738,
-0.025948643684387207,
0.03483491763472557,
-0.0029453986790031195,
0.06905070692300797,
0.009127549827098846,
0.005526605993509293,
0.03860430046916008,
-0.018519137054681778,
-0.0012496320996433496,
0... |
730,361 | jupytercad_freecad | _jupyter_server_extension_points | null | def _jupyter_server_extension_points():
return [{"module": "jupytercad_freecad"}]
| () | [
0.03047911822795868,
-0.07205747067928314,
0.02163824811577797,
0.02412419579923153,
0.006271766033023596,
0.06225373223423958,
0.007842989638447762,
0.055040981620550156,
-0.014731865376234055,
0.013646451756358147,
0.019870074465870857,
-0.021428167819976807,
-0.03517090901732445,
-0.007... |
730,362 | jupytercad_freecad | _load_jupyter_server_extension | Registers the API handler to receive HTTP requests from the frontend extension.
Parameters
----------
server_app: jupyterlab.labapp.LabApp
JupyterLab application instance
| def _load_jupyter_server_extension(server_app):
"""Registers the API handler to receive HTTP requests from the frontend extension.
Parameters
----------
server_app: jupyterlab.labapp.LabApp
JupyterLab application instance
"""
setup_handlers(server_app.web_app)
name = "jupytercad_fre... | (server_app) | [
0.019900748506188393,
-0.05009056627750397,
-0.014234435744583607,
0.027095774188637733,
0.025063591077923775,
0.07352475076913834,
0.03577374666929245,
0.051774900406599045,
-0.022335706278681755,
-0.0003032255044672638,
0.03097706101834774,
-0.0177861787378788,
0.01248602569103241,
-0.05... |
730,365 | jupytercad_freecad.handlers | setup_handlers | null | def setup_handlers(web_app):
host_pattern = ".*$"
base_url = web_app.settings["base_url"]
route_pattern = url_path_join(base_url, "jupytercad_freecad", "backend-check")
handlers = [(route_pattern, BackendCheckHandler)]
web_app.add_handlers(host_pattern, handlers)
| (web_app) | [
-0.023357098922133446,
-0.06627979129552841,
-0.014164487831294537,
0.014593714848160744,
-0.018054356798529625,
0.05347451940178871,
0.021246733143925667,
-0.010167312808334827,
-0.07207435369491577,
0.01539851538836956,
0.020763851702213287,
0.016444755718111992,
0.06145098805427551,
-0.... |
730,366 | chromadb.api | AdminAPI | null | class AdminAPI(ABC):
@abstractmethod
def create_database(self, name: str, tenant: str = DEFAULT_TENANT) -> None:
"""Create a new database. Raises an error if the database already exists.
Args:
database: The name of the database to create.
"""
pass
@abstractmeth... | () | [
-0.013236431404948235,
-0.04465516656637192,
-0.021171173080801964,
0.0002877122606150806,
0.01955220103263855,
-0.032432813197374344,
-0.0096782511100173,
-0.006115622818470001,
-0.06013324856758118,
-0.009100046940147877,
0.04148838296532631,
0.008806496858596802,
-0.04668332636356354,
0... |
730,367 | chromadb.api | create_database | Create a new database. Raises an error if the database already exists.
Args:
database: The name of the database to create.
| @abstractmethod
def create_database(self, name: str, tenant: str = DEFAULT_TENANT) -> None:
"""Create a new database. Raises an error if the database already exists.
Args:
database: The name of the database to create.
"""
pass
| (self, name: str, tenant: str = 'default_tenant') -> NoneType | [
-0.022621596232056618,
-0.04114976152777672,
0.004450260195881128,
0.013025371357798576,
-0.023339740931987762,
-0.056051287800073624,
0.004807088989764452,
0.021221211180090904,
-0.028223134577274323,
-0.03910304233431816,
0.021975263953208923,
0.06089877337217331,
-0.019533568993210793,
... |
730,368 | chromadb.api | create_tenant | Create a new tenant. Raises an error if the tenant already exists.
Args:
tenant: The name of the tenant to create.
| @abstractmethod
def create_tenant(self, name: str) -> None:
"""Create a new tenant. Raises an error if the tenant already exists.
Args:
tenant: The name of the tenant to create.
"""
pass
| (self, name: str) -> NoneType | [
-0.021119507029652596,
-0.04298566281795502,
0.02821267582476139,
0.02933264896273613,
-0.042736779898405075,
-0.06001637876033783,
-0.006342074368149042,
-0.005133213475346565,
-0.01795513741672039,
-0.04376786947250366,
0.06239854544401169,
0.056638676673173904,
0.008057589642703533,
0.0... |
730,369 | chromadb.api | get_database | Get a database. Raises an error if the database does not exist.
Args:
database: The name of the database to get.
tenant: The tenant of the database to get.
| @abstractmethod
def get_database(self, name: str, tenant: str = DEFAULT_TENANT) -> Database:
"""Get a database. Raises an error if the database does not exist.
Args:
database: The name of the database to get.
tenant: The tenant of the database to get.
"""
pass
| (self, name: str, tenant: str = 'default_tenant') -> chromadb.types.Database | [
-0.000144711957545951,
-0.06174376979470253,
-0.004738163203001022,
0.025646036490797997,
-0.009556861594319344,
-0.04341750219464302,
0.02716725878417492,
-0.0075255814008414745,
-0.021780338138341904,
-0.0517931804060936,
0.007100533694028854,
0.0339859202504158,
-0.05293857306241989,
0.... |
730,370 | chromadb.api | get_tenant | Get a tenant. Raises an error if the tenant does not exist.
Args:
tenant: The name of the tenant to get.
| @abstractmethod
def get_tenant(self, name: str) -> Tenant:
"""Get a tenant. Raises an error if the tenant does not exist.
Args:
tenant: The name of the tenant to get.
"""
pass
| (self, name: str) -> chromadb.types.Tenant | [
0.006381310522556305,
-0.07124315947294235,
0.017935216426849365,
0.036652542650699615,
-0.035586029291152954,
-0.04753098636865616,
0.03446618840098381,
-0.038927771151065826,
-0.018841752782464027,
-0.050090622156858444,
0.0542144775390625,
0.038394514471292496,
-0.008269929327070713,
0.... |
730,371 | chromadb | AdminClient |
Creates an admin client that can be used to create tenants and databases.
| def AdminClient(settings: Settings = Settings()) -> AdminAPI:
"""
Creates an admin client that can be used to create tenants and databases.
"""
return AdminClientCreator(settings=settings)
| (settings: chromadb.config.Settings = Settings(environment='', chroma_api_impl='chromadb.api.segment.SegmentAPI', chroma_server_nofile=None, chroma_server_thread_pool_size=40, tenant_id='default', topic_namespace='default', chroma_server_host=None, chroma_server_headers=None, chroma_server_http_port=None, chroma_server... | [
-0.03230099380016327,
-0.0405709370970726,
0.04223975911736488,
-0.03968089818954468,
0.0239939633756876,
-0.01219167746603489,
-0.0018449763301759958,
0.050769299268722534,
-0.056591637432575226,
0.005562742706388235,
0.004732966888695955,
-0.0012910198420286179,
-0.045354895293712616,
-0... |
730,372 | chromadb.api.client | AdminClient | null | class AdminClient(SharedSystemClient, AdminAPI):
_server: ServerAPI
def __init__(self, settings: Settings = Settings()) -> None:
super().__init__(settings)
self._server = self._system.instance(ServerAPI)
@override
def create_database(self, name: str, tenant: str = DEFAULT_TENANT) -> No... | (settings: chromadb.config.Settings = Settings(environment='', chroma_api_impl='chromadb.api.segment.SegmentAPI', chroma_server_nofile=None, chroma_server_thread_pool_size=40, tenant_id='default', topic_namespace='default', chroma_server_host=None, chroma_server_headers=None, chroma_server_http_port=None, chroma_server... | [
0.0026894586626440287,
-0.020434480160474777,
-0.010911003686487675,
-0.005933027248829603,
0.041481636464595795,
-0.023605968803167343,
-0.01647011935710907,
0.04386025294661522,
-0.04753629490733147,
0.012595856562256813,
0.026723399758338928,
-0.007014216389507055,
-0.07402543723583221,
... |
730,373 | chromadb.api.client | __init__ | null | def __init__(self, settings: Settings = Settings()) -> None:
super().__init__(settings)
self._server = self._system.instance(ServerAPI)
| (self, settings: chromadb.config.Settings = Settings(environment='', chroma_api_impl='chromadb.api.segment.SegmentAPI', chroma_server_nofile=None, chroma_server_thread_pool_size=40, tenant_id='default', topic_namespace='default', chroma_server_host=None, chroma_server_headers=None, chroma_server_http_port=None, chroma_... | [
0.009370986372232437,
-0.03395777568221092,
-0.04440773278474808,
-0.004499542992562056,
0.00009892968228086829,
0.00794766191393137,
0.007745641749352217,
0.08712583780288696,
-0.032102860510349274,
0.0075114816427230835,
-0.006023877765983343,
0.06471995264291763,
-0.06416898965835571,
-... |
730,374 | chromadb.api.client | _get_identifier_from_settings | null | @staticmethod
def _get_identifier_from_settings(settings: Settings) -> str:
identifier = ""
api_impl = settings.chroma_api_impl
if api_impl is None:
raise ValueError("Chroma API implementation must be set in settings")
elif api_impl == "chromadb.api.segment.SegmentAPI":
if settings.is_pe... | (settings: chromadb.config.Settings) -> str | [
0.001140175387263298,
-0.04730423167347908,
-0.03895428776741028,
0.04309295490384102,
0.042584698647260666,
0.009920092299580574,
0.01704476960003376,
0.029442617669701576,
-0.03949885070323944,
-0.024396348744630814,
-0.004887438379228115,
0.07979638874530792,
-0.03786516562104225,
0.007... |
730,375 | chromadb.api.client | _populate_data_from_system | null | @staticmethod
def _populate_data_from_system(system: System) -> str:
identifier = SharedSystemClient._get_identifier_from_settings(system.settings)
SharedSystemClient._identifer_to_system[identifier] = system
return identifier
| (system: chromadb.config.System) -> str | [
0.06859630346298218,
0.019356554374098778,
-0.0402367003262043,
0.01732221059501171,
0.05038244277238846,
-0.0174693763256073,
-0.03154529631137848,
0.01487234327942133,
0.018456248566508293,
-0.015209957957267761,
-0.029917821288108826,
0.02520853467285633,
-0.06315984576940536,
-0.019893... |
730,376 | chromadb.api.client | clear_system_cache | null | @staticmethod
def clear_system_cache() -> None:
SharedSystemClient._identifer_to_system = {}
| () -> NoneType | [
0.015640610828995705,
-0.00962632056325674,
-0.038125067949295044,
0.0035083359107375145,
0.008615297265350819,
-0.03451303765177727,
-0.08890088647603989,
0.06553502380847931,
0.02943200059235096,
0.004257961641997099,
-0.02611377090215683,
-0.012659389525651932,
-0.042065463960170746,
-0... |
730,377 | chromadb.api.client | create_database | Create a new database. Raises an error if the database already exists.
Args:
database: The name of the database to create.
| @override
def create_database(self, name: str, tenant: str = DEFAULT_TENANT) -> None:
return self._server.create_database(name=name, tenant=tenant)
| (self, name: str, tenant: str = 'default_tenant') -> NoneType | [
-0.040315091609954834,
-0.030650515109300613,
0.013116210699081421,
-0.007990533486008644,
-0.004681279417127371,
-0.033256497234106064,
-0.01766373962163925,
0.03173777833580971,
-0.051981616765260696,
-0.02419595792889595,
-0.010864019393920898,
0.053741950541734695,
-0.05091160908341408,
... |
730,378 | chromadb.api.client | create_tenant | Create a new tenant. Raises an error if the tenant already exists.
Args:
tenant: The name of the tenant to create.
| @override
def create_tenant(self, name: str) -> None:
return self._server.create_tenant(name=name)
| (self, name: str) -> NoneType | [
-0.03579653054475784,
-0.005675476510077715,
0.030445855110883713,
-0.0032693822868168354,
-0.01620587892830372,
-0.02365921624004841,
-0.004564314149320126,
0.004384818486869335,
-0.023915637284517288,
-0.03849751129746437,
0.03372805938124657,
0.02875346876680851,
-0.01859915256500244,
-... |
730,379 | chromadb.api.client | get_database | Get a database. Raises an error if the database does not exist.
Args:
database: The name of the database to get.
tenant: The tenant of the database to get.
| @override
def get_database(self, name: str, tenant: str = DEFAULT_TENANT) -> Database:
return self._server.get_database(name=name, tenant=tenant)
| (self, name: str, tenant: str = 'default_tenant') -> chromadb.types.Database | [
0.002475267043337226,
-0.046609580516815186,
-0.0003798516117967665,
0.01914322003722191,
0.010126486420631409,
-0.023772966116666794,
0.006966294255107641,
0.004733785521239042,
-0.03877195715904236,
-0.03141985088586807,
-0.0428294874727726,
0.005115262698382139,
-0.09370467811822891,
-0... |
730,380 | chromadb.api.client | get_tenant | Get a tenant. Raises an error if the tenant does not exist.
Args:
tenant: The name of the tenant to get.
| @override
def get_tenant(self, name: str) -> Tenant:
return self._server.get_tenant(name=name)
| (self, name: str) -> chromadb.types.Tenant | [
0.00008566933684051037,
-0.03144744038581848,
0.020430605858564377,
0.026126617565751076,
-0.016431458294391632,
-0.017002765089273453,
0.03287997096776962,
-0.022494129836559296,
-0.026689397171139717,
-0.03492644429206848,
0.017130669206380844,
0.0034662107937037945,
-0.05300360545516014,
... |
730,381 | chromadb | Client |
Return a running chroma.API instance
tenant: The tenant to use for this client. Defaults to the default tenant.
database: The database to use for this client. Defaults to the default database.
| def Client(
settings: Settings = __settings,
tenant: str = DEFAULT_TENANT,
database: str = DEFAULT_DATABASE,
) -> ClientAPI:
"""
Return a running chroma.API instance
tenant: The tenant to use for this client. Defaults to the default tenant.
database: The database to use for this client. Def... | (settings: chromadb.config.Settings = Settings(environment='', chroma_api_impl='chromadb.api.segment.SegmentAPI', chroma_server_nofile=None, chroma_server_thread_pool_size=40, tenant_id='default', topic_namespace='default', chroma_server_host=None, chroma_server_headers=None, chroma_server_http_port=None, chroma_server... | [
-0.030516449362039566,
-0.0628029927611351,
-0.05869637429714203,
-0.0036906495224684477,
0.0007694384548813105,
0.016718553379178047,
0.0028808307833969593,
0.02101103588938713,
-0.054554350674152374,
-0.013886400498449802,
-0.002285636030137539,
0.06467929482460022,
-0.09162015467882156,
... |
730,382 | chromadb.api | ClientAPI | null | class ClientAPI(BaseAPI, ABC):
tenant: str
database: str
@abstractmethod
def set_tenant(self, tenant: str, database: str = DEFAULT_DATABASE) -> None:
"""Set the tenant and database for the client. Raises an error if the tenant or
database does not exist.
Args:
tenan... | () | [
-0.009238133206963539,
-0.04958140477538109,
-0.03975479677319527,
0.009891994297504425,
-0.006744117010384798,
-0.048722043633461,
-0.03362717851996422,
0.040913064032793045,
0.004950667731463909,
-0.017822403460741043,
0.02807869203388691,
0.01315196231007576,
-0.038054756820201874,
0.02... |
730,383 | chromadb.api | _add | [Internal] Add embeddings to a collection specified by UUID.
If (some) ids already exist, only the new embeddings will be added.
Args:
ids: The ids to associate with the embeddings.
collection_id: The UUID of the collection to add the embeddings to.
embedding: The se... | @abstractmethod
def _add(
self,
ids: IDs,
collection_id: UUID,
embeddings: Embeddings,
metadatas: Optional[Metadatas] = None,
documents: Optional[Documents] = None,
uris: Optional[URIs] = None,
) -> bool:
"""[Internal] Add embeddings to a collection specified by UUID.
If (some) ids a... | (self, ids: List[str], collection_id: uuid.UUID, embeddings: List[Union[Sequence[float], Sequence[int]]], metadatas: Optional[List[Mapping[str, Union[str, int, float, bool]]]] = None, documents: Optional[List[str]] = None, uris: Optional[List[str]] = None) -> bool | [
-0.06310771405696869,
-0.039059825241565704,
-0.05032777413725853,
0.03769183158874512,
-0.017522921785712242,
0.026225881651043892,
-0.016676925122737885,
0.0003650608705356717,
0.008342962712049484,
0.03383984789252281,
-0.0514797680079937,
0.010205954313278198,
0.010718951933085918,
0.0... |
730,384 | chromadb.api | _count | [Internal] Returns the number of entries in a collection specified by UUID.
Args:
collection_id: The UUID of the collection to count the embeddings in.
Returns:
int: The number of embeddings in the collection
| @abstractmethod
def _count(self, collection_id: UUID) -> int:
"""[Internal] Returns the number of entries in a collection specified by UUID.
Args:
collection_id: The UUID of the collection to count the embeddings in.
Returns:
int: The number of embeddings in the collection
"""
pass
| (self, collection_id: uuid.UUID) -> int | [
-0.0610281303524971,
-0.10356950759887695,
-0.06474003940820694,
0.07904180139303207,
0.008442770689725876,
0.026583809405565262,
0.009147850796580315,
-0.012000015936791897,
0.03480823338031769,
0.0062820399180054665,
-0.02472785674035549,
0.015156956389546394,
0.005081128794699907,
0.033... |
730,385 | chromadb.api | _delete | [Internal] Deletes entries from a collection specified by UUID.
Args:
collection_id: The UUID of the collection to delete the entries from.
ids: The IDs of the entries to delete. Defaults to None.
where: Conditional filtering on metadata. Defaults to {}.
where_do... | @abstractmethod
def _delete(
self,
collection_id: UUID,
ids: Optional[IDs],
where: Optional[Where] = {},
where_document: Optional[WhereDocument] = {},
) -> IDs:
"""[Internal] Deletes entries from a collection specified by UUID.
Args:
collection_id: The UUID of the collection to delet... | (self, collection_id: uuid.UUID, ids: Optional[List[str]], where: Optional[Dict[Union[str, Literal['$and'], Literal['$or']], Union[str, int, float, bool, Dict[Union[Literal['$gt'], Literal['$gte'], Literal['$lt'], Literal['$lte'], Literal['$ne'], Literal['$eq'], Literal['$and'], Literal['$or']], Union[str, int, float, ... | [
-0.04641338810324669,
-0.054496411234140396,
-0.03979335352778435,
-0.01623919978737831,
-0.04260960966348648,
-0.026150962337851524,
-0.010167786851525307,
0.041219767183065414,
0.013660677708685398,
0.0055136471055448055,
-0.030649660155177116,
0.0088922418653965,
0.02971700206398964,
0.... |
730,386 | chromadb.api | _get | [Internal] Returns entries from a collection specified by UUID.
Args:
ids: The IDs of the entries to get. Defaults to None.
where: Conditional filtering on metadata. Defaults to {}.
sort: The column to sort the entries by. Defaults to None.
limit: The maximum num... | @abstractmethod
def _get(
self,
collection_id: UUID,
ids: Optional[IDs] = None,
where: Optional[Where] = {},
sort: Optional[str] = None,
limit: Optional[int] = None,
offset: Optional[int] = None,
page: Optional[int] = None,
page_size: Optional[int] = None,
where_document: Optiona... | (self, collection_id: uuid.UUID, ids: Optional[List[str]] = None, where: Optional[Dict[Union[str, Literal['$and'], Literal['$or']], Union[str, int, float, bool, Dict[Union[Literal['$gt'], Literal['$gte'], Literal['$lt'], Literal['$lte'], Literal['$ne'], Literal['$eq'], Literal['$and'], Literal['$or']], Union[str, int, ... | [
-0.039598628878593445,
-0.09455543756484985,
-0.07445532828569412,
0.016844457015395164,
-0.005533722694963217,
0.026982979848980904,
0.03984634205698967,
-0.04186343029141426,
0.0026540635153651237,
-0.035228271037340164,
-0.013385327532887459,
0.010784344747662544,
-0.009280375204980373,
... |
730,387 | chromadb.api | _modify | [Internal] Modify a collection by UUID. Can update the name and/or metadata.
Args:
id: The internal UUID of the collection to modify.
new_name: The new name of the collection.
If None, the existing name will remain. Defaults to None.
new_metad... | def _modify(
self,
id: UUID,
new_name: Optional[str] = None,
new_metadata: Optional[CollectionMetadata] = None,
) -> None:
"""[Internal] Modify a collection by UUID. Can update the name and/or metadata.
Args:
id: The internal UUID of the collection to modify.
new_name: The new na... | (self, id: uuid.UUID, new_name: Optional[str] = None, new_metadata: Optional[Dict[str, Any]] = None) -> NoneType | [
-0.005302571225911379,
-0.023355336859822273,
-0.03150653839111328,
0.0027392327319830656,
0.0013159899972379208,
-0.02723359316587448,
0.030459754168987274,
0.03365159034729004,
0.053060032427310944,
0.012020877562463284,
-0.06980860978364944,
0.015186975710093975,
0.0299106203019619,
0.0... |
730,388 | chromadb.api | _peek | [Internal] Returns the first n entries in a collection specified by UUID.
Args:
collection_id: The UUID of the collection to peek into.
n: The number of entries to peek. Defaults to 10.
Returns:
GetResult: The first n entries in the collection.
| @abstractmethod
def _peek(self, collection_id: UUID, n: int = 10) -> GetResult:
"""[Internal] Returns the first n entries in a collection specified by UUID.
Args:
collection_id: The UUID of the collection to peek into.
n: The number of entries to peek. Defaults to 10.
Returns:
GetRes... | (self, collection_id: uuid.UUID, n: int = 10) -> chromadb.api.types.GetResult | [
-0.04130572825670242,
-0.06734393537044525,
-0.08913914114236832,
-0.0010278834961354733,
0.009673664346337318,
0.0259294081479311,
0.051750022917985916,
-0.07325511425733566,
0.024678269401192665,
-0.06255696713924408,
0.0060426401905715466,
0.03040812537074089,
-0.015285658650100231,
0.0... |
730,389 | chromadb.api | _query | [Internal] Performs a nearest neighbors query on a collection specified by UUID.
Args:
collection_id: The UUID of the collection to query.
query_embeddings: The embeddings to use as the query.
n_results: The number of results to return. Defaults to 10.
where: Con... | @abstractmethod
def _query(
self,
collection_id: UUID,
query_embeddings: Embeddings,
n_results: int = 10,
where: Where = {},
where_document: WhereDocument = {},
include: Include = ["embeddings", "metadatas", "documents", "distances"],
) -> QueryResult:
"""[Internal] Performs a nearest ne... | (self, collection_id: uuid.UUID, query_embeddings: List[Union[Sequence[float], Sequence[int]]], n_results: int = 10, where: Dict[Union[str, Literal['$and'], Literal['$or']], Union[str, int, float, bool, Dict[Union[Literal['$gt'], Literal['$gte'], Literal['$lt'], Literal['$lte'], Literal['$ne'], Literal['$eq'], Literal[... | [
-0.05217684432864189,
-0.09463971853256226,
-0.08935417979955673,
0.01383882761001587,
-0.041605763137340546,
0.04089150205254555,
0.0023682250175625086,
-0.04221288859844208,
-0.02221355028450489,
0.007852418348193169,
-0.019106509163975716,
0.003589166793972254,
-0.0027164279017597437,
0... |
730,390 | chromadb.api | _update | [Internal] Update entries in a collection specified by UUID.
Args:
collection_id: The UUID of the collection to update the embeddings in.
ids: The IDs of the entries to update.
embeddings: The sequence of embeddings to update. Defaults to None.
metadatas: The met... | @abstractmethod
def _update(
self,
collection_id: UUID,
ids: IDs,
embeddings: Optional[Embeddings] = None,
metadatas: Optional[Metadatas] = None,
documents: Optional[Documents] = None,
uris: Optional[URIs] = None,
) -> bool:
"""[Internal] Update entries in a collection specified by UUID.... | (self, collection_id: uuid.UUID, ids: List[str], embeddings: Optional[List[Union[Sequence[float], Sequence[int]]]] = None, metadatas: Optional[List[Mapping[str, Union[str, int, float, bool]]]] = None, documents: Optional[List[str]] = None, uris: Optional[List[str]] = None) -> bool | [
-0.024270901456475258,
-0.05573716014623642,
-0.09149914979934692,
0.028888816013932228,
-0.024915261194109917,
-0.02733161300420761,
-0.011974360793828964,
-0.021693460643291473,
0.02738530933856964,
0.04310053959488869,
-0.08033023774623871,
-0.0274927020072937,
0.0238950252532959,
0.090... |
730,391 | chromadb.api | _upsert | [Internal] Add or update entries in the a collection specified by UUID.
If an entry with the same id already exists, it will be updated,
otherwise it will be added.
Args:
collection_id: The collection to add the embeddings to
ids: The ids to associate with the embeddings... | @abstractmethod
def _upsert(
self,
collection_id: UUID,
ids: IDs,
embeddings: Embeddings,
metadatas: Optional[Metadatas] = None,
documents: Optional[Documents] = None,
uris: Optional[URIs] = None,
) -> bool:
"""[Internal] Add or update entries in the a collection specified by UUID.
I... | (self, collection_id: uuid.UUID, ids: List[str], embeddings: List[Union[Sequence[float], Sequence[int]]], metadatas: Optional[List[Mapping[str, Union[str, int, float, bool]]]] = None, documents: Optional[List[str]] = None, uris: Optional[List[str]] = None) -> bool | [
-0.046489693224430084,
-0.06944578140974045,
-0.08677113056182861,
0.04699501395225525,
-0.010530564934015274,
-0.005739022511988878,
-0.014203178696334362,
-0.031077347695827484,
0.01627861149609089,
0.01638689450919628,
-0.0630931556224823,
-0.030788592994213104,
-0.002328094094991684,
0... |
730,392 | chromadb.api | clear_system_cache | Clear the system cache so that new systems can be created for an existing path.
This should only be used for testing purposes. | @staticmethod
@abstractmethod
def clear_system_cache() -> None:
"""Clear the system cache so that new systems can be created for an existing path.
This should only be used for testing purposes."""
pass
| () -> NoneType | [
0.023560691624879837,
-0.03974134474992752,
-0.006894967053085566,
0.006405563093721867,
-0.004017011262476444,
-0.06115385517477989,
-0.052907612174749374,
0.054570719599723816,
0.008432475849986076,
0.0011358072515577078,
0.04407235234975815,
0.004764110315591097,
0.010281817056238651,
0... |
730,393 | chromadb.api | count_collections | Count the number of collections.
Returns:
int: The number of collections.
Examples:
```python
client.count_collections()
# 1
```
| @abstractmethod
def count_collections(self) -> int:
"""Count the number of collections.
Returns:
int: The number of collections.
Examples:
```python
client.count_collections()
# 1
```
"""
pass
| (self) -> int | [
-0.05770859494805336,
-0.09633757919073105,
-0.042350951582193375,
0.03461793065071106,
0.006829633377492428,
0.005221597850322723,
-0.02135615423321724,
-0.02648741379380226,
0.029848026111721992,
-0.011843451298773289,
0.021247748285531998,
0.02061537466943264,
0.014960148371756077,
0.02... |
730,394 | chromadb.api | create_collection | Create a new collection with the given name and metadata.
Args:
name: The name of the collection to create.
metadata: Optional metadata to associate with the collection.
embedding_function: Optional function to use to embed documents.
Uses the ... | @abstractmethod
def create_collection(
self,
name: str,
metadata: Optional[CollectionMetadata] = None,
embedding_function: Optional[
EmbeddingFunction[Embeddable]
] = ef.DefaultEmbeddingFunction(), # type: ignore
data_loader: Optional[DataLoader[Loadable]] = None,
get_or_create: boo... | (self, name: str, metadata: Optional[Dict[str, Any]] = None, embedding_function: Optional[chromadb.api.types.EmbeddingFunction[Union[List[str], List[numpy.ndarray[Any, numpy.dtype[Union[numpy.uint64, numpy.int64, numpy.float64]]]]]]] = <chromadb.utils.embedding_functions.ONNXMiniLM_L6_V2 object at 0x7fd509816bf0>, data... | [
-0.0501914918422699,
-0.029018091037869453,
-0.06544505804777145,
0.02284402959048748,
-0.012647747993469238,
0.013846241869032383,
-0.00599701190367341,
-0.03660855442285538,
0.05538496747612953,
-0.011013437062501907,
0.007862849161028862,
0.05062730982899666,
-0.008630067110061646,
-0.0... |
730,395 | chromadb.api | delete_collection | Delete a collection with the given name.
Args:
name: The name of the collection to delete.
Raises:
ValueError: If the collection does not exist.
Examples:
```python
client.delete_collection("my_collection")
```
| @abstractmethod
def delete_collection(
self,
name: str,
) -> None:
"""Delete a collection with the given name.
Args:
name: The name of the collection to delete.
Raises:
ValueError: If the collection does not exist.
Examples:
```python
client.delete_collection("my_... | (self, name: str) -> NoneType | [
-0.06612186878919601,
-0.02658183127641678,
-0.04734998196363449,
-0.0013822814216837287,
-0.04878589138388634,
-0.0354074202477932,
-0.019052064046263695,
0.025356054306030273,
0.061849161982536316,
0.021713748574256897,
0.014744335785508156,
0.016793133690953255,
0.017143353819847107,
0.... |
730,396 | chromadb.api | get_collection | Get a collection with the given name.
Args:
id: The UUID of the collection to get. Id and Name are simultaneously used for lookup if provided.
name: The name of the collection to get
embedding_function: Optional function to use to embed documents.
... | @abstractmethod
def get_collection(
self,
name: str,
id: Optional[UUID] = None,
embedding_function: Optional[
EmbeddingFunction[Embeddable]
] = ef.DefaultEmbeddingFunction(), # type: ignore
data_loader: Optional[DataLoader[Loadable]] = None,
) -> Collection:
"""Get a collection with... | (self, name: str, id: Optional[uuid.UUID] = None, embedding_function: Optional[chromadb.api.types.EmbeddingFunction[Union[List[str], List[numpy.ndarray[Any, numpy.dtype[Union[numpy.uint64, numpy.int64, numpy.float64]]]]]]] = <chromadb.utils.embedding_functions.ONNXMiniLM_L6_V2 object at 0x7fd508c09e10>, data_loader: Op... | [
-0.03482617810368538,
-0.053119804710149765,
-0.0734979659318924,
0.03613799810409546,
-0.002288949443027377,
0.01407962292432785,
0.031986892223358154,
-0.04913042485713959,
0.054162073880434036,
-0.0003462064196355641,
-0.01053051557391882,
0.008082080632448196,
-0.025248078629374504,
0.... |
730,397 | chromadb.api | get_or_create_collection | Get or create a collection with the given name and metadata.
Args:
name: The name of the collection to get or create
metadata: Optional metadata to associate with the collection. If
the collection alredy exists, the metadata will be updated if
provided and not Non... | @abstractmethod
def get_or_create_collection(
self,
name: str,
metadata: Optional[CollectionMetadata] = None,
embedding_function: Optional[
EmbeddingFunction[Embeddable]
] = ef.DefaultEmbeddingFunction(), # type: ignore
data_loader: Optional[DataLoader[Loadable]] = None,
) -> Collection... | (self, name: str, metadata: Optional[Dict[str, Any]] = None, embedding_function: Optional[chromadb.api.types.EmbeddingFunction[Union[List[str], List[numpy.ndarray[Any, numpy.dtype[Union[numpy.uint64, numpy.int64, numpy.float64]]]]]]] = <chromadb.utils.embedding_functions.ONNXMiniLM_L6_V2 object at 0x7fd508c095a0>, data... | [
-0.04397758096456528,
-0.030773485079407692,
-0.07363268733024597,
0.025524314492940903,
0.0010670832125470042,
0.008148840628564358,
0.013646038249135017,
-0.03943191096186638,
0.07482322305440903,
-0.01713646575808525,
0.009623478166759014,
0.037880606949329376,
-0.024261627346277237,
-0... |
730,398 | chromadb.api | get_settings | Get the settings used to initialize.
Returns:
Settings: The settings used to initialize.
| @abstractmethod
def get_settings(self) -> Settings:
"""Get the settings used to initialize.
Returns:
Settings: The settings used to initialize.
"""
pass
| (self) -> chromadb.config.Settings | [
-0.017115868628025055,
-0.06664775311946869,
-0.014436786063015461,
0.010689630173146725,
-0.014864015392959118,
-0.009363439865410328,
-0.005184604320675135,
0.013048291206359863,
0.015077630057930946,
-0.024779291823506355,
0.010938847437500954,
0.03061809204518795,
-0.0074943117797374725,... |
730,399 | chromadb.api | get_version | Get the version of Chroma.
Returns:
str: The version of Chroma
| @abstractmethod
def get_version(self) -> str:
"""Get the version of Chroma.
Returns:
str: The version of Chroma
"""
pass
| (self) -> str | [
0.012714169919490814,
-0.09212180972099304,
-0.05175141245126724,
0.03636198863387108,
0.016015738248825073,
-0.07165029644966125,
-0.019200991839170456,
0.01357311476022005,
0.015219424851238728,
-0.01214154064655304,
0.05089246854186058,
0.01529995072633028,
0.02208203449845314,
0.077591... |
730,400 | chromadb.api | heartbeat | Get the current time in nanoseconds since epoch.
Used to check if the server is alive.
Returns:
int: The current time in nanoseconds since epoch
| @abstractmethod
def heartbeat(self) -> int:
"""Get the current time in nanoseconds since epoch.
Used to check if the server is alive.
Returns:
int: The current time in nanoseconds since epoch
"""
pass
| (self) -> int | [
-0.0043055410496890545,
-0.07310853898525238,
-0.02257816679775715,
0.0497729554772377,
0.0067040203139185905,
-0.04908767715096474,
-0.022181425243616104,
0.05615687742829323,
-0.043497234582901,
-0.05456991493701935,
0.002995844930410385,
-0.009485715068876743,
0.024814343079924583,
0.02... |
730,401 | chromadb.api | list_collections | List all collections.
Args:
limit: The maximum number of entries to return. Defaults to None.
offset: The number of entries to skip before returning. Defaults to None.
Returns:
Sequence[Collection]: A list of collections
Examples:
```python
... | @abstractmethod
def list_collections(
self,
limit: Optional[int] = None,
offset: Optional[int] = None,
) -> Sequence[Collection]:
"""List all collections.
Args:
limit: The maximum number of entries to return. Defaults to None.
offset: The number of entries to skip before returning. D... | (self, limit: Optional[int] = None, offset: Optional[int] = None) -> Sequence[chromadb.api.models.Collection.Collection] | [
-0.05469365045428276,
-0.06088736653327942,
-0.06393173336982727,
-0.0002408484579063952,
-0.014207052066922188,
0.06372177600860596,
-0.0032871305011212826,
-0.05630331486463547,
0.05427373945713043,
-0.007282863836735487,
-0.010751519352197647,
0.018738610669970512,
0.0007971783052198589,
... |
730,402 | chromadb.api | reset | Resets the database. This will delete all collections and entries.
Returns:
bool: True if the database was reset successfully.
| @abstractmethod
def reset(self) -> bool:
"""Resets the database. This will delete all collections and entries.
Returns:
bool: True if the database was reset successfully.
"""
pass
| (self) -> bool | [
-0.042529936879873276,
-0.008030460216104984,
-0.0019461243646219373,
-0.010390836745500565,
-0.01941809244453907,
-0.06017019599676132,
-0.05910004302859306,
0.007085446268320084,
0.050297174602746964,
0.013195673003792763,
-0.05326598510146141,
-0.01650969311594963,
0.006058444734662771,
... |
730,403 | chromadb.api | set_database | Set the database for the client. Raises an error if the database does not exist.
Args:
database: The database to set.
| @abstractmethod
def set_database(self, database: str) -> None:
"""Set the database for the client. Raises an error if the database does not exist.
Args:
database: The database to set.
"""
pass
| (self, database: str) -> NoneType | [
-0.016980355605483055,
-0.036759957671165466,
-0.007209388539195061,
0.022393997758626938,
-0.009709347039461136,
-0.06063280627131462,
0.0034220388624817133,
0.03693601116538048,
0.013080771081149578,
-0.03665432706475258,
-0.0008302020141854882,
0.029612189158797264,
-0.022534841671586037,... |
730,404 | chromadb.api | set_tenant | Set the tenant and database for the client. Raises an error if the tenant or
database does not exist.
Args:
tenant: The tenant to set.
database: The database to set.
| @abstractmethod
def set_tenant(self, tenant: str, database: str = DEFAULT_DATABASE) -> None:
"""Set the tenant and database for the client. Raises an error if the tenant or
database does not exist.
Args:
tenant: The tenant to set.
database: The database to set.
"""
pass
| (self, tenant: str, database: str = 'default_database') -> NoneType | [
-0.011083163321018219,
-0.042824503034353256,
0.02285025641322136,
0.044788606464862823,
-0.029216060414910316,
-0.055030010640621185,
-0.00350075401365757,
0.004066310822963715,
-0.013669819571077824,
-0.03312673419713974,
0.014853543601930141,
0.039492540061473846,
-0.03235512226819992,
... |
730,405 | chromadb.api.client | Client | A client for Chroma. This is the main entrypoint for interacting with Chroma.
A client internally stores its tenant and database and proxies calls to a
Server API instance of Chroma. It treats the Server API and corresponding System
as a singleton, so multiple clients connecting to the same resource will sh... | class Client(SharedSystemClient, ClientAPI):
"""A client for Chroma. This is the main entrypoint for interacting with Chroma.
A client internally stores its tenant and database and proxies calls to a
Server API instance of Chroma. It treats the Server API and corresponding System
as a singleton, so mult... | (tenant: str = 'default_tenant', database: str = 'default_database', settings: chromadb.config.Settings = Settings(environment='', chroma_api_impl='chromadb.api.segment.SegmentAPI', chroma_server_nofile=None, chroma_server_thread_pool_size=40, tenant_id='default', topic_namespace='default', chroma_server_host=None, chr... | [
-0.011160735040903091,
-0.07481394708156586,
-0.12034551054239273,
0.030657637864351273,
0.03738581761717796,
-0.01815338432788849,
-0.01663002371788025,
-0.024416090920567513,
0.019655587151646614,
0.006283863913267851,
-0.05280984565615654,
-0.004741990007460117,
-0.031186582520604134,
0... |
730,406 | chromadb.api.client | __init__ | null | def __init__(
self,
tenant: str = DEFAULT_TENANT,
database: str = DEFAULT_DATABASE,
settings: Settings = Settings(),
) -> None:
super().__init__(settings=settings)
self.tenant = tenant
self.database = database
# Create an admin client for verifying that databases and tenants exist
se... | (self, tenant: str = 'default_tenant', database: str = 'default_database', settings: chromadb.config.Settings = Settings(environment='', chroma_api_impl='chromadb.api.segment.SegmentAPI', chroma_server_nofile=None, chroma_server_thread_pool_size=40, tenant_id='default', topic_namespace='default', chroma_server_host=Non... | [
-0.010030344128608704,
-0.013609201647341251,
-0.0001230977795785293,
0.025519639253616333,
0.01308430265635252,
-0.02338186837732792,
0.00954362004995346,
0.026397651061415672,
-0.0591704435646534,
0.006022023968398571,
-0.029757006093859673,
0.057490766048431396,
-0.09535984694957733,
-0... |
730,407 | chromadb.api.client | _add | [Internal] Add embeddings to a collection specified by UUID.
If (some) ids already exist, only the new embeddings will be added.
Args:
ids: The ids to associate with the embeddings.
collection_id: The UUID of the collection to add the embeddings to.
embedding: The se... | @override
def _add(
self,
ids: IDs,
collection_id: UUID,
embeddings: Embeddings,
metadatas: Optional[Metadatas] = None,
documents: Optional[Documents] = None,
uris: Optional[URIs] = None,
) -> bool:
return self._server._add(
ids=ids,
collection_id=collection_id,
e... | (self, ids: List[str], collection_id: uuid.UUID, embeddings: List[Union[Sequence[float], Sequence[int]]], metadatas: Optional[List[Mapping[str, Union[str, int, float, bool]]]] = None, documents: Optional[List[str]] = None, uris: Optional[List[str]] = None) -> bool | [
-0.06996843963861465,
-0.03683305159211159,
-0.06386549770832062,
0.042900096625089645,
-0.005488160531967878,
0.026332400739192963,
-0.025488760322332382,
0.019906362518668175,
0.010042930021882057,
0.027445290237665176,
-0.046920858323574066,
0.0096480343490839,
-0.0035787473898380995,
0... |
730,408 | chromadb.api.client | _count | [Internal] Returns the number of entries in a collection specified by UUID.
Args:
collection_id: The UUID of the collection to count the embeddings in.
Returns:
int: The number of embeddings in the collection
| @override
def _count(self, collection_id: UUID) -> int:
return self._server._count(
collection_id=collection_id,
)
| (self, collection_id: uuid.UUID) -> int | [
-0.08411458134651184,
-0.1006418913602829,
-0.03758954629302025,
0.07941169291734695,
0.0365481898188591,
0.049044445157051086,
-0.00969131663441658,
-0.010791458189487457,
0.04548368602991104,
-0.01874438486993313,
-0.045181356370449066,
0.0033109199721366167,
-0.018358075991272926,
-0.01... |
730,409 | chromadb.api.client | _delete | null | def _delete(
self,
collection_id: UUID,
ids: Optional[IDs],
where: Optional[Where] = {},
where_document: Optional[WhereDocument] = {},
) -> IDs:
return self._server._delete(
collection_id=collection_id,
ids=ids,
where=where,
where_document=where_document,
)
| (self, collection_id: uuid.UUID, ids: Optional[List[str]], where: Optional[Dict[Union[str, Literal['$and'], Literal['$or']], Union[str, int, float, bool, Dict[Union[Literal['$gt'], Literal['$gte'], Literal['$lt'], Literal['$lte'], Literal['$ne'], Literal['$eq'], Literal['$and'], Literal['$or']], Union[str, int, float, ... | [
-0.04654192551970482,
-0.06417962163686752,
-0.015432985499501228,
-0.007244054228067398,
-0.0328277125954628,
-0.012553361244499683,
-0.035959307104349136,
0.07227856665849686,
-0.010159673169255257,
0.03619327396154404,
-0.030218055471777916,
0.0057952431961894035,
0.02282102033495903,
-... |
730,410 | chromadb.api.client | _get | [Internal] Returns entries from a collection specified by UUID.
Args:
ids: The IDs of the entries to get. Defaults to None.
where: Conditional filtering on metadata. Defaults to {}.
sort: The column to sort the entries by. Defaults to None.
limit: The maximum num... | @override
def _get(
self,
collection_id: UUID,
ids: Optional[IDs] = None,
where: Optional[Where] = {},
sort: Optional[str] = None,
limit: Optional[int] = None,
offset: Optional[int] = None,
page: Optional[int] = None,
page_size: Optional[int] = None,
where_document: Optional[Wher... | (self, collection_id: uuid.UUID, ids: Optional[List[str]] = None, where: Optional[Dict[Union[str, Literal['$and'], Literal['$or']], Union[str, int, float, bool, Dict[Union[Literal['$gt'], Literal['$gte'], Literal['$lt'], Literal['$lte'], Literal['$ne'], Literal['$eq'], Literal['$and'], Literal['$or']], Union[str, int, ... | [
-0.049793872982263565,
-0.09896575659513474,
-0.07926935702562332,
0.03291371464729309,
0.000021630672563333064,
0.04391951113939285,
0.007325677666813135,
-0.03379487246274948,
0.024378610774874687,
-0.01018511038273573,
-0.024205835536122322,
-0.039461903274059296,
-0.04194987192749977,
... |
730,412 | chromadb.api.client | _modify | [Internal] Modify a collection by UUID. Can update the name and/or metadata.
Args:
id: The internal UUID of the collection to modify.
new_name: The new name of the collection.
If None, the existing name will remain. Defaults to None.
new_metad... | @override
def _modify(
self,
id: UUID,
new_name: Optional[str] = None,
new_metadata: Optional[CollectionMetadata] = None,
) -> None:
return self._server._modify(
id=id,
new_name=new_name,
new_metadata=new_metadata,
)
| (self, id: uuid.UUID, new_name: Optional[str] = None, new_metadata: Optional[Dict[str, Any]] = None) -> NoneType | [
-0.004071672912687063,
-0.025939641520380974,
-0.058308910578489304,
0.0053197527304291725,
-0.003357269801199436,
-0.04463319107890129,
0.00634458102285862,
0.03650260344147682,
0.06892289966344833,
0.0039122081361711025,
-0.072596974670887,
-0.026160765439271927,
0.011940740048885345,
0.... |
730,413 | chromadb.api.client | _peek | [Internal] Returns the first n entries in a collection specified by UUID.
Args:
collection_id: The UUID of the collection to peek into.
n: The number of entries to peek. Defaults to 10.
Returns:
GetResult: The first n entries in the collection.
| @override
def _peek(self, collection_id: UUID, n: int = 10) -> GetResult:
return self._server._peek(
collection_id=collection_id,
n=n,
)
| (self, collection_id: uuid.UUID, n: int = 10) -> chromadb.api.types.GetResult | [
-0.028238877654075623,
-0.05968045815825462,
-0.1114402562379837,
-0.002103925682604313,
0.017089687287807465,
0.053688306361436844,
0.021867912262678146,
-0.07314558327198029,
0.0439080111682415,
-0.06050696223974228,
-0.024192454293370247,
-0.021368565037846565,
-0.04397688806056976,
0.0... |
730,415 | chromadb.api.client | _query | [Internal] Performs a nearest neighbors query on a collection specified by UUID.
Args:
collection_id: The UUID of the collection to query.
query_embeddings: The embeddings to use as the query.
n_results: The number of results to return. Defaults to 10.
where: Con... | @override
def _query(
self,
collection_id: UUID,
query_embeddings: Embeddings,
n_results: int = 10,
where: Where = {},
where_document: WhereDocument = {},
include: Include = ["embeddings", "metadatas", "documents", "distances"],
) -> QueryResult:
return self._server._query(
colle... | (self, collection_id: uuid.UUID, query_embeddings: List[Union[Sequence[float], Sequence[int]]], n_results: int = 10, where: Dict[Union[str, Literal['$and'], Literal['$or']], Union[str, int, float, bool, Dict[Union[Literal['$gt'], Literal['$gte'], Literal['$lt'], Literal['$lte'], Literal['$ne'], Literal['$eq'], Literal[... | [
-0.04606335237622261,
-0.08705104142427444,
-0.08399174362421036,
0.03577297180891037,
-0.007092018146067858,
0.058265794068574905,
-0.020824111998081207,
-0.0423087552189827,
0.023240264505147934,
0.04453369975090027,
-0.013566960580646992,
-0.004065308254212141,
-0.024074619635939598,
0.... |
730,416 | chromadb.api.client | _update | [Internal] Update entries in a collection specified by UUID.
Args:
collection_id: The UUID of the collection to update the embeddings in.
ids: The IDs of the entries to update.
embeddings: The sequence of embeddings to update. Defaults to None.
metadatas: The met... | @override
def _update(
self,
collection_id: UUID,
ids: IDs,
embeddings: Optional[Embeddings] = None,
metadatas: Optional[Metadatas] = None,
documents: Optional[Documents] = None,
uris: Optional[URIs] = None,
) -> bool:
return self._server._update(
collection_id=collection_id,
... | (self, collection_id: uuid.UUID, ids: List[str], embeddings: Optional[List[Union[Sequence[float], Sequence[int]]]] = None, metadatas: Optional[List[Mapping[str, Union[str, int, float, bool]]]] = None, documents: Optional[List[str]] = None, uris: Optional[List[str]] = None) -> bool | [
-0.024287868291139603,
-0.05876796692609787,
-0.0912240743637085,
0.030829688534140587,
-0.005701504647731781,
-0.008114026859402657,
-0.020854314789175987,
-0.008376061916351318,
0.03914250060915947,
0.0513225793838501,
-0.07821271568536758,
-0.048431165516376495,
0.004610448144376278,
0.... |
730,417 | chromadb.api.client | _upsert | [Internal] Add or update entries in the a collection specified by UUID.
If an entry with the same id already exists, it will be updated,
otherwise it will be added.
Args:
collection_id: The collection to add the embeddings to
ids: The ids to associate with the embeddings... | @override
def _upsert(
self,
collection_id: UUID,
ids: IDs,
embeddings: Embeddings,
metadatas: Optional[Metadatas] = None,
documents: Optional[Documents] = None,
uris: Optional[URIs] = None,
) -> bool:
return self._server._upsert(
collection_id=collection_id,
ids=ids,
... | (self, collection_id: uuid.UUID, ids: List[str], embeddings: List[Union[Sequence[float], Sequence[int]]], metadatas: Optional[List[Mapping[str, Union[str, int, float, bool]]]] = None, documents: Optional[List[str]] = None, uris: Optional[List[str]] = None) -> bool | [
-0.03557118400931358,
-0.07454681396484375,
-0.07917966693639755,
0.045521289110183716,
0.0042862663976848125,
0.006822051014751196,
-0.02211134321987629,
-0.035465892404317856,
0.025603530928492546,
0.036080095916986465,
-0.05994630604982376,
-0.03772967308759689,
-0.004187555052340031,
0... |
730,418 | chromadb.api.client | _validate_tenant_database | null | def _validate_tenant_database(self, tenant: str, database: str) -> None:
try:
self._admin_client.get_tenant(name=tenant)
except requests.exceptions.ConnectionError:
raise ValueError(
"Could not connect to a Chroma server. Are you sure it is running?"
)
# Propagate ChromaE... | (self, tenant: str, database: str) -> NoneType | [
0.01308388076722622,
-0.0034078946337103844,
0.019873589277267456,
0.06262875348329544,
0.008815319277346134,
-0.01011066697537899,
0.044337403029203415,
-0.012875234708189964,
-0.042216163128614426,
-0.0215079877525568,
0.01444877777248621,
0.05442199110984802,
-0.06280262768268585,
-0.02... |
730,420 | chromadb.api.client | count_collections | Count the number of collections.
Returns:
int: The number of collections.
Examples:
```python
client.count_collections()
# 1
```
| @override
def count_collections(self) -> int:
return self._server.count_collections(
tenant=self.tenant, database=self.database
)
| (self) -> int | [
-0.06969805061817169,
-0.08027246594429016,
-0.029628321528434753,
0.06590721756219864,
0.030825424939393997,
0.05137570947408676,
-0.003730558091774583,
-0.04462537169456482,
0.039304912090301514,
-0.004950523376464844,
-0.01643523946404457,
0.00014989777992013842,
-0.03255457431077957,
-... |
730,421 | chromadb.api.client | create_collection | Create a new collection with the given name and metadata.
Args:
name: The name of the collection to create.
metadata: Optional metadata to associate with the collection.
embedding_function: Optional function to use to embed documents.
Uses the ... | @override
def create_collection(
self,
name: str,
metadata: Optional[CollectionMetadata] = None,
embedding_function: Optional[
EmbeddingFunction[Embeddable]
] = ef.DefaultEmbeddingFunction(), # type: ignore
data_loader: Optional[DataLoader[Loadable]] = None,
get_or_create: bool = Fa... | (self, name: str, metadata: Optional[Dict[str, Any]] = None, embedding_function: Optional[chromadb.api.types.EmbeddingFunction[Union[List[str], List[numpy.ndarray[Any, numpy.dtype[Union[numpy.uint64, numpy.int64, numpy.float64]]]]]]] = <chromadb.utils.embedding_functions.ONNXMiniLM_L6_V2 object at 0x7fd508aebee0>, data... | [
-0.06095122545957565,
-0.023591168224811554,
-0.04070494323968887,
0.024918504059314728,
0.0003923934418708086,
0.01587492786347866,
-0.002398052019998431,
-0.023768147453665733,
0.043501194566488266,
-0.002982079517096281,
-0.01643240824341774,
0.0482088103890419,
-0.021821388974785805,
-... |
730,422 | chromadb.api.client | delete_collection | Delete a collection with the given name.
Args:
name: The name of the collection to delete.
Raises:
ValueError: If the collection does not exist.
Examples:
```python
client.delete_collection("my_collection")
```
| @override
def delete_collection(
self,
name: str,
) -> None:
return self._server.delete_collection(
name=name,
tenant=self.tenant,
database=self.database,
)
| (self, name: str) -> NoneType | [
-0.060942672193050385,
-0.02478335238993168,
-0.023869212716817856,
0.006944925058633089,
-0.028016699478030205,
-0.02232871763408184,
-0.026019135490059853,
0.0343141108751297,
0.0568121112883091,
0.0339924693107605,
-0.025460494682192802,
-0.007643226534128189,
-0.01518488209694624,
-0.0... |
730,423 | chromadb.api.client | get_collection | Get a collection with the given name.
Args:
id: The UUID of the collection to get. Id and Name are simultaneously used for lookup if provided.
name: The name of the collection to get
embedding_function: Optional function to use to embed documents.
... | @override
def get_collection(
self,
name: str,
id: Optional[UUID] = None,
embedding_function: Optional[
EmbeddingFunction[Embeddable]
] = ef.DefaultEmbeddingFunction(), # type: ignore
data_loader: Optional[DataLoader[Loadable]] = None,
) -> Collection:
return self._server.get_collec... | (self, name: str, id: Optional[uuid.UUID] = None, embedding_function: Optional[chromadb.api.types.EmbeddingFunction[Union[List[str], List[numpy.ndarray[Any, numpy.dtype[Union[numpy.uint64, numpy.int64, numpy.float64]]]]]]] = <chromadb.utils.embedding_functions.ONNXMiniLM_L6_V2 object at 0x7fd509048d30>, data_loader: Op... | [
-0.03510303050279617,
-0.050326548516750336,
-0.04875711351633072,
0.04910587891936302,
0.006722413469105959,
0.02629675529897213,
0.024797072634100914,
-0.04223524034023285,
0.06298665702342987,
0.00994847435504198,
-0.0373874306678772,
-0.01599951833486557,
-0.05168672651052475,
-0.00600... |
730,424 | chromadb.api.client | get_or_create_collection | Get or create a collection with the given name and metadata.
Args:
name: The name of the collection to get or create
metadata: Optional metadata to associate with the collection. If
the collection alredy exists, the metadata will be updated if
provided and not Non... | @override
def get_or_create_collection(
self,
name: str,
metadata: Optional[CollectionMetadata] = None,
embedding_function: Optional[
EmbeddingFunction[Embeddable]
] = ef.DefaultEmbeddingFunction(), # type: ignore
data_loader: Optional[DataLoader[Loadable]] = None,
) -> Collection:
... | (self, name: str, metadata: Optional[Dict[str, Any]] = None, embedding_function: Optional[chromadb.api.types.EmbeddingFunction[Union[List[str], List[numpy.ndarray[Any, numpy.dtype[Union[numpy.uint64, numpy.int64, numpy.float64]]]]]]] = <chromadb.utils.embedding_functions.ONNXMiniLM_L6_V2 object at 0x7fd508ae9840>, data... | [
-0.03809802606701851,
-0.0275349672883749,
-0.05421778932213783,
0.03326920047402382,
0.01181464921683073,
0.01421131007373333,
0.015702566131949425,
-0.032985150814056396,
0.06589929014444351,
-0.0016920868074521422,
-0.017859559506177902,
0.031795699149370193,
-0.0343521349132061,
-0.044... |
730,425 | chromadb.api.client | get_settings | Get the settings used to initialize.
Returns:
Settings: The settings used to initialize.
| @override
def get_settings(self) -> Settings:
return self._server.get_settings()
| (self) -> chromadb.config.Settings | [
-0.01268973108381033,
-0.05093347281217575,
-0.02239467017352581,
-0.0017214920371770859,
0.020963365212082863,
0.010150039568543434,
-0.017149465158581734,
0.03471784666180611,
0.022691404446959496,
-0.0013593023177236319,
-0.019968435168266296,
0.007003788836300373,
-0.05697287991642952,
... |
730,426 | chromadb.api.client | get_version | Get the version of Chroma.
Returns:
str: The version of Chroma
| @override
def get_version(self) -> str:
return self._server.get_version()
| (self) -> str | [
0.025228438898921013,
-0.0637350007891655,
-0.04166227579116821,
0.03174678981304169,
0.04300733283162117,
-0.05869966000318527,
0.004535255953669548,
0.049560170620679855,
0.027452955022454262,
-0.030953552573919296,
-0.0003535085415933281,
-0.017761647701263428,
-0.05080176144838333,
0.0... |
730,427 | chromadb.api.client | heartbeat | Get the current time in nanoseconds since epoch.
Used to check if the server is alive.
Returns:
int: The current time in nanoseconds since epoch
| @override
def heartbeat(self) -> int:
return self._server.heartbeat()
| (self) -> int | [
0.010645199567079544,
-0.04289010167121887,
-0.03574175015091896,
0.03185827285051346,
0.031944189220666885,
-0.03493412584066391,
-0.004983224906027317,
0.094990573823452,
-0.05646509304642677,
-0.03670402988791466,
-0.01996726728975773,
-0.05265034735202789,
0.01619548164308071,
-0.00535... |
730,428 | chromadb.api.client | list_collections | List all collections.
Args:
limit: The maximum number of entries to return. Defaults to None.
offset: The number of entries to skip before returning. Defaults to None.
Returns:
Sequence[Collection]: A list of collections
Examples:
```python
... | @override
def list_collections(
self, limit: Optional[int] = None, offset: Optional[int] = None
) -> Sequence[Collection]:
return self._server.list_collections(
limit, offset, tenant=self.tenant, database=self.database
)
| (self, limit: Optional[int] = None, offset: Optional[int] = None) -> Sequence[chromadb.api.models.Collection.Collection] | [
-0.046103134751319885,
-0.060831476002931595,
-0.05716651678085327,
0.029371052980422974,
0.0030741130467504263,
0.07562831789255142,
0.008554426021873951,
-0.05168620124459267,
0.04808974638581276,
-0.008413136936724186,
-0.026391133666038513,
-0.009915941394865513,
-0.032864753156900406,
... |
730,429 | chromadb.api.client | reset | Resets the database. This will delete all collections and entries.
Returns:
bool: True if the database was reset successfully.
| @override
def reset(self) -> bool:
return self._server.reset()
| (self) -> bool | [
0.0049609532579779625,
0.015459715388715267,
-0.0005011428147554398,
0.00007772289973217994,
-0.023500187322497368,
-0.03150516003370285,
-0.05615905672311783,
0.0665246993303299,
0.03438056260347366,
0.006407528184354305,
-0.02374867908656597,
-0.03138091415166855,
-0.016134191304445267,
... |
730,430 | chromadb.api.client | set_database | Set the database for the client. Raises an error if the database does not exist.
Args:
database: The database to set.
| @override
def set_database(self, database: str) -> None:
self._validate_tenant_database(tenant=self.tenant, database=database)
self.database = database
| (self, database: str) -> NoneType | [
-0.01742573082447052,
0.01371374074369669,
0.017262471839785576,
0.03019428811967373,
0.0011642931494861841,
-0.026190150529146194,
0.0021352535113692284,
-0.0011148859048262239,
-0.012914631515741348,
-0.029489697888493538,
-0.028063330799341202,
0.002788288751617074,
-0.06014798581600189,
... |
730,431 | chromadb.api.client | set_tenant | Set the tenant and database for the client. Raises an error if the tenant or
database does not exist.
Args:
tenant: The tenant to set.
database: The database to set.
| @override
def set_tenant(self, tenant: str, database: str = DEFAULT_DATABASE) -> None:
self._validate_tenant_database(tenant=tenant, database=database)
self.tenant = tenant
self.database = database
| (self, tenant: str, database: str = 'default_database') -> NoneType | [
-0.02052452601492405,
0.011955451220273972,
0.033313680440187454,
0.03302145376801491,
-0.020369820296764374,
-0.023051416501402855,
0.005715582054108381,
-0.004894773010164499,
-0.022552913054823875,
-0.02717694826424122,
-0.022690432146191597,
0.01724128983914852,
-0.07102792710065842,
-... |
730,432 | chromadb | CloudClient |
Creates a client to connect to a tennant and database on the Chroma cloud.
Args:
tenant: The tenant to use for this client.
database: The database to use for this client.
api_key: The api key to use for this client.
| def CloudClient(
tenant: str,
database: str,
api_key: Optional[str] = None,
settings: Optional[Settings] = None,
*, # Following arguments are keyword-only, intended for testing only.
cloud_host: str = "api.trychroma.com",
cloud_port: int = 8000,
enable_ssl: bool = True,
) -> ClientAPI:
... | (tenant: str, database: str, api_key: Optional[str] = None, settings: Optional[chromadb.config.Settings] = None, *, cloud_host: str = 'api.trychroma.com', cloud_port: int = 8000, enable_ssl: bool = True) -> chromadb.api.ClientAPI | [
-0.04983832314610481,
-0.08141472190618515,
-0.06599030643701553,
0.04430881515145302,
0.008726254105567932,
0.007152890786528587,
-0.00680274935439229,
0.015333469025790691,
-0.01340541709214449,
-0.06220695748925209,
0.021790623664855957,
0.025210188701748848,
-0.07013743370771408,
-0.00... |
730,433 | chromadb.api.models.Collection | Collection | null | class Collection(BaseModel):
name: str
id: UUID
metadata: Optional[CollectionMetadata] = None
tenant: Optional[str] = None
database: Optional[str] = None
_client: "ServerAPI" = PrivateAttr()
_embedding_function: Optional[EmbeddingFunction[Embeddable]] = PrivateAttr()
_data_loader: Option... | (client: 'ServerAPI', name: str, id: uuid.UUID, embedding_function: Optional[chromadb.api.types.EmbeddingFunction[Union[List[str], List[numpy.ndarray[Any, numpy.dtype[Union[numpy.uint64, numpy.int64, numpy.float64]]]]]]] = <chromadb.utils.embedding_functions.ONNXMiniLM_L6_V2 object at 0x7fd508aead70>, data_loader: Opti... | [
-0.0014370449353009462,
-0.0624513179063797,
-0.10673065483570099,
0.04011326655745506,
0.028170544654130936,
0.030432123690843582,
-0.008565234020352364,
-0.061340369284152985,
0.03757395222783089,
0.03842700272798538,
-0.036423321813344955,
-0.013152866624295712,
-0.023865608498454094,
0... |
730,440 | chromadb.api.models.Collection | __init__ | null | def __init__(
self,
client: "ServerAPI",
name: str,
id: UUID,
embedding_function: Optional[
EmbeddingFunction[Embeddable]
] = ef.DefaultEmbeddingFunction(), # type: ignore
data_loader: Optional[DataLoader[Loadable]] = None,
tenant: Optional[str] = None,
database: Optional[st... | (self, client: 'ServerAPI', name: str, id: uuid.UUID, embedding_function: Optional[chromadb.api.types.EmbeddingFunction[Union[List[str], List[numpy.ndarray[Any, numpy.dtype[Union[numpy.uint64, numpy.int64, numpy.float64]]]]]]] = <chromadb.utils.embedding_functions.ONNXMiniLM_L6_V2 object at 0x7fd508aead70>, data_loader... | [
-0.03387538343667984,
-0.03797100856900215,
-0.0423760823905468,
0.027285974472761154,
0.00018913831445388496,
0.015690799802541733,
0.027413394302129745,
0.013442756608128548,
-0.007986471988260746,
0.02511984296143055,
-0.04951157420873642,
0.035877689719200134,
-0.03289243206381798,
0.0... |
730,454 | chromadb.api.models.Collection | _embed | null | def _embed(self, input: Any) -> Embeddings:
if self._embedding_function is None:
raise ValueError(
"You must provide an embedding function to compute embeddings."
"https://docs.trychroma.com/embeddings"
)
return self._embedding_function(input=input)
| (self, input: Any) -> List[Union[Sequence[float], Sequence[int]]] | [
-0.0029089529998600483,
-0.07150422036647797,
-0.04564686119556427,
-0.0002453755587339401,
-0.009670652449131012,
0.0338386669754982,
-0.05688619241118431,
-0.002775356639176607,
0.02366810292005539,
0.06919429451227188,
-0.004367738962173462,
-0.0030253110453486443,
-0.010239514522254467,
... |
730,456 | chromadb.api.models.Collection | _normalize_embeddings | null | @staticmethod
def _normalize_embeddings(
embeddings: Union[
OneOrMany[Embedding],
OneOrMany[np.ndarray],
]
) -> Embeddings:
if isinstance(embeddings, np.ndarray):
return embeddings.tolist()
return embeddings
| (embeddings: Union[Sequence[float], Sequence[int], List[Union[Sequence[float], Sequence[int]]], numpy.ndarray, List[numpy.ndarray]]) -> List[Union[Sequence[float], Sequence[int]]] | [
-0.02959311380982399,
-0.0328812375664711,
-0.034660059958696365,
0.0013374848058447242,
-0.0760401040315628,
0.0017956659430637956,
0.0032095143105834723,
-0.0338515043258667,
0.08559902757406235,
0.06856546550989151,
-0.019405320286750793,
-0.035360805690288544,
-0.035989683121442795,
0.... |
730,457 | chromadb.api.models.Collection | _validate_embedding_set | null | def _validate_embedding_set(
self,
ids: OneOrMany[ID],
embeddings: Optional[
Union[
OneOrMany[Embedding],
OneOrMany[np.ndarray],
]
],
metadatas: Optional[OneOrMany[Metadata]],
documents: Optional[OneOrMany[Document]],
images: Optional[OneOrMany[Image]]... | (self, ids: Union[str, List[str]], embeddings: Union[Sequence[float], Sequence[int], List[Union[Sequence[float], Sequence[int]]], numpy.ndarray, List[numpy.ndarray], NoneType], metadatas: Union[Mapping[str, Union[str, int, float, bool]], List[Mapping[str, Union[str, int, float, bool]]], NoneType], documents: Union[str,... | [
-0.014219919219613075,
-0.008249583654105663,
-0.03366272896528244,
0.03395801782608032,
-0.022884750738739967,
0.022737106308341026,
0.0034142571967095137,
-0.020743919536471367,
0.029196511954069138,
0.04953441023826599,
-0.017440393567085266,
0.022774018347263336,
0.01802174001932144,
-... |
730,458 | chromadb.api.models.Collection | add | Add embeddings to the data store.
Args:
ids: The ids of the embeddings you wish to add
embeddings: The embeddings to add. If None, embeddings will be computed based on the documents or images using the embedding_function set for the Collection. Optional.
metadatas: The metada... | def add(
self,
ids: OneOrMany[ID],
embeddings: Optional[
Union[
OneOrMany[Embedding],
OneOrMany[np.ndarray],
]
] = None,
metadatas: Optional[OneOrMany[Metadata]] = None,
documents: Optional[OneOrMany[Document]] = None,
images: Optional[OneOrMany[Image]... | (self, ids: Union[str, List[str]], embeddings: Union[Sequence[float], Sequence[int], List[Union[Sequence[float], Sequence[int]]], numpy.ndarray, List[numpy.ndarray], NoneType] = None, metadatas: Union[Mapping[str, Union[str, int, float, bool]], List[Mapping[str, Union[str, int, float, bool]]], NoneType] = None, documen... | [
-0.05390046909451485,
-0.028080757707357407,
-0.015025028958916664,
0.0010034540900960565,
-0.00472267298027873,
0.03880250081419945,
-0.034626856446266174,
-0.0033323108218610287,
0.01846218667924404,
0.06381990760564804,
-0.04956071451306343,
0.012080196291208267,
-0.013037494383752346,
... |
730,460 | chromadb.api.models.Collection | count | The total number of embeddings added to the database
Returns:
int: The total number of embeddings added to the database
| def count(self) -> int:
"""The total number of embeddings added to the database
Returns:
int: The total number of embeddings added to the database
"""
return self._client._count(collection_id=self.id)
| (self) -> int | [
-0.06030739098787308,
-0.05967257544398308,
-0.07490812987089157,
0.07731374353170395,
0.04657534882426262,
0.06739058345556259,
-0.014183095656335354,
-0.030821921303868294,
0.05816906690597534,
0.04356833174824715,
-0.072569340467453,
-0.033311065286397934,
-0.035917144268751144,
-0.0134... |
730,461 | chromadb.api.models.Collection | delete | Delete the embeddings based on ids and/or a where filter
Args:
ids: The ids of the embeddings to delete
where: A Where type dict used to filter the delection by. E.g. `{"$and": ["color" : "red", "price": {"$gte": 4.20}]}`. Optional.
where_document: A WhereDocument type dict ... | def delete(
self,
ids: Optional[IDs] = None,
where: Optional[Where] = None,
where_document: Optional[WhereDocument] = None,
) -> None:
"""Delete the embeddings based on ids and/or a where filter
Args:
ids: The ids of the embeddings to delete
where: A Where type dict used to filte... | (self, ids: Optional[List[str]] = None, where: Optional[Dict[Union[str, Literal['$and'], Literal['$or']], Union[str, int, float, bool, Dict[Union[Literal['$gt'], Literal['$gte'], Literal['$lt'], Literal['$lte'], Literal['$ne'], Literal['$eq'], Literal['$and'], Literal['$or']], Union[str, int, float, bool]], Dict[Union[... | [
0.006080147810280323,
-0.030896620824933052,
-0.03491729125380516,
-0.04256550222635269,
-0.03597160056233406,
0.011633140966296196,
-0.04631812497973442,
0.0503566674888134,
0.0006042174645699561,
0.08763275295495987,
-0.03684721514582634,
-0.002307418268173933,
0.01451908890157938,
-0.00... |
730,463 | chromadb.api.models.Collection | get | Get embeddings and their associate data from the data store. If no ids or where filter is provided returns
all embeddings up to limit starting at offset.
Args:
ids: The ids of the embeddings to get. Optional.
where: A Where type dict used to filter results by. E.g. `{"$and": ["c... | def get(
self,
ids: Optional[OneOrMany[ID]] = None,
where: Optional[Where] = None,
limit: Optional[int] = None,
offset: Optional[int] = None,
where_document: Optional[WhereDocument] = None,
include: Include = ["metadatas", "documents"],
) -> GetResult:
"""Get embeddings and their associa... | (self, ids: Union[str, List[str], NoneType] = None, where: Optional[Dict[Union[str, Literal['$and'], Literal['$or']], Union[str, int, float, bool, Dict[Union[Literal['$gt'], Literal['$gte'], Literal['$lt'], Literal['$lte'], Literal['$ne'], Literal['$eq'], Literal['$and'], Literal['$or']], Union[str, int, float, bool]],... | [
-0.02564113400876522,
-0.055617544800043106,
-0.04383448138833046,
-0.0011828222777694464,
-0.017239214852452278,
0.0687345415353775,
0.006882717367261648,
-0.04179652780294418,
0.014469454996287823,
0.04401974752545357,
-0.015757068991661072,
-0.029420606791973114,
-0.01902705430984497,
0... |
730,469 | chromadb.api.models.Collection | modify | Modify the collection name or metadata
Args:
name: The updated name for the collection. Optional.
metadata: The updated metadata for the collection. Optional.
Returns:
None
| def modify(
self, name: Optional[str] = None, metadata: Optional[CollectionMetadata] = None
) -> None:
"""Modify the collection name or metadata
Args:
name: The updated name for the collection. Optional.
metadata: The updated metadata for the collection. Optional.
Returns:
None
... | (self, name: Optional[str] = None, metadata: Optional[Dict[str, Any]] = None) -> NoneType | [
0.00909446831792593,
0.005057326517999172,
-0.03360506147146225,
-0.02764090523123741,
-0.01397740375250578,
-0.026158584281802177,
-0.00715873297303915,
-0.009757151827216148,
0.0674891471862793,
0.03934251144528389,
-0.07394160330295563,
-0.007677544839680195,
0.023577604442834854,
0.002... |
730,470 | chromadb.api.models.Collection | peek | Get the first few results in the database up to limit
Args:
limit: The number of results to return.
Returns:
GetResult: A GetResult object containing the results.
| def peek(self, limit: int = 10) -> GetResult:
"""Get the first few results in the database up to limit
Args:
limit: The number of results to return.
Returns:
GetResult: A GetResult object containing the results.
"""
return self._client._peek(self.id, limit)
| (self, limit: int = 10) -> chromadb.api.types.GetResult | [
-0.011963199824094772,
-0.030345264822244644,
-0.0868074893951416,
-0.0006346694426611066,
0.005905184894800186,
0.05518864467740059,
0.024401871487498283,
-0.06938486546278,
0.042249031364917755,
-0.06643014401197433,
-0.05658109486103058,
-0.018730176612734795,
-0.05566411465406418,
-0.0... |
730,471 | chromadb.api.models.Collection | query | Get the n_results nearest neighbor embeddings for provided query_embeddings or query_texts.
Args:
query_embeddings: The embeddings to get the closes neighbors of. Optional.
query_texts: The document texts to get the closes neighbors of. Optional.
query_images: The images to ... | def query(
self,
query_embeddings: Optional[
Union[
OneOrMany[Embedding],
OneOrMany[np.ndarray],
]
] = None,
query_texts: Optional[OneOrMany[Document]] = None,
query_images: Optional[OneOrMany[Image]] = None,
query_uris: Optional[OneOrMany[URI]] = None,
... | (self, query_embeddings: Union[Sequence[float], Sequence[int], List[Union[Sequence[float], Sequence[int]]], numpy.ndarray, List[numpy.ndarray], NoneType] = None, query_texts: Union[str, List[str], NoneType] = None, query_images: Union[numpy.ndarray[Any, numpy.dtype[Union[numpy.uint64, numpy.int64, numpy.float64]]], Lis... | [
-0.015357759781181812,
-0.07626963406801224,
-0.07747787237167358,
-0.008320753462612629,
-0.024202395230531693,
0.04598832502961159,
-0.01834058202803135,
-0.043873921036720276,
0.02239004708826542,
0.045912809669971466,
0.011884093284606934,
0.04157072678208351,
-0.012535405345261097,
0.... |
730,472 | chromadb.api.models.Collection | update | Update the embeddings, metadatas or documents for provided ids.
Args:
ids: The ids of the embeddings to update
embeddings: The embeddings to update. If None, embeddings will be computed based on the documents or images using the embedding_function set for the Collection. Optional.
... | def update(
self,
ids: OneOrMany[ID],
embeddings: Optional[
Union[
OneOrMany[Embedding],
OneOrMany[np.ndarray],
]
] = None,
metadatas: Optional[OneOrMany[Metadata]] = None,
documents: Optional[OneOrMany[Document]] = None,
images: Optional[OneOrMany[Ima... | (self, ids: Union[str, List[str]], embeddings: Union[Sequence[float], Sequence[int], List[Union[Sequence[float], Sequence[int]]], numpy.ndarray, List[numpy.ndarray], NoneType] = None, metadatas: Union[Mapping[str, Union[str, int, float, bool]], List[Mapping[str, Union[str, int, float, bool]]], NoneType] = None, documen... | [
-0.029600821435451508,
-0.04945547133684158,
-0.03550649434328079,
-0.02612263336777687,
-0.008025191724300385,
0.029492126777768135,
-0.028513887897133827,
-0.025995824486017227,
0.014166366308927536,
0.09941817820072174,
-0.0673174113035202,
-0.032734811305999756,
0.01719166338443756,
0.... |
730,473 | chromadb.api.models.Collection | upsert | Update the embeddings, metadatas or documents for provided ids, or create them if they don't exist.
Args:
ids: The ids of the embeddings to update
embeddings: The embeddings to add. If None, embeddings will be computed based on the documents using the embedding_function set for the Coll... | def upsert(
self,
ids: OneOrMany[ID],
embeddings: Optional[
Union[
OneOrMany[Embedding],
OneOrMany[np.ndarray],
]
] = None,
metadatas: Optional[OneOrMany[Metadata]] = None,
documents: Optional[OneOrMany[Document]] = None,
images: Optional[OneOrMany[Ima... | (self, ids: Union[str, List[str]], embeddings: Union[Sequence[float], Sequence[int], List[Union[Sequence[float], Sequence[int]]], numpy.ndarray, List[numpy.ndarray], NoneType] = None, metadatas: Union[Mapping[str, Union[str, int, float, bool]], List[Mapping[str, Union[str, int, float, bool]]], NoneType] = None, documen... | [
-0.03792357072234154,
-0.06266418099403381,
-0.03051944263279438,
-0.00976080447435379,
-0.010167128406465054,
0.027034087106585503,
-0.02457808516919613,
-0.0240724366158247,
0.02237490564584732,
0.0829262062907219,
-0.06006370857357979,
-0.024289142340421677,
0.012108453549444675,
0.0401... |
730,474 | chromadb.api.types | EmbeddingFunction | null | class EmbeddingFunction(Protocol[D]):
def __call__(self, input: D) -> Embeddings:
...
def __init_subclass__(cls) -> None:
super().__init_subclass__()
# Raise an exception if __call__ is not defined since it is expected to be defined
call = getattr(cls, "__call__")
def _... | (*args, **kwargs) | [
-0.006686101201921701,
-0.048195842653512955,
-0.046742137521505356,
0.057029880583286285,
-0.042455580085515976,
0.024917958304286003,
-0.040480032563209534,
-0.034814320504665375,
0.0705232247710228,
0.00485499482601881,
0.026054827496409416,
0.06332925707101822,
0.004328493494540453,
0.... |
730,475 | chromadb.api.types | __call__ | null | def __call__(self, input: D) -> Embeddings:
...
| (self, input: -D) -> List[Union[Sequence[float], Sequence[int]]] | [
0.01124445628374815,
-0.05968018248677254,
-0.026507779955863953,
0.032854240387678146,
-0.02682594023644924,
0.014752592891454697,
-0.04283443093299866,
-0.012131956405937672,
0.08439622074365616,
0.023778298869729042,
-0.00746839540079236,
-0.009620163589715958,
-0.008699174039065838,
0.... |
730,477 | chromadb.api.types | embed_with_retries | null | def embed_with_retries(self, input: D, **retry_kwargs: Dict) -> Embeddings:
return retry(**retry_kwargs)(self.__call__)(input)
| (self, input: -D, **retry_kwargs: Dict) -> List[Union[Sequence[float], Sequence[int]]] | [
0.010893745347857475,
-0.045631032437086105,
-0.02976297214627266,
0.06095191463828087,
-0.023843539878726006,
0.014102177694439888,
-0.03783794119954109,
0.00047877762699499726,
0.07182908058166504,
0.009127864614129066,
0.02589958906173706,
0.07693604379892349,
0.007648006081581116,
0.01... |
730,478 | chromadb | EphemeralClient |
Creates an in-memory instance of Chroma. This is useful for testing and
development, but not recommended for production use.
Args:
tenant: The tenant to use for this client. Defaults to the default tenant.
database: The database to use for this client. Defaults to the default database.
... | def EphemeralClient(
settings: Optional[Settings] = None,
tenant: str = DEFAULT_TENANT,
database: str = DEFAULT_DATABASE,
) -> ClientAPI:
"""
Creates an in-memory instance of Chroma. This is useful for testing and
development, but not recommended for production use.
Args:
tenant: Th... | (settings: Optional[chromadb.config.Settings] = None, tenant: str = 'default_tenant', database: str = 'default_database') -> chromadb.api.ClientAPI | [
0.001797362812794745,
-0.03728840872645378,
-0.0580081008374691,
-0.004296082071959972,
0.019787481054663658,
0.015583740547299385,
-0.008477835915982723,
-0.011784544214606285,
-0.05491245910525322,
-0.031290601938962936,
0.04221329465508461,
0.05790256708860397,
-0.0910400003194809,
0.01... |
730,479 | chromadb.api.types | GetResult | null | class GetResult(TypedDict):
ids: List[ID]
embeddings: Optional[List[Embedding]]
documents: Optional[List[Document]]
uris: Optional[URIs]
data: Optional[Loadable]
metadatas: Optional[List[Metadata]]
| null | [
-0.0031522794160991907,
-0.025928352028131485,
-0.09482785314321518,
-0.033703215420246124,
0.016660423949360847,
0.0554254949092865,
-0.008029777556657791,
-0.05455150455236435,
0.06019601970911026,
0.005385049153119326,
0.03452258184552193,
0.034431539475917816,
-0.04198790714144707,
0.0... |
730,480 | chromadb | HttpClient |
Creates a client that connects to a remote Chroma server. This supports
many clients connecting to the same server, and is the recommended way to
use Chroma in production.
Args:
host: The hostname of the Chroma server. Defaults to "localhost".
port: The port of the Chroma server. Defau... | def HttpClient(
host: str = "localhost",
port: int = 8000,
ssl: bool = False,
headers: Optional[Dict[str, str]] = None,
settings: Optional[Settings] = None,
tenant: str = DEFAULT_TENANT,
database: str = DEFAULT_DATABASE,
) -> ClientAPI:
"""
Creates a client that connects to a remote ... | (host: str = 'localhost', port: int = 8000, ssl: bool = False, headers: Optional[Dict[str, str]] = None, settings: Optional[chromadb.config.Settings] = None, tenant: str = 'default_tenant', database: str = 'default_database') -> chromadb.api.ClientAPI | [
-0.047636911273002625,
-0.06761248409748077,
-0.06527333706617355,
-0.01986418291926384,
-0.006112413480877876,
0.008303043432533741,
-0.03931994363665581,
0.018638916313648224,
-0.0395798496901989,
-0.04511211812496185,
0.03005618043243885,
0.07618935406208038,
-0.026603154838085175,
0.03... |
730,481 | chromadb | PersistentClient |
Creates a persistent instance of Chroma that saves to disk. This is useful for
testing and development, but not recommended for production use.
Args:
path: The directory to save Chroma's data to. Defaults to "./chroma".
tenant: The tenant to use for this client. Defaults to the default ten... | def PersistentClient(
path: str = "./chroma",
settings: Optional[Settings] = None,
tenant: str = DEFAULT_TENANT,
database: str = DEFAULT_DATABASE,
) -> ClientAPI:
"""
Creates a persistent instance of Chroma that saves to disk. This is useful for
testing and development, but not recommended f... | (path: str = './chroma', settings: Optional[chromadb.config.Settings] = None, tenant: str = 'default_tenant', database: str = 'default_database') -> chromadb.api.ClientAPI | [
-0.024790650233626366,
-0.011059354990720749,
-0.08387414366006851,
0.04268026351928711,
0.06157848611474037,
-0.003118738066405058,
-0.01435946673154831,
0.030789243057370186,
-0.012651901692152023,
-0.030913108959794044,
0.03464674577116966,
0.06702853739261627,
-0.07545134425163269,
-0.... |
730,482 | chromadb.api.types | QueryResult | null | class QueryResult(TypedDict):
ids: List[IDs]
embeddings: Optional[List[List[Embedding]]]
documents: Optional[List[List[Document]]]
uris: Optional[List[List[URI]]]
data: Optional[List[Loadable]]
metadatas: Optional[List[List[Metadata]]]
distances: Optional[List[List[float]]]
| null | [
0.007379192393273115,
-0.02341543696820736,
-0.08214300870895386,
-0.035744085907936096,
0.020895712077617645,
0.0661967545747757,
-0.014614400453865528,
-0.05187032371759415,
0.049530576914548874,
0.02359541691839695,
0.012607620097696781,
0.04139547049999237,
-0.04197140410542488,
0.0148... |
730,483 | chromadb.config | Settings | null | class Settings(BaseSettings): # type: ignore
# ==============
# Generic config
# ==============
environment: str = ""
# Can be "chromadb.api.segment.SegmentAPI" or "chromadb.api.fastapi.FastAPI"
chroma_api_impl: str = "chromadb.api.segment.SegmentAPI"
@validator("chroma_server_nofile", ... | (_env_file: Union[str, os.PathLike, List[Union[str, os.PathLike]], Tuple[Union[str, os.PathLike], ...], NoneType] = '<object object at 0x7fd50aaedf00>', _env_file_encoding: Optional[str] = None, _env_nested_delimiter: Optional[str] = None, _secrets_dir: Union[str, os.PathLike, NoneType] = None, *, environment: str = ''... | [
-0.011157536879181862,
-0.05277999863028526,
-0.10532714426517487,
0.04629892855882645,
0.05111122131347656,
-0.006704224273562431,
-0.030872419476509094,
0.022877801209688187,
-0.05898941308259964,
-0.06112389639019966,
-0.014689140021800995,
0.05860132351517677,
-0.021694133058190346,
0.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.