feat: Anweisungen-Feld für Agents mit EasyMDE-Editor
- AgentRecord: TaskInstruction (string, nullable) - DB-Migration: task_instruction TEXT Spalte - AgentEndpoint: Create/Update lesen taskInstruction - SystemPromptBuilder: '## Anweisungen' Block nach Soul, nur wenn nicht leer - HTML: Textarea #agentTaskInstruction nach Rückfragen-Checkbox - agent-page.js: EasyMDE-Editor mit Init, Laden, Speichern, Destroy
This commit is contained in:
1 parent
14e721f95b
commit
4f027360fd
6 files changed
+39
-5
No files matched your search
@@ -179,6 +179,7 @@ public class DatabaseService
|
||||
TryAddColumn(conn, "agents", "avatar_offset_y", "REAL NOT NULL DEFAULT 0");
|
||||
TryAddColumn(conn, "sessions", "finalizer_agent_id", "TEXT");
|
||||
TryAddColumn(conn, "agents", "allow_user_choice", "INTEGER NOT NULL DEFAULT 1");
|
||||
TryAddColumn(conn, "agents", "task_instruction", "TEXT");
|
||||
TryAddColumn(conn, "chains", "plan_mode", "INTEGER NOT NULL DEFAULT 0");
|
||||
TryAddColumn(conn, "sessions", "preparer_agent_id", "TEXT");
|
||||
TryAddColumn(conn, "messages", "tag", "TEXT");
|
||||
@@ -334,8 +335,8 @@ public class DatabaseService
|
||||
agent.CreatedAt = now;
|
||||
agent.UpdatedAt = now;
|
||||
await conn.ExecuteAsync(@"
|
||||
INSERT INTO agents (agent_id, user_id, name, avatar, description, model, tool_choice, custom_commands, auto_commit, use_soul, use_identity, use_user_info, use_memory, use_web_search, web_search_version, allow_user_choice, avatar_scale, avatar_offset_x, avatar_offset_y, is_deleted, created_at, updated_at)
|
||||
VALUES (@AgentId, @UserId, @Name, @Avatar, @Description, @Model, @ToolChoice, @CustomCommands, @AutoCommit, @UseSoul, @UseIdentity, @UseUserInfo, @UseMemory, @UseWebSearch, @WebSearchVersion, @AllowUserChoice, @AvatarScale, @AvatarOffsetX, @AvatarOffsetY, 0, @CreatedAt, @UpdatedAt)
|
||||
INSERT INTO agents (agent_id, user_id, name, avatar, description, model, tool_choice, custom_commands, auto_commit, use_soul, use_identity, use_user_info, use_memory, use_web_search, web_search_version, allow_user_choice, task_instruction, avatar_scale, avatar_offset_x, avatar_offset_y, is_deleted, created_at, updated_at)
|
||||
VALUES (@AgentId, @UserId, @Name, @Avatar, @Description, @Model, @ToolChoice, @CustomCommands, @AutoCommit, @UseSoul, @UseIdentity, @UseUserInfo, @UseMemory, @UseWebSearch, @WebSearchVersion, @AllowUserChoice, @TaskInstruction, @AvatarScale, @AvatarOffsetX, @AvatarOffsetY, 0, @CreatedAt, @UpdatedAt)
|
||||
", agent);
|
||||
return agent;
|
||||
}
|
||||
@@ -363,7 +364,7 @@ public class DatabaseService
|
||||
model = @Model, tool_choice = @ToolChoice,
|
||||
custom_commands = @CustomCommands, auto_commit = @AutoCommit,
|
||||
use_soul = @UseSoul, use_identity = @UseIdentity, use_user_info = @UseUserInfo, use_memory = @UseMemory, use_web_search = @UseWebSearch, web_search_version = @WebSearchVersion,
|
||||
allow_user_choice = @AllowUserChoice,
|
||||
allow_user_choice = @AllowUserChoice, task_instruction = @TaskInstruction,
|
||||
avatar_scale = @AvatarScale, avatar_offset_x = @AvatarOffsetX, avatar_offset_y = @AvatarOffsetY, updated_at = @UpdatedAt
|
||||
WHERE agent_id = @AgentId AND user_id = @UserId
|
||||
", agent);
|
||||
|
||||
@@ -39,6 +39,12 @@ public static class SystemPromptBuilder
|
||||
blocks.Add(new PromptBlock { Icon = "fa-heart", Label = "Agent · SOUL.md (UseSoul)", Content = soul });
|
||||
}
|
||||
|
||||
// Anweisungen
|
||||
if (!string.IsNullOrWhiteSpace(agent.TaskInstruction))
|
||||
{
|
||||
blocks.Add(new PromptBlock { Icon = "fa-clipboard", Label = "Agent · Anweisungen", Content = $"## Anweisungen\n{agent.TaskInstruction.Trim()}" });
|
||||
}
|
||||
|
||||
// User-Info: Persona aus dem Profil des Users der gerade schreibt
|
||||
if (agent.UseUserInfo && !string.IsNullOrWhiteSpace(userPersona))
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user