fix(proxy): parse use_legacy_interactions_schema string values safely

bool("false") returns True in Python, so quoted YAML values like
"false" or "False" silently activated the legacy Interactions API
schema. Match the env-var parsing pattern in litellm/__init__.py by
treating string inputs as true only when they equal "true" (case
insensitive).

Co-authored-by: Yassin Kortam <yassin@berri.ai>
This commit is contained in:
Cursor Agent 2026-05-18 08:47:18 +00:00 • committed by Sameer Kankute
parent a4d0ffcc83
commit 302069ca0e
No known key found for this signature in database

View file

@ -4329,10 +4329,18 @@ class ProxyConfig:
)
health_check_details = general_settings.get("health_check_details", True)
### INTERACTIONS API SCHEMA ###
if general_settings.get("use_legacy_interactions_schema") is not None:
litellm.use_legacy_interactions_schema = bool(
general_settings["use_legacy_interactions_schema"]
)
_use_legacy_interactions_schema = general_settings.get(
"use_legacy_interactions_schema"
)
if _use_legacy_interactions_schema is not None:
if isinstance(_use_legacy_interactions_schema, str):
litellm.use_legacy_interactions_schema = (
_use_legacy_interactions_schema.lower() == "true"
)
else:
litellm.use_legacy_interactions_schema = bool(
_use_legacy_interactions_schema
)
# Health-check-driven routing (opt-in, passes through to Router later)
_enable_hc_routing = general_settings.get(
"enable_health_check_routing", False