a
    ”˜ëj�  ã                   @   sf   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„ deƒZG dd	„ d	eeƒZd
S )zFunction Message.é    )ÚAnyÚLiteral)Úoverride)ÚBaseMessageÚBaseMessageChunkÚmerge_content)Úmerge_dictsc                   @   s*   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   © r   r   ú_/mnt/bigstor/www/usecases/.venv/lib/python3.9/site-packages/langchain_core/messages/function.pyr	      s   
r	   c                       s>   e Zd ZU dZd Zed  ed< eee	dœ‡ fdd„ƒZ
‡  ZS )ÚFunctionMessageChunkzFunction Message chunk.r   )ÚotherÚreturnc                    sd   t |tƒrX| j|jkr"d}t|ƒ‚| j| jt| j|jƒt| j|jƒt| j	|j	ƒ| j
d�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   Úmsg©r   r   r   r    /   s     
ÿÿ÷zFunctionMessageChunk.__add__)r   r   r   r   r   r   r   r   r   r   r    Ú__classcell__r   r   r#   r   r   "   s   
r   N)r   Útypingr   r   Ztyping_extensionsr   Zlangchain_core.messages.baser   r   r   Zlangchain_core.utils._merger   r	   r   r   r   r   r   Ú<module>   s   