awacke1 commited on
Commit
0270bf4
โ€ข
1 Parent(s): 98cb0fe

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +57 -0
app.py CHANGED
@@ -922,6 +922,63 @@ def main():
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":
 
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
+ # Model Selection
928
+ model_choice = st.sidebar.radio(
929
+ "Choose AI Model:",
930
+ ["GPT-4o", "Claude-3", "GPT+Claude+Arxiv"]
931
+ )
932
+
933
+ # Chat Interface
934
+ user_input = st.text_area("Message:", height=100)
935
+
936
+ if st.button("Send ๐Ÿ“จ"):
937
+ if user_input:
938
+ if model_choice == "GPT-4o":
939
+ gpt_response = process_with_gpt(user_input)
940
+ elif model_choice == "Claude-3":
941
+ claude_response = process_with_claude(user_input)
942
+ else: # Both
943
+ col1, col2, col3 = st.columns(3)
944
+ with col2:
945
+ st.subheader("Claude-3.5 Sonnet:")
946
+ try:
947
+ claude_response = process_with_claude(user_input)
948
+ except:
949
+ st.write('Claude 3.5 Sonnet out of tokens.')
950
+ with col1:
951
+ st.subheader("GPT-4o Omni:")
952
+ try:
953
+ gpt_response = process_with_gpt(user_input)
954
+ except:
955
+ st.write('GPT 4o out of tokens')
956
+ with col3:
957
+ st.subheader("Arxiv and Mistral Research:")
958
+ with st.spinner("Searching ArXiv..."):
959
+ #results = search_arxiv(user_input)
960
+ results = perform_ai_lookup(user_input)
961
+
962
+ st.markdown(results)
963
+
964
+ # Display Chat History
965
+ st.subheader("Chat History ๐Ÿ“œ")
966
+ tab1, tab2 = st.tabs(["Claude History", "GPT-4o History"])
967
+
968
+ with tab1:
969
+ for chat in st.session_state.chat_history:
970
+ st.text_area("You:", chat["user"], height=100)
971
+ st.text_area("Claude:", chat["claude"], height=200)
972
+ st.markdown(chat["claude"])
973
+
974
+ with tab2:
975
+ for message in st.session_state.messages:
976
+ with st.chat_message(message["role"]):
977
+ st.markdown(message["content"])
978
+
979
+
980
+ # ------------------------------------------------------- ************************* --->
981
+
982
 
983
 
984
  if tab_main == "๐Ÿ’ฌ Chat":