rerank.go 744 B

1234567891011121314151617181920212223242526
  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 RerankResponseResult struct {
  12. Document any `json:"document,omitempty"`
  13. Index int `json:"index"`
  14. RelevanceScore float64 `json:"relevance_score"`
  15. }
  16. type RerankDocument struct {
  17. Text any `json:"text"`
  18. }
  19. type RerankResponse struct {
  20. Results []RerankResponseResult `json:"results"`
  21. Usage Usage `json:"usage"`
  22. }