mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-24 22:03:54 +00:00
fix: sse
This commit is contained in:
@@ -58,7 +58,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
||||
guidePrompt = ''
|
||||
} = await (async () => {
|
||||
// 使用了知识库搜索
|
||||
if (model.chat.relatedKbs.length > 0) {
|
||||
if (model.chat.relatedKbs?.length > 0) {
|
||||
const { code, searchPrompts, rawSearch, guidePrompt } = await appKbSearch({
|
||||
model,
|
||||
userId,
|
||||
|
@@ -43,7 +43,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
|
||||
|
||||
const { code = 200, systemPrompts = [] } = await (async () => {
|
||||
// 使用了知识库搜索
|
||||
if (model.chat.relatedKbs.length > 0) {
|
||||
if (model.chat.relatedKbs?.length > 0) {
|
||||
const { code, searchPrompts } = await appKbSearch({
|
||||
model,
|
||||
userId,
|
||||
|
@@ -73,7 +73,7 @@ export default withNextCors(async function handler(req: NextApiRequest, res: Nex
|
||||
}[] = [];
|
||||
|
||||
// 使用了知识库搜索
|
||||
if (model.chat.relatedKbs.length > 0) {
|
||||
if (model.chat.relatedKbs?.length > 0) {
|
||||
const { code, searchPrompts } = await appKbSearch({
|
||||
model,
|
||||
userId,
|
||||
|
@@ -645,7 +645,7 @@ const Chat = ({ modelId, chatId }: { modelId: string; chatId: string }) => {
|
||||
fontSize={['sm', 'md']}
|
||||
onClick={() => router.push(`/model?modelId=${chatData.modelId}`)}
|
||||
>
|
||||
{chatData.model.name} {ChatModelMap[chatData.chatModel].name}
|
||||
{chatData.model.name} {ChatModelMap[chatData.chatModel]?.name}
|
||||
{chatData.history.length > 0 ? ` (${chatData.history.length})` : ''}
|
||||
</Box>
|
||||
{chatId ? (
|
||||
|
@@ -175,7 +175,7 @@ ${e.password ? `密码为: ${e.password}` : ''}`;
|
||||
// init kb select list
|
||||
const { data: kbList = [] } = useQuery(['loadKbList'], () => loadKbList());
|
||||
const RenderSelectedKbList = useCallback(() => {
|
||||
const kbs = getValues('chat.relatedKbs').map((id) => kbList.find((kb) => kb._id === id));
|
||||
const kbs = getValues('chat.relatedKbs')?.map((id) => kbList.find((kb) => kb._id === id)) || [];
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -334,7 +334,7 @@ ${e.password ? `密码为: ${e.password}` : ''}`;
|
||||
</Slider>
|
||||
</Flex>
|
||||
</FormControl>
|
||||
{getValues('chat.relatedKbs').length > 0 && (
|
||||
{getValues('chat.relatedKbs')?.length > 0 && (
|
||||
<Flex mt={4} alignItems={'center'}>
|
||||
<Box mr={4} whiteSpace={'nowrap'}>
|
||||
搜索模式 
|
||||
@@ -583,7 +583,7 @@ ${e.password ? `密码为: ${e.password}` : ''}`;
|
||||
{kbList.map((item) => (
|
||||
<Card key={item._id} p={3} mb={3}>
|
||||
<Checkbox
|
||||
isChecked={getValues('chat.relatedKbs').includes(item._id)}
|
||||
isChecked={getValues('chat.relatedKbs')?.includes(item._id)}
|
||||
onChange={(e) => {
|
||||
const ids = getValues('chat.relatedKbs');
|
||||
// toggle to true
|
||||
|
@@ -23,7 +23,7 @@ const BillTable = () => {
|
||||
|
||||
return (
|
||||
<>
|
||||
<TableContainer position={'relative'} minH={'200px'}>
|
||||
<TableContainer position={'relative'} minH={'100px'}>
|
||||
<Table>
|
||||
<Thead>
|
||||
<Tr>
|
||||
@@ -53,7 +53,7 @@ const BillTable = () => {
|
||||
</TableContainer>
|
||||
|
||||
{!isLoading && bills.length === 0 && (
|
||||
<Flex h={'100%'} flexDirection={'column'} alignItems={'center'} pt={'200px'}>
|
||||
<Flex h={'100%'} flexDirection={'column'} alignItems={'center'}>
|
||||
<MyIcon name="empty" w={'48px'} h={'48px'} color={'transparent'} />
|
||||
<Box mt={2} color={'myGray.500'}>
|
||||
无使用记录~
|
||||
|
@@ -71,7 +71,7 @@ const BillTable = () => {
|
||||
))}
|
||||
</Accordion>
|
||||
{!isLoading && informs.length === 0 && (
|
||||
<Flex h={'100%'} flexDirection={'column'} alignItems={'center'} pt={'200px'}>
|
||||
<Flex h={'100%'} flexDirection={'column'} alignItems={'center'} pt={'100px'}>
|
||||
<MyIcon name="empty" w={'48px'} h={'48px'} color={'transparent'} />
|
||||
<Box mt={2} color={'myGray.500'}>
|
||||
暂无通知~
|
||||
|
@@ -92,7 +92,7 @@ const PayRecordTable = () => {
|
||||
</Table>
|
||||
</TableContainer>
|
||||
{!isInitialLoading && payOrders.length === 0 && (
|
||||
<Flex h={'100%'} flexDirection={'column'} alignItems={'center'} pt={'200px'}>
|
||||
<Flex h={'100%'} flexDirection={'column'} alignItems={'center'} pt={'100px'}>
|
||||
<MyIcon name="empty" w={'48px'} h={'48px'} color={'transparent'} />
|
||||
<Box mt={2} color={'myGray.500'}>
|
||||
无支付记录~
|
||||
|
@@ -23,7 +23,7 @@ const OpenApi = () => {
|
||||
|
||||
return (
|
||||
<>
|
||||
<TableContainer position={'relative'} overflow={'hidden'} minH={'200px'}>
|
||||
<TableContainer position={'relative'} overflow={'hidden'} minH={'100px'}>
|
||||
<Table>
|
||||
<Thead>
|
||||
<Tr>
|
||||
|
Reference in New Issue
Block a user