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