one-api/relay/helper/main.go
Laisky.Cai bb8755bc98 refactor: Refactor: Consolidate Anthropic model requests into GeneralOpenAIRequest
- Refactor Anthropic adapter to work with the new Anthropic API and model requests
- Remove the default value for `MaxTokensToSample`
- Set `MaxTokens` to 500 instead of 1000000
- Use `system` messages as the system prompt instead of the first message
2024-03-05 03:38:26 +00:00

38 lines
1.1 KiB
Go

package helper
import (
"github.com/songquanpeng/one-api/relay/channel"
"github.com/songquanpeng/one-api/relay/channel/aiproxy"
"github.com/songquanpeng/one-api/relay/channel/anthropic"
"github.com/songquanpeng/one-api/relay/channel/gemini"
"github.com/songquanpeng/one-api/relay/channel/openai"
"github.com/songquanpeng/one-api/relay/channel/palm"
"github.com/songquanpeng/one-api/relay/constant"
)
func GetAdaptor(apiType int) channel.Adaptor {
switch apiType {
case constant.APITypeAIProxyLibrary:
return &aiproxy.Adaptor{}
// case constant.APITypeAli:
// return &ali.Adaptor{}
case constant.APITypeAnthropic:
return &anthropic.Adaptor{}
// case constant.APITypeBaidu:
// return &baidu.Adaptor{}
case constant.APITypeGemini:
return &gemini.Adaptor{}
case constant.APITypeOpenAI:
return &openai.Adaptor{}
case constant.APITypePaLM:
return &palm.Adaptor{}
// case constant.APITypeTencent:
// return &tencent.Adaptor{}
// case constant.APITypeXunfei:
// return &xunfei.Adaptor{}
// case constant.APITypeZhipu:
// return &zhipu.Adaptor{}
}
return nil
}