mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-09-17 09:16:36 +08:00
Merge 0ed90adb58
into 8df4a2670b
This commit is contained in:
commit
54730fbdbf
@ -16,6 +16,7 @@ import (
|
||||
"github.com/songquanpeng/one-api/relay/adaptor/geminiv2"
|
||||
"github.com/songquanpeng/one-api/relay/adaptor/minimax"
|
||||
"github.com/songquanpeng/one-api/relay/adaptor/novita"
|
||||
"github.com/songquanpeng/one-api/relay/adaptor/xunfeiv2"
|
||||
"github.com/songquanpeng/one-api/relay/channeltype"
|
||||
"github.com/songquanpeng/one-api/relay/meta"
|
||||
"github.com/songquanpeng/one-api/relay/model"
|
||||
@ -62,6 +63,8 @@ func (a *Adaptor) GetRequestURL(meta *meta.Meta) (string, error) {
|
||||
return alibailian.GetRequestURL(meta)
|
||||
case channeltype.GeminiOpenAICompatible:
|
||||
return geminiv2.GetRequestURL(meta)
|
||||
case channeltype.XunfeiV2:
|
||||
return xunfeiv2.GetRequestURL(meta)
|
||||
default:
|
||||
return GetFullRequestURL(meta.BaseURL, meta.RequestURLPath, meta.ChannelType), nil
|
||||
}
|
||||
|
@ -9,4 +9,5 @@ var ModelList = []string{
|
||||
"generalv3.5",
|
||||
"max-32k",
|
||||
"4.0Ultra",
|
||||
"x1",
|
||||
}
|
||||
|
16
relay/adaptor/xunfeiv2/main.go
Normal file
16
relay/adaptor/xunfeiv2/main.go
Normal file
@ -0,0 +1,16 @@
|
||||
package xunfeiv2
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/songquanpeng/one-api/relay/meta"
|
||||
)
|
||||
|
||||
func GetRequestURL(meta *meta.Meta) (string, error) {
|
||||
switch meta.ActualModelName {
|
||||
case "x1":
|
||||
return fmt.Sprintf("%s/v2/chat/completions", meta.BaseURL), nil
|
||||
default:
|
||||
}
|
||||
return fmt.Sprintf("%s/v2/chat/completions", meta.BaseURL), nil
|
||||
}
|
Loading…
Reference in New Issue
Block a user