meart commited on
Commit
6d36287
·
verified ·
1 Parent(s): f097570

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -19,13 +19,14 @@ st.set_page_config(page_title="GAIA Agent", page_icon="🤖", layout="wide")
19
  st.title("🤖 GAIA Agent")
20
 
21
  # Environment variables setup
22
- OPENAI_API_KEY = os.environ.get("OPENAI_API_KEY", st.secrets.get("OPENAI_API_KEY", ""))
23
  SERPER_API_KEY = os.environ.get("SERPER_API_KEY", st.secrets.get("SERPER_API_KEY", ""))
24
- MODEL_NAME = os.environ.get("MODEL_NAME", st.secrets.get("MODEL_NAME", "gpt-4o"))
25
 
26
  # Initialize the LLM
27
  @st.cache_resource
28
  def get_llm():
 
29
  return ChatOpenAI(
30
  model=MODEL_NAME,
31
  temperature=0.1,
@@ -217,12 +218,12 @@ def process_input(user_input: str) -> str:
217
  # Streamlit UI
218
  st.write("""
219
  This agent is designed to pass the GAIA benchmark with at least a 30% score.
220
- It uses OpenAI's GPT-4o model, Google search via Serper API, and can parse YouTube video content.
221
  """)
222
 
223
  # Check if API keys are set
224
  if not OPENAI_API_KEY:
225
- st.warning("⚠️ OpenAI API key is not set. Please add it to your secrets.")
226
  if not SERPER_API_KEY:
227
  st.warning("⚠️ Serper API key is not set. Please add it to your secrets.")
228
 
 
19
  st.title("🤖 GAIA Agent")
20
 
21
  # Environment variables setup
22
+ OPENAI_API_KEY = os.environ.get("OPENAI_TEST", st.secrets.get("OPENAI_TEST", ""))
23
  SERPER_API_KEY = os.environ.get("SERPER_API_KEY", st.secrets.get("SERPER_API_KEY", ""))
24
+ MODEL_NAME = os.environ.get("MODEL_NAME", st.secrets.get("MODEL_NAME", "gpt-4o-mini"))
25
 
26
  # Initialize the LLM
27
  @st.cache_resource
28
  def get_llm():
29
+ """Initialize and cache the LLM"""
30
  return ChatOpenAI(
31
  model=MODEL_NAME,
32
  temperature=0.1,
 
218
  # Streamlit UI
219
  st.write("""
220
  This agent is designed to pass the GAIA benchmark with at least a 30% score.
221
+ It uses OpenAI's gpt-4o-mini model, Google search via Serper API, and can parse YouTube video content.
222
  """)
223
 
224
  # Check if API keys are set
225
  if not OPENAI_API_KEY:
226
+ st.warning("⚠️ OpenAI API key (OPENAI_TEST) is not set. Please add it to your secrets.")
227
  if not SERPER_API_KEY:
228
  st.warning("⚠️ Serper API key is not set. Please add it to your secrets.")
229