pub struct EmbeddingRequest {
pub key: String,
/* private fields */
}Expand description
Text Embedding request client (JSON POST)
Fields§
§key: StringImplementations§
Source§impl EmbeddingRequest
impl EmbeddingRequest
pub fn new(key: String, model: EmbeddingModel, input: EmbeddingInput) -> Self
pub fn with_dimensions(self, dims: EmbeddingDimensions) -> Self
Sourcepub async fn send(&self) -> ZaiResult<EmbeddingResponse>
pub async fn send(&self) -> ZaiResult<EmbeddingResponse>
Send the request and parse typed response.
Automatically runs validate() before sending.
Sourcepub async fn execute(&self) -> ZaiResult<EmbeddingResponse>
👎Deprecated: Use send() instead
pub async fn execute(&self) -> ZaiResult<EmbeddingResponse>
Use send() instead
Deprecated: use send().
Trait Implementations§
Source§impl HttpClient for EmbeddingRequest
impl HttpClient for EmbeddingRequest
type Body = EmbeddingBody
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 EmbeddingRequest
impl RefUnwindSafe for EmbeddingRequest
impl Send for EmbeddingRequest
impl Sync for EmbeddingRequest
impl Unpin for EmbeddingRequest
impl UnsafeUnpin for EmbeddingRequest
impl UnwindSafe for EmbeddingRequest
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