mirror of
https://github.com/hwchase17/langchain.git
synced 2026-06-09 18:50:33 +00:00
`_sanitize_chat_completions_content` now filters every content-part dict against an allowlist derived at import time from the `fireworks-ai` SDK's `ContentUnionMember1` TypedDict, and runs on every message role — not just `ToolMessage`. Fixes 400s of the form `Extra inputs are not permitted, field: 'messages[N].content.list[ChatMessageContent][i].<key>'` when cross-provider history (e.g. an Anthropic-shaped `AIMessage` carrying the v1 streaming-reassembly `index` marker) is forwarded to a Fireworks-hosted model.