ai proxy support passthrough path when api name is unknown (#1754)

This commit is contained in:
澄潭
2025-02-13 21:22:43 +08:00
committed by GitHub
parent 7272eff8b6
commit 2dbde1833f
28 changed files with 24 additions and 109 deletions

View File

@@ -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 {