bc0657f478
- Added a new admin interface to track AI usage metrics, including tokens, features, and models. - Introduced a new route `/admin/plugins/discourse-ai/ai-usage` and supporting API endpoint in `AiUsageController`. - Implemented `AiUsageSerializer` for structuring AI usage data. - Integrated CSS stylings for charts and tables under `stylesheets/modules/llms/common/usage.scss`. - Enhanced backend with `AiApiAuditLog` model changes: added `cached_tokens` column (implemented with OpenAI for now) with relevant DB migration and indexing. - Created `Report` module for efficient aggregation and filtering of AI usage metrics. - Updated AI Bot title generation logic to log correctly to user vs bot - Extended test coverage for the new tracking features, ensuring data consistency and access controls. |
||
---|---|---|
.. | ||
ai_api_audit_log_serializer.rb | ||
ai_chat_channel_serializer.rb | ||
ai_custom_tool_list_serializer.rb | ||
ai_custom_tool_serializer.rb | ||
ai_tool_serializer.rb | ||
ai_topic_summary_serializer.rb | ||
ai_usage_serializer.rb | ||
llm_model_serializer.rb | ||
localized_ai_persona_serializer.rb | ||
reviewable_ai_chat_message_serializer.rb | ||
reviewable_ai_post_serializer.rb |