mirror of
https://github.com/langgenius/dify.git
synced 2026-05-05 01:48:04 +08:00
feat: advanced prompt (#1330)
Co-authored-by: Joel <iamjoel007@gmail.com> Co-authored-by: JzoNg <jzongcode@gmail.com> Co-authored-by: Gillian97 <jinling.sunshine@gmail.com>
This commit is contained in:
@ -1,5 +1,22 @@
|
||||
const translation = {
|
||||
pageTitle: 'Prompt Engineering',
|
||||
pageTitle: {
|
||||
line1: 'PROMPT',
|
||||
line2: 'Engineering',
|
||||
},
|
||||
promptMode: {
|
||||
simple: 'Switch to Advanced Mode to edit the built-in PROMPT',
|
||||
advanced: 'Advanced Mode',
|
||||
switchBack: 'Switch back',
|
||||
advancedWarning: {
|
||||
title: 'You have switched to Advanced Mode, and once you modify the PROMPT, you CANNOT return to the simple mode.',
|
||||
description: 'In Advanced Mode, you can edit built-in PROMPT.',
|
||||
learnMore: 'Learn more',
|
||||
ok: 'OK',
|
||||
},
|
||||
operation: {
|
||||
addMessage: 'Add Message',
|
||||
},
|
||||
},
|
||||
operation: {
|
||||
applyConfig: 'Publish',
|
||||
resetConfig: 'Reset',
|
||||
@ -80,6 +97,17 @@ const translation = {
|
||||
deleteContextVarTip: 'This variable has been set as a context query variable, and removing it will impact the normal use of the dataset. If you still need to delete it, please reselect it in the context section.',
|
||||
},
|
||||
},
|
||||
conversationHistory: {
|
||||
title: 'Conversation History',
|
||||
description: 'Set prefix names for conversation roles',
|
||||
tip: 'The Conversation History is not enabled, please add <histories> in the prompt above.',
|
||||
learnMore: 'Learn more',
|
||||
editModal: {
|
||||
title: 'Edit Conversation Role Names',
|
||||
userPrefix: 'User prefix',
|
||||
assistantPrefix: 'Assistant prefix',
|
||||
},
|
||||
},
|
||||
},
|
||||
automatic: {
|
||||
title: 'Automated application orchestration',
|
||||
@ -136,13 +164,15 @@ const translation = {
|
||||
},
|
||||
varKeyError: {
|
||||
canNoBeEmpty: 'Variable key can not be empty',
|
||||
tooLong: 'Variable key: {{key}} too length. Can not be longer then 16 characters',
|
||||
tooLong: 'Variable key: {{key}} too length. Can not be longer then 30 characters',
|
||||
notValid: 'Variable key: {{key}} is invalid. Can only contain letters, numbers, and underscores',
|
||||
notStartWithNumber: 'Variable key: {{key}} can not start with a number',
|
||||
keyAlreadyExists: 'Variable key: :{{key}} already exists',
|
||||
},
|
||||
otherError: {
|
||||
promptNoBeEmpty: 'Prefix prompt can not be empty',
|
||||
promptNoBeEmpty: 'Prompt can not be empty',
|
||||
historyNoBeEmpty: 'Conversation history must be set in the prompt',
|
||||
queryNoBeEmpty: 'Query must be set in the prompt',
|
||||
},
|
||||
variableConig: {
|
||||
modalTitle: 'Field settings',
|
||||
@ -172,9 +202,13 @@ const translation = {
|
||||
model: 'Model',
|
||||
setTone: 'Set tone of responses',
|
||||
title: 'Model and Parameters',
|
||||
modeType: {
|
||||
chat: 'Chat',
|
||||
completion: 'Complete',
|
||||
},
|
||||
},
|
||||
inputs: {
|
||||
title: 'Debugging and Previewing',
|
||||
title: 'Debug and Preview',
|
||||
noPrompt: 'Try write some prompt in pre-prompt input',
|
||||
userInputField: 'User Input Field',
|
||||
noVar: 'Fill in the value of the variable, which will be automatically replaced in the prompt word every time a new session is started.',
|
||||
@ -188,6 +222,13 @@ const translation = {
|
||||
run: 'RUN',
|
||||
},
|
||||
result: 'Output Text',
|
||||
datasetConfig: {
|
||||
params: 'Params',
|
||||
top_k: 'Top K',
|
||||
top_kTip: 'Used to filter segments that are most similar to user questions. The system will also dynamically adjust the value of Top K, according to max_tokens of the selected model.',
|
||||
score_threshold: 'Score Threshold',
|
||||
score_thresholdTip: 'Used to set the similarity threshold for segment filtering.',
|
||||
},
|
||||
}
|
||||
|
||||
export default translation
|
||||
|
||||
@ -1,5 +1,22 @@
|
||||
const translation = {
|
||||
pageTitle: '提示词编排',
|
||||
pageTitle: {
|
||||
line1: '提示词',
|
||||
line2: '编排',
|
||||
},
|
||||
promptMode: {
|
||||
simple: '切换到高级模式以编辑内置的提示词',
|
||||
advanced: '高级模式',
|
||||
switchBack: '返回简单模式',
|
||||
advancedWarning: {
|
||||
title: '您已切换到高级模式,一旦修改提示词,将无法返回简单模式。',
|
||||
description: '在高级模式下,您可以编辑内置的提示词。',
|
||||
learnMore: '了解更多',
|
||||
ok: '确定',
|
||||
},
|
||||
operation: {
|
||||
addMessage: '添加消息',
|
||||
},
|
||||
},
|
||||
operation: {
|
||||
applyConfig: '发布',
|
||||
resetConfig: '重置',
|
||||
@ -80,6 +97,17 @@ const translation = {
|
||||
deleteContextVarTip: '该变量已被设置为上下文查询变量,删除该变量将影响数据集的正常使用。 如果您仍需要删除它,请在上下文部分中重新选择它。',
|
||||
},
|
||||
},
|
||||
conversationHistory: {
|
||||
title: '对话历史',
|
||||
description: '设置对话角色的前缀名称',
|
||||
tip: '对话历史未启用,请在上面的提示中添加<histories>。',
|
||||
learnMore: '了解更多',
|
||||
editModal: {
|
||||
title: '编辑对话角色名称',
|
||||
userPrefix: '用户前缀',
|
||||
assistantPrefix: '助手前缀',
|
||||
},
|
||||
},
|
||||
},
|
||||
automatic: {
|
||||
title: '自动编排',
|
||||
@ -132,13 +160,15 @@ const translation = {
|
||||
},
|
||||
varKeyError: {
|
||||
canNoBeEmpty: '变量不能为空',
|
||||
tooLong: '变量: {{key}} 长度太长。不能超过 16 个字符',
|
||||
tooLong: '变量: {{key}} 长度太长。不能超过 30 个字符',
|
||||
notValid: '变量: {{key}} 非法。只能包含英文字符,数字和下划线',
|
||||
notStartWithNumber: '变量: {{key}} 不能以数字开头',
|
||||
keyAlreadyExists: '变量:{{key}} 已存在',
|
||||
},
|
||||
otherError: {
|
||||
promptNoBeEmpty: '前缀提示词不能为空',
|
||||
promptNoBeEmpty: '提示词不能为空',
|
||||
historyNoBeEmpty: '提示词中必须设置对话历史',
|
||||
queryNoBeEmpty: '提示词中必须设置查询内容',
|
||||
},
|
||||
variableConig: {
|
||||
modalTitle: '变量设置',
|
||||
@ -182,6 +212,13 @@ const translation = {
|
||||
run: '运行',
|
||||
},
|
||||
result: '结果',
|
||||
datasetConfig: {
|
||||
params: '参数设置',
|
||||
top_k: 'Top K',
|
||||
top_kTip: '用于筛选与用户问题相似度最高的文本片段。系统同时会根据选用模型上下文窗口大小动态调整分段数量。',
|
||||
score_threshold: 'Score 阈值',
|
||||
score_thresholdTip: '用于设置文本片段筛选的相似度阈值。',
|
||||
},
|
||||
}
|
||||
|
||||
export default translation
|
||||
|
||||
@ -8,7 +8,7 @@ const translation = {
|
||||
endUser: 'End User',
|
||||
input: 'Input',
|
||||
output: 'Output',
|
||||
summary: 'Summary',
|
||||
summary: 'Title',
|
||||
messageCount: 'Message Count',
|
||||
userRate: 'User Rate',
|
||||
adminRate: 'Op. Rate',
|
||||
@ -43,6 +43,7 @@ const translation = {
|
||||
editAnnotation: 'Edit Improvement',
|
||||
annotationPlaceholder: 'Enter the expected answer that you want AI to reply, which can be used for model fine-tuning and continuous improvement of text generation quality in the future.',
|
||||
},
|
||||
variables: 'Variables',
|
||||
},
|
||||
filter: {
|
||||
period: {
|
||||
|
||||
@ -8,7 +8,7 @@ const translation = {
|
||||
endUser: '用户',
|
||||
input: '输入',
|
||||
output: '输出',
|
||||
summary: '摘要',
|
||||
summary: '标题',
|
||||
messageCount: '消息数',
|
||||
userRate: '用户反馈',
|
||||
adminRate: '管理员反馈',
|
||||
@ -43,6 +43,7 @@ const translation = {
|
||||
editAnnotation: '编辑改进回复',
|
||||
annotationPlaceholder: '输入你希望 AI 回复的预期答案,这在今后可用于模型微调,持续改进文本生成质量。',
|
||||
},
|
||||
variables: '变量',
|
||||
},
|
||||
filter: {
|
||||
period: {
|
||||
|
||||
@ -29,6 +29,7 @@ const translation = {
|
||||
getForFree: 'Get for free',
|
||||
reload: 'Reload',
|
||||
ok: 'OK',
|
||||
log: 'Log',
|
||||
},
|
||||
placeholder: {
|
||||
input: 'Please enter',
|
||||
@ -66,6 +67,9 @@ const translation = {
|
||||
'Used to limit the maximum length of the reply, in tokens. \nLarger values may limit the space left for prompt words, chat logs, and data sets. \nIt is recommended to set it below two-thirds.',
|
||||
maxTokenSettingTip: 'Your max token setting is high, potentially limiting space for prompts, queries, and data. Consider setting it below 2/3.',
|
||||
setToCurrentModelMaxTokenTip: 'Max token is updated to the 80% maximum token of the current model {{maxToken}}.',
|
||||
stop_sequences: 'Stop sequences',
|
||||
stop_sequencesTip: 'Up to four sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence.',
|
||||
stop_sequencesPlaceholder: 'Enter sequence and press Tab',
|
||||
},
|
||||
tone: {
|
||||
Creative: 'Creative',
|
||||
@ -73,6 +77,7 @@ const translation = {
|
||||
Precise: 'Precise',
|
||||
Custom: 'Custom',
|
||||
},
|
||||
addMoreModel: 'Go to settings to add more models',
|
||||
},
|
||||
menus: {
|
||||
status: 'beta',
|
||||
@ -352,6 +357,48 @@ const translation = {
|
||||
hitScore: 'Hit Score:',
|
||||
},
|
||||
},
|
||||
promptEditor: {
|
||||
placeholder: 'Write your prompt word here, enter \'{\' to insert a variable, enter \'/\' to insert a prompt content block',
|
||||
context: {
|
||||
item: {
|
||||
title: 'Context',
|
||||
desc: 'Insert context template',
|
||||
},
|
||||
modal: {
|
||||
title: '{{num}} Datasets in Context',
|
||||
add: 'Add Context ',
|
||||
footer: 'You can manage contexts in the Context section below.',
|
||||
},
|
||||
},
|
||||
history: {
|
||||
item: {
|
||||
title: 'Conversation History',
|
||||
desc: 'Insert historical message template',
|
||||
},
|
||||
modal: {
|
||||
title: 'EXAMPLE',
|
||||
user: 'Hello',
|
||||
assistant: 'Hello! How can I assist you today?',
|
||||
edit: 'Edit Conversation Role Names',
|
||||
},
|
||||
},
|
||||
variable: {
|
||||
item: {
|
||||
title: 'Variables',
|
||||
desc: 'Insert variable template',
|
||||
},
|
||||
modal: {
|
||||
add: 'New variable',
|
||||
},
|
||||
},
|
||||
query: {
|
||||
item: {
|
||||
title: 'Query',
|
||||
desc: 'Insert user query template',
|
||||
},
|
||||
},
|
||||
existed: 'Already exists in the prompt',
|
||||
},
|
||||
}
|
||||
|
||||
export default translation
|
||||
|
||||
@ -29,6 +29,7 @@ const translation = {
|
||||
getForFree: '免费获取',
|
||||
reload: '刷新',
|
||||
ok: '好的',
|
||||
log: '日志',
|
||||
},
|
||||
placeholder: {
|
||||
input: '请输入',
|
||||
@ -66,6 +67,9 @@ const translation = {
|
||||
'用于限制回复的最大长度,以 token 为单位。\n较大的值可能会限制给提示词、聊天记录和数据集留出的空间。\n建议将其设置在三分之二以下。',
|
||||
maxTokenSettingTip: '您设置的最大 tokens 数较大,可能会导致 prompt、用户问题、数据集内容没有 token 空间进行处理,建议设置到 2/3 以下。',
|
||||
setToCurrentModelMaxTokenTip: '最大令牌数更新为当前模型最大的令牌数 {{maxToken}} 的 80%。',
|
||||
stop_sequences: '停止序列 stop_sequences',
|
||||
stop_sequencesTip: '最多四个序列,API 将停止生成更多的 token。返回的文本将不包含停止序列。',
|
||||
stop_sequencesPlaceholder: '输入序列并按 Tab 键',
|
||||
},
|
||||
tone: {
|
||||
Creative: '创意',
|
||||
@ -73,6 +77,7 @@ const translation = {
|
||||
Precise: '精确',
|
||||
Custom: '自定义',
|
||||
},
|
||||
addMoreModel: '添加更多模型',
|
||||
},
|
||||
menus: {
|
||||
status: 'beta',
|
||||
@ -352,6 +357,48 @@ const translation = {
|
||||
hitScore: '命中得分:',
|
||||
},
|
||||
},
|
||||
promptEditor: {
|
||||
placeholder: '在这里写你的提示词,输入\'{\' 插入变量、输入\'/\' 插入提示内容块',
|
||||
context: {
|
||||
item: {
|
||||
title: '上下文',
|
||||
desc: '插入上下文模板',
|
||||
},
|
||||
modal: {
|
||||
title: '有 {{num}} 个数据集在上下文中',
|
||||
add: '添加上下文',
|
||||
footer: '您可以在下面的“上下文”部分中管理上下文。',
|
||||
},
|
||||
},
|
||||
history: {
|
||||
item: {
|
||||
title: '会话历史',
|
||||
desc: '插入历史消息模板',
|
||||
},
|
||||
modal: {
|
||||
title: '示例',
|
||||
user: '你好',
|
||||
assistant: '你好!今天我能为您提供什么帮助?',
|
||||
edit: '编辑对话角色名称',
|
||||
},
|
||||
},
|
||||
variable: {
|
||||
item: {
|
||||
title: '变量',
|
||||
desc: '插入变量模板',
|
||||
},
|
||||
modal: {
|
||||
add: '添加新变量',
|
||||
},
|
||||
},
|
||||
query: {
|
||||
item: {
|
||||
title: '查询内容',
|
||||
desc: '插入用户查询模板',
|
||||
},
|
||||
},
|
||||
existed: 'Prompt 中已存在',
|
||||
},
|
||||
}
|
||||
|
||||
export default translation
|
||||
|
||||
Reference in New Issue
Block a user