wip deepseek
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user