[Bugfix] Set type/role explicitly in streaming message_start event (#45376)

Signed-off-by: Wayne Chiu <waynehacking8@gmail.com>
This commit is contained in:
WEI CHENG CHIU
2026-06-13 01:40:50 +00:00
committed by GitHub
parent 1a369783e9
commit 17ee5b1ac5
2 changed files with 43 additions and 0 deletions
+7
View File
@@ -678,6 +678,13 @@ class AnthropicServingMessages(OpenAIServingChat):
type="message_start",
message=AnthropicMessagesResponse(
id=origin_chunk.id,
# Set explicitly: this event is serialized
# with exclude_unset=True, which drops
# default-valued fields, while strict
# Anthropic SDK clients require
# message.type/role (issue #45367).
type="message",
role="assistant",
content=[],
model=origin_chunk.model,
stop_reason=None,