o
    h                     @   s4  d dl mZmZmZmZmZmZ d dlmZm	Z	m
Z
 ddlmZmZmZmZ g dZedZe
G dd deZG d	d
 d
ee ee ee ZG dd dee ee ee ZG dd dee ee ee ZG dd dee ee ee ZG dd dee ee ee ZG dd dee ee ee ZdS )    )AnyListGenericTypeVarOptionalcast)Protocoloverrideruntime_checkable   )BasePagePageInfoBaseSyncPageBaseAsyncPage)SyncPage	AsyncPageSyncCursorPageAsyncCursorPageSyncConversationCursorPageAsyncConversationCursorPage_Tc                   @   s   e Zd ZU ee ed< dS )CursorPageItemidN)__name__
__module____qualname__r   str__annotations__ r   r   R/var/www/html/openai_agents/venv/lib/python3.10/site-packages/openai/pagination.pyr      s   
 r   c                   @   J   e Zd ZU dZee ed< eed< edee fddZ	ed
dd	Z
dS )r   LNote: no pagination actually occurs yet, this is for forwards-compatibility.dataobjectreturnc                 C      | j }|sg S |S Nr"   selfr"   r   r   r   _get_page_items      zSyncPage._get_page_itemsNc                 C      dS z
        This page represents a response that isn't actually paginated at the API level
        so there will never be a next page.
        Nr   r)   r   r   r   next_page_info&      zSyncPage.next_page_infor$   Nr   r   r   __doc__r   r   r   r   r	   r*   r/   r   r   r   r   r         
 r   c                   @   r    )r   r!   r"   r#   r$   c                 C   r%   r&   r'   r(   r   r   r   r*   5   r+   zAsyncPage._get_page_itemsNc                 C   r,   r-   r   r.   r   r   r   r/   <   r0   zAsyncPage.next_page_infor1   r2   r   r   r   r   r   /   r4   r   c                       p   e Zd ZU ee ed< dZee ed< e	dee fddZ
e	def fddZe	dee fd	d
Z  ZS )r   r"   Nhas_morer$   c                 C   r%   r&   r'   r(   r   r   r   r*   I   r+   zSyncCursorPage._get_page_itemsc                    $   | j }|d ur|du rdS t  S NFr6   superhas_next_pager)   r6   	__class__r   r   r;   P      
zSyncCursorPage.has_next_pagec                 C   D   | j }|sd S tt|d }t|tr|jd u rd S td|jidS Nafterparamsr"   r   r   
isinstancer   r   r   r)   r"   itemr   r   r   r/   X      zSyncCursorPage.next_page_infor   r   r   r   r   r   r6   r   boolr	   r*   r;   r   r/   __classcell__r   r   r=   r   r   E      
 r   c                       r5   )r   r"   Nr6   r$   c                 C   r%   r&   r'   r(   r   r   r   r*   j   r+   zAsyncCursorPage._get_page_itemsc                    r7   r8   r9   r<   r=   r   r   r;   q   r?   zAsyncCursorPage.has_next_pagec                 C   r@   rA   rF   rH   r   r   r   r/   y   rJ   zAsyncCursorPage.next_page_inforK   r   r   r=   r   r   f   rN   r   c                          e Zd ZU ee ed< dZee ed< dZ	ee
 ed< edee fddZedef fdd	Zedee fd
dZ  ZS )r   r"   Nr6   last_idr$   c                 C   r%   r&   r'   r(   r   r   r   r*      r+   z*SyncConversationCursorPage._get_page_itemsc                    r7   r8   r9   r<   r=   r   r   r;      r?   z(SyncConversationCursorPage.has_next_pagec                 C      | j }|sd S td|idS NrC   rD   rP   r   r)   rP   r   r   r   r/         z)SyncConversationCursorPage.next_page_infor   r   r   r   r   r   r6   r   rL   rP   r   r	   r*   r;   r   r/   rM   r   r   r=   r   r         
 r   c                       rO   )r   r"   Nr6   rP   r$   c                 C   r%   r&   r'   r(   r   r   r   r*      r+   z+AsyncConversationCursorPage._get_page_itemsc                    r7   r8   r9   r<   r=   r   r   r;      r?   z)AsyncConversationCursorPage.has_next_pagec                 C   rQ   rR   rS   rT   r   r   r   r/      rU   z*AsyncConversationCursorPage.next_page_inforV   r   r   r=   r   r      rW   r   N)typingr   r   r   r   r   r   typing_extensionsr   r	   r
   _base_clientr   r   r   r   __all__r   r   r   r   r   r   r   r   r   r   r   r   <module>   s    	    ! !$