wip deepseek

This commit is contained in:
2026-07-07 16:42:42 +02:00
parent 00c67dd66a
commit 9555423f51
12 changed files with 2871 additions and 13 deletions
+21
View File
@@ -23,6 +23,27 @@ namespace AnotherReplayReader.Utils
AiPromptSettings? promptSettings = null)
{
var defaultPrompt = BuildDefaultSystemPrompt(replay, players);
// Try loading from knowledge_{mod}.md file (generated by tools/expand_knowledge.py).
// If the file exists, use it instead of the built-in string.
var modName = replay.Mod.ModName?.ToLowerInvariant();
var knowledgeModName = modName switch
{
"corona" => "corona",
_ => "default",
};
var knowledgePath = Path.Combine(AppContext.BaseDirectory, $"knowledge_{knowledgeModName}.md");
if (File.Exists(knowledgePath))
{
var factionNames = players
.Select(kv => ModData.GetFaction(replay.Mod, kv.Value.FactionId).Name)
.Distinct()
.ToArray();
var mapId = Path.GetFileNameWithoutExtension(replay.MapPath);
var knowledge = KnowledgeSet.ForMod(knowledgeModName, AppContext.BaseDirectory);
defaultPrompt = knowledge.RenderAsPrompt(factionNames, mapId);
}
return ComposeSystemPrompt(defaultPrompt, promptSettings);
}