-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathreranking.py
More file actions
37 lines (26 loc) · 911 Bytes
/
reranking.py
File metadata and controls
37 lines (26 loc) · 911 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import List
from .._models import BaseModel
__all__ = ["Reranking", "Result", "Usage"]
class Result(BaseModel):
index: int
"""
The index of the text in the input array of texts, starting from `0` (and,
therefore, ending at the number of texts minus `1`).
"""
score: float
"""
A score between `0` and `1`, inclusive, representing the relevance of the text
to the query.
"""
class Usage(BaseModel):
input_tokens: int
"""The number of tokens inputted to the model."""
class Reranking(BaseModel):
results: List[Result]
"""
The rerankings of the texts, by relevance to the query, in order from highest to
lowest relevance score.
"""
usage: Usage
"""Statistics about the usage of resources in the process of reranking the texts."""