feat: init commint

This commit is contained in:
2026-09-18 15:26:19 +08:00
parent 3b61a767a0
commit 9f47dbb5cc
95 changed files with 7712 additions and 1137 deletions

View File

@@ -5,6 +5,7 @@ from django.utils import timezone
from apps.agents.models import AgentDefinition, AgentStepBinding, AgentVersion
from apps.modelhub.models import ModelDeployment
from apps.skills.models import SkillDefinition, SkillVersion
from apps.skills.services import validate_skill_version
SKILLS = [
{
@@ -29,6 +30,7 @@ SKILLS = [
"symptoms": {"type": "array", "items": {"type": "string"}},
},
"required": ["summary", "symptoms"],
"additionalProperties": False,
},
},
{
@@ -54,6 +56,7 @@ SKILLS = [
"steps": {"type": "array", "items": {"type": "string"}},
},
"required": ["likely_cause", "steps"],
"additionalProperties": False,
},
},
{
@@ -75,13 +78,16 @@ SKILLS = [
"type": "object",
"properties": {"reply": {"type": "string"}},
"required": ["reply"],
"additionalProperties": False,
},
},
]
DEMO_AGENT_CODE = "support-analysis-demo"
class Command(BaseCommand):
help = "Seed the technical support analysis Agent and its published Skills."
help = "Seed an isolated technical support analysis demo Agent and its published Skills."
def add_arguments(self, parser):
parser.add_argument("--deployment-id", type=int)
@@ -116,14 +122,15 @@ class Command(BaseCommand):
example_input={},
published_at=timezone.now(),
)
validate_skill_version(version)
definition.active_version = version
definition.save(update_fields=["active_version", "updated_at"])
versions[spec["code"]] = version
definition, _ = AgentDefinition.objects.get_or_create(
code="support-analysis",
code=DEMO_AGENT_CODE,
defaults={
"name": "技术支持分析 Agent",
"name": "技术支持分析演示 Agent",
"description": "结构化问题、生成排查建议和客户回复草稿。",
},
)