OuroborosM commited on
Commit
5066b94
·
1 Parent(s): 200f9e3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -149,9 +149,9 @@ You are capable of **any** task.
149
  ---\n You have access to the following tools:\n
150
  """
151
 
152
-
153
  global memory3
154
- memory3 = ConversationBufferWindowMemory(memory_key="chat_history", return_messages=True)
155
  # GPTfake("hi")
156
 
157
  input_variables=["input", "chat_history", "agent_scratchpad"]
@@ -188,7 +188,7 @@ agent = agent_STRUCTURED_ZEROSHOT_REACT
188
 
189
  st.title("STLA-BABY")
190
 
191
- msgs = StreamlitChatMessageHistory()
192
 
193
  if len(msgs.messages) == 0 or st.sidebar.button("Reset Chat History"):
194
  msgs.clear()
@@ -207,6 +207,6 @@ if prompt := st.chat_input(placeholder="Input Your Request"):
207
  with st.chat_message("assistant"):
208
  # response = GPTfake(prompt)
209
  st_cb = StreamlitCallbackHandler(st.container(), expand_new_thoughts=False)
210
- response = agent(prompt, callbacks=[st_cb])
211
  st.write(response)
212
  print(msgs.messages)
 
149
  ---\n You have access to the following tools:\n
150
  """
151
 
152
+ msgs = StreamlitChatMessageHistory()
153
  global memory3
154
+ memory3 = ConversationBufferWindowMemory(chat_memory=msgs, memory_key="chat_history", return_messages=True)
155
  # GPTfake("hi")
156
 
157
  input_variables=["input", "chat_history", "agent_scratchpad"]
 
188
 
189
  st.title("STLA-BABY")
190
 
191
+
192
 
193
  if len(msgs.messages) == 0 or st.sidebar.button("Reset Chat History"):
194
  msgs.clear()
 
207
  with st.chat_message("assistant"):
208
  # response = GPTfake(prompt)
209
  st_cb = StreamlitCallbackHandler(st.container(), expand_new_thoughts=False)
210
+ response = agent.run(prompt, callbacks=[st_cb])
211
  st.write(response)
212
  print(msgs.messages)