pub struct ConversationPattern {
pub id: String,
pub pattern_type: PatternType,
pub pattern: String,
pub source: PatternSource,
pub frequency: u32,
pub last_used: DateTime<Utc>,
pub confidence: f32,
pub is_active: bool,
pub description: Option<String>,
pub tags: Vec<String>,
}Expand description
A conversation pattern captured from user interactions.
Patterns represent reusable conventions like:
- How to refer to pull requests (“PR #123” vs “pull request #123”)
- Code style preferences (naming conventions, formatting)
- Common phrases and their variations
Fields§
§id: StringUnique identifier.
pattern_type: PatternTypeType of pattern.
pattern: StringThe pattern string (regex or literal).
source: PatternSourceSource where this pattern was learned from.
frequency: u32Number of times this pattern has been used/matched.
last_used: DateTime<Utc>When this pattern was last used.
confidence: f32Confidence score (0.0-1.0), higher means more certain.
is_active: boolWhether this pattern is currently active.
description: Option<String>Optional description of what this pattern represents.
Tags for categorization and search.
Implementations§
Source§impl ConversationPattern
impl ConversationPattern
Sourcepub fn new(
pattern_type: PatternType,
pattern: impl Into<String>,
source: PatternSource,
) -> Self
pub fn new( pattern_type: PatternType, pattern: impl Into<String>, source: PatternSource, ) -> Self
Create a new conversation pattern.
Sourcepub fn preset(pattern_type: PatternType, pattern: impl Into<String>) -> Self
pub fn preset(pattern_type: PatternType, pattern: impl Into<String>) -> Self
Create a system preset pattern.
Sourcepub fn manual(pattern_type: PatternType, pattern: impl Into<String>) -> Self
pub fn manual(pattern_type: PatternType, pattern: impl Into<String>) -> Self
Create a manually added pattern.
Sourcepub fn with_description(self, desc: impl Into<String>) -> Self
pub fn with_description(self, desc: impl Into<String>) -> Self
Set the description.
Sourcepub fn deactivate(&mut self)
pub fn deactivate(&mut self)
Deactivate this pattern.
Sourcepub fn format_line(&self) -> String
pub fn format_line(&self) -> String
Format for display.
Sourcepub fn format_for_prompt(&self) -> String
pub fn format_for_prompt(&self) -> String
Format for inclusion in system prompt.
Trait Implementations§
Source§impl Clone for ConversationPattern
impl Clone for ConversationPattern
Source§fn clone(&self) -> ConversationPattern
fn clone(&self) -> ConversationPattern
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 ConversationPattern
impl Debug for ConversationPattern
Source§impl<'de> Deserialize<'de> for ConversationPattern
impl<'de> Deserialize<'de> for ConversationPattern
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 ConversationPattern
impl RefUnwindSafe for ConversationPattern
impl Send for ConversationPattern
impl Sync for ConversationPattern
impl Unpin for ConversationPattern
impl UnsafeUnpin for ConversationPattern
impl UnwindSafe for ConversationPattern
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