-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
fix: 修复4v请求下text参数缺少引发的nil #1634
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1634 +/- ##
========================================
- Coverage 1.22% 1.21% -0.01%
========================================
Files 137 137
Lines 9917 9919 +2
========================================
Hits 121 121
- Misses 9782 9784 +2
Partials 14 14 ☔ View full report in Codecov by Sentry. |
这是一次兼容性更新,防止 request 中 一个小建议,发现 |
不是,是缺失text这个参数,导致获取不到就是nil了。text参数可以为空,但是不能不传
Laisky.Cai ***@***.***> 于2024年7月11日周四 10:23写道:
… 这是一次兼容性更新,防止 request 中 message.type == "text" 但是 message.text 的类型不为 string
导致程序错误?
—
Reply to this email directly, view it on GitHub
<#1634 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BAVUTO5QISQJJBLK6ONA4KTZLXUA3AVCNFSM6AAAAABKVDPDP6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMRRHA3DGNJZGQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
过去的行为是报错,现在的行为是格式合法才计费,不合法就原样传递给上游。 我觉得为了保持兼容性,不合法的时候将 |
主要是和openai的保持一致,所以我采取的是保留报错。主要是想看看大家的意见,如果觉得置空更方便当热也可以 |
以前不合法的内容不会发给上游,现在改完后会发给上游了。 优点是能拿到上游的报错信息,缺点是无法预判上游会如何处理这些信息,万一上游接受了并计费,就 bypass 了 one-api 的计费了。不过我觉得目前应该问题不大,以后有问题再改吧… Ps. 这个 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
patch的检查我之前已经去掉了 |
thx 各位 |
close #1633
我已确认该 PR 已自测通过,相关截图如下:
(此处放上测试通过的截图,如果不涉及前端改动或从 UI 上无法看出,请放终端启动成功的截图)
现在不会引发nil了,会最后直接把错错误抛出