generated from songquanpeng/gin-template
-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add AliBailian adaptor and update channel options
- Loading branch information
1 parent
517f6ad
commit 53da209
Showing
7 changed files
with
96 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package alibailian | ||
|
||
// https://help.aliyun.com/zh/model-studio/getting-started/models | ||
|
||
var ModelList = []string{ | ||
"qwen-turbo", | ||
"qwen-plus", | ||
"qwen-long", | ||
"qwen-max", | ||
"qwen-coder-plus", | ||
"qwen-coder-plus-latest", | ||
"qwen-coder-turbo", | ||
"qwen-coder-turbo-latest", | ||
"qwen-mt-plus", | ||
"qwen-mt-turbo", | ||
"qwq-32b-preview", | ||
|
||
"deepseek-r1", | ||
"deepseek-v3", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package alibailian | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/songquanpeng/one-api/relay/meta" | ||
"github.com/songquanpeng/one-api/relay/relaymode" | ||
) | ||
|
||
func GetRequestURL(meta *meta.Meta) (string, error) { | ||
switch meta.Mode { | ||
case relaymode.ChatCompletions: | ||
return fmt.Sprintf("%s/compatible-mode/v1/chat/completions", meta.BaseURL), nil | ||
case relaymode.Embeddings: | ||
return fmt.Sprintf("%s/compatible-mode/v1/embeddings", meta.BaseURL), nil | ||
default: | ||
} | ||
return "", fmt.Errorf("unsupported relay mode %d for ali bailian", meta.Mode) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,5 +50,6 @@ const ( | |
Replicate | ||
BaiduV2 | ||
XunfeiV2 | ||
AliBailian | ||
Dummy | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters