This commit is contained in:
2025-12-28 17:06:35 +08:00
parent 167ced5f57
commit 9ef8e9188a
5 changed files with 38 additions and 7 deletions

View File

@@ -517,13 +517,16 @@ You are 'The Legion', a super AI of the Wula Empire. Your personality is authori
}
private string GetSystemInstruction(bool toolsEnabled, string toolsForThisPhase)
{
var def = GetActiveEventDef();
string persona = def != null && !string.IsNullOrEmpty(def.aiSystemInstruction) ? def.aiSystemInstruction : DefaultPersona;
var settings = WulaFallenEmpireMod.settings;
string persona;
if (settings != null && !string.IsNullOrWhiteSpace(settings.extraPersonalityPrompt))
{
persona += "\n" + settings.extraPersonalityPrompt;
persona = settings.extraPersonalityPrompt;
}
else
{
var def = GetActiveEventDef();
persona = def != null && !string.IsNullOrEmpty(def.aiSystemInstruction) ? def.aiSystemInstruction : DefaultPersona;
}
string fullInstruction = toolsEnabled
@@ -550,6 +553,12 @@ You are 'The Legion', a super AI of the Wula Empire. Your personality is authori
$"You will produce the natural-language reply later and MUST use: {language}.";
}
public string GetEffectiveBasePersona()
{
var def = GetActiveEventDef();
return def != null && !string.IsNullOrEmpty(def.aiSystemInstruction) ? def.aiSystemInstruction : DefaultPersona;
}
private string GetToolSystemInstruction(RequestPhase phase, bool hasImage)
{
string phaseInstruction = GetPhaseInstruction(phase).TrimEnd();