🤖 自动格式化代码 [skip ci]
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import difflib
|
import difflib
|
||||||
import random
|
import random
|
||||||
|
|
||||||
|
|
||||||
def ji_suan_xiang_si_du(wen_ben_yi: str, wen_ben_er: str) -> float:
|
def ji_suan_xiang_si_du(wen_ben_yi: str, wen_ben_er: str) -> float:
|
||||||
"""
|
"""
|
||||||
计算两个文本字符串的相似度。
|
计算两个文本字符串的相似度。
|
||||||
@@ -17,6 +18,7 @@ def ji_suan_xiang_si_du(wen_ben_yi: str, wen_ben_er: str) -> float:
|
|||||||
xiang_si_bi_lv = xu_lie_pi_pei_qi.ratio()
|
xiang_si_bi_lv = xu_lie_pi_pei_qi.ratio()
|
||||||
return xiang_si_bi_lv
|
return xiang_si_bi_lv
|
||||||
|
|
||||||
|
|
||||||
def ji_suan_ti_huan_gai_lv(xiang_si_du: float) -> float:
|
def ji_suan_ti_huan_gai_lv(xiang_si_du: float) -> float:
|
||||||
"""
|
"""
|
||||||
根据相似度计算替换的概率。
|
根据相似度计算替换的概率。
|
||||||
@@ -39,6 +41,7 @@ def ji_suan_ti_huan_gai_lv(xiang_si_du: float) -> float:
|
|||||||
gai_lv = (5 / 3) * xiang_si_du - 0.5
|
gai_lv = (5 / 3) * xiang_si_du - 0.5
|
||||||
return min(1.0, max(0.0, gai_lv)) # 确保概率在 0 和 1 之间
|
return min(1.0, max(0.0, gai_lv)) # 确保概率在 0 和 1 之间
|
||||||
|
|
||||||
|
|
||||||
# 获取用户输入
|
# 获取用户输入
|
||||||
shu_ru_yi = "豆豆刚刚回复了我的问候 现在可以等待对方的回应 不需要再主动发言 目前情绪满足 不需要使用工具"
|
shu_ru_yi = "豆豆刚刚回复了我的问候 现在可以等待对方的回应 不需要再主动发言 目前情绪满足 不需要使用工具"
|
||||||
|
|
||||||
|
|||||||
@@ -417,6 +417,7 @@ class BotConfig:
|
|||||||
config.model_normal_probability = response_config.get(
|
config.model_normal_probability = response_config.get(
|
||||||
"model_normal_probability", config.model_normal_probability
|
"model_normal_probability", config.model_normal_probability
|
||||||
)
|
)
|
||||||
|
|
||||||
def heartflow(parent: dict):
|
def heartflow(parent: dict):
|
||||||
heartflow_config = parent["heartflow"]
|
heartflow_config = parent["heartflow"]
|
||||||
config.sub_heart_flow_stop_time = heartflow_config.get(
|
config.sub_heart_flow_stop_time = heartflow_config.get(
|
||||||
|
|||||||
@@ -348,7 +348,10 @@ async def build_readable_messages(
|
|||||||
messages_before_mark, replace_bot_name, merge_messages, timestamp_mode, truncate
|
messages_before_mark, replace_bot_name, merge_messages, timestamp_mode, truncate
|
||||||
)
|
)
|
||||||
formatted_after, _ = await _build_readable_messages_internal(
|
formatted_after, _ = await _build_readable_messages_internal(
|
||||||
messages_after_mark, replace_bot_name, merge_messages, timestamp_mode,
|
messages_after_mark,
|
||||||
|
replace_bot_name,
|
||||||
|
merge_messages,
|
||||||
|
timestamp_mode,
|
||||||
)
|
)
|
||||||
|
|
||||||
readable_read_mark = translate_timestamp_to_human_readable(read_mark, mode=timestamp_mode)
|
readable_read_mark = translate_timestamp_to_human_readable(read_mark, mode=timestamp_mode)
|
||||||
|
|||||||
Reference in New Issue
Block a user