diff --git a/src/preload/index.ts b/src/preload/index.ts index f22fef7d7a..59496df4b8 100644 --- a/src/preload/index.ts +++ b/src/preload/index.ts @@ -1,11 +1,11 @@ import type { ExtractChunkData } from '@cherrystudio/embedjs-interfaces' import { electronAPI } from '@electron-toolkit/preload' +import { FeedUrl } from '@shared/config/constant' import { IpcChannel } from '@shared/IpcChannel' import { FileType, KnowledgeBaseParams, KnowledgeItem, MCPServer, Shortcut, ThemeMode, WebDavConfig } from '@types' import { contextBridge, ipcRenderer, OpenDialogOptions, shell, webUtils } from 'electron' import { Notification } from 'src/renderer/src/types/notification' import { CreateDirectoryOptions } from 'webdav' -import { FeedUrl } from '@shared/config/constant' import type { ActionItem } from '../renderer/src/types/selectionTypes' diff --git a/src/renderer/src/i18n/locales/en-us.json b/src/renderer/src/i18n/locales/en-us.json index 7dd6b9636f..ecd278585d 100644 --- a/src/renderer/src/i18n/locales/en-us.json +++ b/src/renderer/src/i18n/locales/en-us.json @@ -8,7 +8,10 @@ "add.name.placeholder": "Enter name", "add.prompt": "Prompt", "add.prompt.placeholder": "Enter prompt", - "add.prompt.variables.tip": "Available variables: {{date}}, {{time}}, {{datetime}}, {{system}}, {{arch}}, {{language}}, {{model_name}}", + "add.prompt.variables.tip": { + "title": "Available variables", + "content": "{{date}}:\tDate\n{{time}}:\tTime\n{{datetime}}:\tDate and time\n{{system}}:\tOperating system\n{{arch}}:\tCPU architecture\n{{language}}:\tLanguage\n{{model_name}}:\tModel name" + }, "add.title": "Create Agent", "import": { "title": "Import from External", diff --git a/src/renderer/src/i18n/locales/ja-jp.json b/src/renderer/src/i18n/locales/ja-jp.json index 2ea6b1034e..99e29e6a8e 100644 --- a/src/renderer/src/i18n/locales/ja-jp.json +++ b/src/renderer/src/i18n/locales/ja-jp.json @@ -8,7 +8,10 @@ "add.name.placeholder": "名前を入力", "add.prompt": "プロンプト", "add.prompt.placeholder": "プロンプトを入力", - "add.prompt.variables.tip": "利用可能な変数:{{date}}, {{time}}, {{datetime}}, {{system}}, {{arch}}, {{language}}, {{model_name}}", + "add.prompt.variables.tip": { + "title": "利用可能な変数", + "content": "{{date}}:\t日付\n{{time}}:\t時間\n{{datetime}}:\t日付と時間\n{{system}}:\tオペレーティングシステム\n{{arch}}:\tCPUアーキテクチャ\n{{language}}:\t言語\n{{model_name}}:\tモデル名" + }, "add.title": "エージェントを作成", "import": { "title": "外部からインポート", diff --git a/src/renderer/src/i18n/locales/ru-ru.json b/src/renderer/src/i18n/locales/ru-ru.json index 3bd1b4a83c..5a5308ed2c 100644 --- a/src/renderer/src/i18n/locales/ru-ru.json +++ b/src/renderer/src/i18n/locales/ru-ru.json @@ -8,7 +8,10 @@ "add.name.placeholder": "Введите имя", "add.prompt": "Промпт", "add.prompt.placeholder": "Введите промпт", - "add.prompt.variables.tip": "Доступные переменные: {{date}}, {{time}}, {{datetime}}, {{system}}, {{arch}}, {{language}}, {{model_name}}", + "add.prompt.variables.tip": { + "title": "Доступные переменные", + "content": "{{date}}:\tДата\n{{time}}:\tВремя\n{{datetime}}:\tДата и время\n{{system}}:\tОперационная система\n{{arch}}:\tАрхитектура процессора\n{{language}}:\tЯзык\n{{model_name}}:\tНазвание модели" + }, "add.title": "Создать агента", "delete.popup.content": "Вы уверены, что хотите удалить этого агента?", "edit.model.select.title": "Выбрать модель", diff --git a/src/renderer/src/i18n/locales/zh-cn.json b/src/renderer/src/i18n/locales/zh-cn.json index f7d7ca3c1a..3b8ab324c2 100644 --- a/src/renderer/src/i18n/locales/zh-cn.json +++ b/src/renderer/src/i18n/locales/zh-cn.json @@ -8,7 +8,10 @@ "add.name.placeholder": "输入名称", "add.prompt": "提示词", "add.prompt.placeholder": "输入提示词", - "add.prompt.variables.tip": "可用的变量:{{date}}, {{time}}, {{datetime}}, {{system}}, {{arch}}, {{language}}, {{model_name}}", + "add.prompt.variables.tip": { + "title": "可用的变量", + "content": "{{date}}:\t日期\n{{time}}:\t时间\n{{datetime}}:\t日期和时间\n{{system}}:\t操作系统\n{{arch}}:\tCPU架构\n{{language}}:\t语言\n{{model_name}}:\t模型名称" + }, "add.title": "创建智能体", "import": { "title": "从外部导入", diff --git a/src/renderer/src/i18n/locales/zh-tw.json b/src/renderer/src/i18n/locales/zh-tw.json index b9b1571f6f..05a658b74d 100644 --- a/src/renderer/src/i18n/locales/zh-tw.json +++ b/src/renderer/src/i18n/locales/zh-tw.json @@ -8,7 +8,10 @@ "add.name.placeholder": "輸入名稱", "add.prompt": "提示詞", "add.prompt.placeholder": "輸入提示詞", - "add.prompt.variables.tip": "可用的變數:{{date}}, {{time}}, {{datetime}}, {{system}}, {{arch}}, {{language}}, {{model_name}}", + "add.prompt.variables.tip": { + "title": "可用的變數", + "content": "{{date}}:\t日期\n{{time}}:\t時間\n{{datetime}}:\t日期和時間\n{{system}}:\t作業系統\n{{arch}}:\tCPU架構\n{{language}}:\t語言\n{{model_name}}:\t模型名稱" + }, "add.title": "建立智慧代理人", "import": { "title": "從外部導入", diff --git a/src/renderer/src/i18n/translate/el-gr.json b/src/renderer/src/i18n/translate/el-gr.json index c54f7e5253..576e740564 100644 --- a/src/renderer/src/i18n/translate/el-gr.json +++ b/src/renderer/src/i18n/translate/el-gr.json @@ -8,6 +8,10 @@ "add.name.placeholder": "Εισαγάγετε όνομα", "add.prompt": "Φράση προκαλέσεως", "add.prompt.placeholder": "Εισαγάγετε φράση προκαλέσεως", + "add.prompt.variables.tip": { + "title": "Διαθέσιμες μεταβλητές", + "content": "{{date}}:\tΗμερομηνία\n{{time}}:\tΏρα\n{{datetime}}:\tΗμερομηνία και ώρα\n{{system}}:\tΛειτουργικό σύστημα\n{{arch}}:\tΑρχιτεκτονική CPU\n{{language}}:\tΓλώσσα\n{{model_name}}:\tΌνομα μοντέλου" + }, "add.title": "Δημιουργία νέου ειδικού", "delete.popup.content": "Είστε σίγουροι ότι θέλετε να διαγράψετε αυτόν τον ειδικό;", "edit.model.select.title": "Επιλογή μοντέλου", diff --git a/src/renderer/src/i18n/translate/es-es.json b/src/renderer/src/i18n/translate/es-es.json index 9496124331..1b3990a8f6 100644 --- a/src/renderer/src/i18n/translate/es-es.json +++ b/src/renderer/src/i18n/translate/es-es.json @@ -8,6 +8,10 @@ "add.name.placeholder": "Ingrese el nombre", "add.prompt": "Palabra clave", "add.prompt.placeholder": "Ingrese la palabra clave", + "add.prompt.variables.tip": { + "title": "Variables disponibles", + "content": "{{date}}:\tFecha\n{{time}}:\tHora\n{{datetime}}:\tFecha y hora\n{{system}}:\tSistema operativo\n{{arch}}:\tArquitectura de CPU\n{{language}}:\tIdioma\n{{model_name}}:\tNombre del modelo" + }, "add.title": "Crear agente inteligente", "delete.popup.content": "¿Está seguro de que desea eliminar este agente inteligente?", "edit.model.select.title": "Seleccionar modelo", diff --git a/src/renderer/src/i18n/translate/fr-fr.json b/src/renderer/src/i18n/translate/fr-fr.json index 30870432df..0c26726f4d 100644 --- a/src/renderer/src/i18n/translate/fr-fr.json +++ b/src/renderer/src/i18n/translate/fr-fr.json @@ -8,6 +8,10 @@ "add.name.placeholder": "Entrer le nom", "add.prompt": "Mot-clé", "add.prompt.placeholder": "Entrer le mot-clé", + "add.prompt.variables.tip": { + "title": "Variables disponibles", + "content": "{{date}}:\tDate\n{{time}}:\tHeure\n{{datetime}}:\tDate et heure\n{{system}}:\tSystème d'exploitation\n{{arch}}:\tArchitecture du processeur\n{{language}}:\tLangue\n{{model_name}}:\tNom du modèle" + }, "add.title": "Créer un agent intelligent", "delete.popup.content": "Êtes-vous sûr de vouloir supprimer cet agent intelligent ?", "edit.model.select.title": "Sélectionner un modèle", diff --git a/src/renderer/src/i18n/translate/pt-pt.json b/src/renderer/src/i18n/translate/pt-pt.json index 2399d39eae..32ddbf10e9 100644 --- a/src/renderer/src/i18n/translate/pt-pt.json +++ b/src/renderer/src/i18n/translate/pt-pt.json @@ -8,6 +8,10 @@ "add.name.placeholder": "Digite o Nome", "add.prompt": "Prompt", "add.prompt.placeholder": "Digite o Prompt", + "add.prompt.variables.tip": { + "title": "Variáveis disponíveis", + "content": "{{date}}:\tData\n{{time}}:\tHora\n{{datetime}}:\tData e hora\n{{system}}:\tSistema operativo\n{{arch}}:\tArquitetura da CPU\n{{language}}:\tIdioma\n{{model_name}}:\tNome do modelo" + }, "add.title": "Criar Agente Inteligente", "delete.popup.content": "Tem certeza de que deseja excluir este agente inteligente?", "edit.model.select.title": "Selecionar Modelo", diff --git a/src/renderer/src/pages/settings/AssistantSettings/AssistantPromptSettings.tsx b/src/renderer/src/pages/settings/AssistantSettings/AssistantPromptSettings.tsx index 1fd3a1deda..02b8185046 100644 --- a/src/renderer/src/pages/settings/AssistantSettings/AssistantPromptSettings.tsx +++ b/src/renderer/src/pages/settings/AssistantSettings/AssistantPromptSettings.tsx @@ -6,7 +6,7 @@ import { Box, HSpaceBetweenStack, HStack } from '@renderer/components/Layout' import { estimateTextTokens } from '@renderer/services/TokenService' import { Assistant, AssistantSettings } from '@renderer/types' import { getLeadingEmoji } from '@renderer/utils' -import { Button, Input, Popover, Tooltip } from 'antd' +import { Button, Input, Popover } from 'antd' import TextArea from 'antd/es/input/TextArea' import { useEffect, useState } from 'react' import { useTranslation } from 'react-i18next' @@ -55,6 +55,8 @@ const AssistantPromptSettings: React.FC = ({ assistant, updateAssistant } updateAssistant(_assistant) } + const promptVarsContent =
{t('agents.add.prompt.variables.tip.content')}
+ return ( @@ -95,9 +97,9 @@ const AssistantPromptSettings: React.FC = ({ assistant, updateAssistant } {t('common.prompt')} - + - + {showMarkdown ? (