DrishtiSharma commited on
Commit
1c04cea
·
verified ·
1 Parent(s): b1c33cf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -3
app.py CHANGED
@@ -878,6 +878,20 @@ def multi_agent_debate() -> None:
878
  # Initialize all the session state variables
879
  initialize_session_state_variables()
880
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
881
 
882
  if st.session_state.new_debate:
883
  set_debate()
@@ -972,7 +986,5 @@ def multi_agent_debate() -> None:
972
  on_click=reset_debate
973
  )
974
 
975
-
976
-
977
  if __name__ == "__main__":
978
- multi_agent_debate()
 
878
  # Initialize all the session state variables
879
  initialize_session_state_variables()
880
 
881
+ # Sidebar for API Key Status
882
+ with st.sidebar:
883
+ st.write("### API Key Status")
884
+ openai_key_status = "✔️ Available" if os.getenv("OPENAI_API_KEY") else "❌ Missing"
885
+ bing_key_status = "✔️ Available" if os.getenv("BING_SUBSCRIPTION_KEY") else "❌ Missing"
886
+ langchain_key_status = "✔️ Available" if os.getenv("LANGCHAIN_API_KEY") else "❌ Missing"
887
+
888
+ st.write(f"**OpenAI Key**: {openai_key_status}")
889
+ st.write(f"**Bing Key**: {bing_key_status}")
890
+ st.write(f"**LangChain Key**: {langchain_key_status}")
891
+
892
+ # Error if OpenAI API key is missing
893
+ if not os.getenv("OPENAI_API_KEY"):
894
+ st.error("OpenAI Key is required for this app to function properly.")
895
 
896
  if st.session_state.new_debate:
897
  set_debate()
 
986
  on_click=reset_debate
987
  )
988
 
 
 
989
  if __name__ == "__main__":
990
+ multi_agent_debate()