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