修改了willing的classical
This commit is contained in:
@@ -216,7 +216,6 @@ class ChatBot:
|
|||||||
is_mentioned = is_mentioned_bot_in_message(message)
|
is_mentioned = is_mentioned_bot_in_message(message)
|
||||||
reply_probability = await willing_manager.change_reply_willing_received(
|
reply_probability = await willing_manager.change_reply_willing_received(
|
||||||
chat_stream=chat,
|
chat_stream=chat,
|
||||||
topic=topic[0] if topic else None,
|
|
||||||
is_mentioned_bot=is_mentioned,
|
is_mentioned_bot=is_mentioned,
|
||||||
config=global_config,
|
config=global_config,
|
||||||
is_emoji=message.is_emoji,
|
is_emoji=message.is_emoji,
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ class WillingManager:
|
|||||||
|
|
||||||
async def change_reply_willing_received(self,
|
async def change_reply_willing_received(self,
|
||||||
chat_stream: ChatStream,
|
chat_stream: ChatStream,
|
||||||
topic: str = None,
|
|
||||||
is_mentioned_bot: bool = False,
|
is_mentioned_bot: bool = False,
|
||||||
config = None,
|
config = None,
|
||||||
is_emoji: bool = False,
|
is_emoji: bool = False,
|
||||||
@@ -38,13 +37,13 @@ class WillingManager:
|
|||||||
chat_id = chat_stream.stream_id
|
chat_id = chat_stream.stream_id
|
||||||
current_willing = self.chat_reply_willing.get(chat_id, 0)
|
current_willing = self.chat_reply_willing.get(chat_id, 0)
|
||||||
|
|
||||||
if topic and current_willing < 1:
|
interested_rate = interested_rate * config.response_interested_rate_amplifier
|
||||||
current_willing += 0.2
|
|
||||||
elif topic:
|
if interested_rate > 0.5:
|
||||||
current_willing += 0.05
|
current_willing += (interested_rate - 0.5)
|
||||||
|
|
||||||
if is_mentioned_bot and current_willing < 1.0:
|
if is_mentioned_bot and current_willing < 1.0:
|
||||||
current_willing += 0.9
|
current_willing += 1
|
||||||
elif is_mentioned_bot:
|
elif is_mentioned_bot:
|
||||||
current_willing += 0.05
|
current_willing += 0.05
|
||||||
|
|
||||||
@@ -53,7 +52,10 @@ class WillingManager:
|
|||||||
|
|
||||||
self.chat_reply_willing[chat_id] = min(current_willing, 3.0)
|
self.chat_reply_willing[chat_id] = min(current_willing, 3.0)
|
||||||
|
|
||||||
reply_probability = (current_willing - 0.5) * 2
|
|
||||||
|
reply_probability = min(max((current_willing - 0.5),0.03)* config.response_willing_amplifier * 2,1)
|
||||||
|
|
||||||
|
reply_probability = reply_probability
|
||||||
|
|
||||||
# 检查群组权限(如果是群聊)
|
# 检查群组权限(如果是群聊)
|
||||||
if chat_stream.group_info and config:
|
if chat_stream.group_info and config:
|
||||||
|
|||||||
@@ -20,14 +20,14 @@ alias_names = ["小麦", "阿麦"]
|
|||||||
|
|
||||||
[personality]
|
[personality]
|
||||||
prompt_personality = [
|
prompt_personality = [
|
||||||
"曾经是一个学习地质的女大学生,现在学习心理学和脑科学,你会刷贴吧", # 贴吧人格
|
"用一句话或几句话描述性格特点和其他特征",
|
||||||
"是一个女大学生,你有黑色头发,你会刷小红书", # 小红书人格
|
"用一句话或几句话描述性格特点和其他特征",
|
||||||
"是一个女大学生,你会刷b站,对ACG文化感兴趣" # b站人格
|
"例如,是一个热爱国家热爱党的新时代好青年"
|
||||||
]
|
]
|
||||||
personality_1_probability = 0.6 # 第一种人格出现概率
|
personality_1_probability = 0.6 # 第一种人格出现概率
|
||||||
personality_2_probability = 0.3 # 第二种人格出现概率
|
personality_2_probability = 0.3 # 第二种人格出现概率
|
||||||
personality_3_probability = 0.1 # 第三种人格出现概率,请确保三个概率相加等于1
|
personality_3_probability = 0.1 # 第三种人格出现概率,请确保三个概率相加等于1
|
||||||
prompt_schedule = "一个曾经学习地质,现在学习心理学和脑科学的女大学生,喜欢刷qq,贴吧,知乎和小红书"
|
prompt_schedule = "用一句话或几句话描述描述性格特点和其他特征"
|
||||||
|
|
||||||
[message]
|
[message]
|
||||||
min_text_length = 2 # 与麦麦聊天时麦麦只会回答文本大于等于此数的消息
|
min_text_length = 2 # 与麦麦聊天时麦麦只会回答文本大于等于此数的消息
|
||||||
|
|||||||
Reference in New Issue
Block a user