mirror of https://gitee.com/godoos/godoos.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
600 B
23 lines
600 B
package api
|
|
|
|
import (
|
|
"fmt"
|
|
"godo/libs"
|
|
)
|
|
|
|
func GetGiteeChatUrl(model string) string {
|
|
return "https://ai.gitee.com/api/serverless/" + model + "/chat/completions"
|
|
}
|
|
func GetGiteeEmbeddingUrl(model string) string {
|
|
return "https://ai.gitee.com/api/serverless/" + model + "/embeddings"
|
|
}
|
|
func GetGiteeText2ImgUrl(model string) string {
|
|
return "https://ai.gitee.com/api/serverless/" + model + "/text-to-image"
|
|
}
|
|
func GetGiteeSecret() (string, error) {
|
|
secret, has := libs.GetConfig("giteeSecret")
|
|
if !has {
|
|
return "", fmt.Errorf("the gitee secret is not set")
|
|
}
|
|
return secret.(string), nil
|
|
}
|
|
|