a
    ag                     @   s  d Z ddlmZmZ 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mZmZmZmZ ddlmZ dd	lmZ dd
lmZ ddlmZ ddlmZ ddlmZ ddlm Z  er.ddl!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2 ddl3m4Z4 ddl5m6Z6 ddl7m8Z8 dddddddddddddddddddddZ9ee:e9dZ;e<edddZ=g dZ>dS )aL  **Memory** maintains Chain state, incorporating context from past runs.

**Class hierarchy for Memory:**

.. code-block::

    BaseMemory --> BaseChatMemory --> <name>Memory  # Examples: ZepMemory, MotorheadMemory

**Main helpers:**

.. code-block::

    BaseChatMessageHistory

**Chat Message History** stores the chat message history in different stores.

**Class hierarchy for ChatMessageHistory:**

.. code-block::

    BaseChatMessageHistory --> <name>ChatMessageHistory  # Example: ZepChatMessageHistory

**Main helpers:**

.. code-block::

    AIMessage, BaseMessage, HumanMessage
    )TYPE_CHECKINGAny)create_importer)ConversationBufferMemoryConversationStringBufferMemory)ConversationBufferWindowMemory)CombinedMemory)ConversationEntityMemoryInMemoryEntityStoreRedisEntityStoreSQLiteEntityStoreUpstashRedisEntityStore)ReadOnlySharedMemory)SimpleMemory)ConversationSummaryMemory)ConversationSummaryBufferMemory)ConversationTokenBufferMemory)VectorStoreRetrieverMemory)(ConversationVectorStoreTokenBufferMemory)AstraDBChatMessageHistoryCassandraChatMessageHistoryChatMessageHistoryCosmosDBChatMessageHistoryDynamoDBChatMessageHistoryElasticsearchChatMessageHistoryFileChatMessageHistoryMomentoChatMessageHistoryMongoDBChatMessageHistoryPostgresChatMessageHistoryRedisChatMessageHistorySingleStoreDBChatMessageHistorySQLChatMessageHistoryStreamlitChatMessageHistoryUpstashRedisChatMessageHistoryXataChatMessageHistoryZepChatMessageHistory)ConversationKGMemory)MotorheadMemory)	ZepMemoryz+langchain_community.memory.motorhead_memoryzlangchain_community.memory.kgz%langchain_community.memory.zep_memoryz*langchain_community.chat_message_histories)r'   r&   r(   r   r   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   )Zdeprecated_lookups)namereturnc                 C   s   t | S )zLook up attributes dynamically.)_import_attribute)r)    r,   g/var/www/html/cobodadashboardai.evdpl.com/venv/lib/python3.9/site-packages/langchain/memory/__init__.py__getattr__o   s    r.   )$r   r   r   r   r   r   r	   r&   r   r   r   r   r   r   r   r   r   r
   r   r   r'   r   r   r   r   r    r!   r   r   r"   r   r$   r%   r(   r   r#   N)?__doc__typingr   r   Zlangchain._apir   Zlangchain.memory.bufferr   r   Zlangchain.memory.buffer_windowr   Zlangchain.memory.combinedr   Zlangchain.memory.entityr	   r
   r   r   r   Zlangchain.memory.readonlyr   Zlangchain.memory.simpler   Zlangchain.memory.summaryr   Zlangchain.memory.summary_bufferr   Zlangchain.memory.token_bufferr   Zlangchain.memory.vectorstorer   Z0langchain.memory.vectorstore_token_buffer_memoryr   Z*langchain_community.chat_message_historiesr   r   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   Zlangchain_community.memory.kgr&   Z+langchain_community.memory.motorhead_memoryr'   Z%langchain_community.memory.zep_memoryr(   ZDEPRECATED_LOOKUP__package__r+   strr.   __all__r,   r,   r,   r-   <module>   sT   L