This commit is contained in:
qixinbo
2026-03-15 01:29:36 +08:00
parent 4985c1eed3
commit 76724b2313
12 changed files with 1345 additions and 82 deletions
+11
View File
@@ -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
+1 -1
View File
@@ -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,