DeepSeek-V2 icon indicating copy to clipboard operation
DeepSeek-V2 copied to clipboard

当结尾 "finish_reason":"stop" 时,role 值为空

Open yttchan opened this issue 9 months ago • 1 comments

data: {"id":"2c0e9145-0ef9-4037-a5b0-590c6df994b0","choices":[{"index":0,"delta":{"content":".","role":"assistant"},"finish_reason":null,"logprobs":null}],"created":1715667871,"model":"deepseek-chat","system_fingerprint":null,"object":"chat.completion.chunk"}

data: {"id":"2c0e9145-0ef9-4037-a5b0-590c6df994b0","choices":[{"index":0,"delta":{"content":"","role":null},"finish_reason":"stop","logprobs":null}],"created":1715667871,"model":"deepseek-chat","system_fingerprint":null,"object":"chat.completion.chunk","usage":{"prompt_tokens":8,"completion_tokens":27,"total_tokens":35}}

.Net在使用SemanticKernel框架流式输出, 会因为最后一行记录role =null 报错

yttchan avatar May 15 '24 07:05 yttchan

DeepSeep api 兼容 openai api 格式,流式输出内容只有第一个chunk有 role:assistant 字段

xyh0202 avatar May 28 '24 02:05 xyh0202