venkat charan commited on
Commit
5964cb6
·
verified ·
1 Parent(s): b8d26cc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -9
app.py CHANGED
@@ -31,21 +31,20 @@ def end_conv():
31
  st.write("Conversation ended.")
32
  memory.clear()
33
  user_input = st.text_area("Input Text")
34
- for i in range(1,5):
35
 
36
  # Generate and display the response
37
- if st.button("Generate Response"):
38
- # Load current conversation history
39
- history = memory.load_memory_variables({})['history']
40
 
41
  # Invoke the chain to get the response
42
- res = chain.invoke({"input": user_input})
43
- response_content = res.content
44
- st.write("Generated Response:")
45
- st.write(response_content)
46
 
47
  # Save the context in memory
48
- memory.save_context({"input": user_input}, {"output": response_content})
49
 
50
  # Display the conversation history
51
  #st.write("Conversation History:")
 
31
  st.write("Conversation ended.")
32
  memory.clear()
33
  user_input = st.text_area("Input Text")
 
34
 
35
  # Generate and display the response
36
+ if st.button("Generate Response"):
37
+ # Load current conversation history
38
+ history = memory.load_memory_variables({})['history']
39
 
40
  # Invoke the chain to get the response
41
+ res = chain.invoke({"input": user_input})
42
+ response_content = res.content
43
+ st.write("Generated Response:")
44
+ st.write(response_content)
45
 
46
  # Save the context in memory
47
+ memory.save_context({"input": user_input}, {"output": response_content})
48
 
49
  # Display the conversation history
50
  #st.write("Conversation History:")