Supports completions API & support config openai baseUrl through openaiCustomUrl (#1765)

This commit is contained in:
澄潭
2025-02-18 09:57:48 +08:00
committed by GitHub
parent 94aacf5153
commit 49aad4152c
6 changed files with 124 additions and 45 deletions

View File

@@ -270,6 +270,9 @@ func checkStream(ctx wrapper.HttpContext, log wrapper.Log) {
func getApiName(path string) provider.ApiName {
// openai style
if strings.HasSuffix(path, "/v1/completions") {
return provider.ApiNameCompletion
}
if strings.HasSuffix(path, "/v1/chat/completions") {
return provider.ApiNameChatCompletion
}