This repository was archived by the owner on Sep 3, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 641
refactor(ai): adds customizable AI prompts and uses structured output #6157
Merged
whitdog47
merged 18 commits into
main
from
refactor/ai-use-cases-to-use-structured-output
Jul 31, 2025
Merged
refactor(ai): adds customizable AI prompts and uses structured output #6157
whitdog47
merged 18 commits into
main
from
refactor/ai-use-cases-to-use-structured-output
Jul 31, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>
mvilanova
approved these changes
Jul 31, 2025
…s://github.com/Netflix/dispatch into refactor/ai-use-cases-to-use-structured-output
Contributor
There was a problem hiding this 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_parseinstead 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
removeaction is accessingstate.selected.idinstead of using thestateparameter from the function signature. This should beawait PromptApi.delete(state.selected.id)but the function signature doesn't includestateas a parameter.
)
…s://github.com/Netflix/dispatch into refactor/ai-use-cases-to-use-structured-output
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.