pub struct RerankRequest {
pub key: String,
/* private fields */
}Expand description
Text Rerank request client (JSON POST)
Fields§
§key: StringImplementations§
Source§impl RerankRequest
impl RerankRequest
pub fn new( key: String, query: impl Into<String>, documents: Vec<String>, ) -> Self
pub fn with_top_n(self, n: usize) -> Self
pub fn with_return_documents(self, v: bool) -> Self
pub fn with_return_raw_scores(self, v: bool) -> Self
pub fn with_request_id(self, v: impl Into<String>) -> Self
pub fn with_user_id(self, v: impl Into<String>) -> Self
Sourcepub async fn send(&self) -> ZaiResult<RerankResponse>
pub async fn send(&self) -> ZaiResult<RerankResponse>
Send the request and parse typed response.
Automatically runs validate() before sending.
Sourcepub async fn execute(&self) -> ZaiResult<RerankResponse>
👎Deprecated: Use send() instead
pub async fn execute(&self) -> ZaiResult<RerankResponse>
Use send() instead
Deprecated: use send().
Trait Implementations§
Source§impl HttpClient for RerankRequest
impl HttpClient for RerankRequest
type Body = RerankBody
type ApiUrl = &'static str
type ApiKey = String
fn api_url(&self) -> &Self::ApiUrl
fn api_key(&self) -> &Self::ApiKey
fn body(&self) -> &Self::Body
Source§fn http_config(&self) -> Arc<HttpClientConfig>
fn http_config(&self) -> Arc<HttpClientConfig>
Get HTTP client configuration for this request Read more
Auto Trait Implementations§
impl Freeze for RerankRequest
impl RefUnwindSafe for RerankRequest
impl Send for RerankRequest
impl Sync for RerankRequest
impl Unpin for RerankRequest
impl UnsafeUnpin for RerankRequest
impl UnwindSafe for RerankRequest
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