feat: Support files and batches APIs provided by Azure OpenAI (#1904)

This commit is contained in:
Kent Dong
2025-03-17 11:21:05 +08:00
committed by GitHub
parent 9a89665b22
commit 5de7c2a5ea
3 changed files with 54 additions and 21 deletions

View File

@@ -331,12 +331,12 @@ 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
}
if strings.HasSuffix(path, "/v1/completions") {
return provider.ApiNameCompletion
}
if strings.HasSuffix(path, "/v1/embeddings") {
return provider.ApiNameEmbeddings
}
@@ -346,6 +346,12 @@ func getApiName(path string) provider.ApiName {
if strings.HasSuffix(path, "/v1/images/generations") {
return provider.ApiNameImageGeneration
}
if strings.HasSuffix(path, "/v1/batches") {
return provider.ApiNameBatches
}
if strings.HasSuffix(path, "/v1/files") {
return provider.ApiNameFiles
}
// cohere style
if strings.HasSuffix(path, "/v1/rerank") {
return provider.ApiNameCohereV1Rerank