pub struct Skill {
pub id: Uuid,
pub category: String,
pub name: String,
pub description: String,
pub patterns: Vec<SkillPattern>,
pub preconditions: Vec<String>,
pub postconditions: Vec<String>,
pub success_rate: f32,
pub usage_count: u64,
pub created_at: DateTime<Utc>,
pub last_used: DateTime<Utc>,
pub tags: Vec<String>,
}Expand description
A learned skill that can be reused.
Fields§
§id: UuidUnique identifier.
category: StringSkill category/domain.
name: StringHuman-readable name.
description: StringDescription of what this skill does.
patterns: Vec<SkillPattern>Component patterns that make up this skill.
preconditions: Vec<String>Preconditions for using this skill.
postconditions: Vec<String>What this skill produces/achieves.
success_rate: f32Success rate when applied (0.0 to 1.0).
usage_count: u64How many times this skill has been used.
created_at: DateTime<Utc>When this skill was created.
last_used: DateTime<Utc>When this skill was last used.
Tags for categorization.
Implementations§
Source§impl Skill
impl Skill
Sourcepub fn new(
category: impl Into<String>,
name: impl Into<String>,
patterns: Vec<SkillPattern>,
) -> Self
pub fn new( category: impl Into<String>, name: impl Into<String>, patterns: Vec<SkillPattern>, ) -> Self
Create a new skill.
Sourcepub fn with_description(self, description: impl Into<String>) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
Add a description.
Sourcepub fn with_preconditions(self, preconditions: Vec<String>) -> Self
pub fn with_preconditions(self, preconditions: Vec<String>) -> Self
Add preconditions.
Sourcepub fn with_postconditions(self, postconditions: Vec<String>) -> Self
pub fn with_postconditions(self, postconditions: Vec<String>) -> Self
Add postconditions.
Sourcepub fn with_success_rate(self, rate: f32) -> Self
pub fn with_success_rate(self, rate: f32) -> Self
Set success rate.
Sourcepub fn with_usage_count(self, count: u64) -> Self
pub fn with_usage_count(self, count: u64) -> Self
Set usage count.
Add tags.
Sourcepub fn record_usage(&mut self, succeeded: bool)
pub fn record_usage(&mut self, succeeded: bool)
Record a usage of this skill.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Skill
impl<'de> Deserialize<'de> for Skill
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 Skill
impl RefUnwindSafe for Skill
impl Send for Skill
impl Sync for Skill
impl Unpin for Skill
impl UnsafeUnpin for Skill
impl UnwindSafe for Skill
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,
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request