This commit is contained in:
archer
2023-06-12 20:52:51 +08:00
parent 36a0ea7e43
commit ca4cd8af9d
9 changed files with 12 additions and 12 deletions

View File

@@ -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,

View File

@@ -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,

View File

@@ -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,

View File

@@ -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 ? (

View File

@@ -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'}>
&emsp;
@@ -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

View File

@@ -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'}>
使~

View File

@@ -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'}>
~

View File

@@ -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'}>
~

View File

@@ -23,7 +23,7 @@ const OpenApi = () => {
return (
<>
<TableContainer position={'relative'} overflow={'hidden'} minH={'200px'}>
<TableContainer position={'relative'} overflow={'hidden'} minH={'100px'}>
<Table>
<Thead>
<Tr>