Jarvis2345 commited on
Commit
5e00fc3
·
verified ·
1 Parent(s): 18afe10

deploy(S4): Blender headless pipeline + WebAR client + backend fixes

Browse files
Files changed (1) hide show
  1. backend/agent/react_agent.py +9 -8
backend/agent/react_agent.py CHANGED
@@ -120,15 +120,16 @@ RULES:
120
  async def _llm_step_stream(self, prompt: str, context: dict) -> AsyncGenerator[ReActStep, None]:
121
  t0 = time.time()
122
  try:
123
- provider = context.get("llm_provider", "OPENAI").upper()
124
- api_key = context.get("llm_key", "")
125
-
126
- if not api_key and provider != "OLLAMA":
127
- yield ReActStep("final_answer", f"Error: API Key missing for provider {provider}", duration_ms=int((time.time() - t0) * 1000))
128
- return
129
-
 
130
  system_prompt = self._build_system_prompt()
131
-
132
  from backend.services.connectors import stream_with_fallback
133
 
134
  raw = ""
 
120
  async def _llm_step_stream(self, prompt: str, context: dict) -> AsyncGenerator[ReActStep, None]:
121
  t0 = time.time()
122
  try:
123
+ # NOTE: the LLM key/provider are NOT taken from `context` here.
124
+ # stream_with_fallback() below resolves keys itself across the full
125
+ # provider chain (Gemini domain keys → Groq → OpenAI → Anthropic →
126
+ # Mistral Ollama(PC) → NVIDIA vault) and always yields a response.
127
+ # A previous `context["llm_key"]` pre-check gated this path and
128
+ # bailed with "API Key missing for provider OPENAI" because
129
+ # agent_service never populates llm_key — dropping every desktop
130
+ # reply. Removed; the fallback chain is the single source of truth.
131
  system_prompt = self._build_system_prompt()
132
+
133
  from backend.services.connectors import stream_with_fallback
134
 
135
  raw = ""