fix(room): should_ai_respond only triggers on @ai mention
This commit is contained in:
parent
c2c079c74d
commit
46a0bdc21e
@ -259,16 +259,11 @@ impl RoomService {
|
|||||||
|
|
||||||
pub async fn should_ai_respond(&self, room_id: Uuid, content: &str) -> Result<bool, RoomError> {
|
pub async fn should_ai_respond(&self, room_id: Uuid, content: &str) -> Result<bool, RoomError> {
|
||||||
let ai_config = history::get_room_ai_config(&self.db, room_id).await?;
|
let ai_config = history::get_room_ai_config(&self.db, room_id).await?;
|
||||||
|
|
||||||
let config = match ai_config {
|
let config = match ai_config {
|
||||||
Some(c) => c,
|
Some(c) => c,
|
||||||
None => return Ok(false),
|
None => return Ok(false),
|
||||||
};
|
};
|
||||||
|
|
||||||
if config.use_exact {
|
|
||||||
return Ok(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
let model_id_str = config.model.to_string();
|
let model_id_str = config.model.to_string();
|
||||||
|
|
||||||
for cap in mention_bracket_re().captures_iter(content) {
|
for cap in mention_bracket_re().captures_iter(content) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user