From dcb823259631c1bb99487ea9602ec06cd2ecffb4 Mon Sep 17 00:00:00 2001 From: AmadeusW <41280211+Amadeus-Winarto@users.noreply.github.com> Date: Mon, 21 Apr 2025 08:15:38 +0800 Subject: [PATCH] Fix ChatCompletionMessageGenericParam to allow for None content (#5452) --- python/sglang/srt/openai_api/protocol.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/sglang/srt/openai_api/protocol.py b/python/sglang/srt/openai_api/protocol.py index 4318afea6..ca27bf210 100644 --- a/python/sglang/srt/openai_api/protocol.py +++ b/python/sglang/srt/openai_api/protocol.py @@ -252,7 +252,7 @@ ChatCompletionMessageContentPart = Union[ class ChatCompletionMessageGenericParam(BaseModel): role: Literal["system", "assistant", "tool"] - content: Union[str, List[ChatCompletionMessageContentTextPart]] + content: Union[str, List[ChatCompletionMessageContentTextPart], None] class ChatCompletionMessageUserParam(BaseModel):