Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -101,23 +101,24 @@ def execute_langchain(user_input):
|
|
101 |
# Streamlit app layout
|
102 |
st.title("LangChain Chat")
|
103 |
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
if
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
st.
|
|
|
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 |
|