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

@@ -5,11 +5,18 @@ type RerankRequest struct {
Query string `json:"query"`
Model string `json:"model"`
TopN int `json:"top_n"`
ReturnDocuments bool `json:"return_documents,omitempty"`
ReturnDocuments *bool `json:"return_documents,omitempty"`
MaxChunkPerDoc int `json:"max_chunk_per_doc,omitempty"`
OverLapTokens int `json:"overlap_tokens,omitempty"`
}
func (r *RerankRequest) GetReturnDocuments() bool {
if r.ReturnDocuments == nil {
return false
}
return *r.ReturnDocuments
}
type RerankResponseResult struct {
Document any `json:"document,omitempty"`
Index int `json:"index"`