仓库指标
- 星标
- (9,036 个星标)
- PR 合并指标
- (平均合并 7天 9小时) (30 天内合并 18 个 PR)
描述
If you are reporting any crash or any potential security issue, do not open an issue in this repo. Please report the issue via ASRC(Alibaba Security Response Center) where the issue will be triaged appropriately.
- I have searched the issues of this repository and believe that this is not a duplicate.
Ⅰ. Issue Description
使用 Higress 配置 ai-proxy 插件来代理 dashscope / openai 等模型,在使用社区 golang sdk 进行流式返回的时候发现使用 qwen-plus 模型时, golang 侧解析出来的response结构体为空,但使用 gpt-4o-mini 模型时并没有问题
通过在终端使用 curl 测试两者区别发现使用 qwen 系列模型时返回结构中缺少部分值为 null 的字段
qwen系列返回数据
openai 系列返回数据
在 sdk 的仓库里看到结构体定义中, system_fingerprint 、finish_reason 等字段是必须存在的(没有添加标签omitempty),导致了结构体解析失败 https://github.com/sashabaranov/go-openai/blob/2a0ff5ac63e460cbe44cccd0d4199d51bf8682a4/chat_stream.go#L38 https://github.com/sashabaranov/go-openai/blob/2a0ff5ac63e460cbe44cccd0d4199d51bf8682a4/chat_stream.go#L53
Ⅱ. Describe what happened
If there is an exception, please attach the exception trace:
Just paste your stack trace here!
Ⅲ. Describe what you expected to happen
希望在返回的结构中与 Openai 保持一致,补全缺失的字段信息
Ⅳ. How to reproduce it (as minimally and precisely as possible)
- xxx
- xxx
- xxx
Ⅴ. Anything else we need to know?
Ⅵ. Environment:
- Higress version:
- OS :
- Others: