beta
This commit is contained in:
@@ -95,6 +95,17 @@ class LLMProvider(ABC):
|
||||
"""Keep only provider-safe message keys and normalize assistant content."""
|
||||
sanitized = []
|
||||
for msg in messages:
|
||||
if isinstance(msg, list):
|
||||
for nested in msg:
|
||||
if not isinstance(nested, dict):
|
||||
continue
|
||||
clean = {k: v for k, v in nested.items() if k in allowed_keys}
|
||||
if clean.get("role") == "assistant" and "content" not in clean:
|
||||
clean["content"] = None
|
||||
sanitized.append(clean)
|
||||
continue
|
||||
if not isinstance(msg, dict):
|
||||
continue
|
||||
clean = {k: v for k, v in msg.items() if k in allowed_keys}
|
||||
if clean.get("role") == "assistant" and "content" not in clean:
|
||||
clean["content"] = None
|
||||
|
||||
@@ -151,7 +151,7 @@ PROVIDERS: tuple[ProviderSpec, ...] = (
|
||||
keywords=("volcengine", "volces", "ark"),
|
||||
env_key="OPENAI_API_KEY",
|
||||
display_name="VolcEngine",
|
||||
litellm_prefix="volcengine",
|
||||
litellm_prefix="openai",
|
||||
skip_prefixes=(),
|
||||
env_extras=(),
|
||||
is_gateway=True,
|
||||
|
||||
Reference in New Issue
Block a user