
    Ng              	           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dS )    )LiteralOptionalType	TypedDict)dereference_refs)	BaseModelc                   6    e Zd ZU dZeed<   	 eed<   	 eed<   dS )FunctionDescription7Representation of a callable function to the Ernie API.namedescription
parametersN)__name__
__module____qualname____doc__str__annotations__dict     e/var/www/html/ai-engine/env/lib/python3.11/site-packages/langchain_community/utils/ernie_functions.pyr
   r
      s?         AA
III#())r   r
   c                   4    e Zd ZU dZed         ed<   eed<   dS )ToolDescriptionr   functiontypeN)r   r   r   r   r   r   r
   r   r   r   r   r      s5         AA
*
!!!!!!r   r   Nr   r   modelr   r   returnc                    t          |                                           }|                    dd           |p|d         |p|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&      sX     ellnn--F
JJ}d###'w";f]&;  r   c                0    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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 5 5 5 5 5 5 5 5 5 5 = = = = = =      * * * * *) * * *" " " " "i " " " !%	  	? 3- #	
    & !%	
6 
6 
6	?
6 3-
6 #	
6
 
6 
6 
6 
6 
6 
6r   