Feat: Chat without KB. #5216 (#5217)

### What problem does this PR solve?
Feat: Chat without KB. #5216

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2025-02-21 12:24:13 +08:00
committed by GitHub
parent f5d63bb7df
commit 46ff897107
8 changed files with 57 additions and 23 deletions

View File

@ -9,7 +9,15 @@ import { Avatar, AvatarFallback, AvatarImage } from './ui/avatar';
import { FormControl, FormField, FormItem, FormLabel } from './ui/form';
import { MultiSelect } from './ui/multi-select';
const KnowledgeBaseItem = () => {
interface KnowledgeBaseItemProps {
required?: boolean;
onChange?(): void;
}
const KnowledgeBaseItem = ({
required = true,
onChange,
}: KnowledgeBaseItemProps) => {
const { t } = useTranslate('chat');
const { list: knowledgeList } = useFetchKnowledgeList(true);
@ -35,7 +43,7 @@ const KnowledgeBaseItem = () => {
tooltip={t('knowledgeBasesTip')}
rules={[
{
required: true,
required,
message: t('knowledgeBasesMessage'),
type: 'array',
},
@ -45,6 +53,7 @@ const KnowledgeBaseItem = () => {
mode="multiple"
options={knowledgeOptions}
placeholder={t('knowledgeBasesMessage')}
onChange={onChange}
></Select>
</Form.Item>
);