pub struct RerankResponse {
pub results: Vec<RerankResult>,
pub model: Option<String>,
pub usage: Usage,
pub provider: String,
pub response_id: Option<String>,
pub provider_request_id: Option<String>,
pub raw: Value,
}Expand description
Ranked documents and normalized provider metadata.
Provider-specific response data is available through Self::raw.
Fields§
§results: Vec<RerankResult>Reranked results sorted by relevance (highest first).
model: Option<String>Provider-reported model identifier, or None when omitted.
usage: UsageToken usage for this rerank request; every counter is None when the
provider reported none (see Usage).
provider: StringStable descriptor name of the provider that produced this response,
for example "voyageai". Always populated.
response_id: Option<String>Provider-assigned response-scoped identifier, when reported.
provider_request_id: Option<String>Transport request ID from HTTP headers, or None when unreported.
raw: ValueProvider response document. Defaults to null until populated.
Implementations§
Source§impl RerankResponse
impl RerankResponse
Sourcepub fn new(results: Vec<RerankResult>) -> Self
pub fn new(results: Vec<RerankResult>) -> Self
A response carrying results. The driver writes the provider, the
transport request id and the reply document; decoders set what the
provider reported.
Trait Implementations§
Source§impl Clone for RerankResponse
impl Clone for RerankResponse
Source§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>,
Auto 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more