AI proxy return unified status in header phase (#1588)

This commit is contained in:
StarryNight
2024-12-16 18:41:38 +08:00
committed by GitHub
parent ec39d56731
commit 2a200cdd42
27 changed files with 94 additions and 88 deletions

View File

@@ -40,12 +40,12 @@ func (m *zhipuAiProvider) GetProviderType() string {
return providerTypeZhipuAi
}
func (m *zhipuAiProvider) OnRequestHeaders(ctx wrapper.HttpContext, apiName ApiName, log wrapper.Log) (types.Action, error) {
func (m *zhipuAiProvider) OnRequestHeaders(ctx wrapper.HttpContext, apiName ApiName, log wrapper.Log) error {
if apiName != ApiNameChatCompletion {
return types.ActionContinue, errUnsupportedApiName
return errUnsupportedApiName
}
m.config.handleRequestHeaders(m, ctx, apiName, log)
return types.ActionContinue, nil
return nil
}
func (m *zhipuAiProvider) OnRequestBody(ctx wrapper.HttpContext, apiName ApiName, body []byte, log wrapper.Log) (types.Action, error) {