Skip to content

Commit 8381ca5

Browse files
Merge branch 'main' of https://github.com/maxkb-dev/maxkb
2 parents f5282bf + e8c1cdf commit 8381ca5

File tree

5 files changed

+43
-13
lines changed

5 files changed

+43
-13
lines changed

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<p align="center"><img src= "https://github.com/1Panel-dev/maxkb/assets/52996290/c0694996-0eed-40d8-b369-322bf2a380bf" alt="MaxKB" width="300" /></p>
2-
<h3 align="center">Ready-to-use RAG Chatbot</h3>
3-
<h3 align="center">基于大模型和 RAG 的开源知识库问答系统</h3>
2+
<h3 align="center">Ready-to-use AI Chatbot</h3>
43
<p align="center"><a href="https://trendshift.io/repositories/9113" target="_blank"><img src="https://trendshift.io/api/badge/repositories/9113" alt="1Panel-dev%2FMaxKB | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a></p>
54
<p align="center">
65
<a href="https://www.gnu.org/licenses/gpl-3.0.html#license-text"><img src="https://img.shields.io/github/license/1Panel-dev/maxkb?color=%231890FF" alt="License: GPL v3"></a>
@@ -11,7 +10,7 @@
1110
</p>
1211
<hr/>
1312

14-
MaxKB = Max Knowledge Base, it is a ready-to-use RAG chatbot that features robust workflow and MCP tool-use capabilities. MaxKB is widely applied in scenarios such as intelligent customer service, corporate internal knowledge bases, academic research, and education.
13+
MaxKB = Max Knowledge Base, it is a ready-to-use AI chatbot that integrates Retrieval-Augmented Generation (RAG) pipelines, supports robust workflows, and provides advanced MCP tool-use capabilities. MaxKB is widely applied in scenarios such as intelligent customer service, corporate internal knowledge bases, academic research, and education.
1514

1615
- **Ready-to-Use**: Supports direct uploading of documents / automatic crawling of online documents, with features for automatic text splitting, vectorization, and RAG (Retrieval-Augmented Generation). This effectively reduces hallucinations in large models, providing a superior smart Q&A interaction experience.
1716
- **Flexible Orchestration**: Equipped with a powerful workflow engine, function library and MCP tool-use, enabling the orchestration of AI processes to meet the needs of complex business scenarios.

ui/src/components/ai-chat/component/answer-content/index.vue

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<template>
22
<div class="item-content mb-16 lighter">
33
<template v-for="(answer_text, index) in answer_text_list" :key="index">
4-
<div class="avatar mr-8" v-if="application.show_avatar">
4+
<div class="avatar mr-8" v-if="showAvatar">
55
<img v-if="application.avatar" :src="application.avatar" height="28px" width="28px" />
66
<LogoIcon v-else height="28px" width="28px" />
77
</div>
88
<div
99
class="content"
1010
@mouseup="openControl"
1111
:style="{
12-
'padding-right': application.show_user_avatar ? 'var(--padding-left)' : '0'
12+
'padding-right': showAvatar ? 'var(--padding-left)' : '0'
1313
}"
1414
>
1515
<el-card shadow="always" class="mb-8 border-r-8" style="--el-card-padding: 6px 16px">
@@ -51,8 +51,8 @@
5151
<div
5252
class="content"
5353
:style="{
54-
'padding-left': application.show_avatar ? 'var(--padding-left)' : '0',
55-
'padding-right': application.show_user_avatar ? 'var(--padding-left)' : '0'
54+
'padding-left': showAvatar ? 'var(--padding-left)' : '0',
55+
'padding-right': showAvatar ? 'var(--padding-left)' : '0'
5656
}"
5757
>
5858
<OperationButton
@@ -75,6 +75,7 @@ import OperationButton from '@/components/ai-chat/component/operation-button/ind
7575
import { type chatType } from '@/api/type/application'
7676
import { computed } from 'vue'
7777
import bus from '@/bus'
78+
import useStore from '@/stores'
7879
const props = defineProps<{
7980
chatRecord: chatType
8081
application: any
@@ -84,8 +85,14 @@ const props = defineProps<{
8485
type: 'log' | 'ai-chat' | 'debug-ai-chat'
8586
}>()
8687
88+
const { user } = useStore()
89+
8790
const emit = defineEmits(['update:chatRecord'])
8891
92+
const showAvatar = computed(() => {
93+
return user.isEnterprise() ? props.application.show_avatar : true
94+
})
95+
8996
const chatMessage = (question: string, type: 'old' | 'new', other_params_data?: any) => {
9097
if (type === 'old') {
9198
add_answer_text_list(props.chatRecord.answer_text_list)

ui/src/components/ai-chat/component/prologue-content/index.vue

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<template>
22
<!-- 开场白组件 -->
33
<div class="item-content mb-16">
4-
<div class="avatar mr-8" v-if="prologue && application.show_avatar">
4+
<div class="avatar mr-8" v-if="prologue && showAvatar">
55
<img v-if="application.avatar" :src="application.avatar" height="28px" width="28px" />
66
<LogoIcon v-else height="28px" width="28px" />
77
</div>
88
<div
99
class="content"
1010
v-if="prologue"
1111
:style="{
12-
'padding-right': application.show_user_avatar ? 'var(--padding-left)' : '0'
12+
'padding-right': showUserAvatar ? 'var(--padding-left)' : '0'
1313
}"
1414
>
1515
<el-card shadow="always" class="border-r-8" style="--el-card-padding: 10px 16px 12px">
@@ -27,12 +27,23 @@ import { type chatType } from '@/api/type/application'
2727
import { computed } from 'vue'
2828
import MdRenderer from '@/components/markdown/MdRenderer.vue'
2929
import { t } from '@/locales'
30+
import useStore from '@/stores'
3031
const props = defineProps<{
3132
application: any
3233
available: boolean
3334
type: 'log' | 'ai-chat' | 'debug-ai-chat'
3435
sendMessage: (question: string, other_params_data?: any, chat?: chatType) => void
3536
}>()
37+
38+
const { user } = useStore()
39+
40+
const showAvatar = computed(() => {
41+
return user.isEnterprise() ? props.application.show_avatar : true
42+
})
43+
const showUserAvatar = computed(() => {
44+
return user.isEnterprise() ? props.application.show_user_avatar : true
45+
})
46+
3647
const toQuickQuestion = (match: string, offset: number, input: string) => {
3748
return `<quick_question>${match.replace('- ', '')}</quick_question>`
3849
}

ui/src/components/ai-chat/component/question-content/index.vue

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
<span> {{ chatRecord.problem_text }}</span>
6464
</div>
6565
</div>
66-
<div class="avatar ml-8" v-if="application.show_user_avatar">
66+
<div class="avatar ml-8" v-if="showAvatar">
6767
<el-image
6868
v-if="application.user_avatar"
6969
:src="application.user_avatar"
@@ -81,12 +81,18 @@
8181
import { type chatType } from '@/api/type/application'
8282
import { getImgUrl, getAttrsArray, downloadByURL } from '@/utils/utils'
8383
import { onMounted, computed } from 'vue'
84-
84+
import useStore from '@/stores'
8585
const props = defineProps<{
8686
application: any
8787
chatRecord: chatType
8888
type: 'log' | 'ai-chat' | 'debug-ai-chat'
8989
}>()
90+
91+
const { user } = useStore()
92+
93+
const showAvatar = computed(() => {
94+
return user.isEnterprise() ? props.application.show_user_avatar : true
95+
})
9096
const document_list = computed(() => {
9197
if (props.chatRecord?.upload_meta) {
9298
return props.chatRecord.upload_meta?.document_list || []

ui/src/workflow/nodes/condition-node/index.vue

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@
2323
v-resize="(wh: any) => resizeCondition(wh, item, index)"
2424
shadow="never"
2525
class="drag-card card-never mb-8"
26-
:class="{ 'no-drag': index === form_data.branch.length - 1 }"
26+
:class="{
27+
'no-drag': index === form_data.branch.length - 1 || form_data.branch.length === 2
28+
}"
2729
style="--el-card-padding: 12px"
2830
>
2931
<div class="handle flex-between lighter">
@@ -245,7 +247,12 @@ function onEnd(event?: any) {
245247
const { oldIndex, newIndex, clonedData } = event
246248
if (oldIndex === undefined || newIndex === undefined) return
247249
const list = cloneDeep(props.nodeModel.properties.node_data.branch)
248-
250+
if (oldIndex === list.length - 1 || newIndex === list.length - 1) {
251+
list[newIndex] = list[oldIndex]
252+
list[oldIndex] = clonedData
253+
set(props.nodeModel.properties.node_data, 'branch', list)
254+
return
255+
}
249256
list[newIndex].type = list[oldIndex].type
250257
list[oldIndex].type = clonedData.type // 恢复原始 type
251258
set(props.nodeModel.properties.node_data, 'branch', list)

0 commit comments

Comments
 (0)