From e0af6d36e14fd8a4c164d515269fcac73dbca647 Mon Sep 17 00:00:00 2001 From: Anthony LC Date: Wed, 12 Mar 2025 11:44:58 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8(AI)=20add=20beautify=20action=20to=20?= =?UTF-8?q?ai=20transform?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The beautify action add emojis to the important parts of the text and add formatting to the text to make it more readable. --- CHANGELOG.md | 3 ++- src/backend/core/services/ai_services.py | 5 +++++ .../docs/doc-editor/api/useDocAITransform.tsx | 3 ++- .../components/BlockNoteToolBar/AIButton.tsx | 11 +++++++++++ 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2186237a..d5c0f5cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,10 +26,12 @@ and this project adheres to ## Added - ✨(frontend) synchronize language-choice #401 +- ✨(frontend) add Beautify action to AI transform #478 ## Changed - Use sentry tags instead of extra scope +- ♻️(frontend) Improve AI translations #478 ## Fixed @@ -56,7 +58,6 @@ and this project adheres to - 📝(doc) minor README.md formatting and wording enhancements - ♻️Stop setting a default title on doc creation #634 - ♻️(frontend) misc ui improvements #644 -- ♻️(frontend) Improve AI translations #478 ## Fixed diff --git a/src/backend/core/services/ai_services.py b/src/backend/core/services/ai_services.py index 819cec0d..eee0b7ef 100644 --- a/src/backend/core/services/ai_services.py +++ b/src/backend/core/services/ai_services.py @@ -31,6 +31,11 @@ AI_ACTIONS = { "Do not provide any other information. " "Preserve the language." ), + "beautify": ( + "Add formatting to the text to make it more readable. " + "Do not provide any other information." + "Preserve the language." + ), } AI_TRANSLATE = ( diff --git a/src/frontend/apps/impress/src/features/docs/doc-editor/api/useDocAITransform.tsx b/src/frontend/apps/impress/src/features/docs/doc-editor/api/useDocAITransform.tsx index f38e1176..dd8b04f3 100644 --- a/src/frontend/apps/impress/src/features/docs/doc-editor/api/useDocAITransform.tsx +++ b/src/frontend/apps/impress/src/features/docs/doc-editor/api/useDocAITransform.tsx @@ -6,7 +6,8 @@ export type AITransformActions = | 'correct' | 'prompt' | 'rephrase' - | 'summarize'; + | 'summarize' + | 'beautify'; export type DocAITransform = { docId: string; diff --git a/src/frontend/apps/impress/src/features/docs/doc-editor/components/BlockNoteToolBar/AIButton.tsx b/src/frontend/apps/impress/src/features/docs/doc-editor/components/BlockNoteToolBar/AIButton.tsx index 91a158fb..ad2241ad 100644 --- a/src/frontend/apps/impress/src/features/docs/doc-editor/components/BlockNoteToolBar/AIButton.tsx +++ b/src/frontend/apps/impress/src/features/docs/doc-editor/components/BlockNoteToolBar/AIButton.tsx @@ -165,6 +165,17 @@ export function AIGroupButton() { > {t('Correct')} + + draw + + } + > + {t('Beautify')} + )} {canAITranslate && (