
    ghm                         d Z ddlmZmZ ddlmZ ddlmZmZm	Z	 ddl
mZ  G d de          Z G d d	ee          Zd
S )zFunction Message.    )AnyLiteral)override)BaseMessageBaseMessageChunkmerge_content)merge_dictsc                   :    e Zd ZU dZeed<   	 dZed         ed<   dS )FunctionMessagea  Message for passing the result of executing a tool back to a model.

    FunctionMessage are an older version of the ToolMessage schema, and
    do not contain the tool_call_id field.

    The tool_call_id field is used to associate the tool call request with the
    tool call response. This is useful in situations where a chat model is able
    to request multiple tool calls in parallel.
    namefunctiontypeN)__name__
__module____qualname____doc__str__annotations__r   r        ]/var/www/FlaskApp/flask-venv/lib/python3.11/site-packages/langchain_core/messages/function.pyr   r      s?           III5 *D'*
***SSr   r   c                   Z     e Zd ZU dZd Zed          ed<   	 edede	f fd            Z
 xZS )FunctionMessageChunkzFunction Message chunk.r   otherreturnc           	         t          |t                    r| j        |j        k    rd}t          |          |                     | j        t          | j        |j                  t          | j        |j                  t          | j	        |j	                  | j
                  S t                                          |          S )Nz>Cannot concatenate FunctionMessageChunks with different names.)r   contentadditional_kwargsresponse_metadataid)
isinstancer   r   
ValueError	__class__r   r   r	   r   r   r    super__add__)selfr   msgr#   s      r   r%   zFunctionMessageChunk.__add__+   s    e122 	yEJ&&V oo%>>Y%dlEMBB"-*E,C# # #.*E,C# # 7 " 
 
 
 wwu%%%r   )r   r   r   r   r   r   r   r   r   r   r%   __classcell__)r#   s   @r   r   r   !   s~         !!
 -CD'(
)BBB+ &S &%5 & & & & & X& & & & &r   r   N)r   typingr   r   typing_extensionsr   langchain_core.messages.baser   r   r   langchain_core.utils._merger	   r   r   r   r   r   <module>r-      s              & & & & & &         
 4 3 3 3 3 3T T T T Tk T T T$& & & & &?,< & & & & &r   