Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add field stop in GeneralOpenAIRequest #1637

Merged
merged 1 commit into from
Jul 14, 2024

Conversation

f1ynn-zhan9
Copy link
Contributor

问题描述:使用【模型重定向】功能后,one-api 转发对话时丢失 stop 参数。

翻查代码,定位到:
image
isModelMapped 为真,shouldResetRequestBody 也为真,调用
jsonStr, err := json.Marshal(textRequest)textRequest 序列化成字符串。
image
由于 textRequest 的类型 GeneralOpenAIRequest 并不包含 stop 字段,导致模型重定向后字段丢失。

close #1558
在 issue 搜索了一下,这个 issue 可能遇到类似的情况:
#1558

我已确认该 PR 已自测通过,相关截图如下:
image

@songquanpeng
Copy link
Owner

可以按照openai的文档里的顺序放置stop字段吗?

@f1ynn-zhan9
Copy link
Contributor Author

可以按照openai的文档里的顺序放置stop字段吗?

好的,我调整一下,辛苦作者 review。

@f1ynn-zhan9
Copy link
Contributor Author

可以按照openai的文档里的顺序放置stop字段吗?

已根据 openai 的文档调整 stop 字段的位置,请作者查收。

@songquanpeng songquanpeng merged commit 422a4e8 into songquanpeng:main Jul 14, 2024
@songquanpeng
Copy link
Owner

thx

@f1ynn-zhan9 f1ynn-zhan9 deleted the my-dev branch July 14, 2024 10:44
jinjianming pushed a commit to jinjianming/one-api that referenced this pull request Jul 17, 2024
@f1ynn-zhan9 f1ynn-zhan9 restored the my-dev branch September 9, 2024 10:22
mxdlzg pushed a commit to mxdlzg/one-api that referenced this pull request Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug:部分模型底层平台无法支持stop参数
2 participants