This commit is contained in:
liqiang-fit2cloud 2025-04-09 15:08:32 +08:00
commit 8381ca5287
5 changed files with 43 additions and 13 deletions

View File

@ -1,6 +1,5 @@
<p align="center"><img src= "https://github.com/1Panel-dev/maxkb/assets/52996290/c0694996-0eed-40d8-b369-322bf2a380bf" alt="MaxKB" width="300" /></p>
<h3 align="center">Ready-to-use RAG Chatbot</h3>
<h3 align="center">基于大模型和 RAG 的开源知识库问答系统</h3>
<h3 align="center">Ready-to-use AI Chatbot</h3>
<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>
<p align="center">
<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 @@
</p>
<hr/>
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.
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.
- **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.
- **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.

View File

@ -1,7 +1,7 @@
<template>
<div class="item-content mb-16 lighter">
<template v-for="(answer_text, index) in answer_text_list" :key="index">
<div class="avatar mr-8" v-if="application.show_avatar">
<div class="avatar mr-8" v-if="showAvatar">
<img v-if="application.avatar" :src="application.avatar" height="28px" width="28px" />
<LogoIcon v-else height="28px" width="28px" />
</div>
@ -9,7 +9,7 @@
class="content"
@mouseup="openControl"
:style="{
'padding-right': application.show_user_avatar ? 'var(--padding-left)' : '0'
'padding-right': showAvatar ? 'var(--padding-left)' : '0'
}"
>
<el-card shadow="always" class="mb-8 border-r-8" style="--el-card-padding: 6px 16px">
@ -51,8 +51,8 @@
<div
class="content"
:style="{
'padding-left': application.show_avatar ? 'var(--padding-left)' : '0',
'padding-right': application.show_user_avatar ? 'var(--padding-left)' : '0'
'padding-left': showAvatar ? 'var(--padding-left)' : '0',
'padding-right': showAvatar ? 'var(--padding-left)' : '0'
}"
>
<OperationButton
@ -75,6 +75,7 @@ import OperationButton from '@/components/ai-chat/component/operation-button/ind
import { type chatType } from '@/api/type/application'
import { computed } from 'vue'
import bus from '@/bus'
import useStore from '@/stores'
const props = defineProps<{
chatRecord: chatType
application: any
@ -84,8 +85,14 @@ const props = defineProps<{
type: 'log' | 'ai-chat' | 'debug-ai-chat'
}>()
const { user } = useStore()
const emit = defineEmits(['update:chatRecord'])
const showAvatar = computed(() => {
return user.isEnterprise() ? props.application.show_avatar : true
})
const chatMessage = (question: string, type: 'old' | 'new', other_params_data?: any) => {
if (type === 'old') {
add_answer_text_list(props.chatRecord.answer_text_list)

View File

@ -1,7 +1,7 @@
<template>
<!-- 开场白组件 -->
<div class="item-content mb-16">
<div class="avatar mr-8" v-if="prologue && application.show_avatar">
<div class="avatar mr-8" v-if="prologue && showAvatar">
<img v-if="application.avatar" :src="application.avatar" height="28px" width="28px" />
<LogoIcon v-else height="28px" width="28px" />
</div>
@ -9,7 +9,7 @@
class="content"
v-if="prologue"
:style="{
'padding-right': application.show_user_avatar ? 'var(--padding-left)' : '0'
'padding-right': showUserAvatar ? 'var(--padding-left)' : '0'
}"
>
<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'
import { computed } from 'vue'
import MdRenderer from '@/components/markdown/MdRenderer.vue'
import { t } from '@/locales'
import useStore from '@/stores'
const props = defineProps<{
application: any
available: boolean
type: 'log' | 'ai-chat' | 'debug-ai-chat'
sendMessage: (question: string, other_params_data?: any, chat?: chatType) => void
}>()
const { user } = useStore()
const showAvatar = computed(() => {
return user.isEnterprise() ? props.application.show_avatar : true
})
const showUserAvatar = computed(() => {
return user.isEnterprise() ? props.application.show_user_avatar : true
})
const toQuickQuestion = (match: string, offset: number, input: string) => {
return `<quick_question>${match.replace('- ', '')}</quick_question>`
}

View File

@ -63,7 +63,7 @@
<span> {{ chatRecord.problem_text }}</span>
</div>
</div>
<div class="avatar ml-8" v-if="application.show_user_avatar">
<div class="avatar ml-8" v-if="showAvatar">
<el-image
v-if="application.user_avatar"
:src="application.user_avatar"
@ -81,12 +81,18 @@
import { type chatType } from '@/api/type/application'
import { getImgUrl, getAttrsArray, downloadByURL } from '@/utils/utils'
import { onMounted, computed } from 'vue'
import useStore from '@/stores'
const props = defineProps<{
application: any
chatRecord: chatType
type: 'log' | 'ai-chat' | 'debug-ai-chat'
}>()
const { user } = useStore()
const showAvatar = computed(() => {
return user.isEnterprise() ? props.application.show_user_avatar : true
})
const document_list = computed(() => {
if (props.chatRecord?.upload_meta) {
return props.chatRecord.upload_meta?.document_list || []

View File

@ -23,7 +23,9 @@
v-resize="(wh: any) => resizeCondition(wh, item, index)"
shadow="never"
class="drag-card card-never mb-8"
:class="{ 'no-drag': index === form_data.branch.length - 1 }"
:class="{
'no-drag': index === form_data.branch.length - 1 || form_data.branch.length === 2
}"
style="--el-card-padding: 12px"
>
<div class="handle flex-between lighter">
@ -245,7 +247,12 @@ function onEnd(event?: any) {
const { oldIndex, newIndex, clonedData } = event
if (oldIndex === undefined || newIndex === undefined) return
const list = cloneDeep(props.nodeModel.properties.node_data.branch)
if (oldIndex === list.length - 1 || newIndex === list.length - 1) {
list[newIndex] = list[oldIndex]
list[oldIndex] = clonedData
set(props.nodeModel.properties.node_data, 'branch', list)
return
}
list[newIndex].type = list[oldIndex].type
list[oldIndex].type = clonedData.type // type
set(props.nodeModel.properties.node_data, 'branch', list)