pub struct EmbedBuilder { /* private fields */ }
Expand description
Builder for embed generation requests
Implementations§
Source§impl EmbedBuilder
impl EmbedBuilder
Sourcepub fn with_text(self, text: impl Into<String>) -> Self
pub fn with_text(self, text: impl Into<String>) -> Self
Add a vec of text to embed to the request
Sourcepub fn with_chunks(self, chunks: Vec<impl Into<String>>) -> Self
pub fn with_chunks(self, chunks: Vec<impl Into<String>>) -> Self
Add a vec of chunks to batch embed to the request
Sourcepub fn with_task_type(self, task_type: TaskType) -> Self
pub fn with_task_type(self, task_type: TaskType) -> Self
Specify embedding task type
Sourcepub fn with_title(self, title: String) -> Self
pub fn with_title(self, title: String) -> Self
Specify document title Supported by newer models since 2024 only !!
Sourcepub fn with_output_dimensionality(self, output_dimensionality: i32) -> Self
pub fn with_output_dimensionality(self, output_dimensionality: i32) -> Self
Specify output_dimensionality. If set, excessive values in the output embedding are truncated from the end
Sourcepub async fn execute(self) -> Result<ContentEmbeddingResponse, ClientError>
pub async fn execute(self) -> Result<ContentEmbeddingResponse, ClientError>
Execute the request
Sourcepub async fn execute_batch(
self,
) -> Result<BatchContentEmbeddingResponse, ClientError>
pub async fn execute_batch( self, ) -> Result<BatchContentEmbeddingResponse, ClientError>
Execute the request
Auto Trait Implementations§
impl Freeze for EmbedBuilder
impl !RefUnwindSafe for EmbedBuilder
impl Send for EmbedBuilder
impl Sync for EmbedBuilder
impl Unpin for EmbedBuilder
impl !UnwindSafe for EmbedBuilder
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