mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-02 03:20:02 +08:00
29 lines
598 B
Python
29 lines
598 B
Python
"""Supported reply languages used by core turn-request validation."""
|
|
|
|
SUPPORTED_RESPONSE_LANGUAGES: tuple[str, ...] = (
|
|
"en",
|
|
"zh",
|
|
"zh-tw",
|
|
"ja",
|
|
"ko",
|
|
"es",
|
|
"fr",
|
|
"de",
|
|
"ru",
|
|
"pt",
|
|
"it",
|
|
"ar",
|
|
"pl",
|
|
"uk",
|
|
"ms",
|
|
)
|
|
|
|
|
|
def validate_reply_language_override(value: str | None) -> str | None:
|
|
"""Validate an explicit session choice; ``None`` follows the account default."""
|
|
if value is None:
|
|
return None
|
|
if value not in SUPPORTED_RESPONSE_LANGUAGES:
|
|
raise ValueError("Unsupported reply language")
|
|
return value
|