
    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dS )    )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]modeldefnr   returnNonec                X    t                                          |           || _        d S N)super__init__r   )selfr   r   	__class__s      O/var/www/html/mpstechhub/venv/lib/python3.11/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   r   r   )r   r   )__name__
__module____qualname____doc____annotations__r   r   __classcell__)r   s   @r   r   r      sk          
 $###     . . . . . . . .r   r   )namedescriptionr   r   r"   
str | Noner#   r   r
   c                   || j         }t          |p| j        dt          |           d|                                           }|||d<   d|dS )NT)r"   strict
parametersr#   function)typer(   )r   r   r   r   r   )r   r"   r#   r(   s       r   pydantic_function_toolr*      s      m#*EN/66	
 	

 	  dff  "-   r   )r   r   r"   r$   r#   r$   r   r
   )
__future__r   typingr   r   r   pydantic	_pydanticr   
types.chatr
   types.shared_paramsr   strr   r*    r   r   <module>r3      s    " " " " " " " " " " " " " " " "  , , , , , , 0 0 0 0 0 0 4 4 4 4 4 4. . . . .4S> . . .& "	       r   