fix(groq): use Config class instead of hardcoded config.json (#136)

Config class writes YAML (config.yaml), but xiaoyuzhou.py, cli.py, and
transcribe.sh were hardcoded to read config.json (JSON format). Users who
configured groq-key via 'agent-reach configure' would not have their key
detected because the wrong file was being read.

Fixes #128 (related to config loading)

Co-authored-by: Panniantong <panniantong@users.noreply.github.com>
This commit is contained in:
Pnant
2026-03-10 14:21:34 +08:00
committed by GitHub
parent f5f4dea075
commit 6737ba6dbd
3 changed files with 11 additions and 22 deletions
+1 -9
View File
@@ -490,15 +490,7 @@ def _install_xiaoyuzhou_deps():
print(" -- ffmpeg not found. Install: apt install -y ffmpeg (or brew install ffmpeg)")
# Check GROQ_API_KEY
config_path = os.path.expanduser("~/.agent-reach/config.json")
has_key = bool(os.environ.get("GROQ_API_KEY"))
if not has_key and os.path.isfile(config_path):
try:
with open(config_path) as f:
cfg = json.load(f)
has_key = bool(cfg.get("groq_api_key"))
except Exception:
pass
has_key = bool(os.environ.get("GROQ_API_KEY")) or bool(config.get("groq_api_key"))
if has_key:
print(" ✅ Groq API key configured")
else: