mirror of
https://github.com/AstrBotDevs/AstrBot
synced 2026-07-20 02:55:08 +08:00
fix: system_prompt None guard before += in _ensure_persona_and_skills
This commit is contained in:
@@ -393,6 +393,10 @@ async def _ensure_persona_and_skills(
|
||||
event, extract_persona_custom_error_message_from_persona(persona)
|
||||
)
|
||||
|
||||
# Ensure system_prompt is a string before any +=
|
||||
if req.system_prompt is None:
|
||||
req.system_prompt = ""
|
||||
|
||||
if persona:
|
||||
# Inject persona system prompt
|
||||
if prompt := persona["prompt"]:
|
||||
|
||||
Reference in New Issue
Block a user