o
    ͩZhF                     @  s  d dl mZ d dlmZmZmZmZmZmZm	Z	m
Z
 d dlmZmZ d dlmZmZ d dlZd dlmZ ddlmZmZ ed	Zed
ejdZejdZersdgddZdhddZdiddZdjdd Zdkd!d"Z dld$d%Z!dld&d'Z"n/erd d(l#mZmZm Z m"Z"m!Z! d d)l$mZmZ nd d(l%mZmZm Z m"Z"m!Z! d d)l&mZmZ erd d*lm'Z' nerd d*lm'Z' ndZ'dmd.d/Z(dnd2d3Z)dod5d6Z*dod7d8Z+dpd:d;Z,dqd=d>Z-d?d@drdBdCZ.ddDdsdIdJZ/dd?d?dKdLdMdtdVdWZ0dudYdZZ1dvd\d]Z2dwd^d_Z3erG d`da daejZ4nerG dbda daejZ4nd dl5ZG dcda daej6j4ejZ4er:e7Z8G ddde deee Z9dS d dfl:m8Z8 e8Z9dS )x    )annotations)TYPE_CHECKINGAnyUnionGenericTypeVarCallablecastoverload)datedatetime)SelfLiteralN)	FieldInfo   )IncExStrBytesIntFloat_T_ModelT)boundz2.valuedate | StrBytesIntFloatreturnr   c                 C     d S N r   r   r   E/var/www/html/lang_env/lib/python3.10/site-packages/openai/_compat.py
parse_date      r   !Union[datetime, StrBytesIntFloat]r   c                 C  r   r   r   r   r   r   r   parse_datetime   r   r!   t	type[Any]tuple[Any, ...]c                 C  r   r   r   r"   r   r   r   get_args   r   r&   tptype[Any] | Noneboolc                 C  r   r   r   )r'   r   r   r   is_union"   r   r*   c                 C  r   r   r   r%   r   r   r   
get_origin%   r   r+   type_c                 C  r   r   r   r,   r   r   r   is_literal_type(   r   r.   c                 C  r   r   r   r-   r   r   r   is_typeddict+   r   r/   )r&   r*   r+   r/   r.   )r   r!   )
ConfigDictmodeltype[_ModelT]objectc                 C  s   t r| |S tt| |S r   )PYDANTIC_V2model_validater	   r   	parse_obj)r1   r   r   r   r   r6   O   s   
r6   fieldr   c                 C  s   t r|  S | jS r   )r4   Zis_requiredrequiredr7   r   r   r   field_is_requiredV   s   r:   r   c                 C  s,   |   }trddlm} ||krd S |S |S )Nr   )PydanticUndefined)get_defaultr4   Zpydantic_corer;   )r7   r   r;   r   r   r   field_get_default\   s   r=   c                 C     t r| jS | jS r   )r4   
annotationZouter_type_r9   r   r   r   field_outer_typeg      r@   type[pydantic.BaseModel]c                 C  r>   r   )r4   Zmodel_configZ
__config__r1   r   r   r   get_model_configm   rA   rD   dict[str, FieldInfo]c                 C  r>   r   )r4   Zmodel_fieldsZ
__fields__rC   r   r   r   get_model_fieldss   rA   rF   FdeeprH   c                C     t r| j|dS | j|dS )NrG   )r4   
model_copycopy)r1   rH   r   r   r   rJ   y      rJ   indentpydantic.BaseModelrN   
int | Nonestrc                C  rI   )NrM   )r4   Zmodel_dump_jsonjson)r1   rN   r   r   r   
model_json   rL   rS   Tpython)excludeexclude_unsetexclude_defaultswarningsmoderU   IncEx | NonerV   rW   rX   rY   Literal['json', 'python']dict[str, Any]c                C  sD   t st| dr| j||||t r|dS ddS td| j|||dS )N
model_dumpT)rY   rU   rV   rW   rX   r\   )rU   rV   rW   )r4   hasattrr]   r	   dict)r1   rU   rV   rW   rX   rY   r   r   r   r]      s$   	r]   datac                 C     t r| |S | |S r   )r4   r5   r6   r1   r`   r   r   r   model_parse      

rc   str | bytesc                 C  ra   r   )r4   Zmodel_validate_jsonZ	parse_rawrb   r   r   r   model_parse_json   rd   rf   c                 C  s   t r|  S |  S r   )r4   model_json_schemaZschemarC   r   r   r   rg      s   rg   c                   @     e Zd ZdS GenericModelN__name__
__module____qualname__r   r   r   r   rj          rj   c                   @  rh   ri   rk   r   r   r   r   rj      ro   c                   @  rh   ri   rk   r   r   r   r   rj      ro   c                   @  sh   e Zd ZU ded< ded< dddZeddddZedd ddZdd!ddZd"ddZd#ddZd	S )$typed_cached_propertyCallable[[Any], _T]funcz
str | Noneattrnamer   Nonec                 C  r   r   r   )selfrr   r   r   r   __init__       ztyped_cached_property.__init__Ninstanceownerr(   r   c                 C  r   r   r   ru   rx   ry   r   r   r   __get__   r   ztyped_cached_property.__get__r3   r   c                 C  r   r   r   rz   r   r   r   r{      r   	_T | Selfc                 C  s   t  r   )NotImplementedErrorrz   r   r   r   r{      s   r#   namerQ   c                 C  r   r   r   )ru   ry   r~   r   r   r   __set_name__   rw   z"typed_cached_property.__set_name__r   c                 C  r   r   r   )ru   rx   r   r   r   r   __set__   rw   ztyped_cached_property.__set__)rr   rq   r   rt   r   )rx   rt   ry   r(   r   r   )rx   r3   ry   r(   r   r   )rx   r3   ry   r(   r   r|   )ry   r#   r~   rQ   r   rt   )rx   r3   r   r   r   rt   )	rl   rm   rn   __annotations__rv   r
   r{   r   r   r   r   r   r   rp      s   
 

rp   )cached_property)r   r   r   r   )r   r    r   r   )r"   r#   r   r$   )r'   r(   r   r)   )r"   r#   r   r(   )r,   r#   r   r)   )r1   r2   r   r3   r   r   )r7   r   r   r)   )r7   r   r   r   )r1   rB   r   r   )r1   rB   r   rE   )r1   r   rH   r)   r   r   )r1   rO   rN   rP   r   rQ   )r1   rO   rU   rZ   rV   r)   rW   r)   rX   r)   rY   r[   r   r\   )r1   r2   r`   r   r   r   )r1   r2   r`   re   r   r   )r1   r2   r   r\   );
__future__r   typingr   r   r   r   r   r   r	   r
   r   r   Ztyping_extensionsr   r   ZpydanticZpydantic.fieldsr   _typesr   r   r   Z	BaseModelr   VERSION
startswithr4   r   r!   r&   r*   r+   r.   r/   Zpydantic.v1.typingZpydantic.v1.datetime_parseZpydantic.typingZpydantic.datetime_parser0   r6   r:   r=   r@   rD   rF   rJ   rS   r]   rc   rf   rg   rj   Zpydantic.genericsZgenericspropertyr   rp   	functoolsr   r   r   r   <module>   sp    (











	



