Spaces:
Sleeping
Sleeping
Test
Browse files- chatbot.py +9 -6
chatbot.py
CHANGED
|
@@ -95,12 +95,15 @@ def render_chatbot(code: str, output: str, error: str):
|
|
| 95 |
""",
|
| 96 |
unsafe_allow_html=True)
|
| 97 |
# Input area
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
|
|
|
|
|
|
|
|
|
| 104 |
# Get response
|
| 105 |
response = bot.analyze_code(code, output, error, user_input)
|
| 106 |
st.session_state.conversation.append((user_input, response))
|
|
|
|
| 95 |
""",
|
| 96 |
unsafe_allow_html=True)
|
| 97 |
# Input area
|
| 98 |
+
col1, col2 = st.columns([4, 1])
|
| 99 |
+
with col1:
|
| 100 |
+
user_input = st.text_input("Ask about your code...",
|
| 101 |
+
key="chat_input",
|
| 102 |
+
placeholder="Type your question here...")
|
| 103 |
+
with col2:
|
| 104 |
+
send_clicked = st.button("Send") # Button to send the message
|
| 105 |
+
|
| 106 |
+
if user_input & send_clicked:
|
| 107 |
# Get response
|
| 108 |
response = bot.analyze_code(code, output, error, user_input)
|
| 109 |
st.session_state.conversation.append((user_input, response))
|