diff --git a/plugins/wasm-go/extensions/ai-proxy/README.md b/plugins/wasm-go/extensions/ai-proxy/README.md index f1470e8ae..8f281ffd2 100644 --- a/plugins/wasm-go/extensions/ai-proxy/README.md +++ b/plugins/wasm-go/extensions/ai-proxy/README.md @@ -43,7 +43,7 @@ description: AI 代理插件配置参考 | `failover` | object | 非必填 | - | 配置 apiToken 的 failover 策略,当 apiToken 不可用时,将其移出 apiToken 列表,待健康检测通过后重新添加回 apiToken 列表 | | `retryOnFailure` | object | 非必填 | - | 当请求失败时立即进行重试 | | `capabilities` | map of string | 非必填 | - | 部分provider的部分ai能力原生兼容openai/v1格式,不需要重写,可以直接转发,通过此配置项指定来开启转发, key表示的是采用的厂商协议能力,values表示的真实的厂商该能力的api path, 厂商协议能力当前支持: openai/v1/chatcompletions, openai/v1/embeddings, openai/v1/imagegeneration, openai/v1/audiospeech, cohere/v1/rerank | -| `passthrough` | bool | 非必填 | - | 只要是不支持的API能力都直接转发, 此配置是capabilities配置的放大版本,允许任意api透传,就像没有ai-proxy插件一样 | + `context`的配置字段说明如下: | 名称 | 数据类型 | 填写要求 | 默认值 | 描述 | diff --git a/plugins/wasm-go/extensions/ai-proxy/main.go b/plugins/wasm-go/extensions/ai-proxy/main.go index 1dcea5878..569a0e9ba 100644 --- a/plugins/wasm-go/extensions/ai-proxy/main.go +++ b/plugins/wasm-go/extensions/ai-proxy/main.go @@ -87,8 +87,9 @@ func onHttpRequestHeader(ctx wrapper.HttpContext, pluginConfig config.PluginConf } if apiName == "" { - log.Warnf("[onHttpRequestHeader] unsupported path: %s", path.Path) - return types.ActionContinue + ctx.DontReadRequestBody() + ctx.DontReadResponseBody() + log.Warnf("[onHttpRequestHeader] unsupported path: %s, will not process http path and body", path.Path) } ctx.SetContext(provider.CtxKeyApiName, apiName) @@ -105,11 +106,6 @@ func onHttpRequestHeader(ctx wrapper.HttpContext, pluginConfig config.PluginConf err := handler.OnRequestHeaders(ctx, apiName, log) if err != nil { - if providerConfig.PassthroughUnsupportedAPI() { - log.Warnf("[onHttpRequestHeader] passthrough unsupported API: %v", err) - ctx.DontReadRequestBody() - return types.ActionContinue - } util.ErrorHandler("ai-proxy.proc_req_headers_failed", fmt.Errorf("failed to process request headers: %v", err)) return types.ActionContinue } @@ -156,10 +152,6 @@ func onHttpRequestBody(ctx wrapper.HttpContext, pluginConfig config.PluginConfig if err == nil { return action } - if pluginConfig.GetProviderConfig().PassthroughUnsupportedAPI() { - log.Warnf("[onHttpRequestBody] passthrough unsupported API: %v", err) - return types.ActionContinue - } util.ErrorHandler("ai-proxy.proc_req_body_failed", fmt.Errorf("failed to process request body: %v", err)) } return types.ActionContinue diff --git a/plugins/wasm-go/extensions/ai-proxy/provider/ai360.go b/plugins/wasm-go/extensions/ai-proxy/provider/ai360.go index 57b092cd8..3c19905a0 100644 --- a/plugins/wasm-go/extensions/ai-proxy/provider/ai360.go +++ b/plugins/wasm-go/extensions/ai-proxy/provider/ai360.go @@ -49,9 +49,6 @@ func (m *ai360Provider) GetProviderType() string { } func (m *ai360Provider) OnRequestHeaders(ctx wrapper.HttpContext, apiName ApiName, log wrapper.Log) error { - if !m.config.isSupportedAPI(apiName) { - return errUnsupportedApiName - } m.config.handleRequestHeaders(m, ctx, apiName, log) // Delay the header processing to allow changing streaming mode in OnRequestBody return nil diff --git a/plugins/wasm-go/extensions/ai-proxy/provider/azure.go b/plugins/wasm-go/extensions/ai-proxy/provider/azure.go index 5fcc378d4..c95b3bcbb 100644 --- a/plugins/wasm-go/extensions/ai-proxy/provider/azure.go +++ b/plugins/wasm-go/extensions/ai-proxy/provider/azure.go @@ -63,9 +63,6 @@ func (m *azureProvider) GetProviderType() string { } func (m *azureProvider) OnRequestHeaders(ctx wrapper.HttpContext, apiName ApiName, log wrapper.Log) error { - if !m.config.isSupportedAPI(apiName) { - return errUnsupportedApiName - } m.config.handleRequestHeaders(m, ctx, apiName, log) return nil } @@ -78,21 +75,23 @@ func (m *azureProvider) OnRequestBody(ctx wrapper.HttpContext, apiName ApiName, } func (m *azureProvider) TransformRequestHeaders(ctx wrapper.HttpContext, apiName ApiName, headers http.Header, log wrapper.Log) { - u, e := url.Parse(ctx.Path()) - if e == nil { - customApiVersion := u.Query().Get("api-version") - if customApiVersion == "" { - util.OverwriteRequestPathHeader(headers, m.serviceUrl.RequestURI()) + if apiName != "" { + u, e := url.Parse(ctx.Path()) + if e == nil { + customApiVersion := u.Query().Get("api-version") + if customApiVersion == "" { + util.OverwriteRequestPathHeader(headers, m.serviceUrl.RequestURI()) + } else { + q := m.serviceUrl.Query() + q.Set("api-version", customApiVersion) + newUrl := *m.serviceUrl + newUrl.RawQuery = q.Encode() + util.OverwriteRequestPathHeader(headers, newUrl.RequestURI()) + } } else { - q := m.serviceUrl.Query() - q.Set("api-version", customApiVersion) - newUrl := *m.serviceUrl - newUrl.RawQuery = q.Encode() - util.OverwriteRequestPathHeader(headers, newUrl.RequestURI()) + log.Errorf("failed to parse request path: %v", e) + util.OverwriteRequestPathHeader(headers, m.serviceUrl.RequestURI()) } - } else { - log.Errorf("failed to parse request path: %v", e) - util.OverwriteRequestPathHeader(headers, m.serviceUrl.RequestURI()) } util.OverwriteRequestHostHeader(headers, m.serviceUrl.Host) headers.Set("api-key", m.config.GetApiTokenInUse(ctx)) diff --git a/plugins/wasm-go/extensions/ai-proxy/provider/baichuan.go b/plugins/wasm-go/extensions/ai-proxy/provider/baichuan.go index d04c5c7d8..3516f5719 100644 --- a/plugins/wasm-go/extensions/ai-proxy/provider/baichuan.go +++ b/plugins/wasm-go/extensions/ai-proxy/provider/baichuan.go @@ -50,9 +50,6 @@ func (m *baichuanProvider) GetProviderType() string { } func (m *baichuanProvider) OnRequestHeaders(ctx wrapper.HttpContext, apiName ApiName, log wrapper.Log) error { - if !m.config.isSupportedAPI(apiName) { - return errUnsupportedApiName - } m.config.handleRequestHeaders(m, ctx, apiName, log) return nil } diff --git a/plugins/wasm-go/extensions/ai-proxy/provider/baidu.go b/plugins/wasm-go/extensions/ai-proxy/provider/baidu.go index 27bf5aaec..fcd7718cf 100644 --- a/plugins/wasm-go/extensions/ai-proxy/provider/baidu.go +++ b/plugins/wasm-go/extensions/ai-proxy/provider/baidu.go @@ -51,9 +51,6 @@ func (g *baiduProvider) GetProviderType() string { } func (g *baiduProvider) OnRequestHeaders(ctx wrapper.HttpContext, apiName ApiName, log wrapper.Log) error { - if !g.config.isSupportedAPI(apiName) { - return errUnsupportedApiName - } g.config.handleRequestHeaders(g, ctx, apiName, log) return nil } diff --git a/plugins/wasm-go/extensions/ai-proxy/provider/claude.go b/plugins/wasm-go/extensions/ai-proxy/provider/claude.go index 8d75f5cae..b185cae54 100644 --- a/plugins/wasm-go/extensions/ai-proxy/provider/claude.go +++ b/plugins/wasm-go/extensions/ai-proxy/provider/claude.go @@ -111,9 +111,6 @@ func (c *claudeProvider) GetProviderType() string { } func (c *claudeProvider) OnRequestHeaders(ctx wrapper.HttpContext, apiName ApiName, log wrapper.Log) error { - if !c.config.isSupportedAPI(apiName) { - return errUnsupportedApiName - } c.config.handleRequestHeaders(c, ctx, apiName, log) return nil } diff --git a/plugins/wasm-go/extensions/ai-proxy/provider/cloudflare.go b/plugins/wasm-go/extensions/ai-proxy/provider/cloudflare.go index 22b9cd428..5d35eef35 100644 --- a/plugins/wasm-go/extensions/ai-proxy/provider/cloudflare.go +++ b/plugins/wasm-go/extensions/ai-proxy/provider/cloudflare.go @@ -49,9 +49,6 @@ func (c *cloudflareProvider) GetProviderType() string { } func (c *cloudflareProvider) OnRequestHeaders(ctx wrapper.HttpContext, apiName ApiName, log wrapper.Log) error { - if !c.config.isSupportedAPI(apiName) { - return errUnsupportedApiName - } c.config.handleRequestHeaders(c, ctx, apiName, log) return nil } diff --git a/plugins/wasm-go/extensions/ai-proxy/provider/cohere.go b/plugins/wasm-go/extensions/ai-proxy/provider/cohere.go index a21964e49..b9d1e76a2 100644 --- a/plugins/wasm-go/extensions/ai-proxy/provider/cohere.go +++ b/plugins/wasm-go/extensions/ai-proxy/provider/cohere.go @@ -66,9 +66,6 @@ func (m *cohereProvider) GetProviderType() string { } func (m *cohereProvider) OnRequestHeaders(ctx wrapper.HttpContext, apiName ApiName, log wrapper.Log) error { - if !m.config.isSupportedAPI(apiName) { - return errUnsupportedApiName - } m.config.handleRequestHeaders(m, ctx, apiName, log) return nil } diff --git a/plugins/wasm-go/extensions/ai-proxy/provider/deepl.go b/plugins/wasm-go/extensions/ai-proxy/provider/deepl.go index 812bd3255..b47917782 100644 --- a/plugins/wasm-go/extensions/ai-proxy/provider/deepl.go +++ b/plugins/wasm-go/extensions/ai-proxy/provider/deepl.go @@ -83,15 +83,16 @@ func (d *deeplProvider) GetProviderType() string { } func (d *deeplProvider) OnRequestHeaders(ctx wrapper.HttpContext, apiName ApiName, log wrapper.Log) error { - if !d.config.isSupportedAPI(apiName) { - return errUnsupportedApiName - } d.config.handleRequestHeaders(d, ctx, apiName, log) return nil } func (d *deeplProvider) TransformRequestHeaders(ctx wrapper.HttpContext, apiName ApiName, headers http.Header, log wrapper.Log) { - util.OverwriteRequestPathHeader(headers, deeplChatCompletionPath) + if apiName != "" { + util.OverwriteRequestPathHeader(headers, deeplChatCompletionPath) + } + // TODO: Support default host through configuration + util.OverwriteRequestHostHeader(headers, deeplHostFree) util.OverwriteRequestAuthorizationHeader(headers, "DeepL-Auth-Key "+d.config.GetApiTokenInUse(ctx)) } diff --git a/plugins/wasm-go/extensions/ai-proxy/provider/deepseek.go b/plugins/wasm-go/extensions/ai-proxy/provider/deepseek.go index c8eca82a5..bc0e1d9d0 100644 --- a/plugins/wasm-go/extensions/ai-proxy/provider/deepseek.go +++ b/plugins/wasm-go/extensions/ai-proxy/provider/deepseek.go @@ -52,9 +52,6 @@ func (m *deepseekProvider) GetProviderType() string { } func (m *deepseekProvider) OnRequestHeaders(ctx wrapper.HttpContext, apiName ApiName, log wrapper.Log) error { - if !m.config.isSupportedAPI(apiName) { - return errUnsupportedApiName - } m.config.handleRequestHeaders(m, ctx, apiName, log) return nil } diff --git a/plugins/wasm-go/extensions/ai-proxy/provider/dify.go b/plugins/wasm-go/extensions/ai-proxy/provider/dify.go index b93461a0c..78c679b86 100644 --- a/plugins/wasm-go/extensions/ai-proxy/provider/dify.go +++ b/plugins/wasm-go/extensions/ai-proxy/provider/dify.go @@ -51,9 +51,6 @@ func (d *difyProvider) GetProviderType() string { } func (d *difyProvider) OnRequestHeaders(ctx wrapper.HttpContext, apiName ApiName, log wrapper.Log) error { - if apiName != ApiNameChatCompletion { - return errUnsupportedApiName - } d.config.handleRequestHeaders(d, ctx, apiName, log) return nil } diff --git a/plugins/wasm-go/extensions/ai-proxy/provider/doubao.go b/plugins/wasm-go/extensions/ai-proxy/provider/doubao.go index a896078e1..7b97ecd40 100644 --- a/plugins/wasm-go/extensions/ai-proxy/provider/doubao.go +++ b/plugins/wasm-go/extensions/ai-proxy/provider/doubao.go @@ -50,9 +50,6 @@ func (m *doubaoProvider) GetProviderType() string { } func (m *doubaoProvider) OnRequestHeaders(ctx wrapper.HttpContext, apiName ApiName, log wrapper.Log) error { - if !m.config.isSupportedAPI(apiName) { - return errUnsupportedApiName - } m.config.handleRequestHeaders(m, ctx, apiName, log) return nil } diff --git a/plugins/wasm-go/extensions/ai-proxy/provider/gemini.go b/plugins/wasm-go/extensions/ai-proxy/provider/gemini.go index 1f8d877ea..3a0fc5805 100644 --- a/plugins/wasm-go/extensions/ai-proxy/provider/gemini.go +++ b/plugins/wasm-go/extensions/ai-proxy/provider/gemini.go @@ -57,9 +57,6 @@ func (g *geminiProvider) GetProviderType() string { } func (g *geminiProvider) OnRequestHeaders(ctx wrapper.HttpContext, apiName ApiName, log wrapper.Log) error { - if !g.config.isSupportedAPI(apiName) { - return errUnsupportedApiName - } g.config.handleRequestHeaders(g, ctx, apiName, log) // Delay the header processing to allow changing streaming mode in OnRequestBody return nil diff --git a/plugins/wasm-go/extensions/ai-proxy/provider/github.go b/plugins/wasm-go/extensions/ai-proxy/provider/github.go index e8a05cc1c..de88f24f8 100644 --- a/plugins/wasm-go/extensions/ai-proxy/provider/github.go +++ b/plugins/wasm-go/extensions/ai-proxy/provider/github.go @@ -52,9 +52,6 @@ func (m *githubProvider) GetProviderType() string { } func (m *githubProvider) OnRequestHeaders(ctx wrapper.HttpContext, apiName ApiName, log wrapper.Log) error { - if !m.config.isSupportedAPI(apiName) { - return errUnsupportedApiName - } m.config.handleRequestHeaders(m, ctx, apiName, log) // Delay the header processing to allow changing streaming mode in OnRequestBody return nil diff --git a/plugins/wasm-go/extensions/ai-proxy/provider/groq.go b/plugins/wasm-go/extensions/ai-proxy/provider/groq.go index c415a707b..c8c67d2b1 100644 --- a/plugins/wasm-go/extensions/ai-proxy/provider/groq.go +++ b/plugins/wasm-go/extensions/ai-proxy/provider/groq.go @@ -49,9 +49,6 @@ func (g *groqProvider) GetProviderType() string { } func (g *groqProvider) OnRequestHeaders(ctx wrapper.HttpContext, apiName ApiName, log wrapper.Log) error { - if !g.config.isSupportedAPI(apiName) { - return errUnsupportedApiName - } g.config.handleRequestHeaders(g, ctx, apiName, log) return nil } diff --git a/plugins/wasm-go/extensions/ai-proxy/provider/hunyuan.go b/plugins/wasm-go/extensions/ai-proxy/provider/hunyuan.go index fc3fddca2..1471b406b 100644 --- a/plugins/wasm-go/extensions/ai-proxy/provider/hunyuan.go +++ b/plugins/wasm-go/extensions/ai-proxy/provider/hunyuan.go @@ -136,9 +136,6 @@ func (m *hunyuanProvider) useOpenAICompatibleAPI() bool { } func (m *hunyuanProvider) OnRequestHeaders(ctx wrapper.HttpContext, apiName ApiName, log wrapper.Log) error { - if !m.config.isSupportedAPI(apiName) { - return errUnsupportedApiName - } m.config.handleRequestHeaders(m, ctx, apiName, log) // Delay the header processing to allow changing streaming mode in OnRequestBody return nil diff --git a/plugins/wasm-go/extensions/ai-proxy/provider/minimax.go b/plugins/wasm-go/extensions/ai-proxy/provider/minimax.go index 0f5e0d369..d85674305 100644 --- a/plugins/wasm-go/extensions/ai-proxy/provider/minimax.go +++ b/plugins/wasm-go/extensions/ai-proxy/provider/minimax.go @@ -74,9 +74,6 @@ func (m *minimaxProvider) GetProviderType() string { } func (m *minimaxProvider) OnRequestHeaders(ctx wrapper.HttpContext, apiName ApiName, log wrapper.Log) error { - if !m.config.isSupportedAPI(apiName) { - return errUnsupportedApiName - } m.config.handleRequestHeaders(m, ctx, apiName, log) // Delay the header processing to allow changing streaming mode in OnRequestBody return nil diff --git a/plugins/wasm-go/extensions/ai-proxy/provider/mistral.go b/plugins/wasm-go/extensions/ai-proxy/provider/mistral.go index 3f361a27a..ab4119d15 100644 --- a/plugins/wasm-go/extensions/ai-proxy/provider/mistral.go +++ b/plugins/wasm-go/extensions/ai-proxy/provider/mistral.go @@ -48,9 +48,6 @@ func (m *mistralProvider) GetProviderType() string { } func (m *mistralProvider) OnRequestHeaders(ctx wrapper.HttpContext, apiName ApiName, log wrapper.Log) error { - if !m.config.isSupportedAPI(apiName) { - return errUnsupportedApiName - } m.config.handleRequestHeaders(m, ctx, apiName, log) return nil } diff --git a/plugins/wasm-go/extensions/ai-proxy/provider/moonshot.go b/plugins/wasm-go/extensions/ai-proxy/provider/moonshot.go index 776e25083..f0f63cf79 100644 --- a/plugins/wasm-go/extensions/ai-proxy/provider/moonshot.go +++ b/plugins/wasm-go/extensions/ai-proxy/provider/moonshot.go @@ -64,9 +64,6 @@ func (m *moonshotProvider) GetProviderType() string { } func (m *moonshotProvider) OnRequestHeaders(ctx wrapper.HttpContext, apiName ApiName, log wrapper.Log) error { - if !m.config.isSupportedAPI(apiName) { - return errUnsupportedApiName - } m.config.handleRequestHeaders(m, ctx, apiName, log) return nil } diff --git a/plugins/wasm-go/extensions/ai-proxy/provider/ollama.go b/plugins/wasm-go/extensions/ai-proxy/provider/ollama.go index 57ad424ff..b43843a86 100644 --- a/plugins/wasm-go/extensions/ai-proxy/provider/ollama.go +++ b/plugins/wasm-go/extensions/ai-proxy/provider/ollama.go @@ -54,9 +54,6 @@ func (m *ollamaProvider) GetProviderType() string { } func (m *ollamaProvider) OnRequestHeaders(ctx wrapper.HttpContext, apiName ApiName, log wrapper.Log) error { - if !m.config.isSupportedAPI(apiName) { - return errUnsupportedApiName - } m.config.handleRequestHeaders(m, ctx, apiName, log) return nil } diff --git a/plugins/wasm-go/extensions/ai-proxy/provider/provider.go b/plugins/wasm-go/extensions/ai-proxy/provider/provider.go index ae2763c0a..d2d9efbbc 100644 --- a/plugins/wasm-go/extensions/ai-proxy/provider/provider.go +++ b/plugins/wasm-go/extensions/ai-proxy/provider/provider.go @@ -265,9 +265,6 @@ type ProviderConfig struct { // @Title zh-CN 额外支持的ai能力 // @Description zh-CN 开放的ai能力和urlpath映射,例如: {"openai/v1/chatcompletions": "/v1/chat/completions"} capabilities map[string]string - // @Title zh-CN 是否开启透传 - // @Description zh-CN 如果是插件不支持的API,是否透传请求, 默认为false - passthrough bool } func (c *ProviderConfig) GetId() string { @@ -453,10 +450,6 @@ func (c *ProviderConfig) ReplaceByCustomSettings(body []byte) ([]byte, error) { return ReplaceByCustomSettings(body, c.customSettings) } -func (c *ProviderConfig) PassthroughUnsupportedAPI() bool { - return c.passthrough -} - func CreateProvider(pc ProviderConfig) (Provider, error) { initializer, has := providerInitializers[pc.typ] if !has { diff --git a/plugins/wasm-go/extensions/ai-proxy/provider/qwen.go b/plugins/wasm-go/extensions/ai-proxy/provider/qwen.go index e5650f355..ddf70e791 100644 --- a/plugins/wasm-go/extensions/ai-proxy/provider/qwen.go +++ b/plugins/wasm-go/extensions/ai-proxy/provider/qwen.go @@ -104,10 +104,6 @@ func (m *qwenProvider) GetProviderType() string { } func (m *qwenProvider) OnRequestHeaders(ctx wrapper.HttpContext, apiName ApiName, log wrapper.Log) error { - if !m.config.isSupportedAPI(apiName) { - return errUnsupportedApiName - } - m.config.handleRequestHeaders(m, ctx, apiName, log) if m.config.protocol == protocolOriginal { diff --git a/plugins/wasm-go/extensions/ai-proxy/provider/spark.go b/plugins/wasm-go/extensions/ai-proxy/provider/spark.go index bac72e023..3ca4460dd 100644 --- a/plugins/wasm-go/extensions/ai-proxy/provider/spark.go +++ b/plugins/wasm-go/extensions/ai-proxy/provider/spark.go @@ -74,9 +74,6 @@ func (p *sparkProvider) GetProviderType() string { } func (p *sparkProvider) OnRequestHeaders(ctx wrapper.HttpContext, apiName ApiName, log wrapper.Log) error { - if !p.config.isSupportedAPI(apiName) { - return errUnsupportedApiName - } p.config.handleRequestHeaders(p, ctx, apiName, log) return nil } diff --git a/plugins/wasm-go/extensions/ai-proxy/provider/stepfun.go b/plugins/wasm-go/extensions/ai-proxy/provider/stepfun.go index 71315621a..260cc2e99 100644 --- a/plugins/wasm-go/extensions/ai-proxy/provider/stepfun.go +++ b/plugins/wasm-go/extensions/ai-proxy/provider/stepfun.go @@ -49,9 +49,6 @@ func (m *stepfunProvider) GetProviderType() string { } func (m *stepfunProvider) OnRequestHeaders(ctx wrapper.HttpContext, apiName ApiName, log wrapper.Log) error { - if !m.config.isSupportedAPI(apiName) { - return errUnsupportedApiName - } m.config.handleRequestHeaders(m, ctx, apiName, log) return nil } diff --git a/plugins/wasm-go/extensions/ai-proxy/provider/together_ai.go b/plugins/wasm-go/extensions/ai-proxy/provider/together_ai.go index dfbeb401c..79b7faedf 100644 --- a/plugins/wasm-go/extensions/ai-proxy/provider/together_ai.go +++ b/plugins/wasm-go/extensions/ai-proxy/provider/together_ai.go @@ -48,9 +48,6 @@ func (m *togetherAIProvider) GetProviderType() string { } func (m *togetherAIProvider) OnRequestHeaders(ctx wrapper.HttpContext, apiName ApiName, log wrapper.Log) error { - if !m.config.isSupportedAPI(apiName) { - return errUnsupportedApiName - } m.config.handleRequestHeaders(m, ctx, apiName, log) return nil } diff --git a/plugins/wasm-go/extensions/ai-proxy/provider/yi.go b/plugins/wasm-go/extensions/ai-proxy/provider/yi.go index 3c3db4d5d..1853a374c 100644 --- a/plugins/wasm-go/extensions/ai-proxy/provider/yi.go +++ b/plugins/wasm-go/extensions/ai-proxy/provider/yi.go @@ -48,9 +48,6 @@ func (m *yiProvider) GetProviderType() string { } func (m *yiProvider) OnRequestHeaders(ctx wrapper.HttpContext, apiName ApiName, log wrapper.Log) error { - if !m.config.isSupportedAPI(apiName) { - return errUnsupportedApiName - } m.config.handleRequestHeaders(m, ctx, apiName, log) return nil } diff --git a/plugins/wasm-go/extensions/ai-proxy/provider/zhipuai.go b/plugins/wasm-go/extensions/ai-proxy/provider/zhipuai.go index e95e99fc8..3d9cbb4fe 100644 --- a/plugins/wasm-go/extensions/ai-proxy/provider/zhipuai.go +++ b/plugins/wasm-go/extensions/ai-proxy/provider/zhipuai.go @@ -50,9 +50,6 @@ func (m *zhipuAiProvider) GetProviderType() string { } func (m *zhipuAiProvider) OnRequestHeaders(ctx wrapper.HttpContext, apiName ApiName, log wrapper.Log) error { - if !m.config.isSupportedAPI(apiName) { - return errUnsupportedApiName - } m.config.handleRequestHeaders(m, ctx, apiName, log) return nil }