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

@@ -123,8 +123,14 @@ AI_CREDENTIAL_ENCRYPTION_KEY = os.getenv("AI_CREDENTIAL_ENCRYPTION_KEY", "")
INTERNAL_MCP_TOKEN = os.getenv("INTERNAL_MCP_TOKEN", "")
METRICS_TOKEN = os.getenv("METRICS_TOKEN", "")
AI_RUN_RETENTION_DAYS = int(os.getenv("AI_RUN_RETENTION_DAYS", "90"))
MODEL_INVOCATION_DIAGNOSTIC_RETENTION_DAYS = int(
os.getenv("MODEL_INVOCATION_DIAGNOSTIC_RETENTION_DAYS", "90")
)
AI_SLOW_RUN_THRESHOLD_SECONDS = int(os.getenv("AI_SLOW_RUN_THRESHOLD_SECONDS", "20"))
AI_AGENT_MODEL_TIMEOUT_SECONDS = int(os.getenv("AI_AGENT_MODEL_TIMEOUT_SECONDS", "60"))
AI_STRUCTURED_OUTPUT_REPAIR_ALERT_THRESHOLD = float(
os.getenv("AI_STRUCTURED_OUTPUT_REPAIR_ALERT_THRESHOLD", "0.2")
)
KNOWLEDGE_EMBEDDING_DEPLOYMENT_ID = int(
os.getenv("KNOWLEDGE_EMBEDDING_DEPLOYMENT_ID", "0")
)
@@ -152,6 +158,10 @@ TICKET_AUTO_RESOLVE_ENABLED = (
TICKET_AUTO_RESOLVE_MIN_SCORE = float(
os.getenv("TICKET_AUTO_RESOLVE_MIN_SCORE", "0.85")
)
TICKET_AUTOMATION_ENABLED = os.getenv("TICKET_AUTOMATION_ENABLED", "false").lower() == "true"
TICKET_AUTOMATION_MAX_RETRIES = int(os.getenv("TICKET_AUTOMATION_MAX_RETRIES", "2"))
TICKET_AUTO_CLOSE_HOURS = int(os.getenv("TICKET_AUTO_CLOSE_HOURS", "24"))
SUPPORT_REFERENCE_MIN_SCORE = float(os.getenv("SUPPORT_REFERENCE_MIN_SCORE", "0.35"))
WORK_ITEM_DEFAULT_SLA_HOURS = int(os.getenv("WORK_ITEM_DEFAULT_SLA_HOURS", "24"))
WORK_ITEM_INTAKE_FAILURE_SLA_HOURS = int(
os.getenv("WORK_ITEM_INTAKE_FAILURE_SLA_HOURS", "4")
@@ -188,6 +198,14 @@ MINIO_BUCKET = os.getenv("MINIO_BUCKET", "ai-ticket-platform")
MINIO_SECURE = os.getenv("MINIO_SECURE", "false").lower() == "true"
CELERY_BEAT_SCHEDULE = {
"close-due-ticket-automations": {
"task": "apps.tickets.tasks.close_due_ticket_automations",
"schedule": 300.0,
},
"scrub-expired-model-invocation-diagnostics": {
"task": "apps.modelhub.tasks.scrub_expired_model_invocation_diagnostics",
"schedule": 86400.0,
},
"cleanup-expired-agent-runs": {
"task": "apps.agents.tasks.cleanup_expired_agent_runs",
"schedule": 86400.0,

View File

@@ -14,6 +14,7 @@ from apps.skills.api import router as skills_router
from apps.solutions.api import router as solutions_router
from apps.system.api import router as system_router
from apps.tickets.api import router as tickets_router
from apps.tickets.automation_api import router as ticket_automation_runs_router
from apps.tickets.draft_api import router as ticket_drafts_router
from apps.tools.api import router as tools_router
from apps.tools.mcp_gateway import internal_mcp_view
@@ -25,6 +26,7 @@ api.add_router("/identity", identity_router)
api.add_router("/system", system_router)
api.add_router("/audit", audit_router)
api.add_router("/tickets", tickets_router)
api.add_router("/ticket-automation-runs", ticket_automation_runs_router)
api.add_router("/ticket-drafts", ticket_drafts_router)
api.add_router("/tasks", work_items_router)
api.add_router("/solutions", solutions_router)