KenyonY/openai-forward

自动重试机制

gougui opened this issue · 6 comments

gougui commented

自动重试机制:在请求失败时自动重试
作者麻烦问下,目前是哪些情况下会自动重试呢?能否加个配置参数自定一些错误码时自动重试呢?比如配置429,多个key时,一个key429频率超了会自动重试调用其它key

Bot detected the issue body's language is not English, translate it automatically.


Title: automatic retry mechanism

Automatic retry mechanism: automatically retry when request fails
The author would like to ask, under what circumstances does it automatically retry? Can I add a configuration parameter to automatically retry when some error codes are customized? For example, when configuring 429 and multiple keys, if the frequency of one key 429 exceeds, it will automatically retry to call other keys

gougui commented

我自己魔改了下,好像重试还是用的原来的key,导致重试一样失败

Bot detected the issue body's language is not English, translate it automatically.


I made some magic changes myself, and it seems that I still use the original key when I try again, causing the retry to fail.

目前的自动重试机制是用于请求时网络、并发等因素导致的错误,而不是用于判断返回的结果是否有错误。

Bot detected the issue body's language is not English, translate it automatically.


The current automatic retry mechanism is used for errors caused by network, concurrency and other factors during the request, rather than for determining whether the returned results have errors.

对于你的需求可以参考这里的回答 #67 (comment) ,可以通过判断返回的状态码确定是否重新请求。
本项目不会额外开发这个需求。