§
    ˜Štj?  ã                   ó®   — d dl mZ d dlmZmZmZ d dlmZ d dlm	Z	m
Z
 d dlmZ d dlmZmZmZmZmZmZmZmZmZmZ d dlmZmZmZ  G d„ d	e¦  «        Zd
S )é    )Úabstractmethod)ÚOptionalÚSequenceÚTuple)ÚUUID)ÚCreateCollectionConfigurationÚUpdateCollectionConfiguration)ÚSchema)
Ú
CollectionÚCollectionAndSegmentsÚDatabaseÚTenantÚMetadataÚSegmentÚSegmentScopeÚOptionalArgumentÚUnspecifiedÚUpdateMetadata)ÚDEFAULT_DATABASEÚDEFAULT_TENANTÚ	Componentc                   óž  — e Zd ZdZeefdedededdfd„¦   «         Zeefdedede	fd„¦   «         Z
eefdededdfd	„¦   «         Zeddefd
ee         dee         dedee	         fd„¦   «         Zededdfd„¦   «         Zededefd„¦   «         Zededdfd„¦   «         Zedededdfd„¦   «         Ze	 	 	 d'dedee         dee         dee         dee         f
d„¦   «         Ze e¦   «         fdededeee                  ddfd„¦   «         Zedddeefdededee         dedee         dee         dee         de dedede!e"e f         fd„¦   «         Z#eeefdedededdfd „¦   «         Z$eddeeddfdee         dee         deded
ee         dee         dee"         fd!„¦   «         Z%eedfdedee         defd"„¦   «         Z&ed#ede'fd$„¦   «         Z(e e¦   «          e¦   «          e¦   «          e¦   «         fdedee         deee                  deee                  deee)                  ddfd%„¦   «         Z*ededefd&„¦   «         Z+dS )(ÚSysDBz+Data interface for Chroma's System databaseÚidÚnameÚtenantÚreturnNc                 ó   — dS )zeCreate a new database in the System database. Raises an Error if the Database
        already exists.N© )Úselfr   r   r   s       úP/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/chromadb/db/system.pyÚcreate_databasezSysDB.create_database   s	   € ð 	ˆó    c                 ó   — dS )zZGet a database by name and tenant. Raises an Error if the Database does not
        exist.Nr   ©r    r   r   s      r!   Úget_databasezSysDB.get_database#   ó	   € ð 	ˆr#   c                 ó   — dS )zDelete a database.Nr   r%   s      r!   Údelete_databasezSysDB.delete_database)   ó	   € ð 	ˆr#   ÚlimitÚoffsetc                 ó   — dS )z List all databases for a tenant.Nr   )r    r+   r,   r   s       r!   Úlist_databaseszSysDB.list_databases.   s	   € ð 	ˆr#   c                 ó   — dS )zzCreate a new tenant in the System database. The name must be unique.
        Raises an Error if the Tenant already exists.Nr   ©r    r   s     r!   Úcreate_tenantzSysDB.create_tenant8   r'   r#   c                 ó   — dS )zCGet a tenant by name. Raises an Error if the Tenant does not exist.Nr   r0   s     r!   Ú
get_tenantzSysDB.get_tenant>   r*   r#   Úsegmentc                 ó   — dS )z^Create a new segment in the System database. Raises an Error if the ID
        already exists.Nr   )r    r4   s     r!   Úcreate_segmentzSysDB.create_segmentE   r'   r#   Ú
collectionc                 ó   — dS )z*Delete a segment from the System database.Nr   )r    r7   r   s      r!   Údelete_segmentzSysDB.delete_segmentK   r*   r#   ÚtypeÚscopec                 ó   — dS )z/Find segments by id, type, scope or collection.Nr   )r    r7   r   r:   r;   s        r!   Úget_segmentszSysDB.get_segmentsP   ó	   € ð 	ˆr#   Úmetadatac                 ó   — dS )zÌUpdate a segment. Unspecified fields will be left unchanged. For the
        metadata, keys with None values will be removed and keys not present in the
        UpdateMetadata dict will be left unchanged.Nr   )r    r7   r   r?   s       r!   Úupdate_segmentzSysDB.update_segment[   s	   € ð 	ˆr#   FÚschemaÚconfigurationÚsegmentsÚ	dimensionÚget_or_createÚdatabasec                 ó   — dS )aê  Create a new collection and associated resources
        in the SysDB. If get_or_create is True, the
        collection will be created if one with the same name does not exist.
        The metadata will be updated using the same protocol as update_collection. If get_or_create
        is False and the collection already exists, an error will be raised.

        Returns a tuple of the created collection and a boolean indicating whether the
        collection was created or not.
        Nr   )r    r   r   rB   rC   rD   r?   rE   rF   r   rG   s              r!   Úcreate_collectionzSysDB.create_collectiong   s	   € ð. 	ˆr#   c                 ó   — dS )z…Delete a collection, all associated segments and any associate resources (log stream)
        from the SysDB and the system at large.Nr   )r    r   r   rG   s       r!   Údelete_collectionzSysDB.delete_collection€   r>   r#   c                 ó   — dS )z_Find collections by id or name. If name is provided, tenant and database must also be provided.Nr   )r    r   r   r   rG   r+   r,   s          r!   Úget_collectionszSysDB.get_collections‹   s	   € ð 	ˆr#   c                 ó   — dS )zFGets the number of collections for the (tenant, database) combination.Nr   )r    r   rG   s      r!   Úcount_collectionszSysDB.count_collections˜   ó	   € ð 	ˆr#   Úcollection_idc                 ó   — dS )z®Get a consistent snapshot of a collection by id. This will return a collection with segment
        information that matches the collection version and log position.
        Nr   )r    rQ   s     r!   Úget_collection_with_segmentsz"SysDB.get_collection_with_segments¡   rP   r#   c                 ó   — dS )zËUpdate a collection. Unspecified fields will be left unchanged. For metadata,
        keys with None values will be removed and keys not present in the UpdateMetadata
        dict will be left unchanged.Nr   )r    r   r   rE   r?   rC   s         r!   Úupdate_collectionzSysDB.update_collectionª   s	   € ð 	ˆr#   c                 ó   — dS )z.Returns the number of records in a collection.Nr   )r    r   s     r!   Úget_collection_sizezSysDB.get_collection_sizeº   r*   r#   )NNN),Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   Ústrr"   r   r&   r)   r   Úintr   r.   r1   r   r3   r   r6   r9   r   r=   r   r   r   rA   r   r
   r   r   Úboolr   r   rI   rK   rM   rO   r   rS   r	   rU   rW   r   r#   r!   r   r      sÌ  € € € € € Ø5Ð5àà1?ðð ØðØ!ðØ+.ðà	ðð ð ñ „^ðð Ø4Bð ð  ð ¨cð Àxð ð ð ñ „^ðð
 Ø7Eð ð  Cð °ð È$ð ð ð ñ „^ðð ð  $Ø $Ø$ð	ð à˜Œ}ðð ˜”ðð ð	ð
 
�(Ô	ðð ð ñ „^ðð ð #ð ¨$ð ð ð ñ „^ðð
 ð˜sð  vð ð ð ñ „^ðð ð gð °$ð ð ð ñ „^ðð
 ð¨ð °4ð ¸Dð ð ð ñ „^ðð ð "Ø"Ø(,ðð àðð �TŒNðð �sŒmð	ð
 ˜Ô%ðð 
�'Ô	ðð ð ñ „^ðð ð
 @K¸{¹}¼}ð		ð 	àð	ð ð	ð # 8¨NÔ#;Ô<ð		ð
 
ð	ð 	ð 	ñ „^ð	ð ð (,Ø#'Ø#Ø$Ø(ðð àðð ðð ˜Ô ð	ð
 5ðð ˜7Ô#ðð ˜8Ô$ðð ˜C”=ðð ðð ðð ðð 
ˆz˜4ÐÔ	 ðð ð ñ „^ðð0 ð %Ø(ð	ð àðð ðð ð	ð
 
ðð ð ñ „^ðð ð "Ø"Ø$Ø(Ø#Ø $ð
ð 
à�TŒNð
ð �sŒmð
ð ð	
ð
 ð
ð ˜Œ}ð
ð ˜”ð
ð 
�*Ô	ð
ð 
ð 
ñ „^ð
ð ð %Ø"&ðð àðð ˜3”-ðð 
ð	ð ð ñ „^ðð ðØ!ðà	ðð ð ñ „^ðð ð '2 k¡m¤mØ5@°[±]´]Ø?J¸{¹}¼}ð ˆK‰MŒMðð àðð ˜sÔ#ðð $ H¨S¤MÔ2ð	ð
 # 8¨NÔ#;Ô<ðð (ØÐ2Ô3ô
ðð 
ðð ð ñ „^ðð ð dð ¨sð ð ð ñ „^ðð ð r#   r   N)Úabcr   Útypingr   r   r   Úuuidr   Ú%chromadb.api.collection_configurationr   r	   Úchromadb.api.typesr
   Úchromadb.typesr   r   r   r   r   r   r   r   r   r   Úchromadb.configr   r   r   r   r   r#   r!   ú<module>rf      sZ  ðØ Ð Ð Ð Ð Ð Ø ,Ð ,Ð ,Ð ,Ð ,Ð ,Ð ,Ð ,Ð ,Ð ,Ø Ð Ð Ð Ð Ð ðð ð ð ð ð ð ð ð &Ð %Ð %Ð %Ð %Ð %ðð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð HÐ GÐ GÐ GÐ GÐ GÐ GÐ GÐ GÐ Gðeð eð eð eð eˆIñ eô eð eð eð er#   