Skip to content

Feat/custom system prompts - #437

Merged
edward-ly merged 7 commits into
nextcloud:mainfrom
astkwcz:feat/custom-system-prompts
Oct 26, 2026
Merged

edward-ly merged 7 commits into
nextcloud:mainfrom
astkwcz:feat/custom-system-prompts

Conversation

@astkwcz

@astkwcz astkwcz commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Configurable system prompts for summary and translation tasks

Earlier work:

Related work:
There is already merged functionality for configurable system prompts set by admin #433 (@Abhijeet-035, @lukasdotcom) introduces that, so I think that I should explain myself and my work a little, considering SummaryProvider
I started working on this PR before #433 was merged, so those two PRs overlap. I implemented the prompt per service using ServiceConfig which is why instance-wide setting from #433 is reverted. I reverted it to keep one place in UI instead of two. I am happy to keep global default as fallback if you prefer.

Summary system prompts

There are 3 types of system prompts configuration:

  • user system prompt (Advanced options in Assistant UI)
  • admin system prompt (that can be set in Admin Settings > Assistant)
  • default system prompt (hard-coded in repo: You are a helpful assistant that summarizes text in the same language as the text. You should only return the summary without any additional information.

How it works:

  • user system prompt (if set) overrides admin system prompt (if set) and default system prompt . It also ignores format and complexity options. The idea is that user knows what they want and the can define thiers output format however they wants
  • admin system prompt (if set) overwrites default system prompt and can be overwritten by user system prompt (if set). It appends format and complexity option, so the idea is that prompt should be more general and should not define format and complexity
  • default system prompt will be used only if user system prompt and admin system prompt are not set

Translation system prompt

I introduce that because I had troubles with translation. Sometimes model outputs only translated text and sometimes it outputs orginal text + translation line by line. It was not coherent

UI look

Admin system prompts for summarization and translation

image
  • Textareas are under the section System prompts
  • It is nested inside Text generation so if we toggle that off, System prompts will not be visible

User defined system prompt for summary

image

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

@edward-ly edward-ly left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hello, thanks a lot for tackling this! We've been discussing the changes internally, and while we agree that it would be nice for admins to be able to customize the system prompts, we're not sure if we can say the same for normal users. Not only does it add additional, unneeded complexity for users, we don't see any meaningful use cases for it either. Would you be able to remove the user part from this PR or, at the very least, split the user part into a separate PR and add more justifications to it?

@astkwcz

astkwcz commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

Hello, thanks a lot for tackling this! We've been discussing the changes internally, and while we agree that it would be nice for admins to be able to customize the system prompts, we're not sure if we can say the same for normal users. Not only does it add additional, unneeded complexity for users, we don't see any meaningful use cases for it either. Would you be able to remove the user part from this PR or, at the very least, split the user part into a separate PR and add more justifications to it?

@edward-ly Hi, thanks for your feedback. I removed user-defined summary system prompt option from this PR. I added a new PR #444 with user-defined summary system prompt option and justification - it is stacked on #437

@astkwcz
astkwcz requested a review from edward-ly October 9, 2026 11:55

@edward-ly edward-ly left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Works great in my testing so far! Just a few small changes and we can get this in. On top of my other comments, the initial revert commit is missing a sign-off trailer, so that should be fixed too.

Also, since this is your first contribution, I recommend reviewing our AI Contributions Policy in case you haven't seen it yet. I don't know for certain if you've used any AI assistance for this PR, but I would appreciate any disclosures if you did (or if you didn't, an explicit mention stating that).

Comment thread lib/Service/ServiceConfig.php Outdated
Comment thread lib/Service/ServiceConfig.php Outdated
Comment thread src/components/AdminSettings.vue
@github-actions

Copy link
Copy Markdown

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

@astkwcz

astkwcz commented Oct 12, 2026

Copy link
Copy Markdown
Contributor Author

Works great in my testing so far!

That's nice!

Just a few small changes and we can get this in.

I applied code changes that you suggested. What is more:

  • added sign-off to revert commit
  • added Assisted-by to commits affected by AI
  • added AI disclosure to PR description

@astkwcz
astkwcz requested a review from edward-ly October 12, 2026 12:06
This reverts commit f9dfdf8.

Signed-off-by: Arkadiusz Sitkiewicz <a.sitkiewicz@wbgroup.com>
…n/default

Assisted-by: OpenCode:DeepSeek-V4.1-Flash
Signed-off-by: Arkadiusz Sitkiewicz <a.sitkiewicz@wbgroup.com>
…dmin/default

Assisted-by: OpenCode:DeepSeek-V4.1-Flash
Signed-off-by: Arkadiusz Sitkiewicz <a.sitkiewicz@wbgroup.com>
…er/admin

Signed-off-by: Arkadiusz Sitkiewicz <a.sitkiewicz@wbgroup.com>
…pt - admin

Signed-off-by: Arkadiusz Sitkiewicz <a.sitkiewicz@wbgroup.com>
Signed-off-by: Arkadiusz Sitkiewicz <a.sitkiewicz@wbgroup.com>
…emove unrelevant doc-comments

Signed-off-by: Arkadiusz Sitkiewicz <a.sitkiewicz@wbgroup.com>
@edward-ly
edward-ly force-pushed the feat/custom-system-prompts branch from 11e7074 to b028591 Compare October 26, 2026 17:45

@edward-ly edward-ly left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey, sorry for not being able to get back to you earlier, but awesome work! I'll take care of rebasing the branch again at this point before merging. Thanks again!

@edward-ly

Copy link
Copy Markdown
Contributor

Some CI checks are failing due to some upstream errors, not related to this PR (all checks passed before the latest rebase).

@edward-ly
edward-ly merged commit 160fe3b into nextcloud:main Oct 26, 2026
21 of 25 checks passed
@astkwcz

astkwcz commented Oct 28, 2026

Copy link
Copy Markdown
Contributor Author

Hey, sorry for not being able to get back to you earlier, but awesome work! I'll take care of rebasing the branch again at this point before merging. Thanks again!

No problem at all. I would also want to thank you for working through this with me and helping me out 🤝 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants