
    g                        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
eeef         Zddd	 	 	 	 	 	 	 ddZy)    )annotations)AnyDictcastN   )to_strict_json_schema   )ChatCompletionToolParam)FunctionDefinitionc                  8     e Zd ZU dZded<   d fdZddZ xZS )PydanticFunctionToolzDictionary wrapper so we can pass the given base model
    throughout the entire request stack without having to special
    case it.
    type[pydantic.BaseModel]modelc                2    t         |   |       || _        y N)super__init__r   )selfdefnr   	__class__s      F/var/www/openai/venv/lib/python3.12/site-packages/openai/lib/_tools.pyr   zPydanticFunctionTool.__init__   s    
    c                "    t        t        |       S r   )r   r   )r   s    r   r   zPydanticFunctionTool.cast   s    &--r   )r   r   r   r   returnNone)r   r   )__name__
__module____qualname____doc____annotations__r   r   __classcell__)r   s   @r   r   r      s    
 $#.r   r   )namedescriptionc                   || j                   }t        |xs | j                  dt        |       d|       j	                         }|||d<   d|dS )NT)r"   strict
parametersr#   function)typer'   )r   r   r   r   r   )r   r"   r#   r'   s       r   pydantic_function_toolr)      sp      mm#*ENN/6	

 	 df  "-  r   )r   r   r"   
str | Noner#   r*   r   r
   )
__future__r   typingr   r   r   pydantic	_pydanticr   
types.chatr
   types.shared_paramsr   strr   r)    r   r   <module>r3      sa    " " "  , 0 4.4S> .& "	#  	
 r   