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
+8
View File
@@ -13,6 +13,12 @@ export interface ToolDefinition {
description: string
}
export interface PlaceholderDefinition {
name: string
label: string
description: string
}
export interface AgentConfig {
enabled: boolean
max_iterations: number
@@ -22,7 +28,9 @@ export interface AgentConfig {
thinking_model_id: string
rerank_model_id: string
knowledge_bases?: string[]
system_prompt?: string // System prompt template with placeholders (optional)
available_tools?: ToolDefinition[] // GET 响应中包含,POST/PUT 不需要
available_placeholders?: PlaceholderDefinition[] // GET 响应中包含,POST/PUT 不需要
}
export function getSystemInfo(): Promise<{ data: SystemInfo }> {