Merge branch 'dev' of https://github.com/MaiM-with-u/MaiBot into dev
This commit is contained in:
@@ -48,7 +48,7 @@ class IdentityConfig(ConfigBase):
|
|||||||
identity_detail: list[str] = field(default_factory=lambda: [])
|
identity_detail: list[str] = field(default_factory=lambda: [])
|
||||||
"""身份特征"""
|
"""身份特征"""
|
||||||
|
|
||||||
compress_indentity: bool = True
|
compress_identity: bool = True
|
||||||
"""是否压缩身份,压缩后会精简身份信息,节省token消耗并提高回复性能,但是会丢失一些信息,如果不长,可以关闭"""
|
"""是否压缩身份,压缩后会精简身份信息,节省token消耗并提高回复性能,但是会丢失一些信息,如果不长,可以关闭"""
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -335,7 +335,7 @@ class Individuality:
|
|||||||
# 身份配置哈希
|
# 身份配置哈希
|
||||||
identity_config = {
|
identity_config = {
|
||||||
"identity_detail": sorted(identity_detail),
|
"identity_detail": sorted(identity_detail),
|
||||||
"compress_identity": global_config.identity.compress_indentity,
|
"compress_identity": global_config.identity.compress_identity,
|
||||||
}
|
}
|
||||||
identity_str = json.dumps(identity_config, sort_keys=True)
|
identity_str = json.dumps(identity_config, sort_keys=True)
|
||||||
identity_hash = hashlib.md5(identity_str.encode("utf-8")).hexdigest()
|
identity_hash = hashlib.md5(identity_str.encode("utf-8")).hexdigest()
|
||||||
@@ -504,7 +504,7 @@ class Individuality:
|
|||||||
"""使用LLM创建压缩版本的impression"""
|
"""使用LLM创建压缩版本的impression"""
|
||||||
logger.info("正在构建身份.........")
|
logger.info("正在构建身份.........")
|
||||||
|
|
||||||
if global_config.identity.compress_indentity:
|
if global_config.identity.compress_identity:
|
||||||
identity_to_compress = []
|
identity_to_compress = []
|
||||||
if identity_detail:
|
if identity_detail:
|
||||||
identity_to_compress.append(f"身份背景: {'、'.join(identity_detail)}")
|
identity_to_compress.append(f"身份背景: {'、'.join(identity_detail)}")
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
[inner]
|
[inner]
|
||||||
version = "4.0.0"
|
version = "4.0.1"
|
||||||
|
|
||||||
#----以下是给开发人员阅读的,如果你只是部署了麦麦,不需要阅读----
|
#----以下是给开发人员阅读的,如果你只是部署了麦麦,不需要阅读----
|
||||||
#如果你想要修改配置文件,请在修改后将version的值进行变更
|
#如果你想要修改配置文件,请在修改后将version的值进行变更
|
||||||
@@ -40,7 +40,7 @@ identity_detail = [
|
|||||||
"有橙色的短发",
|
"有橙色的短发",
|
||||||
]
|
]
|
||||||
|
|
||||||
compress_indentity = true # 是否压缩身份,压缩后会精简身份信息,节省token消耗并提高回复性能,但是会丢失一些信息,如果不长,可以关闭
|
compress_identity = true # 是否压缩身份,压缩后会精简身份信息,节省token消耗并提高回复性能,但是会丢失一些信息,如果不长,可以关闭
|
||||||
|
|
||||||
[expression]
|
[expression]
|
||||||
# 表达方式
|
# 表达方式
|
||||||
|
|||||||
Reference in New Issue
Block a user