V4.8.17 feature (#3485)

* feat: add third party account config (#3443)

* temp

* editor workflow variable style

* add team to dispatch

* i18n

* delete console

* change openai account position

* fix

* fix

* fix

* fix

* fix

* 4.8.17 test (#3461)

* perf: external provider config

* perf: ui

* feat: add template config (#3434)

* change template position

* template config

* delete console

* delete

* fix

* fix

* perf: Mongo visutal field (#3464)

* remve invalid code

* perf: team member visutal code

* perf: virtual search; perf: search test data

* fix: ts

* fix: image response headers

* perf: template code

* perf: auth layout;perf: auto save (#3472)

* perf: auth layout

* perf: auto save

* perf: auto save

* fix: template guide display & http input support external variables (#3475)

* fix: template guide display

* http editor support external workflow variables

* perf: auto save;fix: ifelse checker line break; (#3478)

* perf: auto save

* perf: auto save

* fix: ifelse checker line break

* perf: doc

* perf: doc

* fix: update var type error

* 4.8.17 test (#3479)

* perf: auto save

* perf: auto save

* perf: template code

* 4.8.17 test (#3480)

* perf: auto save

* perf: auto save

* perf: model price model

* feat: add react memo

* perf: model provider filter

* fix: ts (#3481)

* perf: auto save

* perf: auto save

* fix: ts

* simple app tool select (#3473)

* workflow plugin userguide & simple tool ui

* simple tool filter

* reuse component

* change component to hook

* fix

* perf: too selector modal (#3484)

* perf: auto save

* perf: auto save

* perf: markdown render

* perf: too selector

* fix: app version require tmbId

* perf: templates refresh

* perf: templates refresh

* hide auto save error tip

* perf: toolkit guide

---------

Co-authored-by: heheer <heheer@sealos.io>
This commit is contained in:
Archer
2024-12-27 20:05:12 +08:00
committed by GitHub
parent a209856d48
commit b520988c64
207 changed files with 2943 additions and 1378 deletions

View File

@@ -100,12 +100,6 @@ const AIChatSettingsModal = ({
setRefresh(!refresh);
};
const {
isOpen: isOpenAiPointsModal,
onClose: onCloseAiPointsModal,
onOpen: onOpenAiPointsModal
} = useDisclosure();
return (
<MyModal
isOpen
@@ -160,10 +154,11 @@ const AIChatSettingsModal = ({
<Th fontSize={'mini'} pb={2}>
<HStack spacing={1}>
<Box> {t('app:ai_point_price')}</Box>
<QuestionTip
label={t('app:look_ai_point_price')}
onClick={onOpenAiPointsModal}
/>
<ModelPriceModal>
{({ onOpen }) => (
<QuestionTip label={t('app:look_ai_point_price')} onClick={onOpen} />
)}
</ModelPriceModal>
</HStack>
</Th>
<Th fontSize={'mini'} pb={2}>
@@ -327,8 +322,6 @@ const AIChatSettingsModal = ({
{t('common:common.Confirm')}
</Button>
</ModalFooter>
{isOpenAiPointsModal && <ModelPriceModal onClose={onCloseAiPointsModal} />}
</MyModal>
);
};

View File

@@ -9,9 +9,9 @@ import {
Td,
Th,
Thead,
Tr
Tr,
useDisclosure
} from '@chakra-ui/react';
import MyModal from '@fastgpt/web/components/common/MyModal';
import { useTranslation } from 'next-i18next';
import React, { useMemo, useRef, useState } from 'react';
import {
@@ -26,6 +26,9 @@ import { useSystemStore } from '@/web/common/system/useSystemStore';
import Avatar from '@fastgpt/web/components/common/Avatar';
import MyTag from '@fastgpt/web/components/common/Tag/index';
import MyTooltip from '@fastgpt/web/components/common/MyTooltip';
import dynamic from 'next/dynamic';
const MyModal = dynamic(() => import('@fastgpt/web/components/common/MyModal'));
const ModelTable = () => {
const { t } = useTranslation();
@@ -156,6 +159,19 @@ const ModelTable = () => {
search
]);
const filterProviderList = useMemo(() => {
const allProviderIds: string[] = [
...llmModelList,
...vectorModelList,
...audioSpeechModelList,
whisperModel
].map((model) => model.provider);
return providerList.current.filter(
(item) => allProviderIds.includes(item.value) || item.value === ''
);
}, [audioSpeechModelList, llmModelList, vectorModelList, whisperModel]);
return (
<Flex flexDirection={'column'} h={'100%'}>
<Flex>
@@ -168,7 +184,7 @@ const ModelTable = () => {
bg={'myGray.50'}
value={provider}
onchange={setProvider}
list={providerList.current}
list={filterProviderList}
/>
</HStack>
<HStack flexShrink={0} ml={6}>
@@ -228,24 +244,34 @@ const ModelTable = () => {
export default ModelTable;
export const ModelPriceModal = ({ onClose }: { onClose: () => void }) => {
export const ModelPriceModal = ({
children
}: {
children: ({ onOpen }: { onOpen: () => void }) => React.ReactNode;
}) => {
const { t } = useTranslation();
const { isOpen, onOpen, onClose } = useDisclosure();
return (
<MyModal
isCentered
iconSrc="/imgs/modal/bill.svg"
title={t('common:support.wallet.subscription.Ai points')}
isOpen
onClose={onClose}
w={'100%'}
h={'100%'}
maxW={'90vw'}
maxH={'90vh'}
>
<ModalBody flex={'1 0 0'}>
<ModelTable />
</ModalBody>
</MyModal>
<>
{children({ onOpen })}
{isOpen && (
<MyModal
isCentered
iconSrc="/imgs/modal/bill.svg"
title={t('common:support.wallet.subscription.Ai points')}
isOpen
onClose={onClose}
w={'100%'}
h={'100%'}
maxW={'90vw'}
maxH={'90vh'}
>
<ModalBody flex={'1 0 0'}>
<ModelTable />
</ModalBody>
</MyModal>
)}
</>
);
};

View File

@@ -226,8 +226,8 @@ const DatasetParamsModal = ({
{limit !== undefined && (
<Box display={['block', 'flex']}>
<Flex flex={'0 0 120px'} alignItems={'center'} mb={[5, 0]}>
<FormLabel>{t('app:max_quote_tokens')}</FormLabel>
<QuestionTip label={t('app:max_quote_tokens_tips')} />
<FormLabel>{t('common:max_quote_tokens')}</FormLabel>
<QuestionTip label={t('common:max_quote_tokens_tips')} />
</Flex>
<Box flex={'1 0 0'}>
<InputSlider
@@ -245,8 +245,8 @@ const DatasetParamsModal = ({
)}
<Box display={['block', 'flex']} mt={[6, 10]} mb={4}>
<Flex flex={'0 0 120px'} alignItems={'center'} mb={[5, 0]}>
<FormLabel>{t('app:min_similarity')}</FormLabel>
<QuestionTip label={t('app:min_similarity_tip')} />
<FormLabel>{t('common:min_similarity')}</FormLabel>
<QuestionTip label={t('common:min_similarity_tip')} />
</Flex>
<Box flex={'1 0 0'}>
{showSimilarity ? (

View File

@@ -1,4 +1,4 @@
import { Box, Button, Flex, Switch, Textarea } from '@chakra-ui/react';
import { Box, Button, Flex, Switch, Textarea, useDisclosure } from '@chakra-ui/react';
import { WorkflowIOValueTypeEnum } from '@fastgpt/global/core/workflow/constants';
import { FlowNodeInputTypeEnum } from '@fastgpt/global/core/workflow/node/constant';
import { FlowNodeInputItemType } from '@fastgpt/global/core/workflow/type/io';
@@ -20,6 +20,8 @@ import { isEqual } from 'lodash';
import { ChatItemContext } from '@/web/core/chat/context/chatItemContext';
import { ChatRecordContext } from '@/web/core/chat/context/chatRecordContext';
import { PluginRunContext } from '../context';
import { useSystemStore } from '@/web/common/system/useSystemStore';
import AIModelSelector from '@/components/Select/AIModelSelector';
const JsonEditor = dynamic(() => import('@fastgpt/web/components/common/Textarea/JsonEditor'));
@@ -152,6 +154,7 @@ const RenderPluginInput = ({
}) => {
const { t } = useTranslation();
const inputType = input.renderTypeList[0];
const { llmModelList } = useSystemStore();
const render = (() => {
if (inputType === FlowNodeInputTypeEnum.customVariable) {
@@ -167,7 +170,19 @@ const RenderPluginInput = ({
<FileSelector onChange={onChange} input={input} setUploading={setUploading} value={value} />
);
}
if (inputType === FlowNodeInputTypeEnum.selectLLMModel) {
return (
<AIModelSelector
w={'100%'}
value={value}
list={llmModelList.map((item) => ({
value: item.model,
label: item.name
}))}
onchange={onChange}
/>
);
}
if (input.valueType === WorkflowIOValueTypeEnum.string) {
return (
<Textarea

View File

@@ -62,8 +62,8 @@ const SearchParamsTip = ({
<Thead>
<Tr bg={'transparent !important'}>
<Th fontSize={'mini'}>{t('common:core.dataset.search.search mode')}</Th>
<Th fontSize={'mini'}>{t('app:max_quote_tokens')}</Th>
<Th fontSize={'mini'}>{t('app:min_similarity')}</Th>
<Th fontSize={'mini'}>{t('common:max_quote_tokens')}</Th>
<Th fontSize={'mini'}>{t('common:min_similarity')}</Th>
{hasReRankModel && <Th fontSize={'mini'}>{t('common:core.dataset.search.ReRank')}</Th>}
<Th fontSize={'mini'}>{t('common:core.module.template.Query extension')}</Th>
{hasEmptyResponseMode && (