Spaces:
Build error
Build error
Update app.py
Browse files8 unmodified lines91011121312131434 unmodified lines49505154525354556 unmodified lines626364676869656671727374676869708 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") gemini_key = os.environ.get("GEMINI_API_KEY") # If we have at least one API key, use a model-based approach if hf_token or openai_key or xai_key:6 unmodified lines print(f"Agent config - Model Type: {model_type}, Model ID: {model_id}") try: if xai_key: # Use X.AI API with OpenAIServerModel api_base = os.environ.get("XAI_API_BASE", "https://api.x.ai/v1") if gemini_key: self.gaia_agent = GAIAAgent( model_type="OpenAIServerModel", model_id="grok-3-latest", # X.AI's model api_key=xai_key, api_base=api_base, model_type="LiteLLMModel", temperature=temperature, executor_type="local", verbose=verboseapp.py+3-10