Skip to content

feat(AI Summary): Allow author to edit system prompt#2300

Open
hirokiterashima wants to merge 5 commits intoorganize-activity-advanced-authoring-using-tabsfrom
ai-summary-override-default-system-prompt
Open

feat(AI Summary): Allow author to edit system prompt#2300
hirokiterashima wants to merge 5 commits intoorganize-activity-advanced-authoring-using-tabsfrom
ai-summary-override-default-system-prompt

Conversation

@hirokiterashima
Copy link
Copy Markdown
Member

This PR allows authors to edit the default summarization system prompts for OR and Discussion components.

Changes

  • Show a textarea in the Advanced component authoring > "AI" tab for OR and Discussion components.
    • If this is your first time, the default summary system prompt should appear.
    • You can edit the system prompt. It should save automatically
  • Use variables $QUESTION$ and $RESPONSE_FORMAT$ in the system prompt. They will be replaced by the component's prompt and the expected response format for each component type before the prompt is sent to the LLM.

Test Prep

  • Enable AI for the project by adding project.ai.enabled = true
{
...
"ai": {"enabled": true },
...

Test

  • Units with AI disabled should not show the textarea
  • Units with AI enabled
    • Should show the text area and let you overwrite the system prompt, as described above
    • If author edited the system prompt, it the Teacher Tools should use the edited system prompt when summarizing student. Otherwise, it should use the default system prompt.

…scussion componens in the advanced authoring view's AI tab. Also introduced $QUESTION$ and $RESPONSE_FORMAT$ variables
@hirokiterashima hirokiterashima self-assigned this Apr 6, 2026
@hirokiterashima hirokiterashima added the enhancement New feature of any size or improvement (UI, performance, security) label Apr 6, 2026
@qltysh
Copy link
Copy Markdown

qltysh bot commented Apr 6, 2026

Qlty

Coverage Impact

⬇️ Merging this pull request will decrease total coverage on organize-activity-advanced-authoring-using-tabs by 0.03%.

Modified Files with Diff Coverage (7)

RatingFile% DiffUncovered Line #s
Coverage rating: C Coverage rating: C
src/assets/wise5/components/discussion/discussionService.ts100.0%
Coverage rating: A Coverage rating: A
...open-response-ai-summary/open-response-ai-summary.component.ts75.0%26
Coverage rating: A Coverage rating: A
src/assets/wise5/components/openResponse/openResponseService.ts100.0%
Coverage rating: A Coverage rating: A
...ves/teacher-summary-display/ai-summary/ai-summary.component.ts100.0%
Coverage rating: F Coverage rating: F
...splay/discussion-ai-summary/discussion-ai-summary.component.ts33.3%29-32
Coverage rating: D Coverage rating: D
...l/edit-advanced-component/edit-advanced-component.component.ts40.0%29-31, 39-41
New file Coverage rating: A
...em-prompt/edit-component-summarizer-system-prompt.component.ts100.0%
Total71.0%
🤖 Increase coverage with AI coding...

In the `ai-summary-override-default-system-prompt` branch, add test coverage for this new code:

- `src/app/authoring-tool/edit-advanced-component/edit-advanced-component.component.ts` -- Lines 29-31 and 39-41
- `src/assets/wise5/directives/teacher-summary-display/discussion-ai-summary/discussion-ai-summary.component.ts` -- Line 29-32
- `src/assets/wise5/directives/teacher-summary-display/open-response-ai-summary/open-response-ai-summary.component.ts` -- Line 26

🚦 See full report on Qlty Cloud »

🛟 Help
  • Diff Coverage: Coverage for added or modified lines of code (excludes deleted files). Learn more.

  • Total Coverage: Coverage for the whole repository, calculated as the sum of all File Coverage. Learn more.

  • File Coverage: Covered Lines divided by Covered Lines plus Missed Lines. (Excludes non-executable lines including blank lines and comments.)

    • Indirect Changes: Changes to File Coverage for files that were not modified in this PR. Learn more.

@hirokiterashima hirokiterashima changed the base branch from develop to organize-activity-advanced-authoring-using-tabs April 6, 2026 19:05
@hirokiterashima hirokiterashima requested a review from breity April 6, 2026 19:06
@hirokiterashima hirokiterashima marked this pull request as ready for review April 6, 2026 20:02
…i-summary-override-default-system-prompt

~ Conflicts:
~	src/messages.xlf
…i-summary-override-default-system-prompt

~ Conflicts:
~	src/messages.xlf
…i-summary-override-default-system-prompt

~ Conflicts:
~	src/messages.xlf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature of any size or improvement (UI, performance, security)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant