
    f3fi.                     r    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y
)zFunction Message.    )AnyLiteral)override)BaseMessageBaseMessageChunkmerge_content)merge_dictsc                   2    e Zd ZU dZeed<   	 dZed   ed<   y)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. 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/auto_recruiter/arenv/lib/python3.12/site-packages/langchain_core/messages/function.pyr   r      s#    	 I5 *D'*
*;r   r   c                   N     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                  k7  rd}t        |      | j	                  | j                  t        | j                  |j                        t        | j                  |j                        t        | j                  |j                        | j                        S t        | 1  |      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yyEJJ&V o%>>YY%dllEMMB"-**E,C,C# #.**E,C,C# 77 " 
 
 wu%%r   )r   r   r   r   r   r   r   r   r   r   r%   __classcell__)r#   s   @r   r   r   "   s=    !
 -CD'(
)B;&S &%5 & &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-      s8      & 
 4<k <&&?,< &r   