Chat: User-Nachrichten [Datei:]-Tags als klickbare Chips rendern, System-Prompt mit Workspace-Pfad und Leerzeilen-Hinweis erweitern
This commit is contained in:
1 parent
bba82aad7e
commit
3cb468f4e8
5 files changed
+75
-4
No files matched your search
@@ -78,15 +78,32 @@ public static class ChatEndpoint
|
||||
|
||||
var promptParts = new List<string>();
|
||||
promptParts.Add($"Du bist {agent.Name}.");
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(agent.Persona))
|
||||
{
|
||||
promptParts.Add($"## Persona\n{agent.Persona}");
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(agent.Instructions))
|
||||
{
|
||||
promptParts.Add($"## Instructions\n{agent.Instructions}");
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(session.Workspace))
|
||||
promptParts.Add("## Tools\nDu hast Tools zur Verfügung (read_file, write_file, edit_file, list_files, delete_file, execute). Benutze sie um Dateien zu lesen, schreiben und bearbeiten. Beschreibe NICHT was du tun würdest - tu es einfach über die Tools.");
|
||||
{
|
||||
promptParts.Add(@$"## Tools
|
||||
Du hast Tools zur Verfügung (read_file, write_file, edit_file, list_files, delete_file, execute). Benutze sie um Dateien zu lesen, schreiben und bearbeiten.
|
||||
|
||||
Der Workspace-Pfad ist: `{session.Workspace}`
|
||||
Alle Dateipfade in Tool-Aufrufen müssen relativ zu diesem Workspace sein oder absolute Pfade verwenden, die mit diesem Pfad beginnen.
|
||||
|
||||
Wenn der User auf eine bestimmte Zeile in einer Datei verweist (z.B. `[Datei: foo.txt:11]`), zähle Leerzeilen immer mit. Verwende `cat -n` oder ein ähnliches Tool um Zeilennummern exakt zu bestimmen - NIEMALS Leerzeilen beim Zählen überspringen.");
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(session.Context))
|
||||
{
|
||||
promptParts.Add($"## Kontext\n{session.Context}");
|
||||
}
|
||||
|
||||
var systemPromptText = string.Join("\n\n", promptParts);
|
||||
|
||||
|
||||
Reference in new issue
Block a user