mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-29 01:42:19 +00:00
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:
parent
a4d0ffcc83
commit
302069ca0e
1 changed files with 12 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue