o
    ØRWj·  ã                   @  sb   d dl mZ d dlmZmZ d dlmZmZmZm	Z	 d dl
mZ edƒZG dd„ dee eƒZdS )	é    )Úannotations)ÚABCÚabstractmethod)ÚGenericÚTypeVarÚIterableÚcast)ÚoverrideÚTc                   @  sx   e Zd ZdZddd„Zeddd	„ƒZedd
d„ƒZeddd„ƒZe	eddd„ƒƒZ
ddd„Zddd„Zeddd„ƒZdS )Ú	LazyProxyz�Implements data methods to pretend that an instance is another instance.

    This includes forwarding attribute access and other methods.
    ÚattrÚstrÚreturnÚobjectc                 C  s    |   ¡ }t|tƒr|S t||ƒS ©N)Ú__get_proxied__Ú
isinstancer   Úgetattr)Úselfr   Úproxied© r   úc/home/esfera/Documents/content_generation/venv/lib/python3.10/site-packages/openai/_utils/_proxy.pyÚ__getattr__   s   

zLazyProxy.__getattr__c                 C  s&   |   ¡ }t|tƒr|jjS t|   ¡ ƒS r   )r   r   r   Ú	__class__Ú__name__Úrepr©r   r   r   r   r   Ú__repr__   s   
zLazyProxy.__repr__c                 C  s"   |   ¡ }t|tƒr|jjS t|ƒS r   )r   r   r   r   r   r   r   r   r   r   Ú__str__    s   
zLazyProxy.__str__úIterable[str]c                 C  s   |   ¡ }t|tƒrg S | ¡ S r   )r   r   r   Ú__dir__r   r   r   r   r    '   s   
zLazyProxy.__dir__Útypec                 C  sD   z|   ¡ }W n ty   t| ƒ Y S w tt|ƒtƒrt|ƒS |jS r   )r   Ú	Exceptionr!   Ú
issubclassr   r   r   r   r   r   r   .   s   ÿzLazyProxy.__class__r
   c                 C  s   |   ¡ S r   )Ú__load__©r   r   r   r   r   9   s   zLazyProxy.__get_proxied__c                 C  s
   t t| ƒS )zHHelper method that returns the current proxy, typed as the loaded object)r   r
   r%   r   r   r   Ú__as_proxied__<   s   
zLazyProxy.__as_proxied__c                 C  s   d S r   r   r%   r   r   r   r$   @   s   zLazyProxy.__load__N)r   r   r   r   )r   r   )r   r   )r   r!   )r   r
   )r   Ú
__module__Ú__qualname__Ú__doc__r   r	   r   r   r    Úpropertyr   r   r&   r   r$   r   r   r   r   r   
   s     

	
r   N)Ú
__future__r   Úabcr   r   Útypingr   r   r   r   Útyping_extensionsr	   r
   r   r   r   r   r   Ú<module>   s    