o
    .ife                     @  sX   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dZG dd deZdS )	    )annotationsN)ABCabstractmethod)ListOptionalSequencei  )intc                   @  s   e Zd ZdZd1ddZed2dd	Zed2d
dZed3ddZed3ddZ	edddd4ddZ
edddd4ddZed5ddZed5d d!Zeddddd"d6d)d*Zeddddd"d6d+d,Zed7d-d.Zed7d/d0ZdS )8RecordManagerzGAn abstract base class representing the interface for a record manager.	namespacestrreturnNonec                 C  s
   || _ dS )zyInitialize the record manager.

        Args:
            namespace (str): The namespace for the record manager.
        N)r
   )selfr
    r   O/var/www/html/corbot_env/lib/python3.10/site-packages/langchain/indexes/base.py__init__   s   
	zRecordManager.__init__c                 C     dS z2Create the database schema for the record manager.Nr   r   r   r   r   create_schema       zRecordManager.create_schemac                      dS r   r   r   r   r   r   acreate_schema       zRecordManager.acreate_schemafloatc                 C  r   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   r   r   r   get_time    r   zRecordManager.get_timec                   r   r   r   r   r   r   r   	aget_time+   r   zRecordManager.aget_timeN)	group_idstime_at_leastkeysSequence[str]r   !Optional[Sequence[Optional[str]]]r   Optional[float]c                C  r   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   r    r   r   r   r   r   update6   r   zRecordManager.updatec                  r   r$   r   r%   r   r   r   aupdateJ   r   zRecordManager.aupdate
List[bool]c                 C  r   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    r   r   r   exists^   r   zRecordManager.existsc                   r   r)   r   r*   r   r   r   aexistsi   r   zRecordManager.aexists)beforeafterr   limitr-   r.   Optional[Sequence[str]]r/   Optional[int]	List[str]c                C  r   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   r-   r.   r   r/   r   r   r   	list_keyst   r   zRecordManager.list_keysc                  r   r3   r   r4   r   r   r   
alist_keys   r   zRecordManager.alist_keysc                 C  r   zoDelete specified records from the database.

        Args:
            keys: A list of keys to delete.
        Nr   r*   r   r   r   delete_keys   r   zRecordManager.delete_keysc                   r   r7   r   r*   r   r   r   adelete_keys   r   zRecordManager.adelete_keys)r
   r   r   r   )r   r   )r   r   )r    r!   r   r"   r   r#   r   r   )r    r!   r   r(   )
r-   r#   r.   r#   r   r0   r/   r1   r   r2   )r    r!   r   r   )__name__
__module____qualname____doc__r   r   r   r   r   r   r&   r'   r+   r,   r5   r6   r8   r9   r   r   r   r   r	   
   sN    




r	   )
__future__r   uuidabcr   r   typingr   r   r   UUIDNAMESPACE_UUIDr	   r   r   r   r   <module>   s    