[Bugfix] Do not add extra \n for image-only cases when constructing multimodal text prompts. (#33647)

Signed-off-by: wang.yuqi <yuqi.wang@daocloud.io>
This commit is contained in:
wang.yuqi
2026-02-03 22:43:47 +08:00
committed by GitHub
parent 4bc913aeec
commit f3d8a34671

View File

@@ -1164,7 +1164,10 @@ def _get_full_multimodal_text_prompt(
# NOTE: Default behaviour: we always add missing placeholders
# at the front of the prompt, if interleave_strings=False
return "\n".join(missing_placeholders + [text_prompt])
if text_prompt:
return "\n".join(missing_placeholders + [text_prompt])
else:
return "\n".join(missing_placeholders)
# No need to validate using Pydantic again