Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -203,7 +203,7 @@ elif page == "Semantic Search":
|
|
203 |
</script>
|
204 |
''', height=60)
|
205 |
|
206 |
-
# If voice input is received, update the question field directly
|
207 |
if voice_input and isinstance(voice_input, str) and voice_input.strip():
|
208 |
if is_coding_question(voice_input):
|
209 |
st.session_state["sem_question"] = voice_input
|
@@ -211,8 +211,8 @@ elif page == "Semantic Search":
|
|
211 |
else:
|
212 |
st.warning("Please ask a relevant question.")
|
213 |
|
214 |
-
#
|
215 |
-
question = st.text_input("Ask a question about your code",
|
216 |
|
217 |
# Run Semantic Search button
|
218 |
if st.button("Run Semantic Search"):
|
|
|
203 |
</script>
|
204 |
''', height=60)
|
205 |
|
206 |
+
# If voice input is received, update the question field directly in session state
|
207 |
if voice_input and isinstance(voice_input, str) and voice_input.strip():
|
208 |
if is_coding_question(voice_input):
|
209 |
st.session_state["sem_question"] = voice_input
|
|
|
211 |
else:
|
212 |
st.warning("Please ask a relevant question.")
|
213 |
|
214 |
+
# This field is always in sync with session state, whether typed or spoken
|
215 |
+
question = st.text_input("Ask a question about your code", key="sem_question")
|
216 |
|
217 |
# Run Semantic Search button
|
218 |
if st.button("Run Semantic Search"):
|