feat: 增加适用于直播等场景的新回复策略,在ada发送特定消息段的情况下可以按照优先度同一时间只回复一人

This commit is contained in:
tcmofashi
2025-07-01 10:26:29 +08:00
parent c7fc6e57ff
commit 97ab4a242e
4 changed files with 323 additions and 261 deletions

View File

@@ -47,6 +47,16 @@ class ChatMessageContext:
return False
return True
def get_priority_mode(self) -> str:
"""获取优先级模式"""
return self.message.priority_mode
def get_priority_info(self) -> Optional[dict]:
"""获取优先级信息"""
if hasattr(self.message, "priority_info") and self.message.priority_info:
return self.message.priority_info
return None
class ChatStream:
"""聊天流对象,存储一个完整的聊天上下文"""