o
    `+ i                     @   s8   d dl mZ d dlmZ d dlmZ G dd deZdS )    )Any)AgentAction)ChatPromptTemplatec                   @   sZ   e Zd ZdZedefddZdeee	e
f  de
fddZdedee
ef fd	d
ZdS )!AgentScratchPadChatPromptTemplatez.Chat prompt template for the agent scratchpad.returnc                 C   s   dS )NF )clsr   r   c/home/app/PaddleOCR-VL-test/.venv_paddleocr/lib/python3.10/site-packages/langchain/agents/schema.pyis_lc_serializable
   s   z4AgentScratchPadChatPromptTemplate.is_lc_serializableintermediate_stepsc                 C   sF   t |dkrdS d}|D ]\}}||j7 }|d| d7 }qd| S )Nr    z
Observation: z

Thought: zhThis was your previous work (but I haven't seen any of it! I only see what you return as final answer):
)lenlog)selfr   ZthoughtsactionZobservationr   r   r	   _construct_agent_scratchpad   s   
z=AgentScratchPadChatPromptTemplate._construct_agent_scratchpadkwargsc                 K   s   | d}| ||d< |S )Nr   Zagent_scratchpad)popr   )r   r   r   r   r   r	   !_merge_partial_and_user_variables   s
   
zCAgentScratchPadChatPromptTemplate._merge_partial_and_user_variablesN)__name__
__module____qualname____doc__classmethodboolr
   listtupler   strr   r   dictr   r   r   r   r	   r      s    
r   N)typingr   Zlangchain_core.agentsr   Zlangchain_core.prompts.chatr   r   r   r   r   r	   <module>   s    