Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -2,7 +2,6 @@ import streamlit as st
|
|
2 |
import difflib
|
3 |
import requests
|
4 |
import datetime
|
5 |
-
from st_mic_recorder import mic_recorder
|
6 |
|
7 |
# --- CONFIG ---
|
8 |
GROQ_API_KEY = st.secrets.get('GROQ_API_KEY', 'YOUR_GROQ_API_KEY')
|
@@ -163,24 +162,7 @@ elif page == "Semantic Search":
|
|
163 |
st.caption("Example questions:")
|
164 |
st.write(", ".join(EXAMPLE_QUESTIONS))
|
165 |
|
166 |
-
|
167 |
-
st.write("You can type or use the mic to ask your question:")
|
168 |
-
|
169 |
-
# Use mic_recorder for voice input (returns text or None)
|
170 |
-
question_voice = mic_recorder(
|
171 |
-
start_prompt="🎤 Speak your question",
|
172 |
-
stop_prompt="Stop",
|
173 |
-
just_once=True,
|
174 |
-
use_container_width=True,
|
175 |
-
key="mic"
|
176 |
-
)
|
177 |
-
|
178 |
-
# Use a single input field for both typing and voice
|
179 |
-
question = st.text_input(
|
180 |
-
"Ask a question about your code",
|
181 |
-
value=question_voice if question_voice else "",
|
182 |
-
key="sem_question"
|
183 |
-
)
|
184 |
|
185 |
if st.button("Run Semantic Search"):
|
186 |
if not code_input.strip() or not question.strip():
|
|
|
2 |
import difflib
|
3 |
import requests
|
4 |
import datetime
|
|
|
5 |
|
6 |
# --- CONFIG ---
|
7 |
GROQ_API_KEY = st.secrets.get('GROQ_API_KEY', 'YOUR_GROQ_API_KEY')
|
|
|
162 |
st.caption("Example questions:")
|
163 |
st.write(", ".join(EXAMPLE_QUESTIONS))
|
164 |
|
165 |
+
question = st.text_input("Ask a question about your code", key="sem_question")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
166 |
|
167 |
if st.button("Run Semantic Search"):
|
168 |
if not code_input.strip() or not question.strip():
|