mirror of
https://github.com/discourse/discourse-ai.git
synced 2025-02-13 15:04:43 +00:00
- 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.
24 lines
612 B
JavaScript
24 lines
612 B
JavaScript
export default {
|
|
resource: "admin.adminPlugins.show",
|
|
|
|
path: "/plugins",
|
|
|
|
map() {
|
|
this.route("discourse-ai-personas", { path: "ai-personas" }, function () {
|
|
this.route("new");
|
|
this.route("show", { path: "/:id" });
|
|
});
|
|
|
|
this.route("discourse-ai-llms", { path: "ai-llms" }, function () {
|
|
this.route("new");
|
|
this.route("show", { path: "/:id" });
|
|
});
|
|
|
|
this.route("discourse-ai-tools", { path: "ai-tools" }, function () {
|
|
this.route("new");
|
|
this.route("show", { path: "/:id" });
|
|
});
|
|
this.route("discourse-ai-usage", { path: "ai-usage" });
|
|
},
|
|
};
|