21 lines
490 B
Go
Raw Normal View History

2024-02-29 01:08:18 +08:00
package ali
2023-07-28 23:45:08 +08:00
import (
"github.com/QuantumNous/new-api/dto"
"github.com/samber/lo"
2023-07-28 23:45:08 +08:00
)
// https://help.aliyun.com/document_detail/613695.html?spm=a2c4g.2399480.0.0.1adb778fAdzP9w#341800c0f8w0r
const EnableSearchModelSuffix = "-internet"
2024-07-19 00:45:52 +08:00
func requestOpenAI2Ali(request dto.GeneralOpenAIRequest) *dto.GeneralOpenAIRequest {
topP := lo.FromPtrOr(request.TopP, 0)
if topP >= 1 {
request.TopP = lo.ToPtr(0.999)
} else if topP <= 0 {
request.TopP = lo.ToPtr(0.001)
2023-07-28 23:45:08 +08:00
}
2024-07-19 00:45:52 +08:00
return &request
2023-07-28 23:45:08 +08:00
}