Ë
    ´Œj¶  ã                   ón   — d dl mZmZ d dlmZ d dlmZmZ d dlm	Z	  eddd¬«       G d	„ d
e	«      «       Z
y)é    )ÚAnyÚUnion)Ú
deprecated)ÚBaseMessageÚget_buffer_string)ÚBaseChatMemoryz0.3.1z1.0.0z_Please see the migration guide at: https://python.langchain.com/docs/versions/migrating_memory/)ÚsinceÚremovalÚmessagec                   óä   — 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e   f   fd„«       Zed
efd„«       Zed
ee   fd„«       Zed
ee   fd„«       Zdeeef   d
eeef   fd„Zy)Ú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   — | j                   r| j                  S | j                  S )zString buffer of memory.)Úreturn_messagesÚbuffer_as_messagesÚbuffer_as_str©Úselfs    úh/var/www/html/Fitness-lenito-AI-main/venv/lib/python3.12/site-packages/langchain/memory/buffer_window.pyÚbufferz%ConversationBufferWindowMemory.buffer   s#   € ð +/×*>Ò*>ˆt×&Ñ&ÐVÀD×DVÑDVÐVó    c                 ó¶   — | j                   dkD  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#   sT   € ð @D¿v¹vÈºz�4×#Ñ#×,Ñ,¨d¯f©f¨W°q©[¨]Ñ;ÈrˆÜ ØØ×*Ñ*Ø—n‘nô
ð 	
r   c                 ór   — | j                   dkD  r'| j                  j                  | j                    dz  d S 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_messages-   s7   € ð <@¿6¹6ÀAº:ˆt×Ñ×(Ñ(¨$¯&©&¨°1©¨Ð7ÐMÈ2ÐMr   c                 ó   — | j                   gS )zMWill always return list of memory variables.

        :meta private:
        )r   r   s    r   Úmemory_variablesz/ConversationBufferWindowMemory.memory_variables2   s   € ð —‘Ð Ð r   Úinputsc                 ó2   — | 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Úpropertyr   Úlistr   r   r   r   r&   Údictr   r)   © r   r   r   r   	   sÞ   … ñð  €L�#ÓØ€IˆsÓØ€J�ÓØ€A€sƒJØ0àðW˜˜c 4¨Ñ#4Ð4Ñ5ò Wó ðWð ð
˜sò 
ó ð
ð ðN D¨Ñ$5ò Nó ðNð ð! $ s¡)ò !ó ð!ð.¨D°°c°©Nð .¸tÀCÈÀH¹~ô .r   r   N)Útypingr   r   Úlangchain_core._apir   Úlangchain_core.messagesr   r   Úlangchain.memory.chat_memoryr   r   r4   r   r   Ú<module>r9      s=   ðß å *ß Bå 7ñ Ø
Øð	Gô	ô+. ^ó +.óñ+.r   