pub struct Rerank<D> { /* private fields */ }Expand description
Builder returned by rerank; .await runs the call.
Implementations§
Source§impl<D> Rerank<D>
impl<D> Rerank<D>
Sourcepub fn header(self, name: &str, value: &str) -> Self
pub fn header(self, name: &str, value: &str) -> Self
Adds one request header; invalid names or values are ignored.
Sourcepub fn provider_options(self, options: ProviderOptions) -> Self
pub fn provider_options(self, options: ProviderOptions) -> Self
Sets the provider-specific options.
Sourcepub fn provider_option(
self,
provider: impl Into<String>,
options: JsonObject,
) -> Self
pub fn provider_option( self, provider: impl Into<String>, options: JsonObject, ) -> Self
Sets the options of one provider.
Sourcepub fn cancellation(self, token: CancellationToken) -> Self
pub fn cancellation(self, token: CancellationToken) -> Self
Sets the cancellation token.
Sourcepub fn telemetry(self, options: TelemetryOptions) -> Self
pub fn telemetry(self, options: TelemetryOptions) -> Self
Sets the telemetry options.
Source§impl<D> Rerank<D>
impl<D> Rerank<D>
Sourcepub fn retry(self, policy: RetryPolicy) -> Self
pub fn retry(self, policy: RetryPolicy) -> Self
Sets the retry policy (default: two retries).
Sourcepub fn max_retries(self, max_retries: u32) -> Self
pub fn max_retries(self, max_retries: u32) -> Self
Sets the number of retries of the default policy.
Source§impl<D> Rerank<D>
impl<D> Rerank<D>
Sourcepub fn runtime_context(self, context: JsonValue) -> Self
pub fn runtime_context(self, context: JsonValue) -> Self
Sets the application context passed to operation callbacks.
Sourcepub fn on_start(self, hook: impl HookFn<RerankCallStartEvent>) -> Self
pub fn on_start(self, hook: impl HookFn<RerankCallStartEvent>) -> Self
Adds an awaited callback before the first provider attempt.
Sourcepub fn on_end(self, hook: impl HookFn<RerankCallEndEvent>) -> Self
pub fn on_end(self, hook: impl HookFn<RerankCallEndEvent>) -> Self
Adds an awaited callback after the entire operation succeeds.
Trait Implementations§
Source§impl<D> IntoFuture for Rerank<D>
impl<D> IntoFuture for Rerank<D>
Source§type Output = Result<RerankResult<D>, Error>
type Output = Result<RerankResult<D>, Error>
The output that the future will produce on completion.
Source§type IntoFuture = Pin<Box<dyn Future<Output = <Rerank<D> as IntoFuture>::Output> + Send>>
type IntoFuture = Pin<Box<dyn Future<Output = <Rerank<D> as IntoFuture>::Output> + Send>>
Which kind of future are we turning this into?
Source§fn into_future(self) -> Self::IntoFuture
fn into_future(self) -> Self::IntoFuture
Creates a future from a value. Read more
Auto Trait Implementations§
impl<D> !RefUnwindSafe for Rerank<D>
impl<D> !UnwindSafe for Rerank<D>
impl<D> Freeze for Rerank<D>
impl<D> Send for Rerank<D>
impl<D> Sync for Rerank<D>
impl<D> Unpin for Rerank<D>
impl<D> UnsafeUnpin for Rerank<D>where
Vec<D>: UnsafeUnpin,
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