Spaces:
Running on Zero
Running on Zero
Update app.py
Browse files90 unmodified lines919293949596959697989910010110210310410559 unmodified lines16516616716216816917017190 unmodified lines return f"Error downloading file for task '{task_id}': {str(e)}"
litellm.drop_params = True raw_key = os.getenv("OPENROUTER_API_KEY") openrouter_key = (os.getenv("OPENROUTER_API_KEY") or "").strip(" '\"\n\r\t") or None if openrouter_key: os.environ["OPENROUTER_API_KEY"] = openrouter_key if not openrouter_key: raise ValueError( "Missing OPENROUTER_API_KEY in environment/secrets. " "Add OPENROUTER_API_KEY in Space Settings -> Variables and secrets and restart the Space." ) os.environ["OPENROUTER_API_KEY"] = openrouter_key
model = LiteLLMModel( model_id="openrouter/nvidia/nemotron-3.5-lightning:free",59 unmodified lines try: result = self.agent.run(prompt) raw_text = "" if result is None else str(result).strip() return _clean_exact_match_answer(raw_text) return self._clean_exact_match_answer(raw_text) except Exception as exc: return f"AGENT ERROR: {exc}"
app.py+9-3