Parcourir la source

Add 'Select pages for the assistant to reference' message to translation files

Shun Miyazawa il y a 8 mois
Parent
commit
be6f8d6e06

+ 1 - 0
apps/app/public/static/locales/en_US/translation.json

@@ -576,6 +576,7 @@
     "search_by_keyword": "Search by keyword",
     "enter_keywords": "Enter keywords",
     "max_items_space_separated_hint": "Enter up to 5 items separated by spaces",
+    "select_assistant_reference_pages": "Select pages for the assistant to reference",
     "select_from_page_tree": "Select from page tree",
     "edit_page_description": "Edit pages that the assistant can reference.<br> The assistant can reference up to {{limitLearnablePageCountPerAssistant}} pages including child pages.",
     "default_instruction": "You are the knowledge assistant for this Wiki.\n\n## Multilingual Support:\nRespond in the same language the user uses in their input.\n",

+ 1 - 0
apps/app/public/static/locales/fr_FR/translation.json

@@ -569,6 +569,7 @@
     "search_reference_pages_by_keyword": "Rechercher les pages de référence de l'assistant par mot-clé",
     "search_by_keyword": "Rechercher par mot-clé",
     "max_items_space_separated_hint": "Saisissez jusqu'à 5 éléments séparés par des espaces",
+    "select_assistant_reference_pages": "Sélectionnez les pages de référence pour l'assistant",
     "enter_keywords": "Entrer des mots-clés",
     "select_from_page_tree": "Sélectionner depuis l'arborescence des pages",
     "edit_page_description": "Modifier les pages que l'assistant peut référencer.<br> L'assistant peut référencer jusqu'à {{limitLearnablePageCountPerAssistant}} pages, y compris les pages enfants.",

+ 1 - 0
apps/app/public/static/locales/ja_JP/translation.json

@@ -609,6 +609,7 @@
     "search_by_keyword": "キーワードで検索",
     "enter_keywords": "キーワードを入力",
     "max_items_space_separated_hint": "スペース区切りで最大5つまで入力できます",
+    "select_assistant_reference_pages": "アシスタントが参照するページを選択してください",
     "select_from_page_tree": "ページツリーから選択",
     "edit_page_description": " アシスタントが参照するページを編集します。<br> 参照できるページは配下ページも含めて {{limitLearnablePageCountPerAssistant}} ページまでです。",
     "default_instruction": "あなたはこのWikiの知識アシスタントです。\n\n## 多言語サポート:\nユーザーが入力で使用した言語と同じ言語で応答してください。\n",

+ 1 - 0
apps/app/public/static/locales/zh_CN/translation.json

@@ -565,6 +565,7 @@
     "search_reference_pages_by_keyword": "按关键词搜索助手参考的页面",
     "search_by_keyword": "按关键词搜索",
     "max_items_space_separated_hint": "请输入最多5个项目,用空格分隔",
+    "select_assistant_reference_pages": "请选择助手参考的页面",
     "enter_keywords": "输入关键词",
     "select_from_page_tree": "从页面树选择",
     "edit_page_description": "编辑助手可以参考的页面。<br> 助手可以参考最多 {{limitLearnablePageCountPerAssistant}} 个页面,包括子页面。",

+ 10 - 1
apps/app/src/features/openai/client/components/AiAssistant/AiAssistantManagementModal/AiAssistantManagementKeywordSearch.tsx

@@ -43,7 +43,9 @@ export const AiAssistantKeywordSearch = (): JSX.Element => {
     includeUserPages: true,
   });
 
-  console.log('searchResult', searchResult);
+  const shownSearchResult = useMemo(() => {
+    return selectedSearchKeywords.length > 0 && searchResult != null && searchResult.data.length > 0;
+  }, [searchResult, selectedSearchKeywords.length]);
 
   const { data: aiAssistantManagementModalData } = useAiAssistantManagementModal();
   const isNewAiAssistant = aiAssistantManagementModalData?.aiAssistantData == null;
@@ -118,6 +120,13 @@ export const AiAssistantKeywordSearch = (): JSX.Element => {
         <label htmlFor="ai-assistant-keyword-search" className="form-text text-muted mt-2">
           {t('modal_ai_assistant.max_items_space_separated_hint')}
         </label>
+
+        { shownSearchResult && (
+          <h4 className="text-center mb-4 fw-bold mt-5">
+            {t('modal_ai_assistant.select_assistant_reference_pages')}
+          </h4>
+        )}
+
       </ModalBody>
     </div>
   );