Profil-Seite: Anzeigename, Passwort ändern, Persona (ersetzt USER.md)
- Neuer Menüpunkt 'Mein Profil' statt 'Logout' - Profil-Page: Anzeigename, Persona (Freitext), Passwort ändern, Logout - ProfileEndpoint: GET/PUT /api/profile, PUT /api/profile/password - User-Persona im System-Prompt statt USER.md (Fallback: Anzeigename/Username) - SystemPromptBuilder: dataDir-Parameter entfernt, userPersona-Parameter hinzugefügt - DB-Migration: persona-Spalte in users-Tabelle
This commit is contained in:
1 parent
f49c526384
commit
7149904ae4
12 files changed
+341
-26
No files matched your search
@@ -13,7 +13,7 @@ public class PromptBlock
|
||||
|
||||
public static class SystemPromptBuilder
|
||||
{
|
||||
public static List<PromptBlock> BuildBlocks(AgentRecord agent, SessionRecord session, IEnumerable<MessageRecord> markedMessages = null, MemoryService memoryService = null, string agentMemoryDir = null, string dataDir = null, IEnumerable<string> skillSlugs = null, SkillService skillService = null)
|
||||
public static List<PromptBlock> BuildBlocks(AgentRecord agent, SessionRecord session, IEnumerable<MessageRecord> markedMessages = null, MemoryService memoryService = null, string agentMemoryDir = null, IEnumerable<string> skillSlugs = null, SkillService skillService = null, string userPersona = null)
|
||||
{
|
||||
var blocks = new List<PromptBlock>();
|
||||
|
||||
@@ -39,19 +39,10 @@ public static class SystemPromptBuilder
|
||||
blocks.Add(new PromptBlock { Icon = "fa-heart", Label = "Agent · SOUL.md (UseSoul)", Content = soul });
|
||||
}
|
||||
|
||||
// USER.md
|
||||
if (agent.UseUserInfo && !string.IsNullOrWhiteSpace(dataDir))
|
||||
// User-Info: Persona aus dem Profil des Users der gerade schreibt
|
||||
if (agent.UseUserInfo && !string.IsNullOrWhiteSpace(userPersona))
|
||||
{
|
||||
var userFile = System.IO.Path.Combine(dataDir, "USER.md");
|
||||
if (System.IO.File.Exists(userFile))
|
||||
{
|
||||
var userContent = System.IO.File.ReadAllText(userFile);
|
||||
if (!string.IsNullOrWhiteSpace(userContent))
|
||||
{
|
||||
var absolutePath = System.IO.Path.GetFullPath(userFile);
|
||||
blocks.Add(new PromptBlock { Icon = "fa-user", Label = "Agent · USER.md (UseUserInfo)", Content = $"{userContent}\n\n_Pfad: `{absolutePath}`_" });
|
||||
}
|
||||
}
|
||||
blocks.Add(new PromptBlock { Icon = "fa-user", Label = "User · Persona (UseUserInfo)", Content = $"## Dein Gegenüber\nDie folgende Beschreibung stammt von der Person, die dir gerade schreibt:\n\n{userPersona}" });
|
||||
}
|
||||
|
||||
bool toolAny = string.Equals(agent.ToolChoice, "any", System.StringComparison.OrdinalIgnoreCase);
|
||||
@@ -233,9 +224,9 @@ Bei Zeilenreferenzen (z.B. `[Datei: foo.txt:11]`) IMMER `cat -n` verwenden um di
|
||||
return blocks;
|
||||
}
|
||||
|
||||
public static string Build(AgentRecord agent, SessionRecord session, IEnumerable<MessageRecord> markedMessages = null, MemoryService memoryService = null, string agentMemoryDir = null, string dataDir = null, IEnumerable<string> skillSlugs = null, SkillService skillService = null)
|
||||
public static string Build(AgentRecord agent, SessionRecord session, IEnumerable<MessageRecord> markedMessages = null, MemoryService memoryService = null, string agentMemoryDir = null, IEnumerable<string> skillSlugs = null, SkillService skillService = null, string userPersona = null)
|
||||
{
|
||||
var blocks = BuildBlocks(agent, session, markedMessages, memoryService, agentMemoryDir, dataDir, skillSlugs, skillService);
|
||||
var blocks = BuildBlocks(agent, session, markedMessages, memoryService, agentMemoryDir, skillSlugs, skillService, userPersona);
|
||||
return string.Join("\n\n", blocks.Select(b => b.Content));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user