§
    ™Štj”  ã                   óŒ   — d dl mZ d dlmZ d dlmZmZ d dlmZ d dl	m
Z
  edddd	¬
¦  «         G d„ de
¦  «        ¦   «         ZdS )é    )ÚAny)Ú
deprecated)ÚBaseMessageÚget_buffer_string)Úoverride)ÚBaseChatMemoryz0.3.1z2.0.0zlangchain.agents.create_agentzùFor agents that need to remember prior interactions, use `create_agent` with checkpointing or the `Store` API. See https://docs.langchain.com/oss/python/langchain/short-term-memory and https://docs.langchain.com/oss/python/langchain/long-term-memory)ÚsinceÚremovalÚalternativeÚaddendumc                   ó(  — e Zd ZU dZdZeed<   dZeed<   dZeed<   dZ	e
ed	<   	 ed
eee         z  fd„¦   «         Zed
efd„¦   «         Zed
ee         fd„¦   «         Zed
ee         fd„¦   «         Zedeeef         d
eeef         fd„¦   «         ZdS )ÚConversationBufferWindowMemoryzÊUse to keep track of the last k turns of a conversation.

    If the number of messages in the conversation is more than the maximum number
    of messages to keep, the oldest messages are dropped.
    ÚHumanÚhuman_prefixÚAIÚ	ai_prefixÚhistoryÚ
memory_keyé   ÚkÚreturnc                 ó,   — | j         r| j        n| j        S )zString buffer of memory.)Úreturn_messagesÚbuffer_as_messagesÚbuffer_as_str©Úselfs    úd/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/langchain_classic/memory/buffer_window.pyÚbufferz%ConversationBufferWindowMemory.buffer"   s   € ð +/Ô*>ÐVˆtÔ&Ð&ÀDÔDVÐVó    c                 óŽ   — | j         dk    r| j        j        | j          dz  d…         ng }t          || j        | j        ¬¦  «        S )z@Exposes the buffer as a string in case return_messages is False.r   é   N)r   r   )r   Úchat_memoryÚmessagesr   r   r   )r   r$   s     r   r   z,ConversationBufferWindowMemory.buffer_as_str'   sV   € ð @D¼vÈºz¸z�4Ô#Ô,¨d¬f¨W°q©[¨]¨]Ô;Ð;ÈrˆÝ ØØÔ*Ø”nð
ñ 
ô 
ð 	
r    c                 óV   — | j         dk    r| j        j        | j          dz  d…         ng S )zIExposes the buffer as a list of messages in case return_messages is True.r   r"   N)r   r#   r$   r   s    r   r   z1ConversationBufferWindowMemory.buffer_as_messages1   s1   € ð <@¼6ÀAº:¸:ˆtÔÔ(¨$¬&¨°1©¨¨Ô7Ð7È2ÐMr    c                 ó   — | j         gS )z,Will always return list of memory variables.)r   r   s    r   Úmemory_variablesz/ConversationBufferWindowMemory.memory_variables6   s   € ð ”Ð Ð r    Úinputsc                 ó   — | j         | j        iS )zReturn history buffer.)r   r   )r   r(   s     r   Úload_memory_variablesz4ConversationBufferWindowMemory.load_memory_variables;   s   € ð ” ¤Ð-Ð-r    N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   ÚstrÚ__annotations__r   r   r   ÚintÚpropertyÚlistr   r   r   r   r'   r   Údictr   r*   © r    r   r   r   
   sW  € € € € € € ðð ð  €L�#ÐÐÑØ€IˆsÐÐÑØ€J�ÐÐÑØ€A€s€J€J�JØ0àðW˜˜d ;Ô/Ñ/ð Wð Wð Wñ „XðWð ð
˜sð 
ð 
ð 
ñ „Xð
ð ðN D¨Ô$5ð Nð Nð Nñ „XðNð ð! $ s¤)ð !ð !ð !ñ „Xð!ð ð.¨D°°c°¬Nð .¸tÀCÈÀH¼~ð .ð .ð .ñ „Xð.ð .ð .r    r   N)Útypingr   Úlangchain_core._apir   Úlangchain_core.messagesr   r   Útyping_extensionsr   Ú$langchain_classic.memory.chat_memoryr   r   r5   r    r   ú<module>r;      sÈ   ðØ Ð Ð Ð Ð Ð à *Ð *Ð *Ð *Ð *Ð *Ø BÐ BÐ BÐ BÐ BÐ BÐ BÐ BØ &Ð &Ð &Ð &Ð &Ð &à ?Ð ?Ð ?Ð ?Ð ?Ð ?ð €Ø
ØØ/ð	Kð
ñ 
ô 
ð).ð ).ð ).ð ).ð ). ^ñ ).ô ).ñ
ô 
ð).ð ).ð ).r    