[Bugfix][Frontend] Support Responses text types in DeepSeek V4.1 (#56299)

Signed-off-by: CedricHuang <38417461+CedricHwong@users.noreply.github.com>
Co-authored-by: OpenAI Codex <codex@openai.com>
This commit is contained in:
CedricHuang
2026-09-14 10:43:09 +08:00
committed by GitHub
co-authored by OpenAI Codex
parent dfa1984e58
commit eb42686a30
2 changed files with 19 additions and 1 deletions
+18
View File
@@ -99,6 +99,24 @@ def test_raw_text_parts_preserve_reference_separator():
assert messages == original
@pytest.mark.parametrize(
("role", "responses_type"),
[("user", "input_text"), ("assistant", "output_text")],
)
def test_responses_text_parts_match_chat_text_parts(role, responses_type):
responses_message = {
"role": role,
"content": [{"type": responses_type, "text": "hello"}],
}
chat_message = {
"role": role,
"content": [{"type": "text", "text": "hello"}],
}
assert render([responses_message], thinking=False) == render(
[chat_message], thinking=False
)
def test_mid_system_gets_its_own_marker_and_generation_header():
assert render(
[
+1 -1
View File
@@ -32,7 +32,7 @@ def _normalize_messages(
parts = []
for block in content:
part_type = block.get("type")
if part_type == "text":
if part_type in ("text", "input_text", "output_text"):
parts.append(block.get("text", ""))
elif part_type in ("image_url", "input_image", "image_pil"):
parts.append(IMAGE_PLACEHOLDER)