[GH-ISSUE #54] Chat API响应的role字段不要设为null #53

Open
opened 2026-10-26 21:07:15 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @jichulu on GitHub (Jun 5, 2024).
Original GitHub issue: https://github.com/deepseek-ai/DeepSeek-V2/issues/54

Chat API响应的role字段不要设为null,需要明确。

data: {"choices":[{"delta":{"content":"","role":null},"finish_reason":"stop","index":0,"logprobs":null}],"created":1717557740,"id":"f893ea8481f6fe1487bb2000a9ed3cd9","model":"deepseek-chat","object":"chat.completion.chunk","system_fingerprint":"fp_f4b7ce5256","usage":{"completion_tokens":7,"prompt_tokens":15,"total_tokens":22}}

data: [DONE]

在Azure.AI.OpenAI库不支持为null的role。

Originally created by @jichulu on GitHub (Jun 5, 2024). Original GitHub issue: https://github.com/deepseek-ai/DeepSeek-V2/issues/54 Chat API响应的role字段不要设为null,需要明确。 ``` data: {"choices":[{"delta":{"content":"","role":null},"finish_reason":"stop","index":0,"logprobs":null}],"created":1717557740,"id":"f893ea8481f6fe1487bb2000a9ed3cd9","model":"deepseek-chat","object":"chat.completion.chunk","system_fingerprint":"fp_f4b7ce5256","usage":{"completion_tokens":7,"prompt_tokens":15,"total_tokens":22}} data: [DONE] ``` 在Azure.AI.OpenAI库不支持为null的role。
Author
Owner

@xyh0202 commented on GitHub (Jun 11, 2024):

带“finish_reason”字段的是最后一个输出chunk,只有第一个chunk有"role":"assistant"

<!-- gh-comment-id:2160053532 --> @xyh0202 commented on GitHub (Jun 11, 2024): 带“finish_reason”字段的是最后一个输出chunk,只有第一个chunk有"role":"assistant"
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
deepseek-ai/DeepSeek-V2#53
No description provided.