Skip to content

Commit

Permalink
Revert "Merge branch 'songquanpeng:main' into main"
Browse files Browse the repository at this point in the history
This reverts commit bc83d65, reversing
changes made to b2cc54f.
  • Loading branch information
MotorBottle committed Nov 9, 2024
1 parent bc83d65 commit e5fff39
Show file tree
Hide file tree
Showing 13 changed files with 3 additions and 33 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ _✨ 通过标准的 OpenAI API 格式访问所有的大模型,开箱即用
+ [x] [together.ai](https://www.together.ai/)
+ [x] [novita.ai](https://www.novita.ai/)
+ [x] [硅基流动 SiliconCloud](https://siliconflow.cn/siliconcloud)
+ [x] [xAI](https://x.ai/)
2. 支持配置镜像以及众多[第三方代理服务](https://iamazing.cn/page/openai-api-third-party-services)
3. 支持通过**负载均衡**的方式访问多个渠道。
4. 支持 **stream 模式**,可以通过流式传输实现打字机效果。
Expand Down
1 change: 0 additions & 1 deletion relay/adaptor/anthropic/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package anthropic
var ModelList = []string{
"claude-instant-1.2", "claude-2.0", "claude-2.1",
"claude-3-haiku-20240307",
"claude-3-5-haiku-20241022",
"claude-3-sonnet-20240229",
"claude-3-opus-20240229",
"claude-3-5-sonnet-20240620",
Expand Down
1 change: 0 additions & 1 deletion relay/adaptor/aws/claude/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ var AwsModelIDMap = map[string]string{
"claude-3-5-sonnet-20241022": "anthropic.claude-3-5-sonnet-20241022-v2:0",
"claude-3-opus-20240229": "anthropic.claude-3-opus-20240229-v1:0",
"claude-3-haiku-20240307": "anthropic.claude-3-haiku-20240307-v1:0",
"claude-3-5-haiku-20241022": "anthropic.claude-3-5-haiku-20241022-v1:0",
}

func awsModelID(requestModel string) (string, error) {
Expand Down
6 changes: 1 addition & 5 deletions relay/adaptor/openai/compatible.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ import (
"github.com/songquanpeng/one-api/relay/adaptor/mistral"
"github.com/songquanpeng/one-api/relay/adaptor/moonshot"
"github.com/songquanpeng/one-api/relay/adaptor/novita"
"github.com/songquanpeng/one-api/relay/adaptor/siliconflow"
"github.com/songquanpeng/one-api/relay/adaptor/stepfun"
"github.com/songquanpeng/one-api/relay/adaptor/togetherai"
"github.com/songquanpeng/one-api/relay/adaptor/xai"
"github.com/songquanpeng/one-api/relay/adaptor/siliconflow"
"github.com/songquanpeng/one-api/relay/channeltype"
)

Expand All @@ -33,7 +32,6 @@ var CompatibleChannels = []int{
channeltype.TogetherAI,
channeltype.Novita,
channeltype.SiliconFlow,
channeltype.XAI,
}

func GetCompatibleChannelMeta(channelType int) (string, []string) {
Expand Down Expand Up @@ -66,8 +64,6 @@ func GetCompatibleChannelMeta(channelType int) (string, []string) {
return "novita", novita.ModelList
case channeltype.SiliconFlow:
return "siliconflow", siliconflow.ModelList
case channeltype.XAI:
return "xai", xai.ModelList
default:
return "openai", ModelList
}
Expand Down
5 changes: 0 additions & 5 deletions relay/adaptor/xai/constants.go

This file was deleted.

5 changes: 0 additions & 5 deletions relay/billing/ratio/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ var ModelRatio = map[string]float64{
"claude-2.0": 8.0 / 1000 * USD,
"claude-2.1": 8.0 / 1000 * USD,
"claude-3-haiku-20240307": 0.25 / 1000 * USD,
"claude-3-5-haiku-20241022": 1.0 / 1000 * USD,
"claude-3-sonnet-20240229": 3.0 / 1000 * USD,
"claude-3-5-sonnet-20240620": 3.0 / 1000 * USD,
"claude-3-5-sonnet-20241022": 3.0 / 1000 * USD,
Expand Down Expand Up @@ -209,8 +208,6 @@ var ModelRatio = map[string]float64{
"deepl-zh": 25.0 / 1000 * USD,
"deepl-en": 25.0 / 1000 * USD,
"deepl-ja": 25.0 / 1000 * USD,
// https://console.x.ai/
"grok-beta": 5.0 / 1000 * USD,
}

var CompletionRatio = map[string]float64{
Expand Down Expand Up @@ -375,8 +372,6 @@ func GetCompletionRatio(name string, channelType int) float64 {
return 3
case "command-r-plus":
return 5
case "grok-beta":
return 3
}
return 1
}
1 change: 0 additions & 1 deletion relay/channeltype/define.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,5 @@ const (
VertextAI
Proxy
SiliconFlow
XAI
Dummy
)
3 changes: 1 addition & 2 deletions relay/channeltype/url.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ var ChannelBaseURLs = []string{
"https://api.novita.ai/v3/openai", // 41
"", // 42
"", // 43
"https://api.siliconflow.cn", // 44
"https://api.x.ai", // 45
"https://api.siliconflow.cn", // 44
}

func init() {
Expand Down
1 change: 0 additions & 1 deletion web/air/src/constants/channel.constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export const CHANNEL_OPTIONS = [
{ key: 42, text: 'VertexAI', value: 42, color: 'blue' },
{ key: 43, text: 'Proxy', value: 43, color: 'blue' },
{ key: 44, text: 'SiliconFlow', value: 44, color: 'blue' },
{ key: 45, text: 'xAI', value: 45, color: 'blue' },
{ key: 8, text: '自定义渠道', value: 8, color: 'pink' },
{ key: 22, text: '知识库:FastGPT', value: 22, color: 'blue' },
{ key: 21, text: '知识库:AI Proxy', value: 21, color: 'purple' },
Expand Down
2 changes: 1 addition & 1 deletion web/air/src/pages/Channel/EditChannel.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const EditChannel = (props) => {
let localModels = [];
switch (value) {
case 14:
localModels = ["claude-instant-1.2", "claude-2", "claude-2.0", "claude-2.1", "claude-3-opus-20240229", "claude-3-sonnet-20240229", "claude-3-haiku-20240307", "claude-3-5-haiku-20241022", "claude-3-5-sonnet-20240620", "claude-3-5-sonnet-20241022"];
localModels = ["claude-instant-1.2", "claude-2", "claude-2.0", "claude-2.1", "claude-3-opus-20240229", "claude-3-sonnet-20240229", "claude-3-haiku-20240307", "claude-3-5-sonnet-20240620", "claude-3-5-sonnet-20241022"];
break;
case 11:
localModels = ['PaLM-2'];
Expand Down
6 changes: 0 additions & 6 deletions web/berry/src/constants/ChannelConstants.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,6 @@ export const CHANNEL_OPTIONS = {
value: 44,
color: 'primary'
},
45: {
key: 45,
text: 'xAI',
value: 45,
color: 'primary'
},
41: {
key: 41,
text: 'Novita',
Expand Down
3 changes: 0 additions & 3 deletions web/berry/src/views/Channel/type/Config.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,6 @@ const typeConfig = {
},
modelGroup: 'anthropic'
},
45: {
modelGroup: 'xai'
},
};

export { defaultConfig, typeConfig };
1 change: 0 additions & 1 deletion web/default/src/constants/channel.constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export const CHANNEL_OPTIONS = [
{ key: 42, text: 'VertexAI', value: 42, color: 'blue' },
{ key: 43, text: 'Proxy', value: 43, color: 'blue' },
{ key: 44, text: 'SiliconFlow', value: 44, color: 'blue' },
{ key: 45, text: 'xAI', value: 45, color: 'blue' },
{ key: 8, text: '自定义渠道', value: 8, color: 'pink' },
{ key: 22, text: '知识库:FastGPT', value: 22, color: 'blue' },
{ key: 21, text: '知识库:AI Proxy', value: 21, color: 'purple' },
Expand Down

0 comments on commit e5fff39

Please sign in to comment.