from django.contrib import admin

from .models import AgentAuditLog, DemoBusinessRecord


@admin.register(AgentAuditLog)
class AgentAuditLogAdmin(admin.ModelAdmin):
    """便于在 Django Admin 中快速查看一次 Agent 执行的关键信息。"""
    list_display = ("id", "scenario_name", "status", "model_name", "latency_ms", "created_at")
    list_filter = ("status", "scenario_id")
    search_fields = ("scenario_id", "scenario_name", "user_input", "final_answer")


@admin.register(DemoBusinessRecord)
class DemoBusinessRecordAdmin(admin.ModelAdmin):
    """管理工具查询依赖的示例业务记录。"""
    list_display = ("id", "title", "scenario_id", "record_type", "created_at")
    list_filter = ("scenario_id", "record_type")
    search_fields = ("title", "scenario_id", "record_type")
