
    D_io                    |    S r SSKJr  SSKJrJr  SSKJr  SSKJ	r	  SSK
Jr  \(       a  SSKJrJr   " S S	\	5      rg
)(Callback Handler that prints to std out.    )annotations)TYPE_CHECKINGAny)override)BaseCallbackHandler)
print_text)AgentActionAgentFinishc                     \ rS rSrSrSSS jjr\        SS j5       r\SS j5       r\ S       SS jj5       r	\   S           SS jj5       r
\  S         SS	 jj5       r\ S       SS
 jj5       rSrg)StdOutCallbackHandler   r   Nc                    Xl         g)zNInitialize callback handler.

Args:
    color: The color to use for the text.
Ncolor)selfr   s     Y/home/james-whalen/.local/lib/python3.13/site-packages/langchain_core/callbacks/stdout.py__init__StdOutCallbackHandler.__init__   s	     
    c                    SU;   a  US   nO0U(       a'  UR                  SUR                  SS/5      S   5      nOSn[        SU S35        g)zPrint out that we are entering a chain.

Args:
    serialized: The serialized chain.
    inputs: The inputs to the chain.
    **kwargs: Additional keyword arguments.
nameidz	<unknown>z

[1m> Entering new z chain...[0mN)getprint)r   
serializedinputskwargsr   s        r   on_chain_start$StdOutCallbackHandler.on_chain_start   sR     V&>D>>&*..}*Mb*QRDD*4&0@ABr   c                    [        S5        g)z~Print out that we finished a chain.

Args:
    outputs: The outputs of the chain.
    **kwargs: Additional keyword arguments.
z
[1m> Finished chain.[0mN)r   )r   outputsr   s      r   on_chain_end"StdOutCallbackHandler.on_chain_end.   s     	12r   c                R    [        UR                  U=(       d    U R                  S9  g)zRun on agent action.

Args:
    action: The agent action.
    color: The color to use for the text.
    **kwargs: Additional keyword arguments.
r   Nr	   logr   )r   actionr   r   s       r   on_agent_action%StdOutCallbackHandler.on_agent_action8   s     	6::U%8djj9r   c                    [        U5      nUb  [        SU 35        [        X=(       d    U R                  S9  Ub  [        SU 35        gg)zIf not the final action, print out observation.

Args:
    output: The output to print.
    color: The color to use for the text.
    observation_prefix: The observation prefix.
    llm_prefix: The LLM prefix.
    **kwargs: Additional keyword arguments.
N
r   )strr	   r   )r   outputr   observation_prefix
llm_prefixr   s         r   on_tool_end!StdOutCallbackHandler.on_tool_endE   sO    $ V)./016!4$**5!J<() "r   c                >    [        X=(       d    U R                  US9  g)zRun when the agent ends.

Args:
    text: The text to print.
    color: The color to use for the text.
    end: The end character to use.
    **kwargs: Additional keyword arguments.
r   endN)r	   r   )r   textr   r6   r   s        r   on_textStdOutCallbackHandler.on_text^   s      	42

<r   c                T    [        UR                  U=(       d    U R                  SS9  g)zRun on the agent end.

Args:
    finish: The agent finish.
    color: The color to use for the text.
    **kwargs: Additional keyword arguments.
r-   r5   Nr'   )r   finishr   r   s       r   on_agent_finish%StdOutCallbackHandler.on_agent_finishp   s     	6::U%8djjdCr   r   )N)r   
str | NonereturnNone)r   dict[str, Any]r   rA   r   r   r?   r@   )r#   rA   r   r   r?   r@   )r)   r
   r   r>   r   r   r?   r   )NNN)r/   r   r   r>   r0   r>   r1   r>   r   r   r?   r@   )N )
r7   r.   r   r>   r6   r.   r   r   r?   r@   )r;   r   r   r>   r   r   r?   r@   )__name__
__module____qualname____firstlineno____doc__r   r   r    r$   r*   r2   r8   r<   __static_attributes__ r   r   r   r      sq   2 C(C2@CLOC	C C$ 3 3 7;
:!
:*4
:GJ
:	
: 
:  !)-!%** * '	*
 * * 
* *0  !	== = 	=
 = 
= =" 7;
D!
D*4
DGJ
D	
D 
Dr   r   N)rG   
__future__r   typingr   r   typing_extensionsr   langchain_core.callbacks.baser   langchain_core.utilsr	   langchain_core.agentsr
   r   r   rI   r   r   <module>rP      s.    . " % & = +>kD/ kDr   