refactor: rename HERMES_OPENAI_API_KEY to VOICE_TOOLS_OPENAI_KEY

- Updated the environment variable name from HERMES_OPENAI_API_KEY to VOICE_TOOLS_OPENAI_KEY across multiple files to avoid interference with OpenRouter.
- Adjusted related error messages and configuration prompts to reflect the new variable name, ensuring consistency throughout the codebase.
This commit is contained in:
Teknium 2026-02-23 23:21:33 +00:00
parent 4d1f2ea522
commit 0858ee2f27
6 changed files with 18 additions and 18 deletions

View file

@ -50,15 +50,15 @@ def transcribe_audio(file_path: str, model: Optional[str] = None) -> dict:
- "transcript" (str): The transcribed text (empty on failure)
- "error" (str, optional): Error message if success is False
"""
# Use HERMES_OPENAI_API_KEY to avoid interference with the OpenAI SDK's
# Use VOICE_TOOLS_OPENAI_KEY to avoid interference with the OpenAI SDK's
# auto-detection of OPENAI_API_KEY (which would break OpenRouter calls).
# Falls back to OPENAI_API_KEY for backward compatibility.
api_key = os.getenv("HERMES_OPENAI_API_KEY") or os.getenv("OPENAI_API_KEY")
api_key = os.getenv("VOICE_TOOLS_OPENAI_KEY") or os.getenv("OPENAI_API_KEY")
if not api_key:
return {
"success": False,
"transcript": "",
"error": "HERMES_OPENAI_API_KEY not set",
"error": "VOICE_TOOLS_OPENAI_KEY not set",
}
audio_path = Path(file_path)