§
    ™Štj�›  ã            $       ó  — d dl Z d dlZd dlmZmZmZ d dlmZmZm	Z	m
Z
mZmZ d dlmZmZmZ d dlmZmZmZmZmZ d dlmZmZmZmZ d dlmZ d dlmZm Z  d d	l!m"Z" d d
l#m$Z$m%Z% d dl&m'Z'm(Z( d dl)m*Z* d dl+m,Z, d dl-m.Z. d dl/m0Z0 d dl1m2Z2 d dl3m4Z4m5Z5 d dl6m7Z7 d dl8m9Z9 d dl:m;Z; d dl<m=Z=m>Z>m?Z? d dl@mAZAmBZB eCe;z  ZDeCeEe;         z  ZF e?de9¬¦  «         G d„ de>¦  «        ¦   «         ZG e?de9¬¦  «         G d„ de;¦  «        ¦   «         ZH ejI        ¦   «         5   ejJ        de9d¬ ¦  «          e?d!e9¬¦  «         G d"„ d#eG¦  «        ¦   «         ZKddd¦  «         n# 1 swxY w Y    ejI        ¦   «         5   ejJ        de9d¬ ¦  «          e?d$e9¬¦  «         G d%„ d&eH¦  «        ¦   «         ZLddd¦  «         n# 1 swxY w Y    ejI        ¦   «         5   ejJ        de9¬¦  «          e
d'eGeHz  ¬(¦  «        ZMeEeM         ZNddd¦  «         n# 1 swxY w Y   d)ZOeePz  eeMgef         z  eeMef         z  ZQdLd*eMd+ePd,ed-efd.„ZRd/eQdz  d-efd0„ZS	 dMd1ed2ee         d3eTd-eUfd4„ZVd1ed-efd5„ZWd6ee         d-dfd7„ZX e?d8e9¬¦  «        ddddddddddd9d:dd;œd1ePez  eeMe0e7         gef         z  eeMe0e7         gee         f         z  eeMe0e7         geeef         f         z  eeMe0e7         geeeef                  f         z  d2eeez  eCePef         z           eBz  d/eQdz  d<eFeYePeFf         z  dz  d=e dz  d>e dz  d?eNdz  d@eEe         dz  dAe4dz  dBe2dz  dCeZeP         dz  dDeZeP         dz  dEeUdFe	dG         dHePdz  dIed-e,f"dJ„¦   «         Z[e[Z\g dK¢Z]dS )Né    N)Ú	AwaitableÚCallableÚSequence)Ú	AnnotatedÚAnyÚLiteralÚTypeVarÚcastÚget_type_hints)ÚBaseChatModelÚLanguageModelInputÚLanguageModelLike)Ú	AIMessageÚ
AnyMessageÚBaseMessageÚSystemMessageÚToolMessage)ÚRunnableÚRunnableBindingÚRunnableConfigÚRunnableSequence)ÚBaseTool)ÚRunnableCallableÚRunnableLike)ÚMISSING)Ú	ErrorCodeÚcreate_error_message)ÚENDÚ
StateGraph)Úadd_messages)ÚCompiledStateGraph)ÚRemainingSteps)ÚRuntime)Ú	BaseStore)ÚCheckpointerÚSend)ÚContextT)ÚLangGraphDeprecatedSinceV10)Ú	BaseModel)ÚNotRequiredÚ	TypedDictÚ
deprecated)ÚToolCallWithContextÚToolNodezxAgentState has been moved to `langchain.agents`. Please update your import to `from langchain.agents import AgentState`.©Úcategoryc                   óP   — e Zd ZU dZeee         ef         ed<   e	e
         ed<   dS )Ú
AgentStateúThe state of the agent.ÚmessagesÚremaining_stepsN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r    Ú__annotations__r*   r"   © ó    úd/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/langgraph/prebuilt/chat_agent_executor.pyr2   r2   5   sF   € € € € € € ð
 "Ð!à˜ Ô-¨|Ð;Ô<Ð<Ð<Ñ<à  Ô0Ð0Ð0Ñ0Ð0Ð0r<   r2   zTAgentStatePydantic has been deprecated in favor of AgentState in `langchain.agents`.c                   óH   — e Zd ZU dZeee         ef         ed<   dZ	e
ed<   dS )ÚAgentStatePydanticr3   r4   é   r5   N)r6   r7   r8   r9   r   r   r   r    r:   r5   r"   r;   r<   r=   r?   r?   A   sE   € € € € € € ð
 "Ð!à˜ Ô-¨|Ð;Ô<Ð<Ð<Ñ<à&(€O�^Ð(Ð(Ñ(Ð(Ð(r<   r?   Úignorez1AgentState has been moved to `langchain.agents`.*)r0   ÚmessagezbAgentStateWithStructuredResponse has been deprecated in favor of AgentState in `langchain.agents`.c                   ó   — e Zd ZU dZeed<   dS )Ú AgentStateWithStructuredResponseú2The state of the agent with a structured response.Ústructured_responseN©r6   r7   r8   r9   ÚStructuredResponser:   r;   r<   r=   rD   rD   T   ó'   € € € € € € ð
 	AÐ@à/Ð/Ð/Ñ/Ð/Ð/r<   rD   zjAgentStateWithStructuredResponsePydantic has been deprecated in favor of AgentState in `langchain.agents`.c                   ó   — e Zd ZU dZeed<   dS )Ú(AgentStateWithStructuredResponsePydanticrE   rF   NrG   r;   r<   r=   rK   rK   e   rI   r<   rK   ÚStateSchema)ÚboundÚPromptÚstateÚkeyÚdefaultÚreturnc                 óz   — t          | t          ¦  «        r|                      ||¦  «        nt          | ||¦  «        S ©N)Ú
isinstanceÚdictÚgetÚgetattr)rO   rP   rQ   s      r=   Ú_get_state_valuerY   �   s=   € õ �e�TÑ"Ô"ð	*ˆ�	Š	�#�wÑÔÐå�U˜C Ñ)Ô)ðr<   Úpromptc                 ó,  ‡ ‡— ‰ €t          d„ t          ¬¦  «        }n÷t          ‰ t          ¦  «        r*t	          ‰ ¬¦  «        Št          ˆfd„t          ¬¦  «        }n¸t          ‰ t          ¦  «        rt          ˆ fd„t          ¬¦  «        }n‰t          j        ‰ ¦  «        rt          d ‰ t          ¬¦  «        }n]t          ‰ ¦  «        rt          ‰ t          ¬¦  «        }n7t          ‰ t          ¦  «        r‰ }nt          dt          ‰ ¦  «        › �¦  «        ‚|S )Nc                 ó"   — t          | d¦  «        S ©Nr4   ©rY   )rO   s    r=   ú<lambda>z&_get_prompt_runnable.<locals>.<lambda>�   s   € Õ*¨5°*Ñ=Ô=€ r<   ©Úname©Úcontentc                 ó,   •— ‰gt          | d¦  «        z   S r]   r^   )rO   Ú_system_messages    €r=   r_   z&_get_prompt_runnable.<locals>.<lambda>’   s   ø€ ˜?Ð+Õ.>¸uÀjÑ.QÔ.QÑQ€ r<   c                 ó,   •— ‰gt          | d¦  «        z   S r]   r^   )rO   rZ   s    €r=   r_   z&_get_prompt_runnable.<locals>.<lambda>—   s   ø€ ˜6˜(Õ%5°e¸ZÑ%HÔ%HÑH€ r<   z"Got unexpected type for `prompt`: )r   ÚPROMPT_RUNNABLE_NAMErU   Ústrr   ÚinspectÚiscoroutinefunctionÚcallabler   Ú
ValueErrorÚtype)rZ   Úprompt_runnablere   s   ` @r=   Ú_get_prompt_runnablero   ‰   sO  øø€ à€~Ý*Ø=Ð=ÕDXð
ñ 
ô 
ˆˆõ 
�F�CÑ	 Ô	 ð NÝ'4¸VÐ'DÑ'DÔ'DˆÝ*ØQÐQÐQÐQÝ%ð
ñ 
ô 
ˆˆõ 
�F�MÑ	*Ô	*ð NÝ*ØHÐHÐHÐHÝ%ð
ñ 
ô 
ˆˆõ 
Ô	$ VÑ	,Ô	,ð NÝ*ØØÝ%ð
ñ 
ô 
ˆˆõ
 
�&Ñ	Ô	ð NÝ*ØÝ%ð
ñ 
ô 
ˆˆõ 
�F�HÑ	%Ô	%ð NØ ˆˆåÐL½dÀ6¹l¼lÐLÐLÑMÔMÐMàÐr<   ÚmodelÚtoolsÚnum_builtinc                 óº  — t          | t          ¦  «        rt          d„ | j        D ¦   «         | ¦  «        } t          | t          ¦  «        sdS d| j        vrdS | j        d         }t          |¦  «        t          |¦  «        |z
  k    r2t          dt          |¦  «        › dt          |¦  «        |z
  › �¦  «        ‚t          d„ |D ¦   «         ¦  «        }t          ¦   «         }|D ]^}| 	                    d¦  «        dk    r|d         d	         }n| 	                    d	¦  «        r	|d	         }nŒI| 
                    |¦  «         Œ_||z
  x}rt          d
|› d�¦  «        ‚dS )Nc              3   óR   K  — | ]"}t          |t          t          f¦  «        ¯|V — Œ#d S rT   ©rU   r   r   ©Ú.0Ústeps     r=   ú	<genexpr>z%_should_bind_tools.<locals>.<genexpr>²   óK   è è € ð ð àÝ˜d¥_µmÐ$DÑEÔEðØðð ð ð ð ð r<   Trq   z`Number of tools in the model.bind_tools() and tools passed to create_react_agent must match Got z tools, expected c              3   ó$   K  — | ]}|j         V — Œd S rT   r`   )rw   Útools     r=   ry   z%_should_bind_tools.<locals>.<genexpr>Ç   s$   è è € Ð1Ð1 4�T”YÐ1Ð1Ð1Ð1Ð1Ð1r<   rm   Úfunctionra   zMissing tools 'z' in the model.bind_tools()F)rU   r   ÚnextÚstepsr   ÚkwargsÚlenrl   ÚsetrW   Úadd)	rp   rq   rr   Úbound_toolsÚ
tool_namesÚbound_tool_namesÚ
bound_toolÚbound_tool_nameÚmissing_toolss	            r=   Ú_should_bind_toolsrŠ   ­   sµ  € õ �%Õ)Ñ*Ô*ð 
Ýðð à!œKðñ ô ð
 ñ
ô 
ˆõ �e�_Ñ-Ô-ð Øˆtà�e”lÐ"Ð"Øˆtà”,˜wÔ'€KÝ
ˆ5�z„z•S˜Ñ%Ô%¨Ñ3Ò3Ð3ÝðRÝ˜‘J”JðRð RÝ14°[Ñ1AÔ1AÀKÑ1OðRð Rñ
ô 
ð 	
õ
 Ð1Ð1¨5Ð1Ñ1Ô1Ñ1Ô1€JÝ‘u”uÐØ!ð .ð .ˆ
à�>Š>˜&Ñ!Ô! ZÒ/Ð/Ø(¨Ô4°VÔ<ˆOˆOà�^Š^˜FÑ#Ô#ð 	Ø(¨Ô0ˆOˆOð à×Ò˜_Ñ-Ô-Ð-Ð-à"Ð%5Ñ5Ð5€}ð WÝÐU¨=ÐUÐUÐUÑVÔVÐVàˆ5r<   c                 ó  — t          | t          ¦  «        rt          d„ | j        D ¦   «         | ¦  «        } t          | t          ¦  «        r| j        } t          | t          ¦  «        st          dt          | ¦  «        › �¦  «        ‚| S )zKGet the underlying model from a RunnableBinding or return the model itself.c              3   óR   K  — | ]"}t          |t          t          f¦  «        ¯|V — Œ#d S rT   ru   rv   s     r=   ry   z_get_model.<locals>.<genexpr>à   rz   r<   zXExpected `model` to be a ChatModel or RunnableBinding (e.g. model.bind_tools(...)), got )	rU   r   r~   r   r   rM   r   Ú	TypeErrorrm   )rp   s    r=   Ú
_get_modelrŽ   Ü   s¢   € å�%Õ)Ñ*Ô*ð 
Ýðð à!œKðñ ô ð
 ñ
ô 
ˆõ �%�Ñ)Ô)ð Ø”ˆå�e�]Ñ+Ô+ð 
ÝØtÕgkÐlqÑgrÔgrÐtÐtñ
ô 
ð 	
ð €Lr<   r4   c                 óÄ   ‡— d„ | D ¦   «         }d„ | D ¦   «         Šˆfd„|D ¦   «         }|sdS t          d|dd…         › d�t          j        ¬¦  «        }t          |¦  «        ‚)	zLValidate that all tool calls in AIMessages have a corresponding ToolMessage.c                 óP   — g | ]#}t          |t          ¦  «        ¯|j        D ]}|‘ŒŒ$S r;   )rU   r   Ú
tool_calls)rw   rB   Ú	tool_calls      r=   ú
<listcomp>z*_validate_chat_history.<locals>.<listcomp>÷   sV   € ð ð ð àÝ�g�yÑ)Ô)ðð !Ô+ð	ð ð ð 	ðð ð ð r<   c                 óF   — h | ]}t          |t          ¦  «        ¯|j        ’ŒS r;   ©rU   r   Útool_call_id)rw   rB   s     r=   ú	<setcomp>z)_validate_chat_history.<locals>.<setcomp>ý   s:   € ð "ð "ð "Ø!(½
À7ÍKÑ8XÔ8Xð"ØÔð"ð "ð "r<   c                 ó(   •— g | ]}|d          ‰v¯|‘ŒS ©Úidr;   )rw   r’   Útool_call_ids_with_resultss     €r=   r“   z*_validate_chat_history.<locals>.<listcomp>   s3   ø€ ð "ð "ð "àØ�TŒ?Ð"<Ð<Ð<ð 	à<Ð<Ð<r<   Nz{Found AIMessages with tool_calls that do not have a corresponding ToolMessage. Here are the first few of those tool calls: é   zÌ.

Every tool call (LLM requesting to call a tool) in the message history MUST have a corresponding ToolMessage (result of a tool invocation to return to the LLM) - this is required by most LLM providers.)rB   Ú
error_code)r   r   ÚINVALID_CHAT_HISTORYrl   )r4   Úall_tool_callsÚtool_calls_without_resultsÚerror_messager›   s       @r=   Ú_validate_chat_historyr¢   ó   sË   ø€ ðð àðñ ô €Nð"ð "Ø,4ð"ñ "ô "Ðð"ð "ð "ð "à'ð"ñ "ô "Ðð
 &ð Øˆå(ðgØ7QÐRTÐSTÐRTÔ7Uðgð gð gõ Ô1ðñ ô €Mõ �]Ñ
#Ô
#Ð#r<   z‚create_react_agent has been moved to `langchain.agents`. Please update your import to `from langchain.agents import create_agent`.FÚv2)rZ   Úresponse_formatÚpre_model_hookÚpost_model_hookÚstate_schemaÚcontext_schemaÚcheckpointerÚstoreÚinterrupt_beforeÚinterrupt_afterÚdebugÚversionra   r¤   r¥   r¦   r§   r¨   r©   rª   r«   r¬   r­   r®   ©Úv1r£   ra   Údeprecated_kwargsc                óô  ‡ ‡‡‡‡‡‡‡‡&‡'‡(‡)‡*‡+‡,‡-‡.— |                      dt          ¦  «        x}t          urt          j        dt          ¬¦  «         |€|}t          |¦  «        dk    rt          d|› �¦  «        ‚‰dvrt          d‰› d	�¦  «        ‚‰�^d
dh}‰�|                     d¦  «         t          t          ‰¦  «        ¦  «        }|t          |¦  «        z
  x}rt          d|› d�¦  «        ‚‰€‰�t          nt          Šg }t          |t          ¦  «        r)t          |j                             ¦   «         ¦  «        }|}nKd„ |D ¦   «         }t          d„ |D ¦   «         ¦  «        }t          |j                             ¦   «         ¦  «        }t          ‰ t$          t&          f¦  «         ot)          ‰ ¦  «        Š,‰,ot+          j        ‰ ¦  «        Š+t          |¦  «        dk    }‰,sËt          ‰ t$          ¦  «        rC	 ddlm} n# t2          $ r t3          d¦  «        ‚w xY wt5          t6           |‰ ¦  «        ¦  «        Š t9          ‰ |t          |¦  «        ¬¦  «        rAt          ||z   ¦  «        dk    r+t5          t6          ‰ ¦  «                             ||z   ¦  «        Š t=          ‰¦  «        ‰ z  Š.ndŠ.d„ |D ¦   «         Š-dt>          dt@          tB                   dtD          fˆ,ˆ ˆˆ.fd„Š)dt>          dt@          tB                   dtD          fˆ+ˆ,ˆ ˆˆ.fd„Š'dt>          dtF          dtH          fˆ-fd„Š&dt>          dt>          fˆˆfd„Š(dt>          dt@          tB                   dtJ          dt>          fˆ&ˆ(ˆ)ˆ+ˆ,ˆˆ.fd„}dt>          dt@          tB                   dtJ          dt>          fˆ&ˆ'ˆ(ˆ,ˆˆ.fd„}‰�bt          ‰tL          ¦  «        r<tO          ‰tP          ¦  «        r'dd l)m*}  |d!t          tV                   d"f‰¬#¦  «        }n G d$„ d!‰¦  «        }|}n‰}dt>          dt@          tB                   dtJ          dt>          fˆ)ˆ+ˆfd%„}dt>          dt@          tB                   dtJ          dt>          fˆ'ˆfd&„}|�stY          ‰|¬'¦  «        } |  -                    d(t]          ||¦  «        |¬)¦  «         ‰�/|  -                    d*‰¦  «         |  /                    d*d(¦  «         d*Š*nd(Š*|  0                    ‰*¦  «         ‰�,|  -                    d+‰¦  «         |  /                    d(d+¦  «         ‰�S|  -                    d,t]          ||¦  «        ¦  «         ‰�|  /                    d+d,¦  «         n|  /                    d(d,¦  «         |  1                    ||	|
||‰¬-¦  «        S dt>          dt$          t          td                   z  fˆˆˆfd.„}!tY          ‰pt          |¬'¦  «        } |  -                    d(t]          ||¦  «        |¬)¦  «         |  -                    d/|¦  «         ‰�/|  -                    d*‰¦  «         |  /                    d*d(¦  «         d*Š*nd(Š*|  0                    ‰*¦  «         g }"‰*d/g}#‰�B|  -                    d+‰¦  «         |" 3                    d+¦  «         |  /                    d(d+¦  «         n|" 3                    d/¦  «         ‰�R|  -                    d,t]          ||¦  «        ¦  «         ‰�|# 3                    d,¦  «         nM|" 3                    d,¦  «         n7‰�|# 3                    th          ¦  «         n|" 3                    th          ¦  «         ‰�@dt>          dt$          t          td                   z  fˆ*ˆfd0„}$|  5                    d+|$|#¬1¦  «         |  5                    d(|!|"¬1¦  «         dt>          dt$          fˆ*ˆ-fd2„}%‰-r |  5                    d/|%‰*th          g¬1¦  «         n|  /                    d/‰*¦  «         |  1                    ||	|
||‰¬-¦  «        S )3a*  Creates an agent graph that calls tools in a loop until a stopping condition is met.

    !!! warning

        This function is deprecated in favor of
        [`create_agent`][langchain.agents.create_agent] from the `langchain`
        package, which provides an equivalent agent factory with a flexible
        middleware system. For migration guidance, see
        [Migrating from LangGraph v0](https://docs.langchain.com/oss/python/migrate/langgraph-v1).

    Args:
        model: The language model for the agent. Supports static and dynamic
            model selection.

            - **Static model**: A chat model instance (e.g.,
                [`ChatOpenAI`][langchain_openai.ChatOpenAI]) or string identifier (e.g.,
                `"openai:gpt-4"`)
            - **Dynamic model**: A callable with signature
                `(state, runtime) -> BaseChatModel` that returns different models
                based on runtime context

                If the model has tools bound via `bind_tools` or other configurations,
                the return type should be a `Runnable[LanguageModelInput, BaseMessage]`
                Coroutines are also supported, allowing for asynchronous model selection.

            Dynamic functions receive graph state and runtime, enabling
            context-dependent model selection. Must return a `BaseChatModel`
            instance. For tool calling, bind tools using `.bind_tools()`.
            Bound tools must be a subset of the `tools` parameter.

            !!! example "Dynamic model"

                ```python
                from dataclasses import dataclass

                @dataclass
                class ModelContext:
                    model_name: str = "gpt-3.5-turbo"

                # Instantiate models globally
                gpt4_model = ChatOpenAI(model="gpt-4")
                gpt35_model = ChatOpenAI(model="gpt-3.5-turbo")

                def select_model(state: AgentState, runtime: Runtime[ModelContext]) -> ChatOpenAI:
                    model_name = runtime.context.model_name
                    model = gpt4_model if model_name == "gpt-4" else gpt35_model
                    return model.bind_tools(tools)
                ```

            !!! note "Dynamic Model Requirements"

                Ensure returned models have appropriate tools bound via
                `.bind_tools()` and support required functionality. Bound tools
                must be a subset of those specified in the `tools` parameter.

        tools: A list of tools or a `ToolNode` instance.
            If an empty list is provided, the agent will consist of a single LLM node without tool calling.
        prompt: An optional prompt for the LLM. Can take a few different forms:

            - `str`: This is converted to a `SystemMessage` and added to the beginning of the list of messages in `state["messages"]`.
            - `SystemMessage`: this is added to the beginning of the list of messages in `state["messages"]`.
            - `Callable`: This function should take in full graph state and the output is then passed to the language model.
            - `Runnable`: This runnable should take in full graph state and the output is then passed to the language model.

        response_format: An optional schema for the final agent output.

            If provided, output will be formatted to match the given schema and returned in the 'structured_response' state key.

            If not provided, `structured_response` will not be present in the output state.

            Can be passed in as:

            - An OpenAI function/tool schema,
            - A JSON Schema,
            - A TypedDict class,
            - A Pydantic class.
            - A tuple `(prompt, schema)`, where schema is one of the above.
                The prompt will be used together with the model that is being used to
                generate the structured response.

            !!! Important
                `response_format` requires the model to support `.with_structured_output`

            !!! Note
                The graph will make a separate call to the LLM to generate the structured response after the agent loop is finished.
                This is not the only strategy to get structured responses, see more options in [this guide](https://langchain-ai.github.io/langgraph/how-tos/react-agent-structured-output/).

        pre_model_hook: An optional node to add before the `agent` node (i.e., the node that calls the LLM).
            Useful for managing long message histories (e.g., message trimming, summarization, etc.).
            Pre-model hook must be a callable or a runnable that takes in current graph state and returns a state update in the form of
                ```python
                # At least one of `messages` or `llm_input_messages` MUST be provided
                {
                    # If provided, will UPDATE the `messages` in the state
                    "messages": [RemoveMessage(id=REMOVE_ALL_MESSAGES), ...],
                    # If provided, will be used as the input to the LLM,
                    # and will NOT UPDATE `messages` in the state
                    "llm_input_messages": [...],
                    # Any other state keys that need to be propagated
                    ...
                }
                ```

            !!! Important
                At least one of `messages` or `llm_input_messages` MUST be provided and will be used as an input to the `agent` node.
                The rest of the keys will be added to the graph state.

            !!! Warning
                If you are returning `messages` in the pre-model hook, you should OVERWRITE the `messages` key by doing the following:

                ```python
                {
                    "messages": [RemoveMessage(id=REMOVE_ALL_MESSAGES), *new_messages]
                    ...
                }
                ```
        post_model_hook: An optional node to add after the `agent` node (i.e., the node that calls the LLM).
            Useful for implementing human-in-the-loop, guardrails, validation, or other post-processing.
            Post-model hook must be a callable or a runnable that takes in current graph state and returns a state update.

            !!! Note
                Only available with `version="v2"`.
        state_schema: An optional state schema that defines graph state.
            Must have `messages` and `remaining_steps` keys.
            Defaults to `AgentState` that defines those two keys.
            !!! Note
                `remaining_steps` is used to limit the number of steps the react agent can take.
                Calculated roughly as `recursion_limit` - `total_steps_taken`.
                If `remaining_steps` is less than 2 and tool calls are present in the response,
                the react agent will return a final AI Message with
                the content "Sorry, need more steps to process this request.".
                No `GraphRecusionError` will be raised in this case.

        context_schema: An optional schema for runtime context.
        checkpointer: An optional checkpoint saver object. This is used for persisting
            the state of the graph (e.g., as chat memory) for a single thread (e.g., a single conversation).
        store: An optional store object. This is used for persisting data
            across multiple threads (e.g., multiple conversations / users).
        interrupt_before: An optional list of node names to interrupt before.
            Should be one of the following: `"agent"`, `"tools"`.

            This is useful if you want to add a user confirmation or other interrupt before taking an action.
        interrupt_after: An optional list of node names to interrupt after.
            Should be one of the following: `"agent"`, `"tools"`.

            This is useful if you want to return directly or run additional processing on an output.
        debug: A flag indicating whether to enable debug mode.
        version: Determines the version of the graph to create.

            Can be one of:

            - `"v1"`: The tool node processes a single message. All tool
                calls in the message are executed in parallel within the tool node.
            - `"v2"`: The tool node processes a tool call.
                Tool calls are distributed across multiple instances of the tool
                node using the [Send](https://langchain-ai.github.io/langgraph/concepts/low_level/#send)
                API.
        name: An optional name for the `CompiledStateGraph`.
            This name will be automatically used when adding ReAct agent graph to another graph as a subgraph node -
            particularly useful for building multi-agent systems.

    !!! warning "`config_schema` Deprecated"
        The `config_schema` parameter is deprecated in v0.6.0 and support will be removed in v2.0.0.
        Please use `context_schema` instead to specify the schema for run-scoped context.


    Returns:
        A compiled LangChain `Runnable` that can be used for chat interactions.

    The "agent" node calls the language model with the messages list (after applying the prompt).
    If the resulting AIMessage contains `tool_calls`, the graph will then call the ["tools"][langgraph.prebuilt.tool_node.ToolNode].
    The "tools" node executes the tools (1 tool per `tool_call`) and adds the responses to the messages list
    as `ToolMessage` objects. The agent node then calls the language model again.
    The process repeats until no more `tool_calls` are present in the response.
    The agent then returns the full list of messages as a dictionary containing the key `'messages'`.

    ``` mermaid
        sequenceDiagram
            participant U as User
            participant A as LLM
            participant T as Tools
            U->>A: Initial input
            Note over A: Prompt + LLM
            loop while tool_calls present
                A->>T: Execute tools
                T-->>A: ToolMessage for each tool_calls
            end
            A->>U: Return final state
    ```

    Example:
        ```python
        from langgraph.prebuilt import create_react_agent

        def check_weather(location: str) -> str:
            '''Return the weather forecast for the specified location.'''
            return f"It's always sunny in {location}"

        graph = create_react_agent(
            "anthropic:claude-3-7-sonnet-latest",
            tools=[check_weather],
            prompt="You are a helpful assistant",
        )
        inputs = {"messages": [{"role": "user", "content": "what is the weather in sf"}]}
        for chunk in graph.stream(inputs, stream_mode="updates"):
            print(chunk)
        ```
    Úconfig_schemazW`config_schema` is deprecated and will be removed. Please use `context_schema` instead.r/   Nr   z7create_react_agent() got unexpected keyword arguments: r¯   zInvalid version z'. Supported versions are 'v1' and 'v2'.r4   r5   rF   zMissing required key(s) z in state_schemac                 ó<   — g | ]}t          |t          ¦  «        ¯|‘ŒS r;   ©rU   rV   ©rw   Úts     r=   r“   z&create_react_agent.<locals>.<listcomp>/  s'   € ÐEÐEÐE 1µ¸A½tÑ1DÔ1DÐE˜QÐEÐEÐEr<   c                 ó<   — g | ]}t          |t          ¦  «        °|‘ŒS r;   rµ   r¶   s     r=   r“   z&create_react_agent.<locals>.<listcomp>0  s'   € ÐJÐJÐJ AµjÀÅDÑ6IÔ6IÐJ˜aÐJÐJÐJr<   )Úinit_chat_modelzsPlease install langchain (`pip install langchain`) to use '<provider>:<model>' string syntax for `model` parameter.)rr   c                 ó*   — h | ]}|j         ¯	|j        ’ŒS r;   )Úreturn_directra   r¶   s     r=   r—   z%create_react_agent.<locals>.<setcomp>U  s!   € ÐLÐLÐL q¸A¼OÐL˜AœFÐLÐLÐLr<   rO   ÚruntimerR   c                 óD   •— ‰rt          ‰¦  «         ‰| |¦  «        z  S ‰S )zBResolve the model to use, handling both static and dynamic models.©ro   )rO   r¼   Úis_dynamic_modelrp   rZ   Ústatic_models     €€€€r=   Ú_resolve_modelz*create_react_agent.<locals>._resolve_modelW  s2   ø€ ð ð 	 Ý'¨Ñ/Ô/°%°%¸¸wÑ2GÔ2GÑGÐGàÐr<   c              “   ó”   •K  — ‰r$ ‰| |¦  «        ƒ d{V —†}t          ‰¦  «        |z  S ‰rt          ‰¦  «         ‰| |¦  «        z  S ‰S )zHAsync resolve the model to use, handling both static and dynamic models.Nr¾   )rO   r¼   Úresolved_modelÚis_async_dynamic_modelr¿   rp   rZ   rÀ   s      €€€€€r=   Ú_aresolve_modelz+create_react_agent.<locals>._aresolve_model`  st   øè è € ð "ð 	 Ø#( 5¨°Ñ#8Ô#8Ð8Ð8Ð8Ð8Ð8Ð8ˆNÝ'¨Ñ/Ô/°.Ñ@Ð@Øð 	 Ý'¨Ñ/Ô/°%°%¸¸wÑ2GÔ2GÑGÐGàÐr<   Úresponsec                 óü   •— t          |t          ¦  «        o|j        }t          |t          ¦  «        r t          ˆfd„|j        D ¦   «         ¦  «        nd}t	          | dd ¦  «        }|�|dk     r|rdS |dk     r|rdS dS )Nc              3   ó,   •K  — | ]}|d          ‰v V — ŒdS ©ra   Nr;   ©rw   ÚcallÚshould_return_directs     €r=   ry   zEcreate_react_agent.<locals>._are_more_steps_needed.<locals>.<genexpr>o  s-   øè è € ÐUÐU¸��V”Ð 4Ð4ÐUÐUÐUÐUÐUÐUr<   Fr5   é   Té   )rU   r   r‘   ÚallrY   )rO   rÆ   Úhas_tool_callsÚall_tools_return_directr5   rÌ   s        €r=   Ú_are_more_steps_neededz2create_react_agent.<locals>._are_more_steps_neededl  s¥   ø€ Ý# H­iÑ8Ô8ÐP¸XÔ=Pˆõ ˜(¥IÑ.Ô.ð�CÐUÐUÐUÐUÀÔATÐUÑUÔUÑUÔUÐUàð 	 õ
 +¨5Ð2CÀTÑJÔJˆØÐ&Ø Ò"Ð"Ð'>Ð"Ø�tØ  1Ò$Ð$¨Ð$Ø�tàˆur<   c                 ó0  •— ‰�&t          | d¦  «        pt          | d¦  «        }d| › �}nt          | d¦  «        }d| › �}|€t          |¦  «        ‚t          |¦  «         t          ‰t          ¦  «        rt          ‰t          ¦  «        r|| _        n|| d<   | S )NÚllm_input_messagesr4   zUExpected input to call_model to have 'llm_input_messages' or 'messages' key, but got z=Expected input to call_model to have 'messages' key, but got )rY   rl   r¢   rU   rm   Ú
issubclassr)   r4   )rO   r4   Ú	error_msgr¥   r§   s      €€r=   Ú_get_model_input_statez2create_react_agent.<locals>._get_model_input_state|  sÀ   ø€ ØÐ%å  Ð(<Ñ=Ô=ð5å! %¨Ñ4Ô4ð ð xÐpuÐwÐwˆIˆIå'¨¨zÑ:Ô:ˆHàWÐPUÐWÐWð ð ÐÝ˜YÑ'Ô'Ð'å˜xÑ(Ô(Ð(å�l¥DÑ)Ô)ð 	)­j¸ÅyÑ.QÔ.Qð 	)Ø%ˆEŒNˆNà (ˆE�*Ñàˆr<   Úconfigc                 ód  •— ‰
rd}t          |¦  «        ‚ ‰| ¦  «        }‰r6 ‰	| |¦  «        }t          t          |                     ||¦  «        ¦  «        }n)t          t          ‰                     ||¦  «        ¦  «        }‰|_         ‰| |¦  «        rdt          |j        d¬¦  «        giS d|giS )NúˆAsync model callable provided but agent invoked synchronously. Use agent.ainvoke() or agent.astream(), or provide a sync model callable.r4   ú/Sorry, need more steps to process this request.©rš   rc   )ÚRuntimeErrorr
   r   Úinvokera   rš   )rO   r¼   rØ   ÚmsgÚmodel_inputÚdynamic_modelrÆ   rÒ   r×   rÁ   rÄ   r¿   ra   rÀ   s          €€€€€€€r=   Ú
call_modelz&create_react_agent.<locals>.call_model•  sê   ø€ ð "ð 	$ð1ð õ
 ˜sÑ#Ô#Ð#à,Ð,¨UÑ3Ô3ˆàð 	Qà*˜N¨5°'Ñ:Ô:ˆMÝ�I }×';Ò';¸KÈÑ'PÔ'PÑQÔQˆHˆHå�I |×':Ò':¸;ÈÑ'OÔ'OÑPÔPˆHð ˆŒà!Ð! %¨Ñ2Ô2ð 	àÝØ#œ;Ø Qðñ ô ððð ð ˜X˜JÐ'Ð'r<   c              “   óf  •K  —  ‰| ¦  «        }‰	rB ‰| |¦  «        ƒ d {V —†}t          t          |                     ||¦  «        ƒ d {V —†¦  «        }n/t          t          ‰                     ||¦  «        ƒ d {V —†¦  «        }‰
|_         ‰| |¦  «        rdt          |j        d¬¦  «        giS d|giS )Nr4   rÛ   rÜ   )r
   r   Úainvokera   rš   )rO   r¼   rØ   rà   rá   rÆ   rÒ   rÅ   r×   r¿   ra   rÀ   s         €€€€€€r=   Úacall_modelz'create_react_agent.<locals>.acall_model¸  s  øè è € ð -Ð,¨UÑ3Ô3ˆàð 	Xð #2 /°%¸Ñ"AÔ"AÐAÐAÐAÐAÐAÐAˆMÝ�I¨]×-BÒ-BÀ;ÐPVÑ-WÔ-WÐ'WÐ'WÐ'WÐ'WÐ'WÐ'WÑXÔXˆHˆHå�I¨\×-AÒ-AÀ+ÈvÑ-VÔ-VÐ'VÐ'VÐ'VÐ'VÐ'VÐ'VÑWÔWˆHð ˆŒØ!Ð! %¨Ñ2Ô2ð 	àÝØ#œ;Ø Qðñ ô ððð ð ˜X˜JÐ'Ð'r<   )Úcreate_modelÚCallModelInputSchema.)rÔ   Ú__base__c                   ó&   — e Zd ZU ee         ed<   dS )ú0create_react_agent.<locals>.CallModelInputSchemarÔ   N)r6   r7   r8   Úlistr   r:   r;   r<   r=   rç   rê   á  s#   € € € € € € Ø$(¨Ô$4Ð4Ð4Ñ4Ð4Ð4r<   c                 óz  •— ‰rd}t          |¦  «        ‚t          | d¦  «        }‰}t          ‰t          ¦  «        r&‰\  }}t	          |¬¦  «        gt          |¦  «        z   } ‰
| |¦  «        }t          |¦  «                             t          t          |¦  «        ¦  «        }| 
                    ||¦  «        }	d|	iS )NrÚ   r4   rb   rF   )rÝ   rY   rU   Útupler   rë   rŽ   Úwith_structured_outputr
   ÚStructuredResponseSchemarÞ   )rO   r¼   rØ   rß   r4   Ústructured_response_schemaÚsystem_promptrÃ   Úmodel_with_structured_outputrÆ   rÁ   rÄ   r¤   s             €€€r=   Úgenerate_structured_responsez8create_react_agent.<locals>.generate_structured_responseè  sà   ø€ ð "ð 	$ð\ð õ ˜sÑ#Ô#Ð#å# E¨:Ñ6Ô6ˆØ%4Ð"Ý�o¥uÑ-Ô-ð 	OØ8GÑ5ˆMÐ5Ý%¨mÐ<Ñ<Ô<Ð=ÅÀXÁÄÑNˆHà'˜¨¨wÑ7Ô7ˆÝ'1Øñ(
ô (
ç
 Ò
 ÝÕ)Ð+EÑFÔFñ
ô 
ð 	%ð
 0×6Ò6°xÀÑHÔHˆØ% xÐ0Ð0r<   c              “   óp  •K  — t          | d¦  «        }‰
}t          ‰
t          ¦  «        r&‰
\  }}t          |¬¦  «        gt	          |¦  «        z   } ‰	| |¦  «        ƒ d {V —†}t          |¦  «                             t          t          |¦  «        ¦  «        }| 	                    ||¦  «        ƒ d {V —†}d|iS )Nr4   rb   rF   )
rY   rU   rí   r   rë   rŽ   rî   r
   rï   rä   )rO   r¼   rØ   r4   rð   rñ   rÃ   rò   rÆ   rÅ   r¤   s            €€r=   Úagenerate_structured_responsez9create_react_agent.<locals>.agenerate_structured_response  så   øè è € õ $ E¨:Ñ6Ô6ˆØ%4Ð"Ý�o¥uÑ-Ô-ð 	OØ8GÑ5ˆMÐ5Ý%¨mÐ<Ñ<Ô<Ð=ÅÀXÁÄÑNˆHà.˜¨u°gÑ>Ô>Ð>Ð>Ð>Ð>Ð>Ð>ˆÝ'1Øñ(
ô (
ç
 Ò
 ÝÕ)Ð+EÑFÔFñ
ô 
ð 	%ð
 6×=Ò=¸hÈÑOÔOÐOÐOÐOÐOÐOÐOˆØ% xÐ0Ð0r<   )r§   r¨   Úagent)Úinput_schemar¥   r¦   ró   )r©   rª   r«   r¬   r­   ra   c                 óÚ   •‡ — t          ‰ d¦  «        }|d         }t          |t          ¦  «        r|j        s‰�dS ‰�dS t          S ‰dk    rdS ‰dk    r‰�dS ˆ fd„|j        D ¦   «         S d S )	Nr4   éÿÿÿÿr¦   ró   r°   rq   r£   c           
      óP   •— g | ]"}t          d t          d|‰¬¦  «        ¦  «        ‘Œ#S ©rq   Útool_call_with_context)Ú__typer’   rO   ©r&   r-   ©rw   rË   rO   s     €r=   r“   z?create_react_agent.<locals>.should_continue.<locals>.<listcomp>Q  óS   ø€ ð 
ð 
ð 
ð õ ØÝ+Ø#;Ø&*Ø"'ðñ ô ñô ð
ð 
ð 
r<   )rY   rU   r   r‘   r   )rO   r4   Úlast_messager¦   r¤   r®   s   `  €€€r=   Úshould_continuez+create_react_agent.<locals>.should_continue?  s±   øø€ Ý# E¨:Ñ6Ô6ˆØ ”|ˆå˜,­	Ñ2Ô2ð 	¸,Ô:Qð 	ØÐ*Ø(Ð(Ø Ð,Ø5Ð5å�
ð ˜$ŠˆØ�wØ˜D’�Ø"Ð.Ø,Ð,ð
ð 
ð 
ð 
ð !-Ô 7ð
ñ 
ô 
ð 
ð !�r<   rq   c                 ó"  •‡ ‡— t          ‰ d¦  «        }d„ |D ¦   «         Št          d„ t          |¦  «        D ¦   «         ¦  «        }ˆfd„|j        D ¦   «         }|rˆ fd„|D ¦   «         S t	          |d         t
          ¦  «        r‰S ‰�dS t          S )	aw  Route to the next node after post_model_hook.

            Routes to one of:
            * "tools": if there are pending tool calls without a corresponding message.
            * "generate_structured_response": if no pending tool calls exist and response_format is specified.
            * END: if no pending tool calls exist and no response_format is specified.
            r4   c                 óF   — g | ]}t          |t          ¦  «        ¯|j        ‘ŒS r;   r•   ©rw   Úms     r=   r“   zFcreate_react_agent.<locals>.post_model_hook_router.<locals>.<listcomp>¡  s9   € ð ð ð Ø#$µJ¸qÅ+Ñ4NÔ4NðØ”ðð ð r<   c              3   óD   K  — | ]}t          |t          ¦  «        ¯|V — Œd S rT   )rU   r   r  s     r=   ry   zEcreate_react_agent.<locals>.post_model_hook_router.<locals>.<genexpr>¤  sE   è è € ð #ð #Øµ¸A½yÑ1IÔ1Ið#Øð#ð #ð #ð #ð #ð #r<   c                 ó(   •— g | ]}|d          ‰v¯|‘ŒS r™   r;   )rw   ÚcÚtool_messagess     €r=   r“   zFcreate_react_agent.<locals>.post_model_hook_router.<locals>.<listcomp>§  s.   ø€ ð "ð "ð "Ø¸¸4¼ÈÐ9UÐ9U�Ð9UÐ9UÐ9Ur<   c           
      óP   •— g | ]"}t          d t          d|‰¬¦  «        ¦  «        ‘Œ#S rû   rþ   rÿ   s     €r=   r“   zFcreate_react_agent.<locals>.post_model_hook_router.<locals>.<listcomp>¬  r   r<   rù   Nró   )rY   r~   Úreversedr‘   rU   r   r   )rO   r4   Úlast_ai_messageÚpending_tool_callsr
  Ú
entrypointr¤   s   `   @€€r=   Úpost_model_hook_routerz2create_react_agent.<locals>.post_model_hook_router—  sû   øøø€ õ (¨¨zÑ:Ô:ˆHðð Ø(0ðñ ô ˆMõ #ð #ð #Ý# HÑ-Ô-ð#ñ #ô #ñ ô ˆOð"ð "ð "ð "Ø*Ô5ð"ñ "ô "Ðð "ð ð
ð 
ð 
ð 
ð !3ð
ñ 
ô 
ð 
õ ˜H RœL­+Ñ6Ô6ð Ø!Ð!Ø Ð,Ø5Ð5å�
r<   )Úpath_mapc                 ó   •— t          t          | d¦  «        ¦  «        D ]+}t          |t          ¦  «        s n|j        ‰v r	t
          c S Œ,t          |t          ¦  «        r.|j        r't          ˆfd„|j        D ¦   «         ¦  «        rt
          S ‰S )Nr4   c              3   ó,   •K  — | ]}|d          ‰v V — ŒdS rÉ   r;   rÊ   s     €r=   ry   zCcreate_react_agent.<locals>.route_tool_responses.<locals>.<genexpr>Ô  s-   øè è € ÐQÐQ¸D�4˜”<Ð#7Ð7ÐQÐQÐQÐQÐQÐQr<   )	r  rY   rU   r   ra   r   r   r‘   Úany)rO   r  r  rÌ   s     €€r=   Úroute_tool_responsesz0create_react_agent.<locals>.route_tool_responsesÊ  s§   ø€ ÝÕ*¨5°*Ñ=Ô=Ñ>Ô>ð 	ð 	ˆAÝ˜a¥Ñ-Ô-ð Ø�ØŒvÐ-Ð-Ð-Ý�
�
�
ð .õ
 �a�Ñ#Ô#ð 	¨¬ð 	ÝÐQÐQÐQÐQÀAÄLÐQÑQÔQÑQÔQð Ý�
àÐr<   )6Úpopr   ÚwarningsÚwarnr(   r�   r�   rl   rƒ   r‚   r   rD   r2   rU   r.   rë   Útools_by_nameÚvaluesrh   r   rk   ri   rj   Úlangchain.chat_modelsr¹   ÚImportErrorr
   r   rŠ   Ú
bind_toolsro   rL   r#   r'   r   r   Úboolr   rm   rÕ   r)   Úpydanticræ   r   r   Úadd_noder   Úadd_edgeÚset_entry_pointÚcompiler&   Úappendr   Úadd_conditional_edges)/rp   rq   rZ   r¤   r¥   r¦   r§   r¨   r©   rª   r«   r¬   r­   r®   ra   r±   r³   Úrequired_keysÚschema_keysÚmissing_keysÚllm_builtin_toolsÚtool_classesÚ	tool_nodeÚtool_calling_enabledr¹   râ   rå   ræ   r÷   rç   ró   rõ   Úworkflowr  Úagent_pathsÚpost_model_hook_pathsr  r  rÒ   rÅ   r×   rÁ   r  rÄ   r¿   rÌ   rÀ   s/   ` `````      ``                       @@@@@@@@@r=   Úcreate_react_agentr0    s  øøøøøøøøøøøøøøøøø€ ðh +×.Ò.¨ÅÑHÔHÐHˆÝðð õ 	ŒØeÝ0ð	
ñ 	
ô 	
ð 	
ð
 Ð!Ø*ˆNå
ÐÑÔ Ò!Ð!ÝØYÐFWÐYÐYñ
ô 
ð 	
ð �lÐ"Ð"ÝØO˜wÐOÐOÐOñ
ô 
ð 	
ð ÐØ#Ð%6Ð7ˆØÐ&Ø×ÒÐ3Ñ4Ô4Ð4å�.¨Ñ6Ô6Ñ7Ô7ˆØ(­3¨{Ñ+;Ô+;Ñ;Ð;ˆ<ð 	XÝÐV¸ÐVÐVÐVÑWÔWÐWàÐð Ð*õ -Ð,åð 	ð %'ÐÝ�%�Ñ"Ô"ð >Ý˜EÔ/×6Ò6Ñ8Ô8Ñ9Ô9ˆØˆ	ˆ	àEÐE¨ÐEÑEÔEÐÝÐJÐJ¨ÐJÑJÔJÑKÔKˆ	Ý˜IÔ3×:Ò:Ñ<Ô<Ñ=Ô=ˆå% e­cµ8¨_Ñ=Ô=Ð=ÐQÅ(È5Á/Ä/ÐØ-ÐTµ'Ô2MÈeÑ2TÔ2TÐå˜|Ñ,Ô,¨qÒ0Ðàð Ý�e�SÑ!Ô!ð 	@ððð ð ð ð ð ð øõ ð ð ð Ý!ðTñô ð ðøøøõ �¨¨¸Ñ(>Ô(>Ñ?Ô?ˆEõ ˜u lÅÐDUÑ@VÔ@VÐWÑWÔWð	å�LÐ#4Ñ4Ñ5Ô5¸Ò9Ð9å�¨Ñ.Ô.×9Ò9ØÐ0Ñ0ñô ˆEõ )=¸VÑ(DÔ(DÀuÑ(Lˆˆð ˆð MÐL¨LÐLÑLÔLÐð Ýð Ý%,­XÔ%6ð å	ð ð  ð  ð  ð  ð  ð  ð  ð  ð
 Ýð
 Ý%,­XÔ%6ð
 å	ð
 ð 
 ð 
 ð 
 ð 
 ð 
 ð 
 ð 
 ð 
 ð 
 ð¥kð ½[ð ÍTð ð ð ð ð ð ð ¥kð µkð ð ð ð ð ð ð ð2!(Ýð!(Ý%,­XÔ%6ð!(Ý@Nð!(å	ð!(ð !(ð !(ð !(ð !(ð !(ð !(ð !(ð !(ð !(ð !(ð !(ðF(Ýð(Ý%,­XÔ%6ð(Ý@Nð(å	ð(ð (ð (ð (ð (ð (ð (ð (ð (ð (ð (ð8 Ð!å�l¥DÑ)Ô)ð 	0­j¸ÅyÑ.QÔ.Qð 	0à-Ð-Ð-Ð-Ð-Ð-à'˜<Ø&Ý$(­Ô$4°cÐ#:Ø%ðñ ô ˆLˆLð5ð 5ð 5ð 5ð 5 |ñ 5ô 5ð 5ð 0ˆLˆLà#ˆð1Ýð1Ý%,­XÔ%6ð1Ý@Nð1å	ð1ð 1ð 1ð 1ð 1ð 1ð 1ð 1ð21Ýð1Ý%,­XÔ%6ð1Ý@Nð1å	ð1ð 1ð 1ð 1ð 1ð 1ð 1ð$  ñ )
å¨<ÈÐWÑWÔWˆØ×ÒØÝ˜Z¨Ñ5Ô5Ø%ð 	ñ 	
ô 	
ð 	
ð
 Ð%Ø×ÒÐ.°Ñ?Ô?Ð?Ø×ÒÐ.°Ñ8Ô8Ð8Ø)ˆJˆJà ˆJà× Ò  Ñ,Ô,Ð,àÐ&Ø×ÒÐ/°ÑAÔAÐAØ×Ò˜gÐ'8Ñ9Ô9Ð9àÐ&Ø×ÒØ.Ý Ø0Ø1ñô ñô ð ð Ð*Ø×!Ò!Ð"3Ð5SÑTÔTÐTÐTà×!Ò! 'Ð+IÑJÔJÐJà×ÒØ%ØØ-Ø+ØØð  ñ 
ô 
ð 	
ð�{ð ­sµT½$´ZÑ/?ð ð ð ð ð ð ð ð õ> Ø!Ð/¥ZÀðñ ô €Hð
 ×ÒØÝ˜ [Ñ1Ô1Ø!ð ñ ô ð ð
 ×Ò�g˜yÑ)Ô)Ð)ð Ð!Ø×ÒÐ*¨NÑ;Ô;Ð;Ø×ÒÐ*¨GÑ4Ô4Ð4Ø%ˆ
ˆ
àˆ
ð ×Ò˜ZÑ(Ô(Ð(à€KØ'¨Ð1Ðð Ð"Ø×ÒÐ+¨_Ñ=Ô=Ð=Ø×ÒÐ,Ñ-Ô-Ð-Ø×Ò˜'Ð#4Ñ5Ô5Ð5Ð5à×Ò˜7Ñ#Ô#Ð#ð Ð"Ø×ÒØ*ÝØ,Ø-ñô ñ	
ô 	
ð 	
ð Ð&Ø!×(Ò(Ð)GÑHÔHÐHÐHà×ÒÐ=Ñ>Ô>Ð>Ð>àÐ&Ø!×(Ò(­Ñ-Ô-Ð-Ð-à×Ò�sÑ#Ô#Ð#àÐ"ð%	­+ð %	½#ÅÅTÄ
Ñ:Jð %	ð %	ð %	ð %	ð %	ð %	ð %	ðN 	×&Ò&ØØ"Ø*ð 	'ñ 	
ô 	
ð 	
ð ×"Ò"ØØØð #ñ ô ð ð¥Kð µCð ð ð ð ð ð ð ð ð /Ø×&Ò&ØÐ)°ZÅÐ4Eð 	'ñ 	
ô 	
ð 	
ð 	
ð 	×Ò˜' :Ñ.Ô.Ð.ð
 ×ÒØ!ØØ)Ø'ØØð ñ ô ð s   Ç;H ÈH)r0  Úcreate_tool_calling_executorr2   r?   rD   rK   rT   )r   )^ri   r  Úcollections.abcr   r   r   Útypingr   r   r   r	   r
   r   Úlangchain_core.language_modelsr   r   r   Úlangchain_core.messagesr   r   r   r   r   Úlangchain_core.runnablesr   r   r   r   Úlangchain_core.toolsr   Úlanggraph._internal._runnabler   r   Úlanggraph._internal._typingr   Úlanggraph.errorsr   r   Úlanggraph.graphr   r   Úlanggraph.graph.messager    Úlanggraph.graph.stater!   Úlanggraph.managedr"   Úlanggraph.runtimer#   Úlanggraph.store.baser$   Úlanggraph.typesr%   r&   Úlanggraph.typingr'   Úlanggraph.warningsr(   r  r)   Útyping_extensionsr*   r+   r,   Úlanggraph.prebuilt.tool_noder-   r.   rV   rH   rm   rï   r2   r?   Úcatch_warningsÚfilterwarningsrD   rK   rL   ÚStateSchemaTyperg   rh   rN   rY   ro   Úintr  rŠ   rŽ   r¢   rí   rë   r0  r1  Ú__all__r;   r<   r=   ú<module>rK     sL	  ðØ €€€Ø €€€Ø 9Ð 9Ð 9Ð 9Ð 9Ð 9Ð 9Ð 9Ð 9Ð 9ðð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ðð ð ð ð ð ð ð ð ð ð
ð ð ð ð ð ð ð ð ð ð ð ð ð ðð ð ð ð ð ð ð ð ð ð ð ð *Ð )Ð )Ð )Ð )Ð )Ø HÐ HÐ HÐ HÐ HÐ HÐ HÐ HØ /Ð /Ð /Ð /Ð /Ð /Ø <Ð <Ð <Ð <Ð <Ð <Ð <Ð <Ø +Ð +Ð +Ð +Ð +Ð +Ð +Ð +Ø 0Ð 0Ð 0Ð 0Ð 0Ð 0Ø 4Ð 4Ð 4Ð 4Ð 4Ð 4Ø ,Ð ,Ð ,Ð ,Ð ,Ð ,Ø %Ð %Ð %Ð %Ð %Ð %Ø *Ð *Ð *Ð *Ð *Ð *Ø .Ð .Ð .Ð .Ð .Ð .Ð .Ð .Ø %Ð %Ð %Ð %Ð %Ð %Ø :Ð :Ð :Ð :Ð :Ð :Ø Ð Ð Ð Ð Ð Ø @Ð @Ð @Ð @Ð @Ð @Ð @Ð @Ð @Ð @à FÐ FÐ FÐ FÐ FÐ FÐ FÐ Fà˜IÑ%Ð Ø $ y¤/Ñ1Ð ð €Ø~Ø(ðñ ô ð1ð 1ð 1ð 1ð 1�ñ 1ô 1ñ	ô ð1ð €ØZØ(ðñ ô ð)ð )ð )ð )ð )˜ñ )ô )ñ	ô ð)ð €XÔÑÔð 0ð 0Ø€HÔØØ,ØCðñ ô ð ð €ZØlØ,ðñ ô ð0ð 0ð 0ð 0ð 0¨:ñ 0ô 0ñ	ô ð0ð0ð 0ð 0ñ 0ô 0ð 0ð 0ð 0ð 0ð 0ð 0øøøð 0ð 0ð 0ð 0ð" €XÔÑÔð 0ð 0Ø€HÔØØ,Øfðñ ô ð ð €ZØtØ,ðñ ô ð0ð 0ð 0ð 0ð 0Ð3Eñ 0ô 0ñ	ô ð0ð0ð 0ð 0ñ 0ô 0ð 0ð 0ð 0ð 0ð 0ð 0øøøð 0ð 0ð 0ð 0ð" €XÔÑÔð (ð (Ø€HÔØØ,ðñ ô ð ð �'˜-¨zÐ<NÑ/NÐOÑOÔO€KØ˜;Ô'€Oð(ð (ð (ñ (ô (ð (ð (ð (ð (ð (ð (øøøð (ð (ð (ð (ð  Ð ð Ø	ñ
à�ˆ}Ð0Ð0Ô1ñ2ð ˆ{Ð.Ð.Ô/ñ0ð ðð ˜Kð ¨cð ¸Cð È3ð ð ð ð ð! ¨$¡ð !°8ð !ð !ð !ð !ðJ MNð,ð ,Øð,Ø%-¨hÔ%7ð,ØFIð,à	ð,ð ,ð ,ð ,ð^Ð'ð ¨Mð ð ð ð ð.$Ø�{Ô#ð$à	ð$ð $ð $ð $ð> €ð IØ(ðñ ô ð$ !ð Ø*.Ø+/Ø+/Ø'+Ø(,Ø"Ø)-Ø(,ØØ#'Øð9Tð Tð TØØñà�˜W XÔ.Ð/°Ð>Ô?ñ@ð �˜W XÔ.Ð/°¸=Ô1IÐIÔJñKð Ø	�g˜hÔ'Ð(¨(Ð3EÀ{Ð3RÔ*SÐSôñ	ð Ø	�g˜hÔ'Ð(Ø�(Ð-¨{Ð:Ô;Ô<ð	>ôñ
ðTð �H˜xÑ'¨$¨s°C¨x¬.Ñ8Ô9¸HÑDðTð �T‰MðTð .ØˆCÐ)Ð)Ô*ñ+à
ñðTð$ ! 4Ñ'ð%Tð& " DÑ(ð'Tð( " DÑ(ð)Tð* ˜”I Ñ$ð+Tð,  Ñ%ð-Tð. �tÑð/Tð0 ˜3”i $Ñ&ð1Tð2 ˜#”Y Ñ%ð3Tð4 ð5Tð6 �ZÔ ð7Tð8 �‰*ð9Tð: ð;Tð< ð=Tð Tð Tñ	ô ðTðp  2Ð ðð ð €€€s6   Ä5EÅEÅEÅ15F2Æ2F6Æ9F6Ç+HÈHÈ
H