Commit f149afee authored by nick zheng's avatar nick zheng

Merge branch 'beta' into 'master'

Beta

See merge request !18
parents 5174faf5 65c1c1f2
...@@ -165,11 +165,11 @@ personal_space_module: ...@@ -165,11 +165,11 @@ personal_space_module:
accurate_mode: '精准模式' accurate_mode: '精准模式'
balance_mode: '平衡模式' balance_mode: '平衡模式'
creative_mode: '创意模式' creative_mode: '创意模式'
topP: 'top P:' topP: 'Top P'
topP_popover_message: '模型在生成输出时会从概率最高的词汇开始选择,直到这些词汇的总概率累积达到Top p值。这样可以限制模型只选择这些高概率的词汇,从而控制输出内容的多样性。' topP_popover_message: '模型在生成输出时会从概率最高的词汇开始选择,直到这些词汇的总概率累积达到Top p值。这样可以限制模型只选择这些高概率的词汇,从而控制输出内容的多样性。'
temperature: '多样性:' temperature: '生成随机性'
temperature_popover_message: '用于控制模型输出的多样性。推荐值为 0,数值越大,模型每次输出内容的差异性越大' temperature_popover_message: '用于控制模型输出的多样性。推荐值为 0,数值越大,模型每次输出内容的差异性越大'
communication_turn: '参考对话轮数' communication_turn: '参考对话轮数'
communication_turn_popover_message: '传入大模型上下文的最大对话轮数。推荐值为2,数值越大,多轮对话中上下文相关性越强,但Tokens消耗越多' communication_turn_popover_message: '传入大模型上下文的最大对话轮数。推荐值为2,数值越大,多轮对话中上下文相关性越强,但Tokens消耗越多'
agent_setting: '应用设定' agent_setting: '应用设定'
base_info: '基本信息' base_info: '基本信息'
...@@ -182,16 +182,16 @@ personal_space_module: ...@@ -182,16 +182,16 @@ personal_space_module:
optimize_agent_system_prompt: '优化' optimize_agent_system_prompt: '优化'
optimize_agent_system_popover_message: 'AI优化' optimize_agent_system_popover_message: 'AI优化'
agent_system_template: '模板' agent_system_template: '模板'
agent_system_template_message: ' agent_system_template_message: "
#角色设定 #角色设定\n
作为一个____,你的任务是____。 作为一个____,你的任务是____。\n\n
#组件能力 #组件能力\n
你具备____能力。 你具备____能力。\n\n
#要求与限制 #要求与限制\n
1.输出内容的风格要求____ 1.输出内容的风格要求____\n
2.输出结果的格式为____ 2.输出结果的格式为____\n
3.输出内容的字数限制不超过____ 3.输出内容的字数限制不超过____\n
......' ......"
agent_system_input_placeholder: '请输入希望角色完成的任务目标、具备的组件能力以及对输出答案的要求与限制等' agent_system_input_placeholder: '请输入希望角色完成的任务目标、具备的组件能力以及对输出答案的要求与限制等'
ability_expand: '能力扩展' ability_expand: '能力扩展'
...@@ -284,7 +284,7 @@ personal_space_module: ...@@ -284,7 +284,7 @@ personal_space_module:
upload_limit_tip_message: '支持DOC、DOCX、TXT、PDF、MD,最多可上传5个文件,每个文件不超过10MB' upload_limit_tip_message: '支持DOC、DOCX、TXT、PDF、MD,最多可上传5个文件,每个文件不超过10MB'
empty_document_content_message: '上传文件内容不能为空' empty_document_content_message: '上传文件内容不能为空'
upload_format_error_message: '只能上传DOC、DOCX、TXT、PDF、MD格式文本文件,请重新上传' upload_format_error_message: '只能上传DOC、DOCX、TXT、PDF、MD格式文本文件,请重新上传'
upload_size_error_message: '上传文件大小不能超过5M' upload_size_error_message: '上传文件大小不能超过10M'
upload_error_message: '上传失败,请删除文件后再进行操作' upload_error_message: '上传失败,请删除文件后再进行操作'
default_segment_setting_title: '自动分段与清洗' default_segment_setting_title: '自动分段与清洗'
default_segment_setting_desc: '自动分段与预处理规则' default_segment_setting_desc: '自动分段与预处理规则'
......
...@@ -165,11 +165,11 @@ personal_space_module: ...@@ -165,11 +165,11 @@ personal_space_module:
accurate_mode: '精準模式' accurate_mode: '精準模式'
balance_mode: '平衡模式' balance_mode: '平衡模式'
creative_mode: '創意模式' creative_mode: '創意模式'
topP: 'top P:' topP: 'Top P'
topP_popover_message: '模型在生成輸出時會從概率最高的詞彙開始選擇,直到這些詞彙的總概率累積達到Top p值。這樣可以限制模型只選擇這些高概率的詞彙,從而控制輸出內容的多樣性' topP_popover_message: '模型在生成輸出時會從概率最高的詞彙開始選擇,直到這些詞彙的總概率累積達到Top p值。這樣可以限制模型只選擇這些高概率的詞彙,從而控制輸出內容的多樣性'
temperature: '多樣性:' temperature: '生成隨機性'
temperature_popover_message: '用於控制模型輸出的多樣性。推薦值為 0,數值越大,模型每次輸出內容的差異性越大' temperature_popover_message: '用於控制模型輸出的多樣性。推薦值為 0,數值越大,模型每次輸出內容的差異性越大'
communication_turn: '參考對話輪數' communication_turn: '參考對話輪數'
communication_turn_popover_message: '傳入大模型上下文的最大對話輪數。推薦值爲2,數值越大,多輪對話中上下文相關性越強,但Tokens消耗越多' communication_turn_popover_message: '傳入大模型上下文的最大對話輪數。推薦值爲2,數值越大,多輪對話中上下文相關性越強,但Tokens消耗越多'
agent_setting: '應用設定' agent_setting: '應用設定'
base_info: '基本信息' base_info: '基本信息'
...@@ -183,14 +183,14 @@ personal_space_module: ...@@ -183,14 +183,14 @@ personal_space_module:
optimize_agent_system_popover_message: 'AI優化' optimize_agent_system_popover_message: 'AI優化'
agent_system_template: '模板' agent_system_template: '模板'
agent_system_template_message: " agent_system_template_message: "
#角色\n #角色\n
为一个____,你的任务是____。\n\n 為一個____,你的任務是____。\n\n
#件能力\n #件能力\n
你具____能力。\n\n 你具____能力。\n\n
#要求限制\n #要求限制\n
1.输出内容的风格要求____\n 1.輸出內容的風格要求____\n
2.输出结果的格式为____\n 2.輸出結果的格式為____\n
3.输出内容的字数限制不超过____\n 3.輸出內容的字數限制不超過____\n
......" ......"
agent_system_input_placeholder: '請輸入希望角色完成的任務目標、具備的組件能力以及對輸出答案的要求與限制等' agent_system_input_placeholder: '請輸入希望角色完成的任務目標、具備的組件能力以及對輸出答案的要求與限制等'
...@@ -284,7 +284,7 @@ personal_space_module: ...@@ -284,7 +284,7 @@ personal_space_module:
upload_limit_tip_message: '支持DOC、DOCX、TXT、PDF、MD,最多可上傳5個文件,每個文件不超過10MB' upload_limit_tip_message: '支持DOC、DOCX、TXT、PDF、MD,最多可上傳5個文件,每個文件不超過10MB'
empty_document_content_message: '上傳文件內容不能為空' empty_document_content_message: '上傳文件內容不能為空'
upload_format_error_message: '只能上傳DOC、DOCX、TXT、PDF、MD格式文本文件,請重新上傳' upload_format_error_message: '只能上傳DOC、DOCX、TXT、PDF、MD格式文本文件,請重新上傳'
upload_size_error_message: '上傳文件大小不能超過5M' upload_size_error_message: '上傳文件大小不能超過10M'
upload_error_message: '上傳失敗,請刪除文件後再進行操作' upload_error_message: '上傳失敗,請刪除文件後再進行操作'
default_segment_setting_title: '自動分段與清洗' default_segment_setting_title: '自動分段與清洗'
default_segment_setting_desc: '自動分段與預處理規則' default_segment_setting_desc: '自動分段與預處理規則'
......
...@@ -108,8 +108,6 @@ async function handleGetKnowledgeChunkList() { ...@@ -108,8 +108,6 @@ async function handleGetKnowledgeChunkList() {
pagingInfo.value = res.pagingInfo as PaginationInfo pagingInfo.value = res.pagingInfo as PaginationInfo
knowledgeChunkListLoading.value = false knowledgeChunkListLoading.value = false
isSearchEmptyList.value = !!searchKnowledgeChunkValue.value && pagingInfo.value.totalRows === 0 isSearchEmptyList.value = !!searchKnowledgeChunkValue.value && pagingInfo.value.totalRows === 0
scrollBarRef.value?.scrollTo({ top: 0 })
} }
} }
...@@ -120,17 +118,20 @@ function handleBackKnowledgeDocumentList() { ...@@ -120,17 +118,20 @@ function handleBackKnowledgeDocumentList() {
async function handleGetKnowledgeChunkListUpdatePageNo(pageNo: number) { async function handleGetKnowledgeChunkListUpdatePageNo(pageNo: number) {
pagingInfo.value.pageNo = pageNo pagingInfo.value.pageNo = pageNo
await handleGetKnowledgeChunkList() await handleGetKnowledgeChunkList()
scrollBarRef.value?.scrollTo({ top: 0 })
} }
async function handleGetKnowledgeChunkListUpdatePageSize(pageSize: number) { async function handleGetKnowledgeChunkListUpdatePageSize(pageSize: number) {
pagingInfo.value.pageNo = 1 pagingInfo.value.pageNo = 1
pagingInfo.value.pageSize = pageSize pagingInfo.value.pageSize = pageSize
await handleGetKnowledgeChunkList() await handleGetKnowledgeChunkList()
scrollBarRef.value?.scrollTo({ top: 0 })
} }
async function handleSearchKnowledgeChunkList() { async function handleSearchKnowledgeChunkList() {
pagingInfo.value.pageNo = 1 pagingInfo.value.pageNo = 1
await handleGetKnowledgeChunkList() await handleGetKnowledgeChunkList()
scrollBarRef.value?.scrollTo({ top: 0 })
} }
function handleEditKnowledgeChunkModal(chunkItem: KnowledgeChunkItem) { function handleEditKnowledgeChunkModal(chunkItem: KnowledgeChunkItem) {
...@@ -204,7 +205,7 @@ async function handleUpdateOpenKnowledgeChunk(chunkItem: KnowledgeChunkItem) { ...@@ -204,7 +205,7 @@ async function handleUpdateOpenKnowledgeChunk(chunkItem: KnowledgeChunkItem) {
}) })
if (res.code === 0) { if (res.code === 0) {
await handleGetKnowledgeChunkList() chunkItem.isOpen = isOpen === 'Y' ? 'N' : 'Y'
} }
} }
</script> </script>
...@@ -253,11 +254,8 @@ async function handleUpdateOpenKnowledgeChunk(chunkItem: KnowledgeChunkItem) { ...@@ -253,11 +254,8 @@ async function handleUpdateOpenKnowledgeChunk(chunkItem: KnowledgeChunkItem) {
</div> </div>
<n-spin :show="knowledgeChunkListLoading" class="w-full flex-1 overflow-hidden" content-class="flex w-full h-full"> <n-spin :show="knowledgeChunkListLoading" class="w-full flex-1 overflow-hidden" content-class="flex w-full h-full">
<n-scrollbar <div v-if="knowledgeChunkList.length" class="flex flex-1">
v-if="!knowledgeChunkListLoading && knowledgeChunkList.length" <n-scrollbar v-show="!knowledgeChunkListLoading" ref="scrollBarRef" class="grid w-full flex-1 overflow-hidden">
ref="scrollBarRef"
class="grid w-full flex-1 overflow-hidden"
>
<div class="grid gap-5"> <div class="grid gap-5">
<KnowledgeChuckItem <KnowledgeChuckItem
v-for="chunkItem in knowledgeChunkList" v-for="chunkItem in knowledgeChunkList"
...@@ -272,6 +270,7 @@ async function handleUpdateOpenKnowledgeChunk(chunkItem: KnowledgeChunkItem) { ...@@ -272,6 +270,7 @@ async function handleUpdateOpenKnowledgeChunk(chunkItem: KnowledgeChunkItem) {
/> />
</div> </div>
</n-scrollbar> </n-scrollbar>
</div>
<div <div
v-show="!knowledgeChunkListLoading && knowledgeChunkList.length === 0" v-show="!knowledgeChunkListLoading && knowledgeChunkList.length === 0"
......
...@@ -57,7 +57,9 @@ const uploadFileSize = computed(() => (fileSize: number) => { ...@@ -57,7 +57,9 @@ const uploadFileSize = computed(() => (fileSize: number) => {
function handleLimitUpload(data: { file: UploadFileInfo }) { function handleLimitUpload(data: { file: UploadFileInfo }) {
const allowTypeList = ['md', 'doc', 'docx', 'pdf', 'txt'] const allowTypeList = ['md', 'doc', 'docx', 'pdf', 'txt']
if (data.file.file && !allowTypeList.includes(data.file.file?.name.split('.')[1].toLowerCase())) { const fileType = (data.file.file && data.file.file?.name.split('.')?.pop()?.toLowerCase()) || ''
if (fileType && !allowTypeList.includes(fileType)) {
window.$message.error( window.$message.error(
t('personal_space_module.knowledge_module.upload_document_module.upload_format_error_message'), t('personal_space_module.knowledge_module.upload_document_module.upload_format_error_message'),
) )
...@@ -73,7 +75,7 @@ function handleLimitUpload(data: { file: UploadFileInfo }) { ...@@ -73,7 +75,7 @@ function handleLimitUpload(data: { file: UploadFileInfo }) {
name: data.file.name, name: data.file.name,
status: FileItemStatus.ERROR, status: FileItemStatus.ERROR,
size: data.file.file?.size || 0, size: data.file.file?.size || 0,
type: data.file.file?.name.split('.')[1].toLowerCase(), type: fileType,
kdId: 0, kdId: 0,
} }
...@@ -81,14 +83,14 @@ function handleLimitUpload(data: { file: UploadFileInfo }) { ...@@ -81,14 +83,14 @@ function handleLimitUpload(data: { file: UploadFileInfo }) {
return false return false
} }
if (data.file.file && data.file.file?.size > 5 * 1024 * 1024) { if (data.file.file && data.file.file?.size > 10 * 1024 * 1024) {
window.$message.error(t('personal_space_module.knowledge_module.upload_document_module.upload_size_error_message')) window.$message.error(t('personal_space_module.knowledge_module.upload_document_module.upload_size_error_message'))
const fileData = { const fileData = {
id: data.file.id, id: data.file.id,
name: data.file.name, name: data.file.name,
status: FileItemStatus.ERROR, status: FileItemStatus.ERROR,
size: data.file.file?.size || 0, size: data.file.file?.size || 0,
type: data.file.file?.name.split('.')[1].toLowerCase(), type: fileType,
kdId: 0, kdId: 0,
} }
...@@ -109,7 +111,7 @@ async function handleUpload(file: any) { ...@@ -109,7 +111,7 @@ async function handleUpload(file: any) {
name: file.file.name, name: file.file.name,
status: FileItemStatus.UPLOADING, status: FileItemStatus.UPLOADING,
size: file.file?.file?.size || 0, size: file.file?.file?.size || 0,
type: file.file?.name.split('.')[1].toLowerCase(), type: file.file?.name.split('.')?.pop()?.toLowerCase(),
kdId: 0, kdId: 0,
} }
...@@ -144,12 +146,15 @@ function handleDropFile(e: DragEvent) { ...@@ -144,12 +146,15 @@ function handleDropFile(e: DragEvent) {
const allowTypeList = ['md', 'doc', 'docx', 'pdf', 'txt'] const allowTypeList = ['md', 'doc', 'docx', 'pdf', 'txt']
if (file && !allowTypeList.includes(file.name.split('.')[1].toLowerCase())) { if (file && file.name) {
const fileType = file.name.split('.')?.pop()?.toLowerCase() || ''
if (!allowTypeList.includes(fileType)) {
window.$message.error( window.$message.error(
t('personal_space_module.knowledge_module.upload_document_module.upload_format_error_message'), t('personal_space_module.knowledge_module.upload_document_module.upload_format_error_message'),
) )
return false return false
} }
}
} }
function handleRemoveFile(id: string) { function handleRemoveFile(id: string) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment