Update app.py
Browse files
app.py
CHANGED
|
@@ -4,13 +4,7 @@ from langchain.text_splitter import RecursiveCharacterTextSplitter
|
|
| 4 |
from langchain_community.vectorstores import Chroma
|
| 5 |
from langchain.chains import ConversationalRetrievalChain
|
| 6 |
from langchain_community.chat_models import ChatOllama
|
| 7 |
-
from langchain.memory import
|
| 8 |
-
from langchain_core.chat_history import InMemoryChatMessageHistory
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
# باقي الكود
|
| 12 |
-
|
| 13 |
-
|
| 14 |
import chainlit as cl
|
| 15 |
|
| 16 |
|
|
@@ -60,7 +54,7 @@ async def on_chat_start():
|
|
| 60 |
)
|
| 61 |
|
| 62 |
# Initialize message history for conversation
|
| 63 |
-
message_history =
|
| 64 |
|
| 65 |
# Memory for conversational context
|
| 66 |
memory = ConversationBufferMemory(
|
|
|
|
| 4 |
from langchain_community.vectorstores import Chroma
|
| 5 |
from langchain.chains import ConversationalRetrievalChain
|
| 6 |
from langchain_community.chat_models import ChatOllama
|
| 7 |
+
from langchain.memory import ChatMessageHistory, ConversationBufferMemory
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
import chainlit as cl
|
| 9 |
|
| 10 |
|
|
|
|
| 54 |
)
|
| 55 |
|
| 56 |
# Initialize message history for conversation
|
| 57 |
+
message_history = ChatMessageHistory()
|
| 58 |
|
| 59 |
# Memory for conversational context
|
| 60 |
memory = ConversationBufferMemory(
|