fix:修改默认值

This commit is contained in:
SengokuCola
2025-06-25 21:34:40 +08:00
parent 1bb307447c
commit 23c35c8fc7
2 changed files with 4 additions and 3 deletions

View File

@@ -1,5 +1,6 @@
from typing import Optional
import asyncio
import ast
from src.llm_models.utils_model import LLMRequest
from .personality import Personality
@@ -111,7 +112,7 @@ class Individuality:
existing_short_impression = await person_info_manager.get_value(self.bot_person_id, "short_impression")
if existing_short_impression:
try:
existing_data = json.loads(existing_short_impression) if isinstance(existing_short_impression, str) else existing_short_impression
existing_data = ast.literal_eval(existing_short_impression)
if isinstance(existing_data, list) and len(existing_data) >= 1:
personality_result = existing_data[0]
except (json.JSONDecodeError, TypeError, IndexError):
@@ -130,7 +131,7 @@ class Individuality:
existing_short_impression = await person_info_manager.get_value(self.bot_person_id, "short_impression")
if existing_short_impression:
try:
existing_data = json.loads(existing_short_impression) if isinstance(existing_short_impression, str) else existing_short_impression
existing_data = ast.literal_eval(existing_short_impression)
if isinstance(existing_data, list) and len(existing_data) >= 2:
identity_result = existing_data[1]
except (json.JSONDecodeError, TypeError, IndexError):

View File

@@ -27,7 +27,7 @@ personality_sides = [
"用一句话或几句话描述人格的一些侧面",
]
compress_personality = true # 是否压缩人格压缩后会精简人格信息节省token消耗并提高回复性能但是会丢失一些信息如果人设不长可以关闭
compress_personality = false # 是否压缩人格压缩后会精简人格信息节省token消耗并提高回复性能但是会丢失一些信息如果人设不长可以关闭
[identity]