feat: Update RerankerInfo structure and modify GenRelayInfoRerank function to accept RerankRequest

This commit is contained in:
1808837298@qq.com
2025-03-17 16:44:53 +08:00
parent b5aa3c129b
commit 6fef5aaf22
4 changed files with 25 additions and 15 deletions

View File

@@ -34,7 +34,8 @@ const (
)
type RerankerInfo struct {
Documents []any
Documents []any
ReturnDocuments bool
}
type RelayInfo struct {
@@ -116,11 +117,12 @@ func GenRelayInfoClaude(c *gin.Context) *RelayInfo {
return info
}
func GenRelayInfoRerank(c *gin.Context, documents []any) *RelayInfo {
func GenRelayInfoRerank(c *gin.Context, req *dto.RerankRequest) *RelayInfo {
info := GenRelayInfo(c)
info.RelayMode = relayconstant.RelayModeRerank
info.RerankerInfo = &RerankerInfo{
Documents: documents,
Documents: req.Documents,
ReturnDocuments: req.GetReturnDocuments(),
}
return info
}