mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-24 18:50:56 +08:00
feat: add prompt variables description (#6991)
* feat: add prompt variables description * fix: remove comment
This commit is contained in:
parent
8d4b40fa85
commit
cb3573a0e1
@ -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'
|
||||
|
||||
|
||||
@ -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",
|
||||
|
||||
@ -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": "外部からインポート",
|
||||
|
||||
@ -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": "Выбрать модель",
|
||||
|
||||
@ -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": "从外部导入",
|
||||
|
||||
@ -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": "從外部導入",
|
||||
|
||||
@ -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": "Επιλογή μοντέλου",
|
||||
|
||||
@ -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",
|
||||
|
||||
@ -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",
|
||||
|
||||
@ -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",
|
||||
|
||||
@ -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<Props> = ({ assistant, updateAssistant }
|
||||
updateAssistant(_assistant)
|
||||
}
|
||||
|
||||
const promptVarsContent = <pre>{t('agents.add.prompt.variables.tip.content')}</pre>
|
||||
|
||||
return (
|
||||
<Container>
|
||||
<Box mb={8} style={{ fontWeight: 'bold' }}>
|
||||
@ -95,9 +97,9 @@ const AssistantPromptSettings: React.FC<Props> = ({ assistant, updateAssistant }
|
||||
<SettingDivider />
|
||||
<HStack mb={8} alignItems="center" gap={4}>
|
||||
<Box style={{ fontWeight: 'bold' }}>{t('common.prompt')}</Box>
|
||||
<Tooltip title={t('agents.add.prompt.variables.tip')}>
|
||||
<Popover title={t('agents.add.prompt.variables.tip.title')} content={promptVarsContent}>
|
||||
<QuestionCircleOutlined size={14} color="var(--color-text-2)" />
|
||||
</Tooltip>
|
||||
</Popover>
|
||||
</HStack>
|
||||
<TextAreaContainer>
|
||||
{showMarkdown ? (
|
||||
|
||||
Loading…
Reference in New Issue
Block a user