Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -987,43 +987,43 @@ def main():
|
|
987 |
# Update session state if there's new data
|
988 |
if transcript is not None and transcript != "":
|
989 |
st.session_state.voice_transcript = transcript
|
990 |
-
|
991 |
-
# Display the transcript in a Streamlit text area
|
992 |
-
st.markdown("### Processed Voice Input:")
|
993 |
-
st.text_area("Voice Transcript", st.session_state.voice_transcript, height=100)
|
994 |
-
|
995 |
-
# Add functionality to process the transcript
|
996 |
-
if st.button("Process Transcript"):
|
997 |
-
st.subheader("AI Response to Transcript")
|
998 |
-
gpt_response = process_with_gpt(st.session_state.voice_transcript)
|
999 |
-
st.markdown(gpt_response)
|
1000 |
-
|
1001 |
-
# Option to clear the transcript
|
1002 |
-
if st.button("Clear Transcript"):
|
1003 |
-
st.session_state.voice_transcript = ""
|
1004 |
-
st.rerun()
|
1005 |
|
1006 |
-
|
1007 |
-
|
1008 |
-
|
1009 |
-
st.subheader("GPT-4o Response")
|
1010 |
-
gpt_response = process_with_gpt(st.session_state.voice_transcript)
|
1011 |
-
st.markdown(gpt_response)
|
1012 |
-
|
1013 |
-
if st.button("Search with Claude"):
|
1014 |
-
st.subheader("Claude Response")
|
1015 |
-
claude_response = process_with_claude(st.session_state.voice_transcript)
|
1016 |
-
st.markdown(claude_response)
|
1017 |
-
|
1018 |
-
if st.button("Search ArXiv"):
|
1019 |
-
st.subheader("ArXiv Search Results")
|
1020 |
-
arxiv_results = perform_ai_lookup(st.session_state.voice_transcript)
|
1021 |
-
st.markdown(arxiv_results)
|
1022 |
|
1023 |
-
|
1024 |
-
|
1025 |
-
|
1026 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1027 |
|
1028 |
|
1029 |
# Model Selection
|
|
|
987 |
# Update session state if there's new data
|
988 |
if transcript is not None and transcript != "":
|
989 |
st.session_state.voice_transcript = transcript
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
990 |
|
991 |
+
# Display the transcript in a Streamlit text area
|
992 |
+
st.markdown("### Processed Voice Input:")
|
993 |
+
st.text_area("Voice Transcript", st.session_state.voice_transcript, height=100)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
994 |
|
995 |
+
# Add functionality to process the transcript
|
996 |
+
if st.button("Process Transcript"):
|
997 |
+
st.subheader("AI Response to Transcript")
|
998 |
+
gpt_response = process_with_gpt(st.session_state.voice_transcript)
|
999 |
+
st.markdown(gpt_response)
|
1000 |
+
|
1001 |
+
# Option to clear the transcript
|
1002 |
+
if st.button("Clear Transcript"):
|
1003 |
+
st.session_state.voice_transcript = ""
|
1004 |
+
st.rerun()
|
1005 |
+
|
1006 |
+
|
1007 |
+
# Buttons to process the transcript
|
1008 |
+
if st.button("Search with GPT"):
|
1009 |
+
st.subheader("GPT-4o Response")
|
1010 |
+
gpt_response = process_with_gpt(st.session_state.voice_transcript)
|
1011 |
+
st.markdown(gpt_response)
|
1012 |
+
|
1013 |
+
if st.button("Search with Claude"):
|
1014 |
+
st.subheader("Claude Response")
|
1015 |
+
claude_response = process_with_claude(st.session_state.voice_transcript)
|
1016 |
+
st.markdown(claude_response)
|
1017 |
+
|
1018 |
+
if st.button("Search ArXiv"):
|
1019 |
+
st.subheader("ArXiv Search Results")
|
1020 |
+
arxiv_results = perform_ai_lookup(st.session_state.voice_transcript)
|
1021 |
+
st.markdown(arxiv_results)
|
1022 |
+
|
1023 |
+
|
1024 |
+
# Display last voice input
|
1025 |
+
if st.session_state.last_voice_input:
|
1026 |
+
st.text_area("Last Voice Input:", st.session_state.last_voice_input, height=100)
|
1027 |
|
1028 |
|
1029 |
# Model Selection
|