Skip to content
This repository was archived by the owner on Sep 3, 2025. It is now read-only.

Conversation

@whitdog47
Copy link
Contributor

Creates a new "AI Prompts" settings table to allow for customized prompts for each of the current AI actions. Refactors the existing AI queries to use the new structured output approach.

image

@whitdog47 whitdog47 requested a review from Copilot July 25, 2025 22:07
@whitdog47 whitdog47 self-assigned this Jul 25, 2025
@whitdog47 whitdog47 added the enhancement New feature or request label Jul 25, 2025

This comment was marked as outdated.

@whitdog47 whitdog47 requested a review from Copilot July 25, 2025 22:55

This comment was marked as outdated.

@whitdog47 whitdog47 requested a review from mvilanova July 25, 2025 23:35
whitdog47 and others added 3 commits July 25, 2025 16:36
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: David Whittaker <84562015+whitdog47@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: David Whittaker <84562015+whitdog47@users.noreply.github.com>
@whitdog47 whitdog47 requested a review from aaronherman July 29, 2025 16:58
@whitdog47 whitdog47 requested a review from Copilot July 31, 2025 18:40
Copy link
Contributor

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 customizable AI prompts functionality by creating a new "AI Prompts" settings table and refactoring AI queries to use structured output. The changes enable users to configure custom prompts for different AI operations through a web interface while maintaining backward compatibility with default prompts.

  • Adds a new prompt management system with database storage, API endpoints, and UI components
  • Refactors AI service methods to use structured output via chat_parse instead of raw text parsing
  • Updates existing AI operations to check for custom prompts before falling back to defaults

Reviewed Changes

Copilot reviewed 20 out of 21 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/dispatch/static/dispatch/src/store.js Adds prompt store module to Vue.js store
src/dispatch/static/dispatch/src/router/config.js Adds routing for AI Prompts table component
src/dispatch/static/dispatch/src/prompt/store.js Implements Vuex store for prompt management with CRUD operations
src/dispatch/static/dispatch/src/prompt/api.js Provides API client methods for prompt operations
src/dispatch/static/dispatch/src/prompt/Table.vue Creates data table UI for viewing and managing prompts
src/dispatch/static/dispatch/src/prompt/NewEditSheet.vue Implements form component for creating/editing prompts
src/dispatch/static/dispatch/src/prompt/DeleteDialog.vue Adds confirmation dialog for prompt deletion
src/dispatch/plugins/dispatch_slack/incident/interactive.py Code formatting improvements for tactical report handling
src/dispatch/plugins/dispatch_slack/case/messages.py Updates signal analysis to use structured output format
src/dispatch/database/revisions/tenant/versions/2025-07-16_408118048599.py Database migration for new prompt table
src/dispatch/api.py Registers AI router for prompt API endpoints
src/dispatch/ai/strings.py Centralizes default prompt templates and system messages
src/dispatch/ai/service.py Refactors AI methods to use custom prompts and structured output
src/dispatch/ai/prompt/views.py Implements REST API endpoints for prompt management
src/dispatch/ai/prompt/service.py Provides database service layer for prompt operations
src/dispatch/ai/prompt/models.py Defines database and Pydantic models for prompts
src/dispatch/ai/prompt/__init__.py Package initialization file
src/dispatch/ai/models.py Adds structured models for AI responses
src/dispatch/ai/enums.py Defines GenAI types enum with display names
src/dispatch/__init__.py Imports Prompt model for database initialization
Comments suppressed due to low confidence (1)

src/dispatch/ai/service.py:163

  • The remove action is accessing state.selected.id instead of using the state parameter from the function signature. This should be await PromptApi.delete(state.selected.id) but the function signature doesn't include state as a parameter.
    )

@whitdog47 whitdog47 merged commit 2e4be14 into main Jul 31, 2025
14 checks passed
@whitdog47 whitdog47 deleted the refactor/ai-use-cases-to-use-structured-output branch July 31, 2025 21:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants