diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..be4c832 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +/web/dist/ +/web/node_modules/ \ No newline at end of file diff --git a/relay/channel/doubao/constants.go b/relay/channel/doubao/constants.go index b93f399..9cff552 100644 --- a/relay/channel/doubao/constants.go +++ b/relay/channel/doubao/constants.go @@ -9,7 +9,6 @@ var ModelList = []string{ "Doubao-lite-128k", "Doubao-lite-32k", "Doubao-lite-4k", - "Doubao-embedding", } var ChannelName = "doubao" diff --git a/service/channel.go b/service/channel.go index 41ca6b7..36ff975 100644 --- a/service/channel.go +++ b/service/channel.go @@ -31,7 +31,7 @@ func ShouldDisableChannel(err *relaymodel.OpenAIError, statusCode int) bool { if err == nil { return false } - if statusCode == http.StatusUnauthorized { + if statusCode == http.StatusUnauthorized || statusCode == http.StatusForbidden { return true } switch err.Code { @@ -59,6 +59,8 @@ func ShouldDisableChannel(err *relaymodel.OpenAIError, statusCode int) bool { return true } else if strings.HasPrefix(err.Message, "You exceeded your current quota") { return true + } else if strings.HasPrefix(err.Message, "Permission denied") { + return true } return false } diff --git a/web/src/components/ChannelsTable.js b/web/src/components/ChannelsTable.js index c49d85b..5220c2b 100644 --- a/web/src/components/ChannelsTable.js +++ b/web/src/components/ChannelsTable.js @@ -48,6 +48,13 @@ function renderType(type) { } type2label[0] = { value: 0, text: '未知类型', color: 'grey' }; } + const backgroundColor = type2label[type]?.backgroundColor + const textColor = type2label[type]?.textColor + if (backgroundColor && textColor) { + return + {type2label[type]?.text} + + } return ( {type2label[type]?.text} diff --git a/web/src/constants/channel.constants.js b/web/src/constants/channel.constants.js index 60e0dc2..4b0f041 100644 --- a/web/src/constants/channel.constants.js +++ b/web/src/constants/channel.constants.js @@ -97,8 +97,21 @@ export const CHANNEL_OPTIONS = [ { key: 23, text: '腾讯混元', value: 23, color: 'teal', label: '腾讯混元' }, { key: 31, text: '零一万物', value: 31, color: 'green', label: '零一万物' }, { key: 35, text: 'MiniMax', value: 35, color: 'green', label: 'MiniMax' }, - { key: 36, text: 'ScholarAI', value: 36, color: 'green', label: 'ScholarAI' }, - { key: 37, text: '豆包', value: 37, color: 'green', label: '豆包' }, + { + key: 36, + text: 'ScholarAI', + value: 36, + backgroundColor: 'rgb(0, 70, 77)', + textColor: 'white', + label: 'ScholarAI' + }, + { + key: 37, + text: '豆包', + value: 37, + color: 'blue', + label: '豆包' + }, { key: 8, text: '自定义渠道', value: 8, color: 'pink', label: '自定义渠道' }, { key: 22,