pub struct TaskSemanticEmbeddingWithInstruction<'a> {
pub instruction: &'a str,
pub prompt: Prompt<'a>,
pub normalize: Option<bool>,
}
Expand description
Allows you to choose a semantic representation fitting for your use case.
By providing instructions, you can help the model better understand the nuances of your specific data, leading to embeddings that are more useful for your use case.
Fields§
§instruction: &'a str
To further improve performance by steering the model, you can use instructions.
Instructions can help the model understand nuances of your specific data and ultimately lead to embeddings that are more useful for your use-case. In this case, we aim to further increase the absolute difference between the cosine similarities. Instruction can also be the empty string.
prompt: Prompt<'a>
The prompt (usually text) to be embedded.
normalize: Option<bool>
Return normalized embeddings. This can be used to save on additional compute when applying a cosine similarity metric.
Trait Implementations§
Source§impl<'a> Debug for TaskSemanticEmbeddingWithInstruction<'a>
impl<'a> Debug for TaskSemanticEmbeddingWithInstruction<'a>
Source§impl Job for TaskSemanticEmbeddingWithInstruction<'_>
impl Job for TaskSemanticEmbeddingWithInstruction<'_>
Source§type Output = SemanticEmbeddingOutput
type Output = SemanticEmbeddingOutput
crate::Client::output_of
Source§type ResponseBody = SemanticEmbeddingOutput
type ResponseBody = SemanticEmbeddingOutput
Source§fn build_request(&self, client: &Client, base: &str) -> RequestBuilder
fn build_request(&self, client: &Client, base: &str) -> RequestBuilder
Source§fn body_to_output(&self, response: Self::ResponseBody) -> Self::Output
fn body_to_output(&self, response: Self::ResponseBody) -> Self::Output
Source§impl<'a> Serialize for TaskSemanticEmbeddingWithInstruction<'a>
impl<'a> Serialize for TaskSemanticEmbeddingWithInstruction<'a>
Source§impl Task for TaskSemanticEmbeddingWithInstruction<'_>
impl Task for TaskSemanticEmbeddingWithInstruction<'_>
Source§type Output = SemanticEmbeddingOutput
type Output = SemanticEmbeddingOutput
crate::Client::output_of
Source§type ResponseBody = SemanticEmbeddingOutput
type ResponseBody = SemanticEmbeddingOutput
Source§fn build_request(
&self,
client: &Client,
base: &str,
model: &str,
) -> RequestBuilder
fn build_request( &self, client: &Client, base: &str, model: &str, ) -> RequestBuilder
Source§fn body_to_output(&self, response: Self::ResponseBody) -> Self::Output
fn body_to_output(&self, response: Self::ResponseBody) -> Self::Output
Auto Trait Implementations§
impl<'a> Freeze for TaskSemanticEmbeddingWithInstruction<'a>
impl<'a> RefUnwindSafe for TaskSemanticEmbeddingWithInstruction<'a>
impl<'a> Send for TaskSemanticEmbeddingWithInstruction<'a>
impl<'a> Sync for TaskSemanticEmbeddingWithInstruction<'a>
impl<'a> Unpin for TaskSemanticEmbeddingWithInstruction<'a>
impl<'a> UnwindSafe for TaskSemanticEmbeddingWithInstruction<'a>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more