Skip to content

Commit

Permalink
gpt-模型的默认地址为openai,星火模型支持general形式的
Browse files Browse the repository at this point in the history
  • Loading branch information
fruitbars committed Jul 4, 2024
1 parent c154530 commit ae66639
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions pkg/handler/openai_openai_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ func getDefaultServerURL(model string) string {
return "https://api.deepseek.com/v1"
case strings.HasPrefix(model, "yi-"):
return "https://api.lingyiwanwu.com/v1/chat/completions"
case strings.HasPrefix(model, "gpt-"):
return "https://api.openai.com/v1/chat/completions"
default:
return ""
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/handler/openai_xinghuo_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func getURLAndDomain(modelName string) (string, string, error) {
return "wss://spark-api.xf-yun.com/v3.1/chat", "generalv3", nil
case "spark-v2.0", "generalv2":
return "wss://spark-api.xf-yun.com/v2.1/chat", "generalv2", nil
case "spark-lite":
case "spark-lite", "general":
return "wss://spark-api.xf-yun.com/v1.1/chat", "general", nil
default:
return "", "", fmt.Errorf("unsupported model name: %s", modelName)
Expand Down

0 comments on commit ae66639

Please sign in to comment.