o
    ØRWjI  ã                   @   st  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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ÚSyncNextCursorPageÚAsyncNextCursorPageÚ_Tc                   @   s   e Zd ZU ee ed< dS )ÚCursorPageItemÚidN)Ú__name__Ú
__module__Ú__qualname__r   ÚstrÚ__annotations__© r    r    ú`/home/esfera/Documents/content_generation/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,   r1   r    r    r    r!   r      ó   
 r   c                   @   r"   )r   r#   r$   r%   r&   c                 C   r'   r(   r)   r*   r    r    r!   r,   7   r-   zAsyncPage._get_page_itemsNc                 C   r.   r/   r    r0   r    r    r!   r1   >   r2   zAsyncPage.next_page_infor3   r4   r    r    r    r!   r   1   r6   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,   K   r-   zSyncCursorPage._get_page_itemsc                    ó$   | j }|d ur|du rdS tƒ  ¡ S ©NF©r8   ÚsuperÚhas_next_page©r+   r8   ©Ú	__class__r    r!   r=   R   ó   
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!   r1   Z   ó   zSyncCursorPage.next_page_info©r   r   r   r   r   r   r8   r   Úboolr	   r,   r=   r   r1   Ú__classcell__r    r    r?   r!   r   G   ó   
 r   c                       r7   )r   r$   Nr8   r&   c                 C   r'   r(   r)   r*   r    r    r!   r,   l   r-   zAsyncCursorPage._get_page_itemsc                    r9   r:   r;   r>   r?   r    r!   r=   s   rA   zAsyncCursorPage.has_next_pagec                 C   rB   rC   rH   rJ   r    r    r!   r1   {   rL   zAsyncCursorPage.next_page_inforM   r    r    r?   r!   r   h   rP   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$   Nr8   Úlast_idr&   c                 C   r'   r(   r)   r*   r    r    r!   r,   Ž   r-   z*SyncConversationCursorPage._get_page_itemsc                    r9   r:   r;   r>   r?   r    r!   r=   •   rA   z(SyncConversationCursorPage.has_next_pagec                 C   ó   | j }|sd S td|id�S ©NrE   rF   ©rR   r   ©r+   rR   r    r    r!   r1   �   ó   z)SyncConversationCursorPage.next_page_info©r   r   r   r   r   r   r8   r   rN   rR   r   r	   r,   r=   r   r1   rO   r    r    r?   r!   r   ‰   ó   
 r   c                       rQ   )r   r$   Nr8   rR   r&   c                 C   r'   r(   r)   r*   r    r    r!   r,   «   r-   z+AsyncConversationCursorPage._get_page_itemsc                    r9   r:   r;   r>   r?   r    r!   r=   ²   rA   z)AsyncConversationCursorPage.has_next_pagec                 C   rS   rT   rU   rV   r    r    r!   r1   º   rW   z*AsyncConversationCursorPage.next_page_inforX   r    r    r?   r!   r   ¦   rY   r   c                       rQ   )r   r$   Nr8   Únextr&   c                 C   r'   r(   r)   r*   r    r    r!   r,   È   r-   z"SyncNextCursorPage._get_page_itemsc                    r9   r:   r;   r>   r?   r    r!   r=   Ï   rA   z SyncNextCursorPage.has_next_pagec                 C   rS   rT   ©rZ   r   ©r+   rZ   r    r    r!   r1   ×   rW   z!SyncNextCursorPage.next_page_info©r   r   r   r   r   r   r8   r   rN   rZ   r   r	   r,   r=   r   r1   rO   r    r    r?   r!   r   Ã   rY   r   c                       rQ   )r   r$   Nr8   rZ   r&   c                 C   r'   r(   r)   r*   r    r    r!   r,   å   r-   z#AsyncNextCursorPage._get_page_itemsc                    r9   r:   r;   r>   r?   r    r!   r=   ì   rA   z!AsyncNextCursorPage.has_next_pagec                 C   rS   rT   r[   r\   r    r    r!   r1   ô   rW   z"AsyncNextCursorPage.next_page_infor]   r    r    r?   r!   r   à   rY   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    r    r!   Ú<module>   s        ! !  $