Spaces:
Build error
Build error
Merge branch 'main' of https://huggingface.co/spaces/OuroborosM/STLA-BABY-S
Browse files
app.py
CHANGED
@@ -353,9 +353,9 @@ You are capable of **any** task.
|
|
353 |
---\n You have access to the following tools:\n
|
354 |
"""
|
355 |
|
356 |
-
|
357 |
global memory3
|
358 |
-
memory3 = ConversationBufferWindowMemory(memory_key="chat_history", return_messages=True)
|
359 |
# GPTfake("hi")
|
360 |
|
361 |
input_variables=["input", "chat_history", "agent_scratchpad"]
|
@@ -392,7 +392,7 @@ agent = agent_STRUCTURED_ZEROSHOT_REACT
|
|
392 |
|
393 |
st.title("STLA-BABY")
|
394 |
|
395 |
-
|
396 |
|
397 |
if len(msgs.messages) == 0 or st.sidebar.button("Reset Chat History"):
|
398 |
msgs.clear()
|
@@ -411,6 +411,6 @@ if prompt := st.chat_input(placeholder="Input Your Request"):
|
|
411 |
with st.chat_message("assistant"):
|
412 |
# response = GPTfake(prompt)
|
413 |
st_cb = StreamlitCallbackHandler(st.container(), expand_new_thoughts=False)
|
414 |
-
response = agent(prompt, callbacks=[st_cb])
|
415 |
st.write(response)
|
416 |
print(msgs.messages)
|
|
|
353 |
---\n You have access to the following tools:\n
|
354 |
"""
|
355 |
|
356 |
+
msgs = StreamlitChatMessageHistory()
|
357 |
global memory3
|
358 |
+
memory3 = ConversationBufferWindowMemory(chat_memory=msgs, memory_key="chat_history", return_messages=True)
|
359 |
# GPTfake("hi")
|
360 |
|
361 |
input_variables=["input", "chat_history", "agent_scratchpad"]
|
|
|
392 |
|
393 |
st.title("STLA-BABY")
|
394 |
|
395 |
+
|
396 |
|
397 |
if len(msgs.messages) == 0 or st.sidebar.button("Reset Chat History"):
|
398 |
msgs.clear()
|
|
|
411 |
with st.chat_message("assistant"):
|
412 |
# response = GPTfake(prompt)
|
413 |
st_cb = StreamlitCallbackHandler(st.container(), expand_new_thoughts=False)
|
414 |
+
response = agent.run(prompt, callbacks=[st_cb])
|
415 |
st.write(response)
|
416 |
print(msgs.messages)
|