rerank.go 694 B

12345678910111213141516171819202122
  1. package dto
  2. type RerankRequest struct {
  3. Documents []any `json:"documents"`
  4. Query string `json:"query"`
  5. Model string `json:"model"`
  6. TopN int `json:"top_n"`
  7. ReturnDocuments bool `json:"return_documents,omitempty"`
  8. MaxChunkPerDoc int `json:"max_chunk_per_doc,omitempty"`
  9. OverLapTokens int `json:"overlap_tokens,omitempty"`
  10. }
  11. type RerankResponseDocument struct {
  12. Document any `json:"document,omitempty"`
  13. Index int `json:"index"`
  14. RelevanceScore float64 `json:"relevance_score"`
  15. }
  16. type RerankResponse struct {
  17. Results []RerankResponseDocument `json:"results"`
  18. Usage Usage `json:"usage"`
  19. }