SouravNath commited on
Commit
38700c8
Β·
1 Parent(s): 25e2686

fix: strip trailing newline from GROQ_API_KEY before using in HTTP header

Browse files
Files changed (1) hide show
  1. agent/reflection_agent.py +1 -1
agent/reflection_agent.py CHANGED
@@ -469,7 +469,7 @@ def _call_llm(
469
  # ── Groq via httpx directly (most reliable in containerised envs) ──────
470
  if client is None and provider == "groq":
471
  import httpx
472
- api_key = os.environ.get("GROQ_API_KEY") or settings.groq_api_key
473
  if not api_key:
474
  raise ValueError("GROQ_API_KEY is not set. Add it as an env var or HF Space secret.")
475
 
 
469
  # ── Groq via httpx directly (most reliable in containerised envs) ──────
470
  if client is None and provider == "groq":
471
  import httpx
472
+ api_key = (os.environ.get("GROQ_API_KEY") or settings.groq_api_key).strip()
473
  if not api_key:
474
  raise ValueError("GROQ_API_KEY is not set. Add it as an env var or HF Space secret.")
475