deepseek-ai / DeepSeek-V2

DeepSeek-V2: A Strong, Economical, and Efficient Mixture-of-Experts Language Model

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

yttchan opened this issue · 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 报错

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