revert nanobot

This commit is contained in:
qixinbo
2026-03-17 16:13:33 +08:00
parent 600aa495c3
commit a688e6e25e
2 changed files with 19 additions and 10 deletions
-9
View File
@@ -95,15 +95,6 @@ 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}