mirror of
https://github.com/mudler/LocalAI.git
synced 2024-12-18 20:27:57 +00:00
b664edde29
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
35 lines
973 B
Go
35 lines
973 B
Go
package schema
|
|
|
|
// RerankRequest defines the structure of the request payload
|
|
type JINARerankRequest struct {
|
|
Model string `json:"model"`
|
|
Query string `json:"query"`
|
|
Documents []string `json:"documents"`
|
|
TopN int `json:"top_n"`
|
|
}
|
|
|
|
// DocumentResult represents a single document result
|
|
type JINADocumentResult struct {
|
|
Index int `json:"index"`
|
|
Document JINAText `json:"document"`
|
|
RelevanceScore float64 `json:"relevance_score"`
|
|
}
|
|
|
|
// Text holds the text of the document
|
|
type JINAText struct {
|
|
Text string `json:"text"`
|
|
}
|
|
|
|
// RerankResponse defines the structure of the response payload
|
|
type JINARerankResponse struct {
|
|
Model string `json:"model"`
|
|
Usage JINAUsageInfo `json:"usage"`
|
|
Results []JINADocumentResult `json:"results"`
|
|
}
|
|
|
|
// UsageInfo holds information about usage of tokens
|
|
type JINAUsageInfo struct {
|
|
TotalTokens int `json:"total_tokens"`
|
|
PromptTokens int `json:"prompt_tokens"`
|
|
}
|