
    D_i.                     r    S r SSKJrJr  SSKJr  SSKJrJrJ	r	  SSK
Jr   " S S\5      r " S S	\\5      rg
)zFunction Message.    )AnyLiteral)override)BaseMessageBaseMessageChunkmerge_content)merge_dictsc                   :    \ rS rSr% Sr\\S'    Sr\S   \S'   Sr	g)FunctionMessage   au  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type N)
__name__
__module____qualname____firstlineno____doc__str__annotations__r   r   __static_attributes__r       Z/home/james-whalen/.local/lib/python3.13/site-packages/langchain_core/messages/function.pyr   r      s#    	 I5 *D'*
*;r   r   c                   Z   ^  \ rS rSr% SrS r\S    \S'    \S\	S\
4U 4S jj5       rSrU =r$ )FunctionMessageChunk"   zFunction Message chunk.r   otherreturnc           	        > [        U[        5      (       a  U R                  UR                  :w  a  Sn[        U5      eU R	                  U R                  [        U R                  UR                  5      [        U R                  UR                  5      [        U R                  UR                  5      U R                  S9$ [        TU ]1  U5      $ )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)   FunctionMessageChunk.__add__+   s    e12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   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>r2      s8      & 
 4<k <&&?,< &r   