diff --git a/relay/adaptor/openai/compatible.go b/relay/adaptor/openai/compatible.go
index 99424e49..bcbc825e 100644
--- a/relay/adaptor/openai/compatible.go
+++ b/relay/adaptor/openai/compatible.go
@@ -16,6 +16,7 @@ import (
"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/xunfeiv2"
"github.com/songquanpeng/one-api/relay/channeltype"
)
@@ -36,6 +37,7 @@ var CompatibleChannels = []int{
channeltype.SiliconFlow,
channeltype.XAI,
channeltype.BaiduV2,
+ channeltype.XunfeiV2,
}
func GetCompatibleChannelMeta(channelType int) (string, []string) {
@@ -72,6 +74,8 @@ func GetCompatibleChannelMeta(channelType int) (string, []string) {
return "xai", xai.ModelList
case channeltype.BaiduV2:
return "baiduv2", baiduv2.ModelList
+ case channeltype.XunfeiV2:
+ return "xunfeiv2", xunfeiv2.ModelList
default:
return "openai", ModelList
}
diff --git a/relay/adaptor/xunfeiv2/constants.go b/relay/adaptor/xunfeiv2/constants.go
new file mode 100644
index 00000000..08c32646
--- /dev/null
+++ b/relay/adaptor/xunfeiv2/constants.go
@@ -0,0 +1,12 @@
+package xunfeiv2
+
+// https://www.xfyun.cn/doc/spark/HTTP%E8%B0%83%E7%94%A8%E6%96%87%E6%A1%A3.html#_3-%E8%AF%B7%E6%B1%82%E8%AF%B4%E6%98%8E
+
+var ModelList = []string{
+ "lite",
+ "generalv3",
+ "pro-128k",
+ "generalv3.5",
+ "max-32k",
+ "4.0Ultra",
+}
diff --git a/relay/channeltype/define.go b/relay/channeltype/define.go
index a74c6269..ff704149 100644
--- a/relay/channeltype/define.go
+++ b/relay/channeltype/define.go
@@ -49,5 +49,6 @@ const (
XAI
Replicate
BaiduV2
+ XunfeiV2
Dummy
)
diff --git a/relay/channeltype/url.go b/relay/channeltype/url.go
index 6279fee2..59423350 100644
--- a/relay/channeltype/url.go
+++ b/relay/channeltype/url.go
@@ -49,6 +49,7 @@ var ChannelBaseURLs = []string{
"https://api.x.ai", // 45
"https://api.replicate.com/v1/models/", // 46
"https://qianfan.baidubce.com", // 47
+ "https://spark-api-open.xf-yun.com", // 48
}
func init() {
diff --git a/web/default/src/constants/channel.constants.js b/web/default/src/constants/channel.constants.js
index a5f3452f..99e605d6 100644
--- a/web/default/src/constants/channel.constants.js
+++ b/web/default/src/constants/channel.constants.js
@@ -29,7 +29,20 @@ export const CHANNEL_OPTIONS = [
tip: '请前往此处获取 API Key,注意本渠道仅支持推理服务 V2相关模型',
},
{key: 17, text: '阿里通义千问', value: 17, color: 'orange'},
- {key: 18, text: '讯飞星火认知', value: 18, color: 'blue'},
+ {
+ key: 18,
+ text: '讯飞星火认知',
+ value: 18,
+ color: 'blue',
+ tip: '本渠道基于讯飞 WebSocket 版本 API,如需 HTTP 版本,请使用讯飞星火认知 V2渠道',
+ },
+ {
+ key: 48,
+ text: '讯飞星火认知 V2',
+ value: 48,
+ color: 'blue',
+ tip: 'HTTP 版本的讯飞接口,前往此处获取 HTTP 服务接口认证密钥',
+ },
{key: 16, text: '智谱 ChatGLM', value: 16, color: 'violet'},
{key: 19, text: '360 智脑', value: 19, color: 'blue'},
{key: 25, text: 'Moonshot AI', value: 25, color: 'black'},