Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions web/components/knowledge/space-card.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { apiInterceptors, delSpace, newDialogue } from '@/client/api';
import { ChatContext } from '@/app/chat-context';
import { ISpace } from '@/types/knowledge';
import { ClockCircleOutlined, DeleteFilled, MessageFilled, UserOutlined, WarningOutlined } from '@ant-design/icons';
import { Badge, ConfigProvider, Modal, Popover } from 'antd';
import moment from 'moment';
import { useRouter } from 'next/router';
import { useContext } from 'react';
import { useTranslation } from 'react-i18next';
import GptCard from '../common/gpt-card';
import DocPanel from './doc-panel';
Expand All @@ -20,6 +22,7 @@ export default function SpaceCard(props: IProps) {
const router = useRouter();
const { t } = useTranslation();
const { space, getSpaces } = props;
const { model } = useContext(ChatContext);

const showDeleteConfirm = () => {
confirm({
Expand All @@ -44,6 +47,7 @@ export default function SpaceCard(props: IProps) {
const [_, data] = await apiInterceptors(
newDialogue({
chat_mode: 'chat_knowledge',
model,
}),
);
if (data?.conv_uid) {
Expand Down
3 changes: 2 additions & 1 deletion web/pages/construct/knowledge/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { useContext, useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';

const Knowledge = () => {
const { setCurrentDialogInfo } = useContext(ChatContext);
const { setCurrentDialogInfo, model } = useContext(ChatContext);
const [spaceList, setSpaceList] = useState<Array<ISpace> | null>([]);
const [isAddShow, setIsAddShow] = useState<boolean>(false);
const [isPanelShow, setIsPanelShow] = useState<boolean>(false);
Expand Down Expand Up @@ -63,6 +63,7 @@ const Knowledge = () => {
const [_, data] = await apiInterceptors(
newDialogue({
chat_mode: 'chat_knowledge',
model,
}),
);
// 知识库对话都默认私有知识库应用下
Expand Down
Loading