pub struct GroupChatConfig {
pub enabled: bool,
pub activation: ActivationMode,
pub prefix: String,
pub isolation: IsolationMode,
pub max_context_messages: usize,
pub allowed_groups: Vec<String>,
pub blocked_groups: Vec<String>,
pub include_sender_names: bool,
}Expand description
Group chat configuration for a messenger.
Fields§
§enabled: boolWhether group chat support is enabled.
activation: ActivationModeHow the agent is activated in groups.
prefix: StringCommand prefix for Prefix activation mode (e.g., “!claw”).
isolation: IsolationModeHow conversations are isolated.
max_context_messages: usizeMaximum number of messages to keep in group context.
allowed_groups: Vec<String>Allowed group IDs (empty = all groups allowed).
blocked_groups: Vec<String>Blocked group IDs.
include_sender_names: boolWhether to include sender names in the context (helps the model understand who is speaking).
Implementations§
Source§impl GroupChatConfig
impl GroupChatConfig
Sourcepub fn is_group_allowed(&self, group_id: &str) -> bool
pub fn is_group_allowed(&self, group_id: &str) -> bool
Check if a group is allowed.
Sourcepub fn should_respond(&self, message: &str, agent_name: &str) -> bool
pub fn should_respond(&self, message: &str, agent_name: &str) -> bool
Check if the agent should respond to a message in a group.
Sourcepub fn session_key(&self, group_id: &str, user_id: Option<&str>) -> String
pub fn session_key(&self, group_id: &str, user_id: Option<&str>) -> String
Generate a session key for isolation.
Sourcepub fn strip_prefix<'a>(&self, message: &'a str) -> &'a str
pub fn strip_prefix<'a>(&self, message: &'a str) -> &'a str
Strip the prefix from a message (for Prefix activation mode).
Trait Implementations§
Source§impl Clone for GroupChatConfig
impl Clone for GroupChatConfig
Source§fn clone(&self) -> GroupChatConfig
fn clone(&self) -> GroupChatConfig
Returns a duplicate of the value. Read more
1.0.0 · 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 GroupChatConfig
impl Debug for GroupChatConfig
Source§impl Default for GroupChatConfig
impl Default for GroupChatConfig
Source§impl<'de> Deserialize<'de> for GroupChatConfig
impl<'de> Deserialize<'de> for GroupChatConfig
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 GroupChatConfig
impl RefUnwindSafe for GroupChatConfig
impl Send for GroupChatConfig
impl Sync for GroupChatConfig
impl Unpin for GroupChatConfig
impl UnsafeUnpin for GroupChatConfig
impl UnwindSafe for GroupChatConfig
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