Zeros66 commited on
Commit
1f345da
·
verified ·
1 Parent(s): 5fb36ac

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -10
app.py CHANGED
@@ -9,8 +9,6 @@ from core_agent import GAIAAgent
9
  def debug_environment():
10
  """Print available environment variables related to API keys (with values hidden)"""
11
  debug_vars = [
12
- "HF_API_TOKEN", "HUGGINGFACEHUB_API_TOKEN",
13
- "OPENAI_API_KEY", "XAI_API_KEY",
14
  "AGENT_MODEL_TYPE", "AGENT_MODEL_ID",
15
  "AGENT_TEMPERATURE", "AGENT_VERBOSE"
16
  ]
@@ -51,7 +49,7 @@ class BasicAgent:
51
  # Check both HF_API_TOKEN and HUGGINGFACEHUB_API_TOKEN (HF Spaces uses HF_API_TOKEN)
52
  hf_token = os.environ.get("HF_API_TOKEN") or os.environ.get("HUGGINGFACEHUB_API_TOKEN")
53
  openai_key = os.environ.get("OPENAI_API_KEY")
54
- xai_key = os.environ.get("XAI_API_KEY")
55
 
56
  # If we have at least one API key, use a model-based approach
57
  if hf_token or openai_key or xai_key:
@@ -64,14 +62,9 @@ class BasicAgent:
64
  print(f"Agent config - Model Type: {model_type}, Model ID: {model_id}")
65
 
66
  try:
67
- if xai_key:
68
- # Use X.AI API with OpenAIServerModel
69
- api_base = os.environ.get("XAI_API_BASE", "https://api.x.ai/v1")
70
  self.gaia_agent = GAIAAgent(
71
- model_type="OpenAIServerModel",
72
- model_id="grok-3-latest", # X.AI's model
73
- api_key=xai_key,
74
- api_base=api_base,
75
  temperature=temperature,
76
  executor_type="local",
77
  verbose=verbose
 
9
  def debug_environment():
10
  """Print available environment variables related to API keys (with values hidden)"""
11
  debug_vars = [
 
 
12
  "AGENT_MODEL_TYPE", "AGENT_MODEL_ID",
13
  "AGENT_TEMPERATURE", "AGENT_VERBOSE"
14
  ]
 
49
  # Check both HF_API_TOKEN and HUGGINGFACEHUB_API_TOKEN (HF Spaces uses HF_API_TOKEN)
50
  hf_token = os.environ.get("HF_API_TOKEN") or os.environ.get("HUGGINGFACEHUB_API_TOKEN")
51
  openai_key = os.environ.get("OPENAI_API_KEY")
52
+ gemini_key = os.environ.get("GEMINI_API_KEY")
53
 
54
  # If we have at least one API key, use a model-based approach
55
  if hf_token or openai_key or xai_key:
 
62
  print(f"Agent config - Model Type: {model_type}, Model ID: {model_id}")
63
 
64
  try:
65
+ if gemini_key:
 
 
66
  self.gaia_agent = GAIAAgent(
67
+ model_type="LiteLLMModel",
 
 
 
68
  temperature=temperature,
69
  executor_type="local",
70
  verbose=verbose