feat: 收口通知原因语义与留痕校验
This commit is contained in:
@@ -5,6 +5,9 @@ from apps.documents.models import SubmissionBatch
|
||||
from .models import AgentAuditLog, NotificationRecord
|
||||
|
||||
|
||||
SUPPORTED_NOTIFY_REASONS = {"task_completed", "task_failed"}
|
||||
|
||||
|
||||
def create_audit_log(
|
||||
scenario_id: str,
|
||||
scenario_name: str,
|
||||
@@ -84,6 +87,8 @@ def create_notification_record(
|
||||
V1 先把通知载荷和结果状态稳定落库,
|
||||
真实飞书发送可在后续阶段接入。
|
||||
"""
|
||||
if notify_reason not in SUPPORTED_NOTIFY_REASONS:
|
||||
raise ValueError(f"notify_reason 不受支持:{notify_reason}")
|
||||
return NotificationRecord.objects.create(
|
||||
batch_id=batch_id,
|
||||
conversation_id=conversation_id,
|
||||
|
||||
Reference in New Issue
Block a user