feat(audit): 增加审计日志与演示数据管理
This commit is contained in:
46
apps/audit/migrations/0001_initial.py
Normal file
46
apps/audit/migrations/0001_initial.py
Normal file
@@ -0,0 +1,46 @@
|
||||
# Generated by Django 5.2.14 on 2026-05-29 13:39
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = []
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name="AgentAuditLog",
|
||||
fields=[
|
||||
(
|
||||
"id",
|
||||
models.BigAutoField(
|
||||
auto_created=True,
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
verbose_name="ID",
|
||||
),
|
||||
),
|
||||
("scenario_id", models.CharField(db_index=True, max_length=100)),
|
||||
("scenario_name", models.CharField(blank=True, max_length=200)),
|
||||
("user_input", models.TextField()),
|
||||
("retrieved_chunks", models.JSONField(blank=True, default=list)),
|
||||
("tool_calls", models.JSONField(blank=True, default=list)),
|
||||
("structured_output", models.JSONField(blank=True, default=dict)),
|
||||
("final_answer", models.TextField(blank=True)),
|
||||
("raw_output", models.TextField(blank=True)),
|
||||
("model_name", models.CharField(blank=True, max_length=100)),
|
||||
("latency_ms", models.PositiveIntegerField(default=0)),
|
||||
(
|
||||
"status",
|
||||
models.CharField(db_index=True, default="success", max_length=20),
|
||||
),
|
||||
("error_message", models.TextField(blank=True)),
|
||||
("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
|
||||
],
|
||||
options={
|
||||
"ordering": ["-created_at"],
|
||||
},
|
||||
),
|
||||
]
|
||||
35
apps/audit/migrations/0002_demobusinessrecord.py
Normal file
35
apps/audit/migrations/0002_demobusinessrecord.py
Normal file
@@ -0,0 +1,35 @@
|
||||
# Generated for V1 demo business records.
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("audit", "0001_initial"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name="DemoBusinessRecord",
|
||||
fields=[
|
||||
(
|
||||
"id",
|
||||
models.BigAutoField(
|
||||
auto_created=True,
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
verbose_name="ID",
|
||||
),
|
||||
),
|
||||
("scenario_id", models.CharField(db_index=True, max_length=100)),
|
||||
("record_type", models.CharField(db_index=True, max_length=100)),
|
||||
("title", models.CharField(max_length=255)),
|
||||
("payload", models.JSONField(blank=True, default=dict)),
|
||||
("created_at", models.DateTimeField(auto_now_add=True)),
|
||||
],
|
||||
options={
|
||||
"ordering": ["-created_at"],
|
||||
},
|
||||
),
|
||||
]
|
||||
0
apps/audit/migrations/__init__.py
Normal file
0
apps/audit/migrations/__init__.py
Normal file
Reference in New Issue
Block a user