vsj0702 commited on
Commit
222b009
·
verified ·
1 Parent(s): d27d240
Files changed (1) hide show
  1. 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
- user_input = st.text_input("Ask about your code...",
99
- key="chat_input",
100
- value="",
101
- placeholder="Type your question here...")
102
-
103
- if user_input:
 
 
 
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))