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

区别对待接口返回的错误,选择性禁用 #90

Closed
ccyuvin opened this issue May 18, 2023 · 8 comments
Closed

区别对待接口返回的错误,选择性禁用 #90

ccyuvin opened this issue May 18, 2023 · 8 comments
Labels
enhancement New feature or request priority This will have high priority.

Comments

@ccyuvin
Copy link

ccyuvin commented May 18, 2023

测试发现,当自定义的openai接口返回 Rate Limit 和 The model: gpt-4 does not exist 的错误时, 都会把该条渠道自动禁用。这两种报错是普遍的(免费的APIKEY频率限制一分钟3次,用户选错模型等),并非渠道不能用,不应该自动禁用掉渠道。这会导致后面把所有渠道都自动禁用掉了。
{
"error": {
"message": "type invalid_request_error, code model_not_found, message The model: gpt-4 does not exist",
"type": "one_api_error"
}
}

另外能否把openai响应的状态码也暴露出来,现在即使openai接口返回429、401之类的HTTP响应码,one-api返回的都是200响应码。

@songquanpeng
Copy link
Owner

先关掉这个:
image

这个功能确实还在优化。

@songquanpeng songquanpeng added enhancement New feature or request priority This will have high priority. bug Something isn't working and removed enhancement New feature or request labels May 18, 2023
@songquanpeng songquanpeng changed the title 【Bug】 当openai返回错误时,渠道就会被立即禁用 区别对待接口返回的错误,选择性禁用 May 18, 2023
@ccyuvin
Copy link
Author

ccyuvin commented May 18, 2023

先关掉这个: image

这个功能确实还在优化。

好的,感谢大佬开源~

@songquanpeng
Copy link
Owner

我记得这个是默认关闭的哈,难道你那里是默认开启的吗?如果是的话这就是另外的 bug 了。

@songquanpeng songquanpeng added enhancement New feature or request and removed bug Something isn't working labels May 18, 2023
@ccyuvin
Copy link
Author

ccyuvin commented May 18, 2023

我记得这个是默认关闭的哈,难道你那里是默认开启的吗?如果是的话这就是另外的 bug 了。

是我打开的,我以为这个选项是用来在渠道“测试所有已开启通道”的时候,自动禁用失败的渠道,可能是我理解错了~~

@songquanpeng
Copy link
Owner

那个默认就开启禁用哈。确实描述不够清楚,之后我改一下。

@songquanpeng
Copy link
Owner

我比较好奇,如果是 stream 模式,OpenAI 的错误相应是什么格式的?

@songquanpeng
Copy link
Owner

我比较好奇,如果是 stream 模式,OpenAI 的错误相应是什么格式的?

是一样的格式,他貌似并不会在 stream 的返回过程中报错。

@songquanpeng
Copy link
Owner

已修复,已推送 v0.3.1-alpha.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority This will have high priority.
Projects
None yet
Development

No branches or pull requests

2 participants