
    Ng~                     6   d Z ddlZddlmZmZmZmZmZmZm	Z	m
Z
mZmZmZmZmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ dd	lmZmZ dd
lmZmZm Z m!Z!m"Z"m#Z#m$Z$ ddl%m&Z& ddl'm(Z( ddl)m*Z*m+Z+m,Z, ddl-m.Z. ddl/m0Z0 ddl1m2Z2 ddl3m4Z4m5Z5m6Z6m7Z7 ddl8m9Z9m:Z: ddl;m<Z< dee
e=ef                  dee&         fdZ>de=de?e=ef         de@defdZAde?e=ef         dee?e=ef                  fdZBde
e=ef         dee#         fdZCde#de?fdZD G d  d!e          ZEdS )"zOllama chat models.    N)AnyAsyncIteratorCallableDictIteratorListLiteralMappingOptionalSequenceTypeUnioncast)uuid4)CallbackManagerForLLMRun)AsyncCallbackManagerForLLMRun)OutputParserException)LanguageModelInput)BaseChatModelLangSmithParams)	AIMessageAIMessageChunkBaseMessageHumanMessageSystemMessageToolCallToolMessage)UsageMetadata	tool_call)ChatGenerationChatGenerationChunk
ChatResult)Runnable)BaseToolconvert_to_openai_tool)AsyncClientClientMessageOptions)PrivateAttrmodel_validator)Selfgeneration_inforeturnc                     | dS |                      d          }|                      d          }||t          ||||z             S dS )z7Get usage metadata from ollama generation info mapping.Nprompt_eval_count
eval_count)input_tokensoutput_tokenstotal_tokens)getr   )r/   r4   r5   s      X/var/www/html/ai-engine/env/lib/python3.11/site-packages/langchain_ollama/chat_models.py(_get_usage_metadata_from_generation_infor9   0   sm     t"1"5"56I"J"JL#2#6#6|#D#DMM$=%'%5
 
 
 	

 4    json_stringraw_tool_callskipc                 d   	 t          j        |           S # t           j        $ rA}|r| cY d}~S d|d         d          d|d         d          d| }t          |          |d}~wt          $ rA}|r| cY d}~S d|d         d          d|d         d          d| }t          |          |d}~ww xY w)	a  Attempt to parse a JSON string for tool calling.

    Args:
        json_string: JSON string to parse.
        skip: Whether to ignore parsing errors and return the value anyways.
        raw_tool_call: Raw tool call to include in error message.

    Returns:
        The parsed JSON string.

    Raises:
        OutputParserException: If the JSON string wrong invalid and skip=False.
    Nz	Function functionnamez arguments:

	argumentsz/

are not valid JSON. Received JSONDecodeError z7

are not a string or a dictionary. Received TypeError )jsonloadsJSONDecodeErrorr   	TypeError)r;   r<   r=   emsgs        r8   _parse_json_stringrH   A   s5    0z+&&& 0 0 0 	,j1&9 , ,Z(5, ,(), , 	
 $C((a/ 0 0 0 	2j1&9 2 2Z(52 2./2 2 	
 $C((a/0s6    B/A!B/3A!!B/.B*1B/73B**B/c                    d| vrdS | d         d         }i }t          |t                    rK|                                D ]5\  }}t          |t                    rt	          |d|           ||<   0|||<   6nt	          |d|           }|S )a  Parse arguments by trying to parse any shallowly nested string-encoded JSON.

    Band-aid fix for issue in Ollama with inconsistent tool call argument structure.
    Should be removed/changed if fixed upstream.
    See https://github.com/ollama/ollama/issues/6155
    r?   NrA   T)r=   r<   F)
isinstancedictitemsstrrH   )r<   rA   parsed_argumentskeyvalues        r8   _parse_arguments_from_tool_callrQ   g   s     &&tj)+6I)T"" 
#//++ 	. 	.JC%%% .(:M) ) ) %% ). %%	. .E
 
 
 r:   responsec           
         g }d| v r{| d                              d          x}r^|D ][}|                    t          t          t	                                |d         d         t          |          pi                      \|S )z$Get tool calls from ollama response.message
tool_callsr?   r@   )idr@   args)r7   appendr    rM   r   rQ   )rR   rU   raw_tool_callstcs       r8   _get_tool_calls_from_responser[      s     JH%i044\BBB> 	$  !!uww<<
^F3<R@@FB      r:   r    c                 8    d| d         | d         | d         ddS )Nr?   rV   r@   rW   )r@   rA   )typerV   r?    r   s    r8   !_lc_tool_call_to_openai_tool_callr_      s5    of%"6*
 
  r:   c                       e Zd ZU dZeed<   	 dZee         ed<   	 dZ	ee
         ed<   	 dZee
         ed<   	 dZee         ed<   	 dZee         ed<   	 dZee         ed	<   	 dZee         ed
<   	 dZee         ed<   	 dZee
         ed<   	 dZee
         ed<   	 dZee         ed<   	 dZeee                  ed<   	 dZee
         ed<   	 dZee         ed<   	 dZee
         ed<   	 dZed         ed<   	 dZeeeef                  ed<   	 dZee         ed<   	 i Zee         ed<   	  e d          Z!e"ed<   	  e d          Z#e$ed<   	 	 d6dee%         deee                  de&de'ee&f         fdZ( e)d !          de*fd"            Z+dee%         de,e-         fd#Z.	 d6dee%         deee                  de&de/ee0ee&f         ef                  fd$Z1	 d6dee%         deee                  de&de2ee0ee&f         ef                  fd%Z3	 	 	 d7dee%         deee                  d'ee4         d(e5de&de6fd)Z7	 	 	 d7dee%         deee                  d'ee8         d(e5de&de6fd*Z9	 d6deee                  de&de:fd+Z;	 	 d8dee%         deee                  d'ee4         de&de<f
d,Z=	 	 d8dee%         deee                  d'ee4         de&de2e6         f
d-Z>	 	 d8dee%         deee                  d'ee8         de&de/e6         f
d.Z?	 	 d8dee%         deee                  d'ee8         de&de<f
d/Z@eAdefd0            ZBdd1d2e,ee'ee&f         eCeDeEf                  d3eeeeed4         e5f                  de&deFeGe%f         f fd5ZH xZIS )9
ChatOllamau  Ollama chat model integration.

    .. dropdown:: Setup
        :open:

        Install ``langchain-ollama`` and download any models you want to use from ollama.

        .. code-block:: bash

            ollama pull mistral:v0.3
            pip install -U langchain-ollama

    Key init args — completion params:
        model: str
            Name of Ollama model to use.
        temperature: float
            Sampling temperature. Ranges from 0.0 to 1.0.
        num_predict: Optional[int]
            Max number of tokens to generate.

    See full list of supported init args and their descriptions in the params section.

    Instantiate:
        .. code-block:: python

            from langchain_ollama import ChatOllama

            llm = ChatOllama(
                model = "llama3",
                temperature = 0.8,
                num_predict = 256,
                # other params ...
            )

    Invoke:
        .. code-block:: python

            messages = [
                ("system", "You are a helpful translator. Translate the user sentence to French."),
                ("human", "I love programming."),
            ]
            llm.invoke(messages)

        .. code-block:: python

            AIMessage(content='J'adore le programmation. (Note: "programming" can also refer to the act of writing code, so if you meant that, I could translate it as "J'adore programmer". But since you didn\'t specify, I assumed you were talking about the activity itself, which is what "le programmation" usually refers to.)', response_metadata={'model': 'llama3', 'created_at': '2024-07-04T03:37:50.182604Z', 'message': {'role': 'assistant', 'content': ''}, 'done_reason': 'stop', 'done': True, 'total_duration': 3576619666, 'load_duration': 788524916, 'prompt_eval_count': 32, 'prompt_eval_duration': 128125000, 'eval_count': 71, 'eval_duration': 2656556000}, id='run-ba48f958-6402-41a5-b461-5e250a4ebd36-0')

    Stream:
        .. code-block:: python

            messages = [
                ("human", "Return the words Hello World!"),
            ]
            for chunk in llm.stream(messages):
                print(chunk)


        .. code-block:: python

            content='Hello' id='run-327ff5ad-45c8-49fe-965c-0a93982e9be1'
            content=' World' id='run-327ff5ad-45c8-49fe-965c-0a93982e9be1'
            content='!' id='run-327ff5ad-45c8-49fe-965c-0a93982e9be1'
            content='' response_metadata={'model': 'llama3', 'created_at': '2024-07-04T03:39:42.274449Z', 'message': {'role': 'assistant', 'content': ''}, 'done_reason': 'stop', 'done': True, 'total_duration': 411875125, 'load_duration': 1898166, 'prompt_eval_count': 14, 'prompt_eval_duration': 297320000, 'eval_count': 4, 'eval_duration': 111099000} id='run-327ff5ad-45c8-49fe-965c-0a93982e9be1'


        .. code-block:: python

            stream = llm.stream(messages)
            full = next(stream)
            for chunk in stream:
                full += chunk
            full

        .. code-block:: python

            AIMessageChunk(content='Je adore le programmation.(Note: "programmation" is the formal way to say "programming" in French, but informally, people might use the phrase "le développement logiciel" or simply "le code")', response_metadata={'model': 'llama3', 'created_at': '2024-07-04T03:38:54.933154Z', 'message': {'role': 'assistant', 'content': ''}, 'done_reason': 'stop', 'done': True, 'total_duration': 1977300042, 'load_duration': 1345709, 'prompt_eval_duration': 159343000, 'eval_count': 47, 'eval_duration': 1815123000}, id='run-3c81a3ed-3e79-4dd3-a796-04064d804890')

    Async:
        .. code-block:: python

            messages = [
                ("human", "Hello how are you!"),
            ]
            await llm.ainvoke(messages)

        .. code-block:: python

            AIMessage(content="Hi there! I'm just an AI, so I don't have feelings or emotions like humans do. But I'm functioning properly and ready to help with any questions or tasks you may have! How can I assist you today?", response_metadata={'model': 'llama3', 'created_at': '2024-07-04T03:52:08.165478Z', 'message': {'role': 'assistant', 'content': ''}, 'done_reason': 'stop', 'done': True, 'total_duration': 2138492875, 'load_duration': 1364000, 'prompt_eval_count': 10, 'prompt_eval_duration': 297081000, 'eval_count': 47, 'eval_duration': 1838524000}, id='run-29c510ae-49a4-4cdd-8f23-b972bfab1c49-0')

        .. code-block:: python

            messages = [
                ("human", "Say hello world!"),
            ]
            async for chunk in llm.astream(messages):
                print(chunk.content)

        .. code-block:: python

            HEL
            LO
            WORLD
            !

        .. code-block:: python

            messages = [
                ("human", "Say hello world!"),
                ("human","Say goodbye world!")
            ]
            await llm.abatch(messages)

        .. code-block:: python

            [AIMessage(content='HELLO, WORLD!', response_metadata={'model': 'llama3', 'created_at': '2024-07-04T03:55:07.315396Z', 'message': {'role': 'assistant', 'content': ''}, 'done_reason': 'stop', 'done': True, 'total_duration': 1696745458, 'load_duration': 1505000, 'prompt_eval_count': 8, 'prompt_eval_duration': 111627000, 'eval_count': 6, 'eval_duration': 185181000}, id='run-da6c7562-e25a-4a44-987a-2c83cd8c2686-0'),
            AIMessage(content="It's been a blast chatting with you! Say goodbye to the world for me, and don't forget to come back and visit us again soon!", response_metadata={'model': 'llama3', 'created_at': '2024-07-04T03:55:07.018076Z', 'message': {'role': 'assistant', 'content': ''}, 'done_reason': 'stop', 'done': True, 'total_duration': 1399391083, 'load_duration': 1187417, 'prompt_eval_count': 20, 'prompt_eval_duration': 230349000, 'eval_count': 31, 'eval_duration': 1166047000}, id='run-96cad530-6f3e-4cf9-86b4-e0f8abba4cdb-0')]

    JSON mode:
        .. code-block:: python


            json_llm = ChatOllama(format="json")
            messages = [
                ("human", "Return a query for the weather in a random location and time of day with two keys: location and time_of_day. Respond using JSON only."),
            ]
            llm.invoke(messages).content

        .. code-block:: python

            '{"location": "Pune, India", "time_of_day": "morning"}'

    Tool Calling:
        .. warning::
            Ollama currently does not support streaming for tools

        .. code-block:: python

            from langchain_ollama import ChatOllama
            from pydantic import BaseModel, Field

            class Multiply(BaseModel):
                a: int = Field(..., description="First integer")
                b: int = Field(..., description="Second integer")

            ans = await chat.invoke("What is 45*67")
            ans.tool_calls

        .. code-block:: python

            [{'name': 'Multiply',
            'args': {'a': 45, 'b': 67},
            'id': '420c3f3b-df10-4188-945f-eb3abdb40622',
            'type': 'tool_call'}]
    modelNmirostatmirostat_etamirostat_taunum_ctxnum_gpu
num_threadnum_predictrepeat_last_nrepeat_penaltytemperatureseedstoptfs_ztop_ktop_p )rr   rB   format
keep_alivebase_urlclient_kwargs)default_client_async_clientmessageskwargsr0   c                    |                      |          }| j        |t          d          | j        | j        }|                    d| j        | j        | j        | j        | j        | j	        | j
        | j        | j        | j        | j        || j        n|| j        | j        | j        d          }|                    d          }t'          |           }||                    d|          |                    d| j                  |                    d| j                  t-          d
i ||                    d| j                  d	|}|r||d<   |S )Nz2`stop` found in both the input and default params.options)rc   rd   re   rf   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   rq   toolsstreamrb   rs   rt   )rz   r   rb   rs   r}   rt   r^   )$_convert_messages_to_ollama_messagesrn   
ValueErrorpoprc   rd   re   rf   rg   rh   ri   rj   rk   rl   rm   ro   rp   rq   r7   boolrb   rs   r+   rt   )	selfrz   rn   r{   ollama_messagesoptions_dictr~   default_streamparamss	            r8   _chat_paramszChatOllama._chat_params  si    CCHMM9 T%5QRRRY"9Dzz M $ 1 $ 1<<"o#/!%!3"&"5#/	%)\		t 
 
* 

7##!%[[ (jj>::ZZ44jj4;77.... **\4?CC
 
 
  	$#F7Or:   after)modec                 x    | j         pi }t          dd| j        i|| _        t	          dd| j        i|| _        | S )zSet clients to use for ollama.hostr^   )rv   r)   ru   rx   r(   ry   )r   rv   s     r8   _set_clientszChatOllama._set_clients  sO     *0bBB4=BMBB(MMdmM}MMr:   c                    g }|D ]V}d }d }t          |t                    rd}nxt          |t                    rd}|j        rd |j        D             nd }nFt          |t                    rd}n.t          |t
                    r
d}|j        }nt          d          d}g }t          |j        t                    r	|j        }not          t          t                   |j                  D ]H}	|	                    d          d	k    r|d
|	d	          z  }+|	                    d          dk    rE|	                    d          dk    rd }
|	                    d          }t          |t                    r|}
nLt          |t                    r(d|v r$t          |d         t                    r	|d         }
nt          d          |
                    d          }t!          |          dk    r|                    |d                    |                    |d                    ;t          d          |||d}|r||d<   |r||d<   |                    |           X|S )Nuser	assistantc                 ,    g | ]}t          |          S r^   )r_   ).0r    s     r8   
<listcomp>zCChatOllama._convert_messages_to_ollama_messages.<locals>.<listcomp>  s0       % :)DD  r:   systemtoolz-Received unsupported message type for Ollama.rr   r]   text
tool_use	image_urlurlzSOnly string image_url or dict with string 'url' inside content parts are supported.,   r   zsUnsupported message content type. Must either have type 'text' or type 'image_url' with a string 'image_url' field.)rolecontentimagesrU   tool_call_id)rJ   r   r   rU   r   r   r   r   r   rM   r   r   r   r7   rK   splitlenrX   )r   rz   r   rT   r   rU   r   r   r   content_partr   temp_image_urlimage_url_componentsrG   s                 r8   r   z/ChatOllama._convert_messages_to_ollama_messages  s    !# K	( K	(G*.L9=J'<00 RGY// R" )	  )0);   
  
 G]33 RG[11 R&3 !PQQQGF'/3// &!/$(dW_$E$E # #L#''//699#>V(<#>#>>%))&11Z?? %))&11[@@$(	)5)9)9+)F)F%nc:: (6II&~t<<
 % 7 7 *>%+@# F F !8 )7u(=II",!F# # 
 09s/C/C, 344q88"MM*>q*ABBBB"MM*>q*ABBBB )?   "  C
  /$.L! 3&2N#""3''''r:   c                   K    | j         ||fi |}|d         r( | j        j        di | d {V 2 3 d {V }|W V  6 d S  | j        j        di | d {V W V  d S Nr   r^   )r   ry   chat)r   rz   rn   r{   chat_paramsparts         r8   _acreate_chat_streamzChatOllama._acreate_chat_stream+  s       (d'$AA&AAx  	?$;D$6$;$J$Jk$J$JJJJJJJ       d




 KJJ 0*/>>+>>>>>>>>>>>>>>s   ?c              +      K    | j         ||fi |}|d         r | j        j        di |E d {V  d S  | j        j        di |V  d S r   )r   rx   r   )r   rz   rn   r{   r   s        r8   _create_chat_streamzChatOllama._create_chat_stream9  s       (d'$AA&AAx  	3(t|(77;77777777777#$,#22k2222222r:   Frun_managerverbosec           
         d } | j         ||fi |D ]}t          |t                    st          t	          d|v rd|d         v r|d         d         ndt          |          t          |                    |                    d          du rt          |          nd           }||}n||z  }|r|	                    |j
        ||           |t          d	          |S 
NrT   r   rr   r   usage_metadatarU   doneTrT   r/   )chunkr   z$No data received from Ollama stream.)r   rJ   rM   r"   r   r9   r[   r7   rK   on_llm_new_tokenr   r   	r   rz   rn   r   r   r{   final_chunkstream_respr   s	            r8   _chat_stream_with_aggregationz(ChatOllama._chat_stream_with_aggregationF  sI    343HdMMfMM 	 	Kk3// +*  )K77 )[-C C C (	29== "$'O'( ( $A#M#M   .9__V-D-D-L-L[)))RV  " &"'KK5(K 00
# ' 1   
 CDDDr:   c           
        K   d } | j         ||fi |2 3 d {V }t          |t                    st          t	          d|v rd|d         v r|d         d         ndt          |          t          |                    |                    d          du rt          |          nd           }||}n||z  }|r#|	                    |j
        ||           d {V  6 |t          d	          |S r   )r   rJ   rM   r"   r   r9   r[   r7   rK   r   r   r   r   s	            r8   _achat_stream_with_aggregationz)ChatOllama._achat_stream_with_aggregationq  s      !:!:8T!T!TV!T!T 	 	 	 	 	 	 	+k3// +*  )K77 )[-C C C (	29== "$'O'( ( $A#M#M   .9__V-D-D-L-L[)))RV  " &"'KK5(K %66
# ' 7         1 "U: CDDDs   Cc           	           | j         dd|i|}t          d| j        d|                    d| j                            }|p|                    dd          p| j        x}r||d<   |S )	z Get standard params for tracing.rn   ollamar   rl   )ls_providerls_model_namels_model_typels_temperatureNls_stopr^   )_get_invocation_paramsr   rb   r7   rl   rn   )r   rn   r{   r   	ls_paramsr   s         r8   _get_ls_paramszChatOllama._get_ls_params  s     -,AA$A&AA# * !::mT5EFF	
 
 
	 Cfjj66C$)C7 	+#*Ii r:   c           
           | j         |||fd| j        i|}|j        }t          t	          |j        t          t          |j                  j	        t          t          |j                  j
                  |          }t          |g          S Nr   r   r   )generations)r   r   r/   r!   r   r   r   r   rT   r   rU   r#   r   rz   rn   r   r{   r   r/   chat_generations           r8   	_generatezChatOllama._generate  s     9d8dK
 
15
AG
 
 &5(#(#NK4GHHW0CDDO  
 ,
 
 
 &78888r:   c           
   +     K    | j         ||fi |D ]}t          |t                    st          t	          d|v rd|d         v r|d         d         ndt          |          t          |                    |                    d          du rt          |          nd           }|r!|	                    |j
        | j                   |V  d S 	NrT   r   rr   r   r   Tr   )r   )r   rJ   rM   r"   r   r9   r[   r7   rK   r   r   r   r   rz   rn   r   r{   r   r   s          r8   _streamzChatOllama._stream  s(      443HdMMfMM 	 	Kk3// +*  )K77 )[-C C C (	29== "$'O'( ( $A#M#M   .9__V-D-D-L-L[)))RV  "  00
 $ 1    1	 	r:   c           
       K    | j         ||fi |2 3 d {V }t          |t                    st          t	          d|v rd|d         v r|d         d         ndt          |          t          |                    |                    d          du rt          |          nd           }|r'|	                    |j
        | j                   d {V  |W V  6 d S r   )r   rJ   rM   r"   r   r9   r[   r7   rK   r   r   r   r   s          r8   _astreamzChatOllama._astream  sc      ";!:8T!T!TV!T!T 	 	 	 	 	 	 	+k3// +*  )K77 )[-C C C (	29== "$'O'( ( $A#M#M   .9__V-D-D-L-L[)))RV  "  %66
 $ 7          1 "U!T!Ts   Cc           
      0  K    | j         |||fd| j        i| d {V }|j        }t          t	          |j        t          t          |j                  j	        t          t          |j                  j
                  |          }t          |g          S r   )r   r   r/   r!   r   r   r   r   rT   r   rU   r#   r   s           r8   
_ageneratezChatOllama._agenerate  s       @D?dK
 
15
AG
 
 
 
 
 
 
 
 &5(#(#NK4GHHW0CDDO  
 ,
 
 
 &78888r:   c                     dS )zReturn type of chat model.zchat-ollamar^   )r   s    r8   	_llm_typezChatOllama._llm_type  s	     }r:   )tool_choicer~   r   )autoanyc                R    d |D             } t                      j        dd|i|S )ai  Bind tool-like objects to this chat model.

        Assumes model is compatible with OpenAI tool-calling API.

        Args:
            tools: A list of tool definitions to bind to this chat model.
                Supports any tool definition handled by
                :meth:`langchain_core.utils.function_calling.convert_to_openai_tool`.
            tool_choice: If provided, which tool for model to call. **This parameter
                is currently ignored as it is not supported by Ollama.**
            kwargs: Any additional parameters are passed directly to
                ``self.bind(**kwargs)``.
        c                 ,    g | ]}t          |          S r^   r&   )r   r   s     r8   r   z)ChatOllama.bind_tools.<locals>.<listcomp>0  s!    JJJD1$77JJJr:   r~   r^   )superbind)r   r~   r   r{   formatted_tools	__class__s        r8   
bind_toolszChatOllama.bind_tools  s:    ( KJEJJJuww|<</<V<<<r:   )N)NNF)NN)J__name__
__module____qualname____doc__rM   __annotations__rc   r   intrd   floatre   rf   rg   rh   ri   rj   rk   rl   rm   rn   r   ro   rp   rq   rs   r	   rt   r   ru   rv   rK   r,   rx   r)   ry   r(   r   r   r   r   r-   r.   r   r   r*   r   r   r
   r   r   r   r   r   r"   r   r   r   r   r   r#   r   r   r   r   propertyr   r   r   r%   r$   r   r   __classcell__)r   s   @r8   ra   ra      s        Y Yv JJJ"Hhsm"""B %)L(5/(((5
 %)L(5/(((% "GXc]!!!$ "GXc]!!!+ !%J$$$N
 "&K#%%%C $(M8C='''= '+NHUO***, $(K%'''= D(3- !%D(49
$$$&!E8E?!!!M  E8C=0 "E8E?!!!C #%FGJ$$$:,0JsCx)000:"Hhsm"""-$&M8D>&&& "k$///GV/// "-T!:!:!:M;::: %)2 2{#2 tCy!2 	2
 
c3h2 2 2 2h _'"""d    #"Q[)Q	'	Q Q Q Ql %)? ?{#? tCy!? 	?
 
uWS#X.34	5? ? ? ?" %)3 3{#3 tCy!3 	3
 
%S)3./	03 3 3 3  %):>) ){#) tCy!) 67	)
 ) ) 
) ) ) )\ %)?C) ){#) tCy!) ;<	)
 ) ) 
) ) ) )X +/ T#Y':=	   $ %):>	9 9{#9 tCy!9 67	9
 9 
9 9 9 90 %):>	 {# tCy! 67	
  
%	&   H %)?C	 {# tCy! ;<	
  
*	+   H %)?C	9 9{#9 tCy!9 ;<	9
 9 
9 9 9 9* 3    X QU	= = =d38ndHhFGH= eD#w}/Et$KLM	=
 = 
$k1	2= = = = = = = = = =r:   ra   )Fr   rB   typingr   r   r   r   r   r   r	   r
   r   r   r   r   r   uuidr   langchain_core.callbacksr    langchain_core.callbacks.managerr   langchain_core.exceptionsr   langchain_core.language_modelsr   *langchain_core.language_models.chat_modelsr   r   langchain_core.messagesr   r   r   r   r   r   r   langchain_core.messages.air   langchain_core.messages.toolr    langchain_core.outputsr!   r"   r#   langchain_core.runnablesr$   langchain_core.toolsr%   %langchain_core.utils.function_callingr'   r   r(   r)   r*   r+   pydanticr,   r-   typing_extensionsr.   rM   r9   rK   r   rH   rQ   r[   r_   ra   r^   r:   r8   <module>r      s                                              K J J J J J ; ; ; ; ; ; = = = = = = U U U U U U U U                  5 4 4 4 4 4 2 2 2 2 2 2 R R R R R R R R R R - - - - - - ) ) ) ) ) ) H H H H H H 8 8 8 8 8 8 8 8 8 8 8 8 1 1 1 1 1 1 1 1 " " " " " "gc3h/0m   "#0#0%)#s(^#0;?#0#0 #0 #0 #0LS>d38n   8c3h	(^   $ d    Q
= Q
= Q
= Q
= Q
= Q
= Q
= Q
= Q
= Q
=r:   