public class DefaultOpenAiAuthInterceptor extends OpenAiAuthInterceptor
| Constructor and Description |
|---|
DefaultOpenAiAuthInterceptor()
请求头处理
|
DefaultOpenAiAuthInterceptor(Map warringConfig)
构造方法
|
| Modifier and Type | Method and Description |
|---|---|
okhttp3.Response |
intercept(okhttp3.Interceptor.Chain chain)
拦截器鉴权
|
protected void |
noHaveActiveKeyWarring()
所有的key都失效后,自定义预警配置
可以通过warringConfig配置参数实现飞书、钉钉、企业微信、邮箱预警等
|
protected List<String> |
onErrorDealApiKeys(String apiKey)
key失效或者禁用后的处理逻辑
默认不处理
|
auth, getKeypublic DefaultOpenAiAuthInterceptor()
public DefaultOpenAiAuthInterceptor(Map warringConfig)
warringConfig - 所有的key都失效后的告警参数配置public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain)
throws IOException
chain - ChainIOException - io异常protected List<String> onErrorDealApiKeys(String apiKey)
onErrorDealApiKeys in class OpenAiAuthInterceptorapiKey - 返回新的api keys集合protected void noHaveActiveKeyWarring()
OpenAiAuthInterceptornoHaveActiveKeyWarring in class OpenAiAuthInterceptorCopyright © 2023 grt1228. All rights reserved.