
    9|h                     J    d dl mZmZmZmZ d dlmZ d dlmZ  G d de      Z	y)    )AnyDictListTuple)AgentAction)ChatPromptTemplatec                   `    e Zd ZdZedefd       Zdeee	e
f      de
fdZdedee
ef   fdZy)	!AgentScratchPadChatPromptTemplatez.Chat prompt template for the agent scratchpad.returnc                      y)NF )clss    V/var/www/html/test/engine/venv/lib/python3.12/site-packages/langchain/agents/schema.pyis_lc_serializablez4AgentScratchPadChatPromptTemplate.is_lc_serializable
   s        intermediate_stepsc                 r    t        |      dk(  ryd}|D ]  \  }}||j                  z  }|d| dz  } 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   thoughtsactionobservations        r   _construct_agent_scratchpadz=AgentScratchPadChatPromptTemplate._construct_agent_scratchpad   se     !"a'#5 	CFK

"H/+kBBH	C--5J8	
r   kwargsc                 P    |j                  d      }| j                  |      |d<   |S )Nr   agent_scratchpad)popr   )r   r   r   s      r   !_merge_partial_and_user_variableszCAgentScratchPadChatPromptTemplate._merge_partial_and_user_variables   s2    #ZZ(<=%)%E%E&
!" r   N)__name__
__module____qualname____doc__classmethodboolr   r   r   r   strr   r   r   r    r   r   r   r
   r
      s]    84  
"&u[#-='>"?
	
# $sCx. r   r
   N)
typingr   r   r   r   langchain_core.agentsr   langchain_core.prompts.chatr   r
   r   r   r   <module>r+      s    ) ) - :(: r   