deepseek-ai / DeepSeek-V2

DeepSeek-V2: A Strong, Economical, and Efficient Mixture-of-Experts Language Model
MIT License
3.47k stars 143 forks source link

Chat API响应的role字段不要设为null #54

Open jichulu opened 3 months ago

jichulu commented 3 months ago

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。

xyh0202 commented 3 months ago

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