pub struct SkillEmbeddings {
pub skill_name: SkillName,
pub description: Embedding,
pub triggers: Embedding,
pub tags: Embedding,
pub examples: Embedding,
pub weights: ComponentWeights,
}Expand description
Multi-component embedding for a single skill. Each component is embedded separately and scored with configurable weights.
Fields§
§skill_name: SkillNameThe skill name this embedding belongs to.
description: EmbeddingEmbedding of the main description text.
triggers: EmbeddingEmbedding of trigger keywords concatenated.
Embedding of tags concatenated.
examples: EmbeddingEmbedding of example inputs concatenated.
weights: ComponentWeightsWeights for combining component scores.
Implementations§
Source§impl SkillEmbeddings
impl SkillEmbeddings
Sourcepub fn new(
skill_name: SkillName,
description: Embedding,
triggers: Embedding,
tags: Embedding,
examples: Embedding,
weights: ComponentWeights,
) -> Self
pub fn new( skill_name: SkillName, description: Embedding, triggers: Embedding, tags: Embedding, examples: Embedding, weights: ComponentWeights, ) -> Self
Create new skill embeddings.
Sourcepub fn score(&self, query: &Embedding) -> f32
pub fn score(&self, query: &Embedding) -> f32
Compute weighted similarity score against a query embedding.
Sourcepub fn component_scores(&self, query: &Embedding) -> ComponentScores
pub fn component_scores(&self, query: &Embedding) -> ComponentScores
Compute per-component scores against a query.
Sourcepub fn with_weights(self, weights: ComponentWeights) -> Self
pub fn with_weights(self, weights: ComponentWeights) -> Self
Update weights.
Trait Implementations§
Source§impl Clone for SkillEmbeddings
impl Clone for SkillEmbeddings
Source§fn clone(&self) -> SkillEmbeddings
fn clone(&self) -> SkillEmbeddings
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SkillEmbeddings
impl Debug for SkillEmbeddings
Source§impl<'de> Deserialize<'de> for SkillEmbeddings
impl<'de> Deserialize<'de> for SkillEmbeddings
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SkillEmbeddings
impl RefUnwindSafe for SkillEmbeddings
impl Send for SkillEmbeddings
impl Sync for SkillEmbeddings
impl Unpin for SkillEmbeddings
impl UnsafeUnpin for SkillEmbeddings
impl UnwindSafe for SkillEmbeddings
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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>
Converts
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>
Converts
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