
    NgG                    |    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dS )	    )annotationsN)ABCabstractmethod)ListOptionalSequencei  )intc                  b   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dS )+RecordManagerz)Abstract base class for a record manager.	namespacestrreturnNonec                    || _         dS )zyInitialize the record manager.

        Args:
            namespace (str): The namespace for the record manager.
        N)r   )selfr   s     \/var/www/html/ai-engine/env/lib/python3.11/site-packages/langchain_community/indexes/base.py__init__zRecordManager.__init__   s     #    c                    dS z2Create the database schema for the record manager.N r   s    r   create_schemazRecordManager.create_schema         r   c                
   K   dS r   r   r   s    r   acreate_schemazRecordManager.acreate_schema   
        r   floatc                    dS 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   dS r    r   r   s    r   	aget_timezRecordManager.aget_time+   r   r   N)	group_idstime_at_leastkeysSequence[str]r$   !Optional[Sequence[Optional[str]]]r%   Optional[float]c                   dS 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%   s       r   updatezRecordManager.update6   r   r   c               
   K   dS r+   r   r,   s       r   aupdatezRecordManager.aupdateJ   r   r   
List[bool]c                    dS 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   dS r2   r   r3   s     r   aexistszRecordManager.aexistsi   r   r   )beforeafterr$   limitr7   r8   Optional[Sequence[str]]r9   Optional[int]	List[str]c                   dS 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   r7   r8   r$   r9   s        r   	list_keyszRecordManager.list_keyst   r   r   c               
   K   dS r>   r   r?   s        r   
alist_keyszRecordManager.alist_keys   r   r   c                    dS zoDelete specified records from the database.

        Args:
            keys: A list of keys to delete.
        Nr   r3   s     r   delete_keyszRecordManager.delete_keys   r   r   c                
   K   dS rD   r   r3   s     r   adelete_keyszRecordManager.adelete_keys   r   r   )r   r   r   r   )r   r   )r   r   )r&   r'   r$   r(   r%   r)   r   r   )r&   r'   r   r0   )
r7   r)   r8   r)   r$   r:   r9   r;   r   r<   )r&   r'   r   r   )__name__
__module____qualname____doc__r   r   r   r   r!   r#   r-   r/   r4   r6   r@   rB   rE   rG   r   r   r   r   r   
   s
       33	# 	# 	# 	# A A A ^A A A A ^A    ^    ^ 
 8<)-     ^& 
 8<)-     ^&    ^    ^  #'!%-1#     ^(  #'!%-1#     ^(    ^    ^  r   r   )
__future__r   uuidabcr   r   typingr   r   r   UUIDNAMESPACE_UUIDr   r   r   r   <module>rR      s    " " " " " "  # # # # # # # # + + + + + + + + + +t$$$b b b b bC b b b b br   