Ë
    ‚3fio  ã                  ó~   — d dl mZ d dlmZmZ d dlmZ d dlmZ d dlm	Z
 erd dlmZ dddd	d
œ	 	 	 	 	 	 	 	 	 	 	 dd„Z	y	)é    )Úannotations)ÚTYPE_CHECKINGÚOptional)ÚBaseCallbackHandler)ÚLLMThoughtLabeler©ÚStreamlitCallbackHandler)ÚDeltaGeneratoré   TN©Úmax_thought_containersÚexpand_new_thoughtsÚcollapse_completed_thoughtsÚthought_labelerc               óh   — 	 ddl m}  || ||||¬«      S # t        $ r t        | ||||¬«      cY S w xY w)ab  Callback Handler that writes to a Streamlit app.

    This CallbackHandler is geared towards
    use with a LangChain Agent; it displays the Agent's LLM and tool-usage "thoughts"
    inside a series of Streamlit expanders.

    Parameters
    ----------
    parent_container
        The `st.container` that will contain all the Streamlit elements that the
        Handler creates.
    max_thought_containers
        The max number of completed LLM thought containers to show at once. When this
        threshold is reached, a new thought will cause the oldest thoughts to be
        collapsed into a "History" expander. Defaults to 4.
    expand_new_thoughts
        Each LLM "thought" gets its own `st.expander`. This param controls whether that
        expander is expanded by default. Defaults to True.
    collapse_completed_thoughts
        If True, LLM thought expanders will be collapsed when completed.
        Defaults to True.
    thought_labeler
        An optional custom LLMThoughtLabeler instance. If unspecified, the handler
        will use the default thought labeling logic. Defaults to None.

    Returns
    -------
    A new StreamlitCallbackHandler instance.

    Note that this is an "auto-updating" API: if the installed version of Streamlit
    has a more recent StreamlitCallbackHandler implementation, an instance of that class
    will be used.

    r   r   r   )Ústreamlit.external.langchainr	   ÚImportErrorÚ!_InternalStreamlitCallbackHandler)Úparent_containerr   r   r   r   Ú OfficialStreamlitCallbackHandlers         ún/var/www/auto_recruiter/arenv/lib/python3.12/site-packages/langchain_community/callbacks/streamlit/__init__.pyr	   r	      sX   € ðZ
õ	
ñ 0ØØ#9Ø 3Ø(CØ+ô
ð 	
øô ò 
Ü0ØØ#9Ø 3Ø(CØ+ô
ò 	
ð
ús   ‚ •1°1)r   r
   r   Úintr   Úboolr   r   r   zOptional[LLMThoughtLabeler]Úreturnr   )Ú
__future__r   Útypingr   r   Úlangchain_core.callbacksr   ÚBlangchain_community.callbacks.streamlit.streamlit_callback_handlerr   r	   r   Ústreamlit.delta_generatorr
   © ó    r   ú<module>r"      st   ðÝ "ç *å 8õõñ Ý8ð #$Ø $Ø(,Ø37ñ@
Ø$ð@
ð  ð@
ð ð	@
ð
 "&ð@
ð 1ð@
ð ô@
r!   