feat: Add system prompt template support and placeholder functionality

- Introduced a new PlaceholderDefinition interface to manage available placeholders for system prompts.
- Enhanced AgentSettings.vue to allow users to configure system prompts with dynamic placeholders, improving user experience.
- Updated the AgentConfig structure to include a system prompt field, enabling custom prompt templates.
- Modified backend components to support the new system prompt template, ensuring compatibility with existing configurations.
- Implemented logic for rendering placeholders in the system prompt, allowing for dynamic content generation based on user input.
This commit is contained in:
wizardchen
2025-11-09 23:17:39 +08:00
parent 77b6133e2a
commit 1313f4dfbb
7 changed files with 736 additions and 100 deletions
@@ -144,6 +144,9 @@ func (s *agentService) CreateAgentEngine(
}
}
// Get system prompt template from config (use default if empty)
systemPromptTemplate := config.SystemPrompt
// Create engine with provided EventBus and contextManager
engine := agent.NewAgentEngine(
config,
@@ -154,6 +157,7 @@ func (s *agentService) CreateAgentEngine(
kbInfos,
contextManager,
sessionID,
systemPromptTemplate,
)
return engine, nil