Spaces:
Sleeping
Sleeping
Israr-dawar
commited on
Commit
Β·
a2478aa
1
Parent(s):
0ec9aa9
Update app.py
Browse files
app.py
CHANGED
@@ -31,7 +31,7 @@ chain = LLMChain(prompt=prompt, llm=llm, memory = memory, output_parser = StrOut
|
|
31 |
|
32 |
st.title("Psychology ChatBot π§π½ββοΈ")
|
33 |
def conversation_chat(query):
|
34 |
-
result = chain({"
|
35 |
print("restult: ",result)
|
36 |
st.session_state['history'].append((query, result["answer"]))
|
37 |
return result["answer"]
|
@@ -52,7 +52,7 @@ def display_chat_history():
|
|
52 |
|
53 |
with container:
|
54 |
with st.form(key='my_form', clear_on_submit=True):
|
55 |
-
user_input = st.text_input("Question:", placeholder="
|
56 |
submit_button = st.form_submit_button(label='Send')
|
57 |
|
58 |
if submit_button and user_input:
|
|
|
31 |
|
32 |
st.title("Psychology ChatBot π§π½ββοΈ")
|
33 |
def conversation_chat(query):
|
34 |
+
result = chain({"text": query, "chat_history": st.session_state['history']})
|
35 |
print("restult: ",result)
|
36 |
st.session_state['history'].append((query, result["answer"]))
|
37 |
return result["answer"]
|
|
|
52 |
|
53 |
with container:
|
54 |
with st.form(key='my_form', clear_on_submit=True):
|
55 |
+
user_input = st.text_input("Question:", placeholder="I am a psychologist", key='input')
|
56 |
submit_button = st.form_submit_button(label='Send')
|
57 |
|
58 |
if submit_button and user_input:
|