Spaces:
Build error
Build error
Update app.py
Browse files8 unmodified lines91011121314151634 unmodified lines515253545556576 unmodified lines64656667686970717273747576778 unmodified linesdef debug_environment():"""Print available environment variables related to API keys (with values hidden)"""debug_vars = ["HF_API_TOKEN", "HUGGINGFACEHUB_API_TOKEN","OPENAI_API_KEY", "XAI_API_KEY","AGENT_MODEL_TYPE", "AGENT_MODEL_ID","AGENT_TEMPERATURE", "AGENT_VERBOSE"]34 unmodified lines# Check both HF_API_TOKEN and HUGGINGFACEHUB_API_TOKEN (HF Spaces uses HF_API_TOKEN)hf_token = os.environ.get("HF_API_TOKEN") or os.environ.get("HUGGINGFACEHUB_API_TOKEN")openai_key = os.environ.get("OPENAI_API_KEY")xai_key = os.environ.get("XAI_API_KEY")# If we have at least one API key, use a model-based approachif hf_token or openai_key or xai_key:6 unmodified linesprint(f"Agent config - Model Type: {model_type}, Model ID: {model_id}")try:if xai_key:# Use X.AI API with OpenAIServerModelapi_base = os.environ.get("XAI_API_BASE", "https://api.x.ai/v1")self.gaia_agent = GAIAAgent(model_type="OpenAIServerModel",model_id="grok-3-latest", # X.AI's modelapi_key=xai_key,api_base=api_base,temperature=temperature,executor_type="local",verbose=verbose8 unmodified lines9101112131434 unmodified lines495051525354556 unmodified lines6263646566676869708 unmodified linesdef debug_environment():"""Print available environment variables related to API keys (with values hidden)"""debug_vars = ["AGENT_MODEL_TYPE", "AGENT_MODEL_ID","AGENT_TEMPERATURE", "AGENT_VERBOSE"]34 unmodified lines# Check both HF_API_TOKEN and HUGGINGFACEHUB_API_TOKEN (HF Spaces uses HF_API_TOKEN)hf_token = os.environ.get("HF_API_TOKEN") or os.environ.get("HUGGINGFACEHUB_API_TOKEN")openai_key = os.environ.get("OPENAI_API_KEY")gemini_key = os.environ.get("GEMINI_API_KEY")# If we have at least one API key, use a model-based approachif hf_token or openai_key or xai_key:6 unmodified linesprint(f"Agent config - Model Type: {model_type}, Model ID: {model_id}")try:if gemini_key:self.gaia_agent = GAIAAgent(model_type="LiteLLMModel",temperature=temperature,executor_type="local",verbose=verbose
app.py+3-10