mirror of
https://github.com/alibaba/higress.git
synced 2026-02-06 23:21:08 +08:00
[ai-proxy]qwen text-rerank support (#2537)
This commit is contained in:
@@ -81,6 +81,7 @@ const (
|
||||
|
||||
// TODO: 以下是一些非标准的API名称,需要进一步确认是否支持
|
||||
ApiNameCohereV1Rerank ApiName = "cohere/v1/rerank"
|
||||
ApiNameQwenV1Rerank ApiName = "qwen/v1/rerank"
|
||||
ApiNameQwenAsyncAIGC ApiName = "api/v1/services/aigc"
|
||||
ApiNameQwenAsyncTask ApiName = "api/v1/tasks/"
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ const (
|
||||
qwenDefaultDomain = "dashscope.aliyuncs.com"
|
||||
qwenChatCompletionPath = "/api/v1/services/aigc/text-generation/generation"
|
||||
qwenTextEmbeddingPath = "/api/v1/services/embeddings/text-embedding/text-embedding"
|
||||
qwenTextRerankPath = "/api/v1/services/rerank/text-rerank/text-rerank"
|
||||
qwenCompatibleChatCompletionPath = "/compatible-mode/v1/chat/completions"
|
||||
qwenCompatibleCompletionsPath = "/compatible-mode/v1/completions"
|
||||
qwenCompatibleTextEmbeddingPath = "/compatible-mode/v1/embeddings"
|
||||
@@ -37,8 +38,8 @@ const (
|
||||
qwenBailianPath = "/api/v1/apps"
|
||||
qwenMultimodalGenerationPath = "/api/v1/services/aigc/multimodal-generation/generation"
|
||||
|
||||
qwenAsyncAIGCPath = "/api/v1/services/aigc/"
|
||||
qwenAsyncTaskPath = "/api/v1/tasks/"
|
||||
qwenAsyncAIGCPath = "/api/v1/services/aigc/"
|
||||
qwenAsyncTaskPath = "/api/v1/tasks/"
|
||||
|
||||
qwenTopPMin = 0.000001
|
||||
qwenTopPMax = 0.999999
|
||||
@@ -77,8 +78,9 @@ func (m *qwenProviderInitializer) DefaultCapabilities(qwenEnableCompatible bool)
|
||||
return map[string]string{
|
||||
string(ApiNameChatCompletion): qwenChatCompletionPath,
|
||||
string(ApiNameEmbeddings): qwenTextEmbeddingPath,
|
||||
string(ApiNameQwenAsyncAIGC): qwenAsyncAIGCPath,
|
||||
string(ApiNameQwenAsyncTask): qwenAsyncTaskPath,
|
||||
string(ApiNameQwenAsyncAIGC): qwenAsyncAIGCPath,
|
||||
string(ApiNameQwenAsyncTask): qwenAsyncTaskPath,
|
||||
string(ApiNameQwenV1Rerank): qwenTextRerankPath,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -698,6 +700,8 @@ func (m *qwenProvider) GetApiName(path string) ApiName {
|
||||
return ApiNameQwenAsyncAIGC
|
||||
case strings.Contains(path, qwenAsyncTaskPath):
|
||||
return ApiNameQwenAsyncTask
|
||||
case strings.Contains(path, qwenTextRerankPath):
|
||||
return ApiNameQwenV1Rerank
|
||||
default:
|
||||
return ""
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user