mirror of
https://github.com/hanzoai/index.git
synced 2026-10-30 18:34:27 +00:00
Mistral models return the `content` field in streaming chat completion deltas as an array of typed parts (e.g. reference chunks and text parts) instead of a plain string, causing deserialization to fail with "invalid type: sequence, expected a string". Add a custom deserializer that accepts both a plain string (OpenAI) and an array of content parts (Mistral), extracting and concatenating only the text parts. Applied to both ChatCompletionStreamResponseDelta and ChatCompletionResponseMessage. Fixes #6123