feat: support assistant frontend (#2139)
Co-authored-by: StyleZhang <jasonapring2015@outlook.com>
This commit is contained in:
parent
e65a2a400d
commit
7bbe12b2bd
194 changed files with 8726 additions and 1586 deletions
|
|
@ -39,6 +39,8 @@ import billingEn from './lang/billing.en'
|
|||
import billingZh from './lang/billing.zh'
|
||||
import customEn from './lang/custom.en'
|
||||
import customZh from './lang/custom.zh'
|
||||
import toolsEn from './lang/tools.en'
|
||||
import toolsZh from './lang/tools.zh'
|
||||
|
||||
const resources = {
|
||||
'en': {
|
||||
|
|
@ -65,6 +67,8 @@ const resources = {
|
|||
// billing
|
||||
billing: billingEn,
|
||||
custom: customEn,
|
||||
// tools
|
||||
tools: toolsEn,
|
||||
},
|
||||
},
|
||||
'zh-Hans': {
|
||||
|
|
@ -90,6 +94,8 @@ const resources = {
|
|||
explore: exploreZh,
|
||||
billing: billingZh,
|
||||
custom: customZh,
|
||||
// tools
|
||||
tools: toolsZh,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ const translation = {
|
|||
line1: 'PROMPT',
|
||||
line2: 'Engineering',
|
||||
},
|
||||
orchestrate: 'Orchestrate',
|
||||
promptMode: {
|
||||
simple: 'Switch to Expert Mode to edit the whole PROMPT',
|
||||
advanced: 'Expert Mode',
|
||||
|
|
@ -226,7 +227,7 @@ const translation = {
|
|||
notSelectModel: 'Please choose a model',
|
||||
waitForImgUpload: 'Please wait for the image to upload',
|
||||
},
|
||||
chatSubTitle: 'Pre Prompt',
|
||||
chatSubTitle: 'Instructions',
|
||||
completionSubTitle: 'Prefix Prompt',
|
||||
promptTip:
|
||||
'Prompts guide AI responses with instructions and constraints. Insert variables like {{input}}. This prompt won\'t be visible to users.',
|
||||
|
|
@ -271,6 +272,7 @@ const translation = {
|
|||
maxLength: 'Max length',
|
||||
options: 'Options',
|
||||
addOption: 'Add option',
|
||||
apiBasedVar: 'API-based Variable',
|
||||
},
|
||||
vision: {
|
||||
name: 'Vision',
|
||||
|
|
@ -292,10 +294,11 @@ const translation = {
|
|||
},
|
||||
},
|
||||
openingStatement: {
|
||||
title: 'Opening remarks',
|
||||
title: 'Conversation Opener',
|
||||
add: 'Add',
|
||||
writeOpner: 'Write remarks',
|
||||
placeholder: 'Write your remarks message here',
|
||||
writeOpner: 'Write opener',
|
||||
placeholder: 'Write your opener message here, you can use variables, try type {{variable}}.',
|
||||
openingQuestion: 'Opening Questions',
|
||||
noDataPlaceHolder:
|
||||
'Starting the conversation with the user can help AI establish a closer connection with them in conversational applications.',
|
||||
varTip: 'You can use variables, try type {{variable}}',
|
||||
|
|
@ -344,6 +347,42 @@ const translation = {
|
|||
score_thresholdTip: 'Used to set the similarity threshold for chunks filtering.',
|
||||
retrieveChangeTip: 'Modifying the index mode and retrieval mode may affect applications associated with this Knowledge.',
|
||||
},
|
||||
assistantType: {
|
||||
name: 'Assistant Type',
|
||||
chatAssistant: {
|
||||
name: 'Basic Assistant',
|
||||
description: 'Build a chat-based assistant using a Large Language Model',
|
||||
},
|
||||
agentAssistant: {
|
||||
name: 'Agent Assistant',
|
||||
description: 'Build an intelligent Agent which can autonomously choose tools to complete the tasks',
|
||||
},
|
||||
},
|
||||
agent: {
|
||||
agentMode: 'Agent Mode',
|
||||
agentModeDes: 'Set the type of inference mode for the agent',
|
||||
agentModeType: {
|
||||
ReACT: 'ReAct',
|
||||
functionCall: 'Function Calling',
|
||||
},
|
||||
setting: {
|
||||
name: 'Agent Settings',
|
||||
description: 'Agent Assistant settings allow setting agent mode and advanced features like built-in prompts, only available in Agent type.',
|
||||
maximumIterations: {
|
||||
name: 'Maximum Iterations',
|
||||
description: 'Limit the number of iterations an agent assistant can execute',
|
||||
},
|
||||
},
|
||||
buildInPrompt: 'Build-In Prompt',
|
||||
firstPrompt: 'First Prompt',
|
||||
nextIteration: 'Next Iteration',
|
||||
promptPlaceholder: 'Write your prompt here',
|
||||
tools: {
|
||||
name: 'Tools',
|
||||
description: 'Using tools can extend the capabilities of LLM, such as searching the internet or performing scientific calculations',
|
||||
enabled: 'Enabled',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
export default translation
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ const translation = {
|
|||
line1: '提示词',
|
||||
line2: '编排',
|
||||
},
|
||||
orchestrate: '编排',
|
||||
promptMode: {
|
||||
simple: '切换到专家模式以编辑完整的提示词',
|
||||
advanced: '专家模式',
|
||||
|
|
@ -223,7 +224,7 @@ const translation = {
|
|||
notSelectModel: '请选择模型',
|
||||
waitForImgUpload: '请等待图片上传完成',
|
||||
},
|
||||
chatSubTitle: '对话前提示词',
|
||||
chatSubTitle: '提示词',
|
||||
completionSubTitle: '前缀提示词',
|
||||
promptTip:
|
||||
'提示词用于对 AI 的回复做出一系列指令和约束。可插入表单变量,例如 {{input}}。这段提示词不会被最终用户所看到。',
|
||||
|
|
@ -267,6 +268,7 @@ const translation = {
|
|||
maxLength: '最大长度',
|
||||
options: '选项',
|
||||
addOption: '添加选项',
|
||||
apiBasedVar: '基于API的变量',
|
||||
},
|
||||
vision: {
|
||||
name: '视觉',
|
||||
|
|
@ -291,7 +293,8 @@ const translation = {
|
|||
title: '对话开场白',
|
||||
add: '添加开场白',
|
||||
writeOpner: '编写开场白',
|
||||
placeholder: '请在这里输入开场白',
|
||||
placeholder: '在这里写下你的开场白,你可以使用变量,尝试输入 {{variable}}。',
|
||||
openingQuestion: '开场问题',
|
||||
noDataPlaceHolder:
|
||||
'在对话型应用中,让 AI 主动说第一段话可以拉近与用户间的距离。',
|
||||
varTip: '你可以使用变量, 试试输入 {{variable}}',
|
||||
|
|
@ -338,6 +341,42 @@ const translation = {
|
|||
score_thresholdTip: '用于设置文本片段筛选的相似度阈值。',
|
||||
retrieveChangeTip: '修改索引模式和检索模式可能会影响与该知识库关联的应用程序。',
|
||||
},
|
||||
assistantType: {
|
||||
name: '助手类型',
|
||||
chatAssistant: {
|
||||
name: '基础助手',
|
||||
description: '基于 LLM 构建一个聊天型助手',
|
||||
},
|
||||
agentAssistant: {
|
||||
name: '智能助手',
|
||||
description: '构建一个智能助手,他可以自主选择工具完成你设置的任务',
|
||||
},
|
||||
},
|
||||
agent: {
|
||||
agentMode: 'Agent Mode',
|
||||
agentModeDes: '设置代理的推理模式类型',
|
||||
agentModeType: {
|
||||
ReACT: 'ReAct',
|
||||
functionCall: 'Function Calling',
|
||||
},
|
||||
setting: {
|
||||
name: 'Agent 设置',
|
||||
description: '智能助手设置允许设置代理模式和内置提示等高级功能,仅在代理类型中可用。',
|
||||
maximumIterations: {
|
||||
name: '最大迭代次数',
|
||||
description: '限制代理型助手执行迭代的次数',
|
||||
},
|
||||
},
|
||||
buildInPrompt: '内置提示词',
|
||||
firstPrompt: '第一次提示词',
|
||||
nextIteration: '下一次迭代',
|
||||
promptPlaceholder: '在这里写下您的提示词',
|
||||
tools: {
|
||||
name: '工具',
|
||||
description: '使用工具可以扩展代理的能力,比如搜索互联网或科学计算',
|
||||
enabled: '启用',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
export default translation
|
||||
|
|
|
|||
|
|
@ -1,9 +1,14 @@
|
|||
const translation = {
|
||||
title: 'Apps',
|
||||
createApp: 'Create new App',
|
||||
types: {
|
||||
all: 'All',
|
||||
assistant: 'Assistant',
|
||||
completion: 'Completion',
|
||||
},
|
||||
modes: {
|
||||
completion: 'Text Generator',
|
||||
chat: 'Chat App',
|
||||
chat: 'Basic Assistant',
|
||||
},
|
||||
createFromConfigFile: 'Create app from config file',
|
||||
deleteAppConfirmTitle: 'Delete this app?',
|
||||
|
|
@ -18,10 +23,10 @@ const translation = {
|
|||
appNamePlaceholder: 'Please enter the name of the app',
|
||||
newApp: {
|
||||
startToCreate: 'Let\'s start with your new app',
|
||||
captionName: 'Give your app a name',
|
||||
captionAppType: 'What kind of app do you want?',
|
||||
captionName: 'App icon & name',
|
||||
captionAppType: 'What type of app do you want to create?',
|
||||
previewDemo: 'Preview demo',
|
||||
chatApp: 'Chat App',
|
||||
chatApp: 'Assistant',
|
||||
chatAppIntro:
|
||||
'I want to build a chat-based application. This app uses a question-and-answer format, allowing for multiple rounds of continuous conversation.',
|
||||
completeApp: 'Text Generator',
|
||||
|
|
|
|||
|
|
@ -1,9 +1,14 @@
|
|||
const translation = {
|
||||
title: '应用',
|
||||
createApp: '创建应用',
|
||||
types: {
|
||||
all: '全部',
|
||||
assistant: '助手',
|
||||
completion: '文本生成',
|
||||
},
|
||||
modes: {
|
||||
completion: '文本生成型',
|
||||
chat: '对话型',
|
||||
chat: '基础助手',
|
||||
},
|
||||
createFromConfigFile: '通过导入应用配置文件创建',
|
||||
deleteAppConfirmTitle: '确认删除应用?',
|
||||
|
|
@ -17,10 +22,10 @@ const translation = {
|
|||
appNamePlaceholder: '请输入应用名称',
|
||||
newApp: {
|
||||
startToCreate: '开始创建一个新应用',
|
||||
captionName: '给应用起个名字',
|
||||
captionName: '图标 & 名称',
|
||||
captionAppType: '想要哪种应用类型?',
|
||||
previewDemo: '预览 Demo',
|
||||
chatApp: '对话型应用',
|
||||
chatApp: '助手',
|
||||
chatAppIntro:
|
||||
'我要构建一个聊天场景的应用。该应用采用一问一答模式与用户持续对话。',
|
||||
completeApp: '文本生成应用',
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ const translation = {
|
|||
save: 'Save',
|
||||
edit: 'Edit',
|
||||
add: 'Add',
|
||||
added: 'Added',
|
||||
refresh: 'Restart',
|
||||
reset: 'Reset',
|
||||
search: 'Search',
|
||||
|
|
@ -85,13 +86,14 @@ const translation = {
|
|||
menus: {
|
||||
status: 'beta',
|
||||
explore: 'Explore',
|
||||
apps: 'Build Apps',
|
||||
apps: 'Studio',
|
||||
plugins: 'Plugins',
|
||||
pluginsTips: 'Integrate third-party plugins or create ChatGPT-compatible AI-Plugins.',
|
||||
datasets: 'Knowledge',
|
||||
datasetsTips: 'COMING SOON: Import your own text data or write data in real-time via Webhook for LLM context enhancement.',
|
||||
newApp: 'New App',
|
||||
newDataset: 'Create Knowledge',
|
||||
tools: 'Tools',
|
||||
},
|
||||
userProfile: {
|
||||
settings: 'Settings',
|
||||
|
|
@ -370,7 +372,7 @@ const translation = {
|
|||
},
|
||||
appMenus: {
|
||||
overview: 'Overview',
|
||||
promptEng: 'Prompt Eng.',
|
||||
promptEng: 'Orchestrate',
|
||||
apiAccess: 'API Access',
|
||||
logAndAnn: 'Logs & Ann.',
|
||||
},
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ const translation = {
|
|||
save: '保存',
|
||||
edit: '编辑',
|
||||
add: '添加',
|
||||
added: '已添加',
|
||||
refresh: '重新开始',
|
||||
reset: '重置',
|
||||
search: '搜索',
|
||||
|
|
@ -85,13 +86,14 @@ const translation = {
|
|||
menus: {
|
||||
status: 'beta',
|
||||
explore: '探索',
|
||||
apps: '构建应用',
|
||||
apps: '工作室',
|
||||
plugins: '插件',
|
||||
pluginsTips: '集成第三方插件或创建与 ChatGPT 兼容的 AI 插件。',
|
||||
datasets: '知识库',
|
||||
datasetsTips: '即将到来: 上传自己的长文本数据,或通过 Webhook 集成自己的数据源',
|
||||
newApp: '创建应用',
|
||||
newDataset: '创建知识库',
|
||||
tools: '工具',
|
||||
},
|
||||
userProfile: {
|
||||
settings: '设置',
|
||||
|
|
@ -370,7 +372,7 @@ const translation = {
|
|||
},
|
||||
appMenus: {
|
||||
overview: '概览',
|
||||
promptEng: '提示词编排',
|
||||
promptEng: '编排',
|
||||
apiAccess: '访问 API',
|
||||
logAndAnn: '日志与标注',
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
const translation = {
|
||||
knowledge: 'Knowledge',
|
||||
documentCount: ' docs',
|
||||
wordCount: 'k words',
|
||||
appCount: ' linked apps',
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
const translation = {
|
||||
knowledge: '知识库',
|
||||
documentCount: ' 文档',
|
||||
wordCount: '千字符',
|
||||
appCount: ' 关联应用',
|
||||
|
|
|
|||
103
web/i18n/lang/tools.en.ts
Normal file
103
web/i18n/lang/tools.en.ts
Normal file
|
|
@ -0,0 +1,103 @@
|
|||
const translation = {
|
||||
title: 'Tools',
|
||||
createCustomTool: 'Create Custom Tool',
|
||||
type: {
|
||||
all: 'All',
|
||||
builtIn: 'Built-in',
|
||||
custom: 'Custom',
|
||||
},
|
||||
contribute: {
|
||||
line1: 'I\'m interested in ',
|
||||
line2: 'contributing tools to Dify.',
|
||||
viewGuide: 'View the guide',
|
||||
},
|
||||
author: 'By',
|
||||
auth: {
|
||||
unauthorized: 'To Authorize',
|
||||
authorized: 'Authorized',
|
||||
setup: 'Set up authorization to use',
|
||||
setupModalTitle: 'Set Up Authorization',
|
||||
setupModalTitleDescription: 'After configuring credentials, all members within the workspace can use this tool when orchestrating applications.',
|
||||
},
|
||||
includeToolNum: '{{num}} tools included',
|
||||
addTool: 'Add Tool',
|
||||
createTool: {
|
||||
title: 'Create Custom Tool',
|
||||
editAction: 'Configure',
|
||||
editTitle: 'Edit Custom Tool',
|
||||
name: 'Name',
|
||||
toolNamePlaceHolder: 'Enter the tool name',
|
||||
schema: 'Schema',
|
||||
schemaPlaceHolder: 'Enter your OpenAPI schema here',
|
||||
viewSchemaSpec: 'View the OpenAPI-Swagger Specification',
|
||||
importFromUrl: 'Import from URL',
|
||||
importFromUrlPlaceHolder: 'https://...',
|
||||
urlError: 'Please enter a valid URL',
|
||||
examples: 'Examples',
|
||||
exampleOptions: {
|
||||
json: 'Weather(JSON)',
|
||||
yaml: 'Pet Store(YAML)',
|
||||
blankTemplate: 'Blank Template',
|
||||
},
|
||||
availableTools: {
|
||||
title: 'Available Tools',
|
||||
name: 'Name',
|
||||
description: 'Description',
|
||||
method: 'Method',
|
||||
path: 'Path',
|
||||
action: 'Actions',
|
||||
test: 'Test',
|
||||
},
|
||||
authMethod: {
|
||||
title: 'Authorization method',
|
||||
type: 'Authorization type',
|
||||
types: {
|
||||
none: 'None',
|
||||
api_key: 'API Key',
|
||||
},
|
||||
key: 'Key',
|
||||
value: 'Value',
|
||||
},
|
||||
privacyPolicy: 'Privacy policy',
|
||||
privacyPolicyPlaceholder: 'Please enter privacy policy',
|
||||
},
|
||||
test: {
|
||||
title: 'Test',
|
||||
parametersValue: 'Parameters & Value',
|
||||
parameters: 'Parameters',
|
||||
value: 'Value',
|
||||
testResult: 'Test Results',
|
||||
testResultPlaceholder: 'Test result will show here',
|
||||
},
|
||||
thought: {
|
||||
using: 'Using',
|
||||
used: 'Used',
|
||||
requestTitle: 'Request to',
|
||||
responseTitle: 'Response from',
|
||||
},
|
||||
setBuiltInTools: {
|
||||
info: 'Info',
|
||||
setting: 'Setting',
|
||||
toolDescription: 'Tool description',
|
||||
parameters: 'parameters',
|
||||
string: 'string',
|
||||
number: 'number',
|
||||
required: 'Required',
|
||||
infoAndSetting: 'Info & Settings',
|
||||
},
|
||||
noCustomTool: {
|
||||
title: 'No custom tools',
|
||||
content: 'Add and manage your custom tools here for building AI apps.',
|
||||
createTool: 'Create Tool',
|
||||
},
|
||||
noSearchRes: {
|
||||
title: 'Sorry, no results!',
|
||||
content: 'We couldn\'t find any tools that match your search.',
|
||||
reset: 'Reset Search',
|
||||
},
|
||||
builtInPromptTitle: 'Prompt',
|
||||
toolRemoved: 'Tool removed',
|
||||
notAuthorized: 'Tool not authorized',
|
||||
}
|
||||
|
||||
export default translation
|
||||
95
web/i18n/lang/tools.zh.ts
Normal file
95
web/i18n/lang/tools.zh.ts
Normal file
|
|
@ -0,0 +1,95 @@
|
|||
const translation = {
|
||||
title: '工具',
|
||||
createCustomTool: '创建自定义工具',
|
||||
type: {
|
||||
all: '全部',
|
||||
builtIn: '内置',
|
||||
custom: '自定义',
|
||||
},
|
||||
contribute: {
|
||||
line1: '我有兴趣为 ',
|
||||
line2: 'Dify 贡献工具。',
|
||||
viewGuide: '查看指南',
|
||||
},
|
||||
author: '作者',
|
||||
auth: {
|
||||
unauthorized: '去授权',
|
||||
authorized: '已授权',
|
||||
setup: '要使用请先授权',
|
||||
setupModalTitle: '设置授权',
|
||||
setupModalTitleDescription: '配置凭据后,工作区中的所有成员都可以在编排应用程序时使用此工具。',
|
||||
},
|
||||
includeToolNum: '包含 {{num}} 个工具',
|
||||
addTool: '添加工具',
|
||||
createTool: {
|
||||
title: '创建自定义工具',
|
||||
editAction: '编辑',
|
||||
editTitle: '编辑自定义工具',
|
||||
name: '名称',
|
||||
toolNamePlaceHolder: '输入工具名称',
|
||||
schema: 'Schema',
|
||||
schemaPlaceHolder: '在此处输入您的 OpenAPI schema',
|
||||
viewSchemaSpec: '查看 OpenAPI-Swagger 规范',
|
||||
importFromUrl: '从 URL 中导入',
|
||||
importFromUrlPlaceHolder: 'https://...',
|
||||
urlError: '请输入有效的 URL',
|
||||
examples: '例子',
|
||||
exampleOptions: {
|
||||
json: '天气(JSON)',
|
||||
yaml: '宠物商店(YAML)',
|
||||
blankTemplate: '空白模版',
|
||||
},
|
||||
availableTools: {
|
||||
title: '可用工具',
|
||||
name: '名称',
|
||||
description: '描述',
|
||||
method: '方法',
|
||||
path: '路径',
|
||||
action: '操作',
|
||||
test: '测试',
|
||||
},
|
||||
authMethod: {
|
||||
title: '鉴权方法',
|
||||
type: '鉴权类型',
|
||||
types: {
|
||||
none: '无',
|
||||
api_key: 'API Key',
|
||||
},
|
||||
key: '键',
|
||||
value: '值',
|
||||
},
|
||||
privacyPolicy: '隐私协议',
|
||||
privacyPolicyPlaceholder: '请输入隐私协议',
|
||||
},
|
||||
thought: {
|
||||
using: '正在使用',
|
||||
used: '已使用',
|
||||
requestTitle: '请求来自',
|
||||
responseTitle: '响应来自',
|
||||
},
|
||||
setBuiltInTools: {
|
||||
info: '信息',
|
||||
setting: '设置',
|
||||
toolDescription: '工具描述',
|
||||
parameters: '参数',
|
||||
string: '字符串',
|
||||
number: '数字',
|
||||
required: '必填',
|
||||
infoAndSetting: '信息和设置',
|
||||
},
|
||||
noCustomTool: {
|
||||
title: '没有自定义工具',
|
||||
content: '在此统一添加和管理你的自定义工具,方便构建应用时使用。',
|
||||
createTool: '创建工具',
|
||||
},
|
||||
noSearchRes: {
|
||||
title: '抱歉,没有结果!',
|
||||
content: '我们找不到任何与您的搜索相匹配的工具。',
|
||||
reset: '重置搜索',
|
||||
},
|
||||
builtInPromptTitle: '提示词',
|
||||
toolRemoved: '工具已被移除',
|
||||
notAuthorized: '工具未授权',
|
||||
}
|
||||
|
||||
export default translation
|
||||
Loading…
Add table
Add a link
Reference in a new issue