This commit is contained in:
Chen Tao 2025-06-14 23:01:45 +08:00 committed by GitHub
parent 06b543039f
commit fc62a5bdc2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -21,10 +21,13 @@ export default abstract class BaseReranker {
return 'https://dashscope.aliyuncs.com/api/v1/services/rerank/text-rerank/text-rerank'
}
let baseURL = this.base?.rerankBaseURL?.endsWith('/')
? this.base.rerankBaseURL.slice(0, -1)
: this.base.rerankBaseURL
// 必须携带/v1否则会404
let baseURL = this.base.rerankBaseURL
if (baseURL && baseURL.endsWith('/')) {
// `/` 结尾强制使用rerankBaseURL
return `${baseURL}rerank`
}
if (baseURL && !baseURL.endsWith('/v1')) {
baseURL = `${baseURL}/v1`
}