
    dh              	           S SK JrJrJrJr  S SKJr  S SKJr   " S S\5      r	 " S S\5      r
SSS	.S
\\   S\\   S\\   S\	4S jjrSSS	.S
\\   S\\   S\\   S\
4S jjrg)    )LiteralOptionalType	TypedDict)dereference_refs)	BaseModelc                   <    \ rS rSr% Sr\\S'    \\S'    \\S'   Srg)FunctionDescription   7Representation of a callable function to the Ernie API.namedescription
parameters N)	__name__
__module____qualname____firstlineno____doc__str__annotations__dict__static_attributes__r       a/var/www/html/shao/venv/lib/python3.13/site-packages/langchain_community/utils/ernie_functions.pyr
   r
      s    A
I#()r   r
   c                   4    \ rS rSr% Sr\S   \S'   \\S'   Srg)ToolDescription   r   functiontyper   N)	r   r   r   r   r   r   r   r
   r   r   r   r   r   r      s    A
*
!!r   r   Nr   r   modelr   r   returnc                    [        U R                  5       5      nUR                  SS5        U=(       d    US   U=(       d    US   U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                     [        XUS9nSUS.$ )r%   r!   r   )r    r   )r*   )r"   r   r   r   s       r   convert_pydantic_to_ernie_toolr,   )   s      2kH H55r   )typingr   r   r   r    langchain_core.utils.json_schemar   pydanticr   r
   r   r   r*   r,   r   r   r   <module>r0      s    5 5 = *) *"i " !%		? 3- #	
 & !%	
6	?
6 3-
6 #	
6
 
6r   