Skip to content

feat(ui): adds genai suggestions for tags #6073

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

whitdog47
Copy link
Contributor

This Pull Request introduces GenAI-powered tag suggestions to the existing TagPicker component, significantly enhancing the user experience by providing intelligent and context-aware recommendations for classifying incidents and cases.

Key Features & Enhancements

  • GenAI Integration: Connects the platform's backend to the artificial-intelligence plugin, enabling the generation of relevant tag suggestions for incidents and cases.
    • Contextual Suggestions: The AI analyzes incident/case details (title, description, resolution, type, and associated documents) and a predefined list of project tags to provide highly relevant recommendations.
    • Configurable Tag Types: A new genai_suggestions boolean field has been added to the TagType model, allowing admins to specify which tag types should be considered for AI suggestions.
  • Enhanced TagPicker UI: The TagPicker component has been updated to display these AI-generated suggestions in a user-friendly panel.
    • "Generate Suggestions" Button: A prominent button triggers the AI suggestion process.
    • Structured Recommendations: Suggestions are grouped by tag type, with each recommended tag including a reason for its suggestion.
    • Interactive Chips: Users can easily add suggested tags to their selection via clickable chips.
    • Loading and Error States: Clear visual indicators for when suggestions are being generated or if an error occurs.
    • Collapsible Panel: The suggestions panel can be collapsed for a cleaner interface.
  • New API Endpoints: Dedicated backend endpoints have been introduced to fetch AI tag recommendations for cases and incidents:
    • /api/v1/tag/recommendations/{project_id}/case/{case_id}
    • /api/v1/tag/recommendations/{project_id}/incident/{incident_id}
  • Vuex Store Refactor: The tag-related business logic, including fetching and managing suggestions, has been centralized and refactored within the Vuex store (src/dispatch/static/dispatch/src/tag/store.js). This improves maintainability and separation of concerns.
  • Tag Table Filtering: Added new filtering capabilities to the Tag Table, allowing users to filter tags by Tag Type and Discoverable status.
  • Suggestion Reset Logic: Ensures that AI suggestions are automatically reset when a different incident or case is selected, preventing stale recommendations.

Screenshots

genai-tag-suggestions-demo.mov

New attribute for each tag type:
image

@whitdog47 whitdog47 requested a review from Copilot June 20, 2025 17:08
@whitdog47 whitdog47 self-assigned this Jun 20, 2025
@whitdog47 whitdog47 added the enhancement New feature or request label Jun 20, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces GenAI-powered tag suggestions to the TagPicker component by integrating an AI plugin, updating both backend and frontend code to generate and display intelligent tag recommendations. Key changes include:

  • Adding a new "genai_suggestions" field to the TagType model and corresponding Pydantic schema.
  • Creating new API endpoints and updating the AI service to fetch tag recommendations.
  • Updating the Vuex store, UI components, and styles to handle and display the AI-generated suggestions.

Reviewed Changes

Copilot reviewed 16 out of 17 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/dispatch/tag_type/models.py Added a new Boolean field "genai_suggestions" to TagType and updated the Pydantic schema.
src/dispatch/tag/views.py Introduced new endpoints for fetching tag recommendations for cases and incidents.
src/dispatch/tag/models.py Added new Pydantic models to support tag recommendation responses.
src/dispatch/static/dispatch/src/tag_type/Table.vue Updated table slot templates including a new slot for GenAI suggestions.
src/dispatch/static/dispatch/src/tag_type/NewEditSheet.vue Added UI elements for enabling GenAI suggestions in tag type configurations.
src/dispatch/static/dispatch/src/tag/store.js Refactored Vuex store with actions and mutations to handle suggested tags and AI recommendations.
src/dispatch/static/dispatch/src/tag/api.js Updated API calls to support new endpoints for case and incident recommendations.
src/dispatch/static/dispatch/src/tag/TableFilterDialog.vue Introduced a new dialog component for improved tag filtering.
src/dispatch/static/dispatch/src/tag/Table.vue Updated table component to incorporate filtering changes and new syntax for slots.
src/dispatch/static/dispatch/src/styles/tagpicker.scss Added new styles for the GenAI suggestions panel and tag picker enhancements.
src/dispatch/database/service.py Enhanced filtering and pagination logic for handling DISTINCT queries on Tag models.
src/dispatch/ai/service.py Extended the AI service with a new method to generate tag recommendations using external AI resources.
src/dispatch/database/revisions/tenant/versions/2025-06-04_7fc3888c7b9a.py Added migration for the new "genai_suggestions" column.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant