
    +h                    v    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mZ  ed      Z G d dee   e      Zy)	    )annotations)ABCabstractmethod)GenericTypeVarIterablecast)ClassVaroverrideTc                      e Zd ZU dZdZded<   ddZddZedd       Z	edd       Z
edd	       Zeedd
              ZddZddZddZedd       Zy)	LazyProxyzImplements data methods to pretend that an instance is another instance.

    This includes forwarding attribute access and othe methods.
    FzClassVar[bool]should_cachec                    d | _         y N_LazyProxy__proxiedselfs    G/var/www/html/venv/lib/python3.12/site-packages/openai/_utils/_proxy.py__init__zLazyProxy.__init__   s	    #'    c                ^    | j                         }t        |t              r|S t        ||      S r   )__get_proxied__
isinstancer   getattr)r   attrproxieds      r   __getattr__zLazyProxy.__getattr__   s,    &&(gy)Nw%%r   c                    | j                         }t        |t              r|j                  j                  S t        | j                               S r   )r   r   r   	__class____name__reprr   r   s     r   __repr__zLazyProxy.__repr__   s@    &&(gy)$$---D((*++r   c                    | j                         }t        |t              r|j                  j                  S t        |      S r   )r   r   r   r!   r"   strr$   s     r   __str__zLazyProxy.__str__%   s6    &&(gy)$$---7|r   c                f    | j                         }t        |t              rg S |j                         S r   )r   r   r   __dir__r$   s     r   r*   zLazyProxy.__dir__,   s,    &&(gy)I  r   c                    | j                         }t        t        |      t              rt        |      S |j                  S r   )r   
issubclasstyper   r!   r$   s     r   r!   zLazyProxy.__class__3   s6     &&(d7mY/=    r   c                    | j                   s| j                         S | j                  }||S | j                         x| _        }|S r   )r   __load__r   r$   s     r   r   zLazyProxy.__get_proxied__;   sB      ==?"..N#'==?2r   c                    || _         y r   r   )r   values     r   __set_proxied__zLazyProxy.__set_proxied__F   s	    r   c                "    t        t        |       S )zHHelper method that returns the current proxy, typed as the loaded object)r	   r   r   s    r   __as_proxied__zLazyProxy.__as_proxied__I   s    At}r   c                     y r    r   s    r   r/   zLazyProxy.__load__M   s    r   N)returnNone)r   r'   r7   object)r7   r'   )r7   zIterable[str])r7   r-   )r7   r   )r1   r   r7   r8   )r"   
__module____qualname____doc__r   __annotations__r   r   r   r%   r(   r*   propertyr!   r   r2   r4   r   r/   r6   r   r   r   r   
   s    
 $)L.((& , ,   ! ! !  !	  r   r   N)
__future__r   abcr   r   typingr   r   r   r	   typing_extensionsr
   r   r   r   r6   r   r   <module>rC      s1    " # 3 3 0CLE
C Er   