fix: settings output_language overrides the compose env default
The settings-UI output_language was ignored because the OUTPUT_LANGUAGE env took precedence. Read the config value first, fall back to env, so changing the language in /settings actually applies.
This commit is contained in:
@@ -1696,8 +1696,10 @@ def run_reply_engine(db: "Database", cfg, tts: Optional[Any],
|
|||||||
# Placed at the FRONT (after the persona header) so a small model gives
|
# Placed at the FRONT (after the persona header) so a small model gives
|
||||||
# it primacy over the persona's "use the user's language" lines — a tail
|
# it primacy over the persona's "use the user's language" lines — a tail
|
||||||
# instruction loses to those when the query itself is in another language.
|
# instruction loses to those when the query itself is in another language.
|
||||||
|
# Settings-UI value (config) wins over the compose OUTPUT_LANGUAGE env so
|
||||||
|
# changing the language in the settings page actually takes effect.
|
||||||
_lang_directive = reply_language_directive(
|
_lang_directive = reply_language_directive(
|
||||||
os.environ.get("OUTPUT_LANGUAGE") or _extra_config("output_language", ""),
|
_extra_config("output_language", "") or os.environ.get("OUTPUT_LANGUAGE"),
|
||||||
getattr(cfg, "tts_engine", "piper"),
|
getattr(cfg, "tts_engine", "piper"),
|
||||||
)
|
)
|
||||||
if _lang_directive:
|
if _lang_directive:
|
||||||
|
|||||||
Reference in New Issue
Block a user