a
    _ŠÝgÝ  ã                   @  s„   d dl mZ d dlmZmZmZ d dlZddlmZ ddl	m
Z
 ddlmZ G d	d
„ d
eeef ƒZdddœdddddœdd„ZdS )é    )Úannotations)ÚAnyÚDictÚcastNé   )Úto_strict_json_schemaé   )ÚChatCompletionToolParam)ÚFunctionDefinitionc                      sB   e Zd ZU dZded< ddddœ‡ fdd„Zdd	œd
d„Z‡  ZS )ÚPydanticFunctionToolzŠDictionary wrapper so we can pass the given base model
    throughout the entire request stack without having to special
    case it.
    útype[pydantic.BaseModel]Úmodelr
   ÚNone)Údefnr   Úreturnc                   s   t ƒ  |¡ || _d S ©N)ÚsuperÚ__init__r   )Úselfr   r   ©Ú	__class__© ú_/var/www/html/cobodadashboardai.evdpl.com/venv/lib/python3.9/site-packages/openai/lib/_tools.pyr      s    zPydanticFunctionTool.__init__)r   c                 C  s
   t t| ƒS r   )r   r
   )r   r   r   r   r      s    zPydanticFunctionTool.cast)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú__annotations__r   r   Ú__classcell__r   r   r   r   r      s   
r   )ÚnameÚdescriptionr   z
str | Noner	   )r   r   r    r   c                C  sH   |d u r| j }t|p| jdt| ƒdœ| ƒ ¡ }|d ur>||d< d|dœS )NT)r   ÚstrictÚ
parametersr    Úfunction)Útyper#   )r   r   r   r   r   )r   r   r    r#   r   r   r   Úpydantic_function_tool   s    ýú	þr%   )Ú
__future__r   Útypingr   r   r   ZpydanticZ	_pydanticr   Z
types.chatr	   Ztypes.shared_paramsr
   Ústrr   r%   r   r   r   r   Ú<module>   s   ü