v0.3.1 实装了记忆系统和自动发言
哈哈哈
This commit is contained in:
@@ -83,7 +83,7 @@ class ChatBot:
|
||||
|
||||
await relationship_manager.update_relationship(user_id = event.user_id, data = sender_info)
|
||||
await relationship_manager.update_relationship_value(user_id = event.user_id, relationship_value = 0.5)
|
||||
print(f"\033[1;32m[关系管理]\033[0m 更新关系值: {relationship_manager.get_relationship(event.user_id).relationship_value}")
|
||||
# print(f"\033[1;32m[关系管理]\033[0m 更新关系值: {relationship_manager.get_relationship(event.user_id).relationship_value}")
|
||||
|
||||
|
||||
message = Message(
|
||||
@@ -100,14 +100,19 @@ class ChatBot:
|
||||
topic = topic_identifier.identify_topic_jieba(message.processed_plain_text)
|
||||
print(f"\033[1;32m[主题识别]\033[0m 主题: {topic}")
|
||||
|
||||
all_num = 0
|
||||
interested_num = 0
|
||||
if topic:
|
||||
for current_topic in topic:
|
||||
all_num += 1
|
||||
first_layer_items, second_layer_items = memory_graph.get_related_item(current_topic, depth=2)
|
||||
if first_layer_items:
|
||||
print(f"\033[1;32m[记忆检索-bot]\033[0m 有印象:{current_topic}")
|
||||
interested_num += 1
|
||||
print(f"\033[1;32m[前额叶]\033[0m 对|{current_topic}|有印象")
|
||||
interested_rate = interested_num / all_num if all_num > 0 else 0
|
||||
|
||||
|
||||
await self.storage.store_message(message, topic[0] if topic else None)
|
||||
|
||||
|
||||
|
||||
is_mentioned = is_mentioned_bot_in_txt(message.processed_plain_text)
|
||||
@@ -117,7 +122,8 @@ class ChatBot:
|
||||
is_mentioned,
|
||||
self.config,
|
||||
event.user_id,
|
||||
message.is_emoji
|
||||
message.is_emoji,
|
||||
interested_rate
|
||||
)
|
||||
current_willing = willing_manager.get_willing(event.group_id)
|
||||
|
||||
@@ -188,7 +194,8 @@ class ChatBot:
|
||||
user_nickname=global_config.BOT_NICKNAME,
|
||||
group_name=message.group_name,
|
||||
time=bot_response_time,
|
||||
is_emoji=True
|
||||
is_emoji=True,
|
||||
translate_cq=False
|
||||
)
|
||||
message_sender.send_temp_container.add_message(bot_message)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user