
    LKi                         S SK JrJrJr  S SKJr  S SKJrJrJ	r	J
r
JrJrJrJrJrJrJrJr  S SKJrJr  S SKJr  S SKJr   " S S\5      r " S	 S
\5      r\" S\S9r " S S\5      r " S S\5      r " S S\5      rg)    )OptionalSequenceTypeVar)abstractmethod)
CollectionMetadataEmbeddingRecord	OperationRequestVersionContextVectorEmbeddingRecordWhereWhereDocumentVectorQueryVectorQueryResultSegmentSeqIdMetadata)	ComponentSystem)UUID)Enumc                   ,    \ rS rSrSrSrSrSrSrSr	Sr
g	)
SegmentType   z"urn:chroma:segment/metadata/sqlitez+urn:chroma:segment/vector/hnsw-local-memoryz.urn:chroma:segment/vector/hnsw-local-persistedz*urn:chroma:segment/vector/hnsw-distributedz#urn:chroma:segment/record/blockfilez%urn:chroma:segment/metadata/blockfile N)__name__
__module____qualname____firstlineno__SQLITEHNSW_LOCAL_MEMORYHNSW_LOCAL_PERSISTEDHNSW_DISTRIBUTEDBLOCKFILE_RECORDBLOCKFILE_METADATA__static_attributes__r       [/var/www/html/dynamic-report/venv/lib/python3.13/site-packages/chromadb/segment/__init__.pyr   r      s%    1FEKC<@r&   r   c                       \ rS rSr\S\S\4S j5       r\S\S\	4S j5       r
\S\4S j5       r\S	\S\\   4S
 j5       r\SS j5       rSrg)SegmentImplementation   sytstemsegmentc                     g Nr   )selfr+   r,   s      r'   __init__SegmentImplementation.__init__    s    r&   request_version_contextreturnc                     g)z,Get the number of embeddings in this segmentNr   )r/   r2   s     r'   countSegmentImplementation.count$        	r&   c                     g)z7Get the maximum SeqID currently indexed by this segmentNr   r/   s    r'   	max_seqidSegmentImplementation.max_seqid)   r7   r&   metadatac                     g)zGiven an arbitrary metadata map (e.g, from a collection), validate it and
return metadata (if any) that is applicable and should be applied to the
segment. Validation errors will be reported to the user.Nr   )r<   s    r'   propagate_collection_metadata3SegmentImplementation.propagate_collection_metadata.   s    
 r&   Nc                     g)z#Delete the segment and all its dataNr   r9   s    r'   deleteSegmentImplementation.delete5   s     	r&   r   )r3   N)r   r   r   r   r   r   r   r0   r
   intr5   r   r:   staticmethodr   r   r>   rA   r%   r   r&   r'   r)   r)      s        -B s   5    Xh=O    r&   r)   S)boundc                       \ rS rSrSr\      SS\S\\   S\\	   S\\
\      S\\   S	\\   S
\S\
\   4S jj5       rSrg)MetadataReader>   z$Embedding Metadata segment interfaceNr2   wherewhere_documentidslimitoffsetinclude_metadatar3   c                     g)zQuery for embedding metadata.Nr   )r/   r2   rJ   rK   rL   rM   rN   rO   s           r'   get_metadataMetadataReader.get_metadataA   s     	r&   r   )NNNNNT)r   r   r   r   __doc__r   r
   r   r   r   r   strrC   boolr   rQ   r%   r   r&   r'   rH   rH   >   s    . "&26'+# $!%!6  !/	
 hsm$ }   
)	* r&   rH   c            	       x    \ rS rSrSr\ SS\S\\\	      S\\
   4S jj5       r\S\S\\\      4S	 j5       rS
rg)VectorReaderP   z"Embedding Vector segment interfaceNr2   rL   r3   c                     g)zUGet embeddings from the segment. If no IDs are provided, all embeddings are
returned.Nr   )r/   r2   rL   s      r'   get_vectorsVectorReader.get_vectorsS   s     	r&   queryc                     g)zQGiven a vector query, return the top-k nearest neighbors for vector in the
query.Nr   )r/   r\   s     r'   query_vectorsVectorReader.query_vectors]        	r&   r   r.   )r   r   r   r   rS   r   r
   r   r   rT   r   rZ   r   r   r^   r%   r   r&   r'   rW   rW   P   sv    , (,!6 hsm$ 
'	(	   	(,-	. r&   rW   c                   |    \ rS rSrSr\S\S\\   4S j5       r	\S\
S\\
   4S j5       r\S\
S\SS	4S
 j5       rSrg	)SegmentManagerf   zbInterface for a pluggable strategy for creating, retrieving and instantiating
segments as required
collectionr3   c                     g)zkReturn the segments required for a new collection. Returns only segment data,
does not persist to the SysDBNr   )r/   rd   s     r'   #prepare_segments_for_new_collection2SegmentManager.prepare_segments_for_new_collectionj   r`   r&   collection_idc                     g)zDelete any local state for all the segments associated with a collection, and
returns a sequence of their IDs. Does not update the SysDB.Nr   )r/   rh   s     r'   delete_segmentsSegmentManager.delete_segmentsr   s     	r&   	hint_typeNc                     g)zSignal to the segment manager that a collection is about to be used, so that
it can preload segments as needed. This is only a hint, and implementations are
free to ignore it.Nr   )r/   rh   rl   s      r'   hint_use_collection"SegmentManager.hint_use_collectionx   s    
 	r&   r   )r   r   r   r   rS   r   r   r   r   rf   r   rj   r	   rn   r%   r   r&   r'   rb   rb   f   s     $	'	  T htn  
  ) PT  r&   rb   N) typingr   r   r   abcr   chromadb.typesr   r   r	   r
   r   r   r   r   r   r   r   r   chromadb.configr   r   uuidr   enumr   r   r)   rE   rH   rW   rb   r   r&   r'   <module>rv      s|    . .     .  A$ AI 8 C,-* $( ,Y r&   