[Bug Fix] Handle chat sessions properly during app.chat() calls (#1084)
This commit is contained in:
@@ -7,7 +7,7 @@ from embedchain import App
|
||||
from embedchain.config import AppConfig, ChromaDbConfig
|
||||
from embedchain.embedchain import EmbedChain
|
||||
from embedchain.llm.base import BaseLlm
|
||||
from embedchain.memory.base import ECChatMemory
|
||||
from embedchain.memory.base import ChatHistory
|
||||
from embedchain.vectordb.chroma import ChromaDB
|
||||
|
||||
os.environ["OPENAI_API_KEY"] = "test-api-key"
|
||||
@@ -31,7 +31,7 @@ def test_whole_app(app_instance, mocker):
|
||||
BaseLlm,
|
||||
"add_history",
|
||||
)
|
||||
mocker.patch.object(ECChatMemory, "delete_chat_history", autospec=True)
|
||||
mocker.patch.object(ChatHistory, "delete", autospec=True)
|
||||
|
||||
app_instance.add(knowledge, data_type="text")
|
||||
app_instance.query("What text did I give you?")
|
||||
@@ -50,7 +50,7 @@ def test_add_after_reset(app_instance, mocker):
|
||||
app_instance = App(config=config, db=db)
|
||||
|
||||
# mock delete chat history
|
||||
mocker.patch.object(ECChatMemory, "delete_chat_history", autospec=True)
|
||||
mocker.patch.object(ChatHistory, "delete", autospec=True)
|
||||
|
||||
app_instance.reset()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user