refactor: Simplify OpenAI handler function signature and remove unused TextResponseWithError struct; introduce common_handler for rerank functionality

This commit is contained in:
CalciumIon
2025-03-14 17:31:05 +08:00
parent 9a78db8484
commit 69e44a03b1
18 changed files with 70 additions and 179 deletions

View File

@@ -18,7 +18,6 @@ import (
"one-api/relay/channel/mokaai"
"one-api/relay/channel/ollama"
"one-api/relay/channel/openai"
"one-api/relay/channel/openrouter"
"one-api/relay/channel/palm"
"one-api/relay/channel/perplexity"
"one-api/relay/channel/siliconflow"
@@ -83,7 +82,7 @@ func GetAdaptor(apiType int) channel.Adaptor {
case constant.APITypeBaiduV2:
return &baidu_v2.Adaptor{}
case constant.APITypeOpenRouter:
return &openrouter.Adaptor{}
return &openai.Adaptor{}
case constant.APITypeXinference:
return &openai.Adaptor{}
}