awacke1 commited on
Commit
34c21dd
·
verified ·
1 Parent(s): fe1df36

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -38
app.py CHANGED
@@ -880,7 +880,7 @@ def main():
880
  st.session_state.voice_transcript = ""
881
 
882
  # Display speech recognition component and capture returned value
883
- transcript = st.components.v1.html(speech_recognition_html, height=400)
884
 
885
  # Update session state if there's new data
886
  if transcript is not None and transcript != "":
@@ -889,46 +889,11 @@ def main():
889
  # Display the transcript in a Streamlit text area
890
  st.markdown("### Processed Voice Input:")
891
  st.text_area("Voice Transcript", st.session_state.voice_transcript, height=100)
892
-
893
- # Add functionality to process the transcript
894
- if st.button("Process Transcript"):
895
- st.subheader("AI Response to Transcript")
896
- gpt_response = process_with_gpt(st.session_state.voice_transcript)
897
- st.markdown(gpt_response)
898
-
899
- # Option to clear the transcript
900
- if st.button("Clear Transcript"):
901
- st.session_state.voice_transcript = ""
902
- st.rerun()
903
-
904
-
905
- # Buttons to process the transcript
906
- if st.button("Search with GPT"):
907
- st.subheader("GPT-4o Response")
908
- gpt_response = process_with_gpt(st.session_state.voice_transcript)
909
- st.markdown(gpt_response)
910
-
911
- if st.button("Search with Claude"):
912
- st.subheader("Claude Response")
913
- claude_response = process_with_claude(st.session_state.voice_transcript)
914
- st.markdown(claude_response)
915
-
916
- if st.button("Search ArXiv"):
917
- st.subheader("ArXiv Search Results")
918
- arxiv_results = perform_ai_lookup(st.session_state.voice_transcript)
919
- st.markdown(arxiv_results)
920
-
921
-
922
- # Display last voice input
923
- if st.session_state.last_voice_input:
924
- st.text_area("Last Voice Input:", st.session_state.last_voice_input, height=100)
925
-
926
-
927
- if tab_main == "💬 Chat":
928
  # Model Selection
929
  model_choice = st.sidebar.radio(
930
  "Choose AI Model:",
931
- ["GPT-4o", "Claude-3", "GPT+Claude+Arxiv"]
932
  )
933
 
934
  # Chat Interface
 
880
  st.session_state.voice_transcript = ""
881
 
882
  # Display speech recognition component and capture returned value
883
+ transcript = st.components.v1.html(speech_recognition_html, height=800)
884
 
885
  # Update session state if there's new data
886
  if transcript is not None and transcript != "":
 
889
  # Display the transcript in a Streamlit text area
890
  st.markdown("### Processed Voice Input:")
891
  st.text_area("Voice Transcript", st.session_state.voice_transcript, height=100)
892
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
893
  # Model Selection
894
  model_choice = st.sidebar.radio(
895
  "Choose AI Model:",
896
+ [ "GPT+Claude+Arxiv", "GPT-4o", "Claude-3"]
897
  )
898
 
899
  # Chat Interface