Spaces:
Runtime error
Runtime error
Commit
·
7154eab
1
Parent(s):
a3c1b8f
update memory setting
Browse files
app.py
CHANGED
|
@@ -361,6 +361,10 @@ async def start_playwright(question: str):
|
|
| 361 |
# import playsound
|
| 362 |
|
| 363 |
langchain.debug = True
|
|
|
|
|
|
|
|
|
|
|
|
|
| 364 |
global memory2
|
| 365 |
memory2 = ConversationBufferWindowMemory(memory_key="chat_history")
|
| 366 |
global memory_openai
|
|
@@ -1018,7 +1022,7 @@ agent_STRUCTURED_ZEROSHOT_REACT = initialize_agent(tools_remote, GPTfake,
|
|
| 1018 |
handle_parsing_errors = True,
|
| 1019 |
max_iterations = int(os.environ["max_iterations"]),
|
| 1020 |
early_stopping_method="generate",
|
| 1021 |
-
memory =
|
| 1022 |
agent_kwargs={
|
| 1023 |
# 'prefix': PREFIX_2,
|
| 1024 |
# 'format_instructions': FORMAT_INSTRUCTIONS_3,
|
|
@@ -1645,7 +1649,7 @@ def Text2Sound_HMI():
|
|
| 1645 |
|
| 1646 |
def UpdateChatbot(Running_history):
|
| 1647 |
timestr = time.strftime("%Y-%m-%d-%H:%M:%S")
|
| 1648 |
-
Running_history = Running_history + [(None, 'Timestamp: '+timestr)]
|
| 1649 |
# yield Running_history
|
| 1650 |
WelcomeStr = """
|
| 1651 |
This is AI Assistant powered by MECH Core Team.
|
|
|
|
| 361 |
# import playsound
|
| 362 |
|
| 363 |
langchain.debug = True
|
| 364 |
+
|
| 365 |
+
global memory3
|
| 366 |
+
memory3 = ConversationBufferWindowMemory(memory_key="chat_history", return_messages=True)
|
| 367 |
+
|
| 368 |
global memory2
|
| 369 |
memory2 = ConversationBufferWindowMemory(memory_key="chat_history")
|
| 370 |
global memory_openai
|
|
|
|
| 1022 |
handle_parsing_errors = True,
|
| 1023 |
max_iterations = int(os.environ["max_iterations"]),
|
| 1024 |
early_stopping_method="generate",
|
| 1025 |
+
memory = memory3,
|
| 1026 |
agent_kwargs={
|
| 1027 |
# 'prefix': PREFIX_2,
|
| 1028 |
# 'format_instructions': FORMAT_INSTRUCTIONS_3,
|
|
|
|
| 1649 |
|
| 1650 |
def UpdateChatbot(Running_history):
|
| 1651 |
timestr = time.strftime("%Y-%m-%d-%H:%M:%S")
|
| 1652 |
+
# Running_history = Running_history + [(None, 'Timestamp: '+timestr)]
|
| 1653 |
# yield Running_history
|
| 1654 |
WelcomeStr = """
|
| 1655 |
This is AI Assistant powered by MECH Core Team.
|