mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-10-15 15:30:26 +00:00
feat: support baidu's models now (close #286)
This commit is contained in:
@@ -152,6 +152,7 @@ const (
|
||||
ChannelTypeAPI2GPT = 12
|
||||
ChannelTypeAIGC2D = 13
|
||||
ChannelTypeAnthropic = 14
|
||||
ChannelTypeBaidu = 15
|
||||
)
|
||||
|
||||
var ChannelBaseURLs = []string{
|
||||
@@ -170,4 +171,5 @@ var ChannelBaseURLs = []string{
|
||||
"https://api.api2gpt.com", // 12
|
||||
"https://api.aigc2d.com", // 13
|
||||
"https://api.anthropic.com", // 14
|
||||
"https://aip.baidubce.com", // 15
|
||||
}
|
||||
|
@@ -4,6 +4,7 @@ import "encoding/json"
|
||||
|
||||
// ModelRatio
|
||||
// https://platform.openai.com/docs/models/model-endpoint-compatibility
|
||||
// https://cloud.baidu.com/doc/WENXINWORKSHOP/s/Blfmc9dlf
|
||||
// https://openai.com/pricing
|
||||
// TODO: when a new api is enabled, check the pricing here
|
||||
// 1 === $0.002 / 1K tokens
|
||||
@@ -38,6 +39,8 @@ var ModelRatio = map[string]float64{
|
||||
"dall-e": 8,
|
||||
"claude-instant-1": 0.75,
|
||||
"claude-2": 30,
|
||||
"ERNIE-Bot": 1, // 0.012元/千tokens
|
||||
"ERNIE-Bot-turbo": 0.67, // 0.008元/千tokens
|
||||
}
|
||||
|
||||
func ModelRatio2JSONString() string {
|
||||
|
Reference in New Issue
Block a user