[PR #4451] [CLOSED] feat: add a global prompt #4629

Closed
opened 2026-02-22 18:36:13 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Mintplex-Labs/anything-llm/pull/4451
Author: @ArturTask
Created: 9/30/2025
Status: Closed

Base: masterHead: feature/3906


📝 Commits (3)

  • 81c95fc feat: add a global prompt
  • 1c46e27 refactoring + added rus values to locale
  • bbed5d2 Merge branch 'master' into feature/3906

📊 Changes

40 files changed (+732 additions, -321 deletions)

View changed files

📝 frontend/src/i18n.js (+5 -0)
📝 frontend/src/locales/ar/common.js (+7 -0)
📝 frontend/src/locales/da/common.js (+7 -0)
📝 frontend/src/locales/de/common.js (+7 -0)
📝 frontend/src/locales/en/common.js (+7 -0)
📝 frontend/src/locales/es/common.js (+7 -0)
📝 frontend/src/locales/et/common.js (+7 -0)
📝 frontend/src/locales/fa/common.js (+7 -0)
📝 frontend/src/locales/fr/common.js (+7 -0)
📝 frontend/src/locales/he/common.js (+7 -0)
📝 frontend/src/locales/it/common.js (+7 -0)
📝 frontend/src/locales/ja/common.js (+7 -0)
📝 frontend/src/locales/ko/common.js (+7 -0)
📝 frontend/src/locales/lv/common.js (+7 -0)
📝 frontend/src/locales/nl/common.js (+7 -0)
📝 frontend/src/locales/pl/common.js (+7 -0)
📝 frontend/src/locales/pt_BR/common.js (+7 -0)
📝 frontend/src/locales/ro/common.js (+7 -0)
📝 frontend/src/locales/ru/common.js (+277 -236)
📝 frontend/src/locales/tr/common.js (+7 -0)

...and 20 more files

📄 Description

Pull Request Type

  • feat

Relevant Issues

resolves #3906

What is in this change?

#3906

short description

adds default system prompt (locale dependent + all locale translations of previous default system prompt) + general (global) configurable system prompt for ALL workspaces (admin or manager may configure general system prompt instead of default one which will be used by default in all workspaces)

I tested the code on local machine + tested docker-compose version new changes work as planned

More specifically added:

  • configurable global system prompt (I called it "general_system_prompt")
  • default system prompt for all locales + changing it on server when changing locale on frontend
  • full rus localization

Additional Information

about me (just in case)

  • I'm JAVA BACKEND developer) not js, sorry if something is incorrect, I tried my best
  • I'm from Russia, again sorry for misspelling
  • I worked as full stack dev and had few little pet projects using React that's why I have some experience

new things

  • new component for configuring general system prompt ...components/GeneralSystemPrompt/index.jsx
  • 2 new util classes for retrieving general or default system prompt (systemPromptHelper.js on server) / sending default system prompt to server (systemPrompt.js on frontend)
  • 2 new system_settings: "general_system_prompt" and "default_system_prompt"
  • all locales have their own locale dependent default_system_prompt property customization.items.system-prompt.default + title and description

important changes:

  • I moved chatPrompt function (from index.js to systemPromptHelper.js) because of cyclic dependency (couldn't import SystemSettings.js to index.js)
  • 2 events on language setting and changing (in i18n.js) => frontend sends default system prompt to server

(unfortunately I found no other way because locale is located on frontend part, the only way to have locale dependent
default system prompt is to synchronise frontend and server, so
I decided to store it in DB in system_settings as default_system_prompt and change on language change

  • changed signature of function buildSystemPrompt in convertTo.js (now async)
  • I DIDN'T TEST csv downloadning, I just didn't find it

Developer Validations

  • I ran yarn lint from the root of the repo & committed changes
  • Relevant documentation has been updated
  • I have tested my code functionality
  • Docker build succeeds locally

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Mintplex-Labs/anything-llm/pull/4451 **Author:** [@ArturTask](https://github.com/ArturTask) **Created:** 9/30/2025 **Status:** ❌ Closed **Base:** `master` ← **Head:** `feature/3906` --- ### 📝 Commits (3) - [`81c95fc`](https://github.com/Mintplex-Labs/anything-llm/commit/81c95fc64a4f7452829150583ec4cf2f83f55e37) feat: add a global prompt - [`1c46e27`](https://github.com/Mintplex-Labs/anything-llm/commit/1c46e276fe7c90a653e4168daf40529855f32c56) refactoring + added rus values to locale - [`bbed5d2`](https://github.com/Mintplex-Labs/anything-llm/commit/bbed5d24fa985dcba2cb902c3147789d259096d2) Merge branch 'master' into feature/3906 ### 📊 Changes **40 files changed** (+732 additions, -321 deletions) <details> <summary>View changed files</summary> 📝 `frontend/src/i18n.js` (+5 -0) 📝 `frontend/src/locales/ar/common.js` (+7 -0) 📝 `frontend/src/locales/da/common.js` (+7 -0) 📝 `frontend/src/locales/de/common.js` (+7 -0) 📝 `frontend/src/locales/en/common.js` (+7 -0) 📝 `frontend/src/locales/es/common.js` (+7 -0) 📝 `frontend/src/locales/et/common.js` (+7 -0) 📝 `frontend/src/locales/fa/common.js` (+7 -0) 📝 `frontend/src/locales/fr/common.js` (+7 -0) 📝 `frontend/src/locales/he/common.js` (+7 -0) 📝 `frontend/src/locales/it/common.js` (+7 -0) 📝 `frontend/src/locales/ja/common.js` (+7 -0) 📝 `frontend/src/locales/ko/common.js` (+7 -0) 📝 `frontend/src/locales/lv/common.js` (+7 -0) 📝 `frontend/src/locales/nl/common.js` (+7 -0) 📝 `frontend/src/locales/pl/common.js` (+7 -0) 📝 `frontend/src/locales/pt_BR/common.js` (+7 -0) 📝 `frontend/src/locales/ro/common.js` (+7 -0) 📝 `frontend/src/locales/ru/common.js` (+277 -236) 📝 `frontend/src/locales/tr/common.js` (+7 -0) _...and 20 more files_ </details> ### 📄 Description ### Pull Request Type <!-- For change type, change [ ] to [x]. --> - [x] ✨ feat ### Relevant Issues <!-- Use "resolves #xxx" to auto resolve on merge. Otherwise, please use "connect #xxx" --> resolves #3906 ### What is in this change? [#3906 ](https://github.com/Mintplex-Labs/anything-llm/issues/3906) <!-- Describe the changes in this PR that are impactful to the repo. --> **short description** adds default system prompt (locale dependent + all locale translations of previous default system prompt) + general (global) **configurable** system prompt for ALL workspaces (admin or manager may configure general system prompt instead of default one which will be used by default in all workspaces) I tested the code on local machine + tested docker-compose version new changes work as planned More specifically added: - **configurable** global system prompt (I called it "general_system_prompt") - default system prompt for all locales + changing it on server when changing locale on frontend - full **rus** localization ### Additional Information <!-- Add any other context about the Pull Request here that was not captured above. --> **about me** (just in case) - I'm **JAVA BACKEND developer) not js**, sorry if something is incorrect, I tried my best - I'm from Russia, again sorry for misspelling - I worked as full stack dev and had few little pet projects using React that's why I have some experience **new things** - new component for configuring general system prompt [...components/GeneralSystemPrompt/index.jsx](frontend%2Fsrc%2Fpages%2FGeneralSettings%2FSettings%2Fcomponents%2FGeneralSystemPrompt%2Findex.jsx) - 2 new util classes for retrieving general or default system prompt ([systemPromptHelper.js](server%2Fmodels%2FsystemPromptHelper.js) on server) / sending default system prompt to server ([systemPrompt.js](frontend%2Fsrc%2Futils%2Fchat%2FsystemPrompt.js) on frontend) - 2 new `system_settings`: `"general_system_prompt"` and `"default_system_prompt"` - all locales have their own locale dependent default_system_prompt property `customization.items.system-prompt.default` + title and description **important changes:** - I moved `chatPrompt` function (from [index.js](frontend%2Fsrc%2Futils%2Fchat%2Findex.js) to [systemPromptHelper.js](server%2Fmodels%2FsystemPromptHelper.js)) because of cyclic dependency (couldn't import SystemSettings.js to index.js) - 2 events on language setting and changing (in [i18n.js](frontend%2Fsrc%2Fi18n.js)) => frontend sends default system prompt to server (unfortunately I found no other way because locale is located on frontend part, the only way to have locale dependent default system prompt is to synchronise frontend and server, so I decided to store it in DB in `system_settings` as `default_system_prompt` and change on language change - changed signature of function `buildSystemPrompt` in [convertTo.js](server%2Futils%2Fhelpers%2Fchat%2FconvertTo.js) (now async) - I DIDN'T TEST csv downloadning, I just didn't find it ### Developer Validations <!-- All of the applicable items should be checked. --> - [X] I ran `yarn lint` from the root of the repo & committed changes - [X] Relevant documentation has been updated - [X] I have tested my code functionality - [X] Docker build succeeds locally --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-22 18:36:13 -05:00
yindo closed this issue 2026-02-22 18:36:13 -05:00
yindo changed title from [PR #4451] feat: add a global prompt to [PR #4451] [CLOSED] feat: add a global prompt 2026-06-05 15:19:32 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#4629