pub struct EncodeRequest { /* private fields */ }Expand description
Embeds one or more items. Build with Client::encode.
Implementations§
Source§impl EncodeRequest
impl EncodeRequest
Sourcepub fn gpu(self, gpu: impl Into<String>) -> Self
pub fn gpu(self, gpu: impl Into<String>) -> Self
Route to a machine profile, optionally pool-qualified as "pool/profile".
Sourcepub fn wait_for_capacity(self, wait: bool) -> Self
pub fn wait_for_capacity(self, wait: bool) -> Self
Whether to wait out provisioning and model loading, or fail fast.
Sourcepub fn provision_timeout(self, timeout: Duration) -> Self
pub fn provision_timeout(self, timeout: Duration) -> Self
Total wall-clock budget for this call, retries included.
Sourcepub fn max_oom_retries(self, retries: u32) -> Self
pub fn max_oom_retries(self, retries: u32) -> Self
Cap on RESOURCE_EXHAUSTED retries. Zero fails fast.
Sourcepub fn output_types(self, types: impl IntoIterator<Item = OutputType>) -> Self
pub fn output_types(self, types: impl IntoIterator<Item = OutputType>) -> Self
Which representations to return. Defaults to whatever the model produces.
Sourcepub fn instruction(self, instruction: impl Into<String>) -> Self
pub fn instruction(self, instruction: impl Into<String>) -> Self
Task instruction prepended by instruction-tuned models.
Sourcepub fn output_dtype(self, dtype: OutputDType) -> Self
pub fn output_dtype(self, dtype: OutputDType) -> Self
Quantize the returned embeddings.
Sourcepub fn is_query(self, is_query: bool) -> Self
pub fn is_query(self, is_query: bool) -> Self
Encode as a query rather than a document, for asymmetric models.
Sourcepub fn options(self, options: Value) -> Self
pub fn options(self, options: Value) -> Self
Adapter-specific runtime options, merged over the client defaults.
Sourcepub async fn send(self) -> Result<Vec<EncodeResult>>
pub async fn send(self) -> Result<Vec<EncodeResult>>
Send the request.
Sourcepub async fn send_one(self) -> Result<EncodeResult>
pub async fn send_one(self) -> Result<EncodeResult>
Send the request and return the single expected result.
Auto Trait Implementations§
impl !RefUnwindSafe for EncodeRequest
impl !UnwindSafe for EncodeRequest
impl Freeze for EncodeRequest
impl Send for EncodeRequest
impl Sync for EncodeRequest
impl Unpin for EncodeRequest
impl UnsafeUnpin for EncodeRequest
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