
    zvh                        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 dd	lmZ  G d
 deeef         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)FunctionDefinition)FunctionToolParamc                  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      I/var/www/html/luna/venv/lib/python3.12/site-packages/openai/lib/_tools.pyr   zPydanticFunctionTool.__init__       
    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   c                  4     e Zd ZU ded<   d fdZddZ xZS )ResponsesPydanticFunctionToolr   r   c                2    t         |   |       || _        y r   r   )r   toolr   r   s      r   r   z&ResponsesPydanticFunctionTool.__init__    r   r   c                "    t        t        |       S r   )r   ResponsesFunctionToolParamr   s    r   r   z"ResponsesPydanticFunctionTool.cast$   s    .55r   )r*   r,   r   r   r   r   )r   r,   )r    r!   r"   r$   r   r   r%   r&   s   @r   r(   r(      s    ##6r   r(   )namedescriptionc                   || j                   }t        |xs | j                  dt        |       d|       j	                         }|||d<   d|dS )NT)r-   strict
parametersr.   function)typer2   )r#   r   r    r   r   )r   r-   r.   r2   s       r   pydantic_function_toolr4   (   sp      mm#*ENN/6	

 	 df  "-  r   )r   r   r-   
str | Noner.   r5   r   r
   )
__future__r   typingr   r   r   pydantic	_pydanticr   
types.chatr
   types.shared_paramsr   #types.responses.function_tool_paramr   r,   strr   r(   r4    r   r   <module>r?      sx    " " "  , 0 4 a.4S> . 6DcN 6 "	#  	
 r   