Phase 3: Add token analytics reports (adapted for AIModelConfig)
This commit is contained in:
@@ -24,7 +24,10 @@ class Igny8AdminSite(UnfoldAdminSite):
|
||||
"""Get admin URLs with dashboard and reports available"""
|
||||
from django.urls import path
|
||||
from .dashboard import admin_dashboard
|
||||
from .reports import revenue_report, usage_report, content_report, data_quality_report
|
||||
from .reports import (
|
||||
revenue_report, usage_report, content_report, data_quality_report,
|
||||
token_usage_report, ai_cost_analysis
|
||||
)
|
||||
|
||||
urls = super().get_urls()
|
||||
custom_urls = [
|
||||
@@ -33,6 +36,8 @@ class Igny8AdminSite(UnfoldAdminSite):
|
||||
path('reports/usage/', self.admin_view(usage_report), name='report_usage'),
|
||||
path('reports/content/', self.admin_view(content_report), name='report_content'),
|
||||
path('reports/data-quality/', self.admin_view(data_quality_report), name='report_data_quality'),
|
||||
path('reports/token-usage/', self.admin_view(token_usage_report), name='report_token_usage'),
|
||||
path('reports/ai-cost-analysis/', self.admin_view(ai_cost_analysis), name='report_ai_cost'),
|
||||
]
|
||||
return custom_urls + urls
|
||||
|
||||
@@ -292,6 +297,20 @@ class Igny8AdminSite(UnfoldAdminSite):
|
||||
'view_only': True,
|
||||
'perms': {'view': True},
|
||||
},
|
||||
{
|
||||
'name': 'Token Usage Report',
|
||||
'object_name': 'TokenUsageReport',
|
||||
'admin_url': '/admin/reports/token-usage/',
|
||||
'view_only': True,
|
||||
'perms': {'view': True},
|
||||
},
|
||||
{
|
||||
'name': 'AI Cost Analysis',
|
||||
'object_name': 'AICostAnalysis',
|
||||
'admin_url': '/admin/reports/ai-cost-analysis/',
|
||||
'view_only': True,
|
||||
'perms': {'view': True},
|
||||
},
|
||||
],
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user