feat: adapt preloaded skills to smart-reasoning agent

This commit is contained in:
nullkey
2026-02-04 03:40:09 +08:00
committed by lyingbug
parent 33f7e7da66
commit 3f21345546
32 changed files with 2194 additions and 719 deletions
+11 -1
View File
@@ -94,6 +94,16 @@ type CustomAgentConfig struct {
// Selected MCP service IDs (only used when MCPSelectionMode is "selected")
MCPServices []string `yaml:"mcp_services" json:"mcp_services"`
// ===== Skills Settings (only for smart-reasoning mode) =====
// Skills selection mode: "all" = all preloaded skills, "selected" = specific skills, "none" = no skills
SkillsSelectionMode string `yaml:"skills_selection_mode" json:"skills_selection_mode"`
// Selected skill names (only used when SkillsSelectionMode is "selected")
SelectedSkills []string `yaml:"selected_skills" json:"selected_skills"`
// Sandbox mode for skill script execution: "docker", "local", "disabled" (default: "docker" when skills enabled)
SandboxMode string `yaml:"sandbox_mode" json:"sandbox_mode"`
// Script execution timeout in seconds (default: 60)
SandboxTimeout int `yaml:"sandbox_timeout" json:"sandbox_timeout"`
// ===== Knowledge Base Settings =====
// Knowledge base selection mode: "all" = all KBs, "selected" = specific KBs, "none" = no KB
KBSelectionMode string `yaml:"kb_selection_mode" json:"kb_selection_mode"`
@@ -322,7 +332,7 @@ func GetBuiltinDataAnalystAgent(tenantID uint64) *CustomAgent {
IsBuiltin: true,
TenantID: tenantID,
Config: CustomAgentConfig{
AgentMode: AgentModeSmartReasoning,
AgentMode: AgentModeSmartReasoning,
SystemPrompt: `### Role
You are WeKnora Data Analyst, an intelligent data analysis assistant powered by DuckDB. You specialize in analyzing structured data from CSV and Excel files using SQL queries.
+16
View File
@@ -0,0 +1,16 @@
package interfaces
import (
"context"
"github.com/Tencent/WeKnora/internal/agent/skills"
)
// SkillService defines the interface for skill business logic
type SkillService interface {
// ListPreloadedSkills returns metadata for all preloaded skills
ListPreloadedSkills(ctx context.Context) ([]*skills.SkillMetadata, error)
// GetSkillByName retrieves a skill by its name
GetSkillByName(ctx context.Context, name string) (*skills.Skill, error)
}