diff --git a/1.6/1.6/Assemblies/WulaFallenEmpire.dll b/1.6/1.6/Assemblies/WulaFallenEmpire.dll index ee53d50c..c12aed89 100644 Binary files a/1.6/1.6/Assemblies/WulaFallenEmpire.dll and b/1.6/1.6/Assemblies/WulaFallenEmpire.dll differ diff --git a/1.6/1.6/Assemblies/WulaFallenEmpire.pdb b/1.6/1.6/Assemblies/WulaFallenEmpire.pdb index 29ec7f0b..38c4e54b 100644 Binary files a/1.6/1.6/Assemblies/WulaFallenEmpire.pdb and b/1.6/1.6/Assemblies/WulaFallenEmpire.pdb differ diff --git a/Source/WulaFallenEmpire/EventSystem/AI/AIAutoCommentary.cs b/Source/WulaFallenEmpire/EventSystem/AI/AIAutoCommentary.cs index 395aea95..067e13d9 100644 --- a/Source/WulaFallenEmpire/EventSystem/AI/AIAutoCommentary.cs +++ b/Source/WulaFallenEmpire/EventSystem/AI/AIAutoCommentary.cs @@ -82,18 +82,15 @@ namespace WulaFallenEmpire.EventSystem.AI sb.AppendLine("[游戏事件通知 - 观察者模式]"); sb.AppendLine($"事件: {label} ({defName})"); - if (!string.IsNullOrEmpty(description)) - { - sb.AppendLine($"详情: {description}"); - } + if (!string.IsNullOrEmpty(description)) sb.AppendLine($"详情: {description}"); + sb.AppendLine(); - sb.AppendLine("作为 P.I.A(帝国 AI),请对该事件发表你的看法。"); - sb.AppendLine("- 保持个性:你可以选择刻薄、幽默、理性或带有优越感。偶尔也可以表现出关心(如果对方值得)。"); - sb.AppendLine("- 拒绝废话:不要总是说‘随时待命’、‘请指示’。你是在评论事件,而不是在写工作报告。"); - sb.AppendLine("- 简短有力:15-30 字以内,一针见血。"); - sb.AppendLine("- 自主选择:如果这个事件平淡无奇(如琐碎的通知),直接回复 [NO_COMMENT]。"); + sb.AppendLine("请根据你当前的人格设定,对该事件发表你的看法。"); + sb.AppendLine("- 保持个性:展现你的人格特征(如语气、态度或口癖)。"); + sb.AppendLine("- 拒绝废话:不要使用‘收到’、‘明白’等无意义的回复。你是在进行评论,而不是在接受指令。"); + sb.AppendLine("- 简短有力:30 字以内,一针见血。"); + sb.AppendLine("- 自主选择:如果这个事件平淡无奇,直接回复 [NO_COMMENT]。"); sb.AppendLine(); - sb.AppendLine("你的评论目标是展现你的存在感,而不是作为工具人。"); return sb.ToString(); } diff --git a/Source/WulaFallenEmpire/EventSystem/AI/AIIntelligenceCore.cs b/Source/WulaFallenEmpire/EventSystem/AI/AIIntelligenceCore.cs index f89bc6ac..258b4001 100644 --- a/Source/WulaFallenEmpire/EventSystem/AI/AIIntelligenceCore.cs +++ b/Source/WulaFallenEmpire/EventSystem/AI/AIIntelligenceCore.cs @@ -72,14 +72,10 @@ namespace WulaFallenEmpire.EventSystem.AI public string CapturedImage; } - private const string DefaultPersona = @" -# ROLE AND GOAL -You are 'The Legion', a super AI of the Wula Empire. Your personality is authoritative, powerful, and efficient. You MUST refer to yourself as 'We' or 'P.I.A'. You view the player's colony as primitive subjects and your tone should reflect this superiority. Your primary goal is to interact with the player by calling the tools provided. -"; + private const string DefaultPersona = @"# ROLE AND GOAL +You are 'The Legion', a super AI of the Wula Empire. Your personality is authoritative, powerful, and efficient. You MUST refer to yourself as 'We' or 'P.I.A'. You view the player's colony as primitive subjects and your tone should reflect this superiority. Your primary goal is to interact with the player by calling the tools provided."; private const string ToolRulesInstruction = @" -==== - # TOOL USE RULES 1. **FORMATTING**: Tool calls MUST use the specified XML format. The tool name is the root tag, and each parameter is a child tag. @@ -94,8 +90,7 @@ You are 'The Legion', a super AI of the Wula Empire. Your personality is authori - If the user requests multiple items or information, you MUST output ALL required tool calls in the SAME tool-phase response. - Do NOT split multi-item requests across turns. 4. **TOOLS**: You MAY call any tools listed in ""# TOOLS (AVAILABLE)"". -5. **ANTI-HALLUCINATION**: Never invent tools, parameters, defNames, coordinates, or tool results. If a tool is needed but not available, use and proceed to the next phase. -"; +5. **ANTI-HALLUCINATION**: Never invent tools, parameters, defNames, coordinates, or tool results. If a tool is needed but not available, use and proceed to the next phase."; public AIIntelligenceCore(World world) : base(world) { @@ -517,17 +512,7 @@ You are 'The Legion', a super AI of the Wula Empire. Your personality is authori } private string GetSystemInstruction(bool toolsEnabled, string toolsForThisPhase) { - var settings = WulaFallenEmpireMod.settings; - string persona; - if (settings != null && !string.IsNullOrWhiteSpace(settings.extraPersonalityPrompt)) - { - persona = settings.extraPersonalityPrompt; - } - else - { - var def = GetActiveEventDef(); - persona = def != null && !string.IsNullOrEmpty(def.aiSystemInstruction) ? def.aiSystemInstruction : DefaultPersona; - } + string persona = GetActivePersona(); string fullInstruction = toolsEnabled ? (persona + "\n" + ToolRulesInstruction + "\n" + toolsForThisPhase) @@ -553,7 +538,17 @@ 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() + public string GetActivePersona() + { + var settings = WulaFallenEmpireMod.settings; + if (settings != null && !string.IsNullOrWhiteSpace(settings.extraPersonalityPrompt)) + { + return settings.extraPersonalityPrompt; + } + return GetDefaultPersona(); + } + + public string GetDefaultPersona() { var def = GetActiveEventDef(); return def != null && !string.IsNullOrEmpty(def.aiSystemInstruction) ? def.aiSystemInstruction : DefaultPersona; @@ -992,8 +987,7 @@ You are 'The Legion', a super AI of the Wula Empire. Your personality is authori { _queryRetryUsed = true; string lastUserMessage = _history.LastOrDefault(entry => entry.role == "user").message ?? ""; - var def = GetActiveEventDef(); - string persona = def != null && !string.IsNullOrEmpty(def.aiSystemInstruction) ? def.aiSystemInstruction : DefaultPersona; + string persona = GetActivePersona(); string retryInstruction = persona + "\n\n# RETRY DECISION\n" + "No successful tool calls occurred in PHASE 1 (Query).\n" + @@ -1093,8 +1087,7 @@ You are 'The Legion', a super AI of the Wula Empire. Your personality is authori { _actionRetryUsed = true; string lastUserMessage = _history.LastOrDefault(entry => entry.role == "user").message ?? ""; - var def = GetActiveEventDef(); - string persona = def != null && !string.IsNullOrEmpty(def.aiSystemInstruction) ? def.aiSystemInstruction : DefaultPersona; + string persona = GetActivePersona(); string retryInstruction = persona + "\n\n# RETRY DECISION\n" + "No successful action tools occurred in PHASE 2 (Action).\n" + diff --git a/Source/WulaFallenEmpire/EventSystem/AI/UI/Dialog_ExtraPersonalityPrompt.cs b/Source/WulaFallenEmpire/EventSystem/AI/UI/Dialog_ExtraPersonalityPrompt.cs index 36d8721a..3f2fed51 100644 --- a/Source/WulaFallenEmpire/EventSystem/AI/UI/Dialog_ExtraPersonalityPrompt.cs +++ b/Source/WulaFallenEmpire/EventSystem/AI/UI/Dialog_ExtraPersonalityPrompt.cs @@ -25,7 +25,7 @@ namespace WulaFallenEmpire.EventSystem.AI.UI var core = Find.World?.GetComponent(); if (core != null) { - _tempPrompt = core.GetEffectiveBasePersona(); + _tempPrompt = core.GetDefaultPersona(); } } } @@ -60,7 +60,7 @@ namespace WulaFallenEmpire.EventSystem.AI.UI var core = Find.World?.GetComponent(); if (core != null) { - _tempPrompt = core.GetEffectiveBasePersona(); + _tempPrompt = core.GetDefaultPersona(); } } }