
    7|h              	           d dl mZmZmZmZ d dlmZ d dlmZ  G d de      Z	 G d de      Z
ddd	d
ee   dee   dee   de	fdZddd	d
ee   dee   dee   de
fdZy)    )LiteralOptionalType	TypedDict)dereference_refs)	BaseModelc                   4    e Zd ZU dZeed<   	 eed<   	 eed<   y)FunctionDescription7Representation of a callable function to the Ernie API.namedescription
parametersN)__name__
__module____qualname____doc__str__annotations__dict     h/var/www/html/test/engine/venv/lib/python3.12/site-packages/langchain_community/utils/ernie_functions.pyr
   r
      s    A
I#()r   r
   c                   ,    e Zd ZU dZed   ed<   eed<   y)ToolDescriptionr   functiontypeN)r   r   r   r   r   r   r
   r   r   r   r   r      s    A
*
!!r   r   Nr   r   modelr   r   returnc                    t        | j                               }|j                  dd       |xs |d   |xs |d   |dS )EConvert a Pydantic model to a function description for the Ernie API.definitionsNtitler   )r   r   r   )r   schemapop)r   r   r   r$   s       r   "convert_pydantic_to_ernie_functionr&      sH     elln-F
JJ}d#'w";f]&; r   c                (    t        | ||      }d|dS )r!   r   r   )r   r   )r&   )r   r   r   r   s       r   convert_pydantic_to_ernie_toolr(   )   s"     2DkH H55r   )typingr   r   r   r    langchain_core.utils.json_schemar   pydanticr   r
   r   r   r&   r(   r   r   r   <module>r,      s    5 5 = *) *"i " !%		? 3- #	
 & !%	
6	?
6 3-
6 #	
6
 
6r   