Skip to content

Commit 0d5507c

Browse files
roryeckelclaude
andcommitted
Apply case-insensitive parsing to backend environment variables
Add .upper() to STT_BACKEND and TTS_BACKEND environment variable parsing to match the case-insensitive behavior of command-line arguments. This ensures consistency between `--stt-backend localai` and `STT_BACKEND=localai`, both now accepting lowercase, uppercase, or mixed case values. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent b27bf4a commit 0d5507c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/wyoming_openai/__main__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ async def main():
7474
type=lambda x: OpenAIBackend[x.upper()],
7575
required=False,
7676
choices=list(OpenAIBackend),
77-
default=OpenAIBackend[env_stt_backend] if env_stt_backend else None,
77+
default=OpenAIBackend[env_stt_backend.upper()] if env_stt_backend else None,
7878
help="Backend for speech-to-text (OPENAI, SPEACHES, KOKORO_FASTAPI, LOCALAI, or None)"
7979
)
8080
parser.add_argument(
@@ -125,7 +125,7 @@ async def main():
125125
type=lambda x: OpenAIBackend[x.upper()],
126126
required=False,
127127
choices=list(OpenAIBackend),
128-
default=OpenAIBackend[env_tts_backend] if env_tts_backend else None,
128+
default=OpenAIBackend[env_tts_backend.upper()] if env_tts_backend else None,
129129
help="Backend for text-to-speech (OPENAI, SPEACHES, KOKORO_FASTAPI, LOCALAI, or None)"
130130
)
131131
parser.add_argument(

0 commit comments

Comments
 (0)