ai365vip / chat-api

基于One API与New API的基础上进行二次开发
https://api.ai365vip.com/
Other
284 stars 69 forks source link

最后一次重试不会使用低优先级渠道 #41

Closed luomo-pro closed 1 month ago

luomo-pro commented 1 month ago

例行检查

问题描述 使用最新的0.4.2,看更新日志说最后一次重试会强制使用低优先级渠道,但实际测试并没有。 复现步骤 添加两个渠道,第一个渠道优先级是2,第二个渠道优先级1。 重试次数设置成3。 实际调用,发现一直都是调用第一个渠道,并不会调用到第二个。 预期结果 应该会调用优先级低的渠道

ai365vip commented 1 month ago

请给出详细运行日志和渠道配置,这边测试没问题

luomo-pro commented 1 month ago

我配置的两个渠道是不同的分类,第一个是Google Gemini,第二个是open ai。 两个渠道的模型,都有 gemini-pro。 那第二个渠道,是第三方中转站,做了对谷歌的兼容,所以渠道分类选的就是open ai。 第一个渠道的优先级是2,第二个渠道的优先级是1。 我故意把第一个渠道的请求地址给改成了个错误的,发起请求,就看到了如下的日志: [SYS] 2024/05/20 - 12:13:46 | error: do request failed: Post "http://xxx.com/v1/models/gemini-pro:generateContent": dial tcp: lookup xxx.com on 183.60.83.19:53: no such host [INFO] 2024/05/20 - 12:13:46 | 20240520121346770885669hlT5SfM4 | 使用渠道 #1 重试 (剩余重试 5次) [INFO] 2024/05/20 - 12:13:46 | 20240520121346770885669hlT5SfM4 | 使用渠道 #1 重试 (剩余重试 4次) [INFO] 2024/05/20 - 12:13:46 | 20240520121346770885669hlT5SfM4 | 使用渠道 #1 重试 (剩余重试 3次) [INFO] 2024/05/20 - 12:13:46 | 20240520121346770885669hlT5SfM4 | 使用渠道 #1 重试 (剩余重试 2次) [INFO] 2024/05/20 - 12:13:46 | 20240520121346770885669hlT5SfM4 | 使用渠道 #1 重试 (剩余重试 1次) [GIN] 2024/05/20 - 12:13:46 | 20240520121346770885669hlT5SfM4 | 500 | 10.644234ms | x.x.75.48 | POST /v1/chat/completions 下面是error日志: [ERR] 2024/05/20 - 12:13:46 | 20240520121346770885669hlT5SfM4 | relay error (channel #1): 请求上游地址失败 [ERR] 2024/05/20 - 12:14:17 | 20240520121417523644421S4kLKisr | DoRequest failed: do request failed: Post "http://xxx.com/v1/models/gemini-pro:generateContent": dial tcp: lookup xxx.com on 183.60.83.19:53: no such host 我怀疑是不是因为这边的重试机制是按照渠道分类来的,所以没走到低优先级的上面?

ai365vip commented 1 month ago

v0.4.3-alpha.3 新测试版本