
    7|hG                    x    d dl mZ d dlZd dlmZmZ d dlmZmZm	Z	  ej                  d      Z G d de      Zy)	    )annotationsN)ABCabstractmethod)ListOptionalSequencei  )intc                  `   e Zd ZdZ	 	 	 	 ddZedd       Zedd       Zedd       Zedd       Z	eddd	 	 	 	 	 	 	 dd	       Z
eddd	 	 	 	 	 	 	 dd
       Zedd       Zedd       Zeddddd	 	 	 	 	 	 	 	 	 dd       Zeddddd	 	 	 	 	 	 	 	 	 dd       Zedd       Zedd       Zy)RecordManagerz)Abstract base class for a record manager.c                    || _         y)zyInitialize the record manager.

        Args:
            namespace (str): The namespace for the record manager.
        N)	namespace)selfr   s     _/var/www/html/test/engine/venv/lib/python3.12/site-packages/langchain_community/indexes/base.py__init__zRecordManager.__init__   s     #    c                     yz2Create the database schema for the record manager.N r   s    r   create_schemazRecordManager.create_schema       r   c                   K   ywr   r   r   s    r   acreate_schemazRecordManager.acreate_schema           c                     ya*  Get the current server time as a high resolution timestamp!

        It's important to get this from the server to ensure a monotonic clock,
        otherwise there may be data loss when cleaning up old documents!

        Returns:
            The current server time as a float timestamp.
        Nr   r   s    r   get_timezRecordManager.get_time    r   r   c                   K   ywr   r   r   s    r   	aget_timezRecordManager.aget_time+   r   r   N)	group_idstime_at_leastc                    ya  Upsert records into the database.

        Args:
            keys: A list of record keys to upsert.
            group_ids: A list of group IDs corresponding to the keys.
            time_at_least: if provided, updates should only happen if the
              updated_at field is at least this time.

        Raises:
            ValueError: If the length of keys doesn't match the length of group_ids.
        Nr   r   keysr!   r"   s       r   updatezRecordManager.update6   r   r   c                  K   ywr$   r   r%   s       r   aupdatezRecordManager.aupdateJ   r   r   c                     yzCheck if the provided keys exist in the database.

        Args:
            keys: A list of keys to check.

        Returns:
            A list of boolean values indicating the existence of each key.
        Nr   r   r&   s     r   existszRecordManager.exists^   r   r   c                   K   ywr+   r   r,   s     r   aexistszRecordManager.aexistsi   r   r   )beforeafterr!   limitc                    ya  List records in the database based on the provided filters.

        Args:
            before: Filter to list records updated before this time.
            after: Filter to list records updated after this time.
            group_ids: Filter to list records with specific group IDs.
            limit: optional limit on the number of records to return.

        Returns:
            A list of keys for the matching records.
        Nr   r   r0   r1   r!   r2   s        r   	list_keyszRecordManager.list_keyst   r   r   c                  K   ywr4   r   r5   s        r   
alist_keyszRecordManager.alist_keys   r   r   c                     yzoDelete specified records from the database.

        Args:
            keys: A list of keys to delete.
        Nr   r,   s     r   delete_keyszRecordManager.delete_keys   r   r   c                   K   ywr:   r   r,   s     r   adelete_keyszRecordManager.adelete_keys   r   r   )r   strreturnNone)r?   r@   )r?   float)r&   Sequence[str]r!   z!Optional[Sequence[Optional[str]]]r"   Optional[float]r?   r@   )r&   rB   r?   z
List[bool])
r0   rC   r1   rC   r!   zOptional[Sequence[str]]r2   zOptional[int]r?   z	List[str])r&   rB   r?   r@   )__name__
__module____qualname____doc__r   r   r   r   r   r    r'   r)   r-   r/   r6   r8   r;   r=   r   r   r   r   r   
   s   3	#	# 
	# A A A A     
 8<)- 5	
 ' 
 & 
 8<)- 5	
 ' 
 &      #'!%-1#   	
 +  
 (  #'!%-1#   	
 +  
 (    r   r   )
__future__r   uuidabcr   r   typingr   r   r   UUIDNAMESPACE_UUIDr   r   r   r   <module>rN      s2    "  # + +t$bC br   