ageraustine commited on
Commit
578df40
·
verified ·
1 Parent(s): f3c8871

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -19
app.py CHANGED
@@ -101,23 +101,24 @@ def execute_langchain(user_input):
101
  # Streamlit app layout
102
  st.title("LangChain Chat")
103
 
104
- user_input = st.text_input("You:", "")
105
-
106
- if st.button("Send"):
107
- if user_input:
108
- # Execute LangChain logic
109
- outputs = execute_langchain(user_input)
110
-
111
- # Display LangChain outputs
112
- for key, value in outputs:
113
- if key == "Output from node 'info':":
114
- st.text("Bot: " + value)
115
- elif key == "Output from node 'profile':":
116
- st.text("Bot: " + value)
117
-
118
- st.text("\n---\n")
119
-
120
- # Allow the user to quit the chat
121
- if st.button("Quit"):
122
- st.text("Bot: Byebye")
 
123
 
 
101
  # Streamlit app layout
102
  st.title("LangChain Chat")
103
 
104
+ while True:
105
+ user_input = st.text_input("You:", "")
106
+
107
+ if st.button("Send"):
108
+ if user_input:
109
+ # Execute LangChain logic
110
+ outputs = execute_langchain(user_input)
111
+
112
+ # Display LangChain outputs
113
+ for key, value in outputs:
114
+ if key == "Output from node 'info':":
115
+ st.text("Bot: " + value)
116
+ elif key == "Output from node 'profile':":
117
+ st.text("Bot: " + value)
118
+
119
+ st.text("\n---\n")
120
+
121
+ # Allow the user to quit the chat
122
+ if st.button("Quit"):
123
+ st.text("Bot: Byebye")
124