from django.contrib import admin

from .models import AiAssistantMessage, AiAssistantSession


@admin.register(AiAssistantSession)
class AiAssistantSessionAdmin(admin.ModelAdmin):
    list_display = ("uuid", "site_id", "mode", "status", "user", "created_at")
    list_filter = ("mode", "status", "site_id")
    search_fields = ("uuid", "visitor_id", "source_path")
    readonly_fields = ("uuid", "created_at", "updated_at", "metadata")


@admin.register(AiAssistantMessage)
class AiAssistantMessageAdmin(admin.ModelAdmin):
    list_display = ("id", "session", "role", "created_at")
    list_filter = ("role",)
    search_fields = ("content",)
    readonly_fields = ("created_at", "raw")
