pub struct RerankResponse {
pub results: Vec<RerankResult>,
pub model: String,
pub usage: Option<UsageInfo>,
pub object: String,
pub id: Option<StringOrArray>,
pub created: i64,
}Expand description
Rerank response containing sorted results
Fields§
§results: Vec<RerankResult>Ranked results sorted by score (highest first)
model: StringModel used for reranking
usage: Option<UsageInfo>Usage information
object: StringResponse object type
id: Option<StringOrArray>Response ID
created: i64Creation timestamp
Implementations§
Source§impl RerankResponse
impl RerankResponse
Sourcepub fn new(
results: Vec<RerankResult>,
model: String,
request_id: Option<StringOrArray>,
) -> Self
pub fn new( results: Vec<RerankResult>, model: String, request_id: Option<StringOrArray>, ) -> Self
Create a new RerankResponse with the given results and model
Sourcepub fn apply_top_k(&mut self, k: usize)
pub fn apply_top_k(&mut self, k: usize)
Apply top_k limit to results
Sourcepub fn drop_documents(&mut self)
pub fn drop_documents(&mut self)
Drop documents from results (when return_documents is false)
Trait Implementations§
Source§impl Clone for RerankResponse
impl Clone for RerankResponse
Source§fn clone(&self) -> RerankResponse
fn clone(&self) -> RerankResponse
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RerankResponse
impl Debug for RerankResponse
Source§impl<'de> Deserialize<'de> for RerankResponse
impl<'de> Deserialize<'de> for RerankResponse
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl JsonSchema for RerankResponse
impl JsonSchema for RerankResponse
Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref keyword. Read moreAuto Trait Implementations§
impl Freeze for RerankResponse
impl RefUnwindSafe for RerankResponse
impl Send for RerankResponse
impl Sync for RerankResponse
impl Unpin for RerankResponse
impl UnsafeUnpin for RerankResponse
impl UnwindSafe for RerankResponse
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more