mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-22 20:37:48 +00:00
HTTP support jsonPath; System plugin support save file. (#2969)
* perf: system plugin auto save file * feat: http support jsonPath * fix: assistant response * reset milvus version * fix: textarea register * fix: global variable * delete tip * doc
This commit is contained in:
@@ -4,8 +4,9 @@
|
||||
"lafEnv": "https://laf.dev" // laf环境。 https://laf.run (杭州阿里云) ,或者私有化的laf环境。如果使用 Laf openapi 功能,需要最新版的 laf 。
|
||||
},
|
||||
"systemEnv": {
|
||||
"vectorMaxProcess": 15,
|
||||
"qaMaxProcess": 15,
|
||||
"vectorMaxProcess": 15, // 向量处理线程数量
|
||||
"qaMaxProcess": 15, // 问答拆分线程数量
|
||||
"tokenWorkers": 50, // Token 计算线程保持数,会持续占用内存,不能设置太大。
|
||||
"pgHNSWEfSearch": 100 // 向量搜索参数。越大,搜索越精确,但是速度越慢。设置为100,有99%+精度。
|
||||
},
|
||||
"llmModels": [
|
||||
|
@@ -24,6 +24,7 @@ type Props = TextareaProps & {
|
||||
const MyTextarea = React.forwardRef<HTMLTextAreaElement, Props>(function MyTextarea(props, ref) {
|
||||
const ModalTextareaRef = useRef<HTMLTextAreaElement>(null);
|
||||
const TextareaRef = useRef<HTMLTextAreaElement>(null);
|
||||
React.useImperativeHandle(ref, () => TextareaRef.current!);
|
||||
|
||||
const { t } = useTranslation();
|
||||
const {
|
||||
|
@@ -322,10 +322,7 @@ const DatasetParamsModal = ({
|
||||
minH={150}
|
||||
maxH={300}
|
||||
placeholder={t('common:core.module.QueryExtension.placeholder')}
|
||||
value={cfbBgDesc}
|
||||
onChange={(e) => {
|
||||
setValue('datasetSearchExtensionBg', e.target.value);
|
||||
}}
|
||||
{...register('datasetSearchExtensionBg')}
|
||||
/>
|
||||
</Box>
|
||||
</Box>
|
||||
|
@@ -120,10 +120,8 @@ const VariableEdit = ({
|
||||
|
||||
if (data.type === VariableInputEnum.custom) {
|
||||
data.required = false;
|
||||
}
|
||||
|
||||
if (data.type === VariableInputEnum.numberInput) {
|
||||
data.valueType = WorkflowIOValueTypeEnum.number;
|
||||
} else {
|
||||
data.valueType = inputTypeList.find((item) => item.value === data.type)?.defaultValueType;
|
||||
}
|
||||
|
||||
const onChangeVariable = [...variables];
|
||||
@@ -152,7 +150,7 @@ const VariableEdit = ({
|
||||
});
|
||||
}
|
||||
},
|
||||
[variables, toast, t, onChange, reset]
|
||||
[variables, toast, t, inputTypeList, onChange, reset]
|
||||
);
|
||||
|
||||
const onSubmitError = useCallback(
|
||||
@@ -205,7 +203,7 @@ const VariableEdit = ({
|
||||
p={0}
|
||||
/>
|
||||
<Th fontSize={'mini'}>{t('workflow:Variable_name')}</Th>
|
||||
<Th fontSize={'mini'}>{t('common:core.module.variable.key')}</Th>
|
||||
<Th fontSize={'mini'}>{t('app:global_variables_desc')}</Th>
|
||||
<Th fontSize={'mini'}>{t('common:common.Require Input')}</Th>
|
||||
<Th fontSize={'mini'} borderRadius={'none !important'}></Th>
|
||||
</Tr>
|
||||
@@ -216,9 +214,17 @@ const VariableEdit = ({
|
||||
<Td p={0} pl={3}>
|
||||
<MyIcon name={item.icon as any} w={'16px'} color={'myGray.500'} />
|
||||
</Td>
|
||||
<Td>{item.label}</Td>
|
||||
<Td>{item.key}</Td>
|
||||
<Td>{item.required ? '✔' : ''}</Td>
|
||||
<Td
|
||||
maxW={'200px'}
|
||||
fontSize={'sm'}
|
||||
whiteSpace={'pre-wrap'}
|
||||
wordBreak={'break-all'}
|
||||
px={0}
|
||||
>
|
||||
{item.description || '-'}
|
||||
</Td>
|
||||
<Td>{item.required ? '✔' : '-'}</Td>
|
||||
<Td>
|
||||
<MyIcon
|
||||
mr={3}
|
||||
|
@@ -17,6 +17,7 @@ const WelcomeTextConfig = (props: TextareaProps) => {
|
||||
<ChatFunctionTip type={'welcome'} />
|
||||
</Flex>
|
||||
<MyTextarea
|
||||
className="nowheel"
|
||||
iconSrc={'core/app/simpleMode/chat'}
|
||||
title={t('common:core.app.Welcome Text')}
|
||||
mt={2}
|
||||
|
@@ -64,8 +64,9 @@ export const VariableInputItem = ({
|
||||
minH={40}
|
||||
maxH={160}
|
||||
bg={'myGray.50'}
|
||||
value={item.defaultValue}
|
||||
onChange={(e) => setValue(item.key, e.target.value)}
|
||||
{...register(item.key, {
|
||||
required: item.required
|
||||
})}
|
||||
/>
|
||||
)}
|
||||
{item.type === VariableInputEnum.textarea && (
|
||||
|
@@ -59,7 +59,7 @@ export const useDebug = () => {
|
||||
const filteredVar = useMemo(() => {
|
||||
const variables = appDetail.chatConfig?.variables;
|
||||
return variables?.filter((item) => item.type !== VariableInputEnum.custom) || [];
|
||||
}, [appDetail.chatConfig.variables]);
|
||||
}, [appDetail.chatConfig?.variables]);
|
||||
|
||||
const [defaultGlobalVariables, setDefaultGlobalVariables] = useState<Record<string, any>>(
|
||||
filteredVar.reduce(
|
||||
@@ -272,14 +272,13 @@ export const useDebug = () => {
|
||||
return (
|
||||
<MyTextarea
|
||||
autoHeight
|
||||
minH={40}
|
||||
minH={60}
|
||||
maxH={160}
|
||||
bg={'myGray.50'}
|
||||
placeholder={t(input.placeholder || ('' as any))}
|
||||
value={getValues(`nodeVariables.${input.key}`)}
|
||||
onChange={(e) => {
|
||||
setValue(`nodeVariables.${input.key}`, e.target.value);
|
||||
}}
|
||||
{...register(`nodeVariables.${input.key}`, {
|
||||
required: input.required
|
||||
})}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
@@ -142,7 +142,7 @@ const FieldModal = ({
|
||||
{/* key */}
|
||||
<Flex mt={3} alignItems={'center'}>
|
||||
<FormLabel flex={'0 0 70px'} required>
|
||||
{t('common:core.module.Field Name')}
|
||||
{t('workflow:Variable_name')}
|
||||
</FormLabel>
|
||||
<Input
|
||||
bg={'myGray.50'}
|
||||
|
@@ -78,7 +78,7 @@ const RenderOutput = ({
|
||||
position={'relative'}
|
||||
>
|
||||
<Box position={'relative'} fontWeight={'medium'}>
|
||||
{t('common:core.workflow.Custom outputs')}
|
||||
{t((addOutput.label || 'common:core.workflow.Custom outputs') as any)}
|
||||
</Box>
|
||||
{addOutput.description && <QuestionTip ml={1} label={addOutput.description} />}
|
||||
<Box flex={'1 0 0'} />
|
||||
|
@@ -176,7 +176,15 @@ const AppContextProvider = ({ children }: { children: ReactNode }) => {
|
||||
errorToast: t('common:common.Delete Failed')
|
||||
}
|
||||
);
|
||||
const onDelApp = useCallback(() => openConfirmDel(deleteApp)(), [deleteApp, openConfirmDel]);
|
||||
const onDelApp = useCallback(
|
||||
() =>
|
||||
openConfirmDel(
|
||||
deleteApp,
|
||||
undefined,
|
||||
t('app:confirm_del_app_tip', { name: appDetail.name })
|
||||
)(),
|
||||
[appDetail.name, deleteApp, openConfirmDel, t]
|
||||
);
|
||||
|
||||
const contextValue: AppContextType = {
|
||||
appId,
|
||||
|
Reference in New Issue
Block a user