mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-29 09:44:47 +00:00
Feat: Workflow loop node;feat: support openai o1;perf: query extension prompt;fix: intro was not delivered when the datase was created (#2719)
* feat: loop node (#2675) * loop node frontend * loop-node * fix-code * fix version * fix * fix * fix * perf: loop array code * perf: get histories error tip * feat: support openai o1 * perf: query extension prompt * feat: 4811 doc * remove log * fix: loop node zindex & variable picker type (#2710) * perf: performance * perf: workflow performance * remove uninvalid code * perf:code * fix: invoice table refresh * perf: loop node data type * fix: loop node store assistants * perf: target connection * feat: loop node support help line * perf: add default icon --------- Co-authored-by: heheer <heheer@sealos.io>
This commit is contained in:
@@ -39,7 +39,6 @@ const Markdown = ({
|
||||
() => ({
|
||||
img: Image,
|
||||
pre: RewritePre,
|
||||
p: (pProps: any) => <p {...pProps} dir="auto" />,
|
||||
code: Code,
|
||||
a: A
|
||||
}),
|
||||
|
@@ -1,7 +1,16 @@
|
||||
import { LOGO_ICON } from '@fastgpt/global/common/system/constants';
|
||||
import Head from 'next/head';
|
||||
import React from 'react';
|
||||
import React, { useMemo } from 'react';
|
||||
|
||||
const NextHead = ({ title, icon, desc }: { title?: string; icon?: string; desc?: string }) => {
|
||||
const formatIcon = useMemo(() => {
|
||||
if (!icon) return LOGO_ICON;
|
||||
if (icon.startsWith('http') || icon.startsWith('/')) {
|
||||
return icon;
|
||||
}
|
||||
return LOGO_ICON;
|
||||
}, [icon]);
|
||||
|
||||
return (
|
||||
<Head>
|
||||
<title>{title}</title>
|
||||
@@ -11,7 +20,7 @@ const NextHead = ({ title, icon, desc }: { title?: string; icon?: string; desc?:
|
||||
/>
|
||||
<meta httpEquiv="Content-Security-Policy" content="img-src * data:;" />
|
||||
{desc && <meta name="description" content={desc} />}
|
||||
{icon && <link rel="icon" href={icon} />}
|
||||
{icon && <link rel="icon" href={formatIcon} />}
|
||||
</Head>
|
||||
);
|
||||
};
|
||||
|
@@ -504,7 +504,6 @@ const ChatInput = ({
|
||||
const files = Array.from(items)
|
||||
.map((item) => (item.kind === 'file' ? item.getAsFile() : undefined))
|
||||
.filter((file) => {
|
||||
console.log(file);
|
||||
return file && fileTypeFilter(file);
|
||||
}) as File[];
|
||||
onSelectFile(files);
|
||||
|
@@ -35,8 +35,7 @@ const RenderText = React.memo(function RenderText({
|
||||
showAnimation: boolean;
|
||||
text?: string;
|
||||
}) {
|
||||
let source = (text || '').trim();
|
||||
|
||||
let source = text || '';
|
||||
// First empty line
|
||||
// if (!source && !isLastChild) return null;
|
||||
|
||||
|
@@ -8,7 +8,6 @@ import Markdown from '@/components/Markdown';
|
||||
import { QuoteList } from '../ChatContainer/ChatBox/components/QuoteModal';
|
||||
import { DatasetSearchModeMap } from '@fastgpt/global/core/dataset/constants';
|
||||
import { formatNumber } from '@fastgpt/global/common/math/tools';
|
||||
import { useI18n } from '@/web/context/I18n';
|
||||
import QuestionTip from '@fastgpt/web/components/common/MyTooltip/QuestionTip';
|
||||
import Avatar from '@fastgpt/web/components/common/Avatar';
|
||||
import { useSystem } from '@fastgpt/web/hooks/useSystem';
|
||||
@@ -337,6 +336,22 @@ export const WholeResponseContent = ({
|
||||
label={t('common:core.chat.response.update_var_result')}
|
||||
value={activeModule?.updateVarResult}
|
||||
/>
|
||||
|
||||
{/* loop */}
|
||||
<Row label={t('common:core.chat.response.loop_input')} value={activeModule?.loopInput} />
|
||||
<Row label={t('common:core.chat.response.loop_output')} value={activeModule?.loopResult} />
|
||||
|
||||
{/* loopStart */}
|
||||
<Row
|
||||
label={t('common:core.chat.response.loop_input_element')}
|
||||
value={activeModule?.loopInputValue}
|
||||
/>
|
||||
|
||||
{/* loopEnd */}
|
||||
<Row
|
||||
label={t('common:core.chat.response.loop_output_element')}
|
||||
value={activeModule?.loopOutputValue}
|
||||
/>
|
||||
</Box>
|
||||
) : null;
|
||||
};
|
||||
@@ -525,6 +540,9 @@ export const ResponseBox = React.memo(function ResponseBox({
|
||||
if (Array.isArray(item.pluginDetail)) {
|
||||
helper(item.pluginDetail);
|
||||
}
|
||||
if (Array.isArray(item.loopDetail)) {
|
||||
helper(item.loopDetail);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -552,9 +570,10 @@ export const ResponseBox = React.memo(function ResponseBox({
|
||||
function pretreatmentResponse(res: ChatHistoryItemResType[]): sideTabItemType[] {
|
||||
return res.map((item) => {
|
||||
let children: sideTabItemType[] = [];
|
||||
if (!!(item?.toolDetail || item?.pluginDetail)) {
|
||||
if (!!(item?.toolDetail || item?.pluginDetail || item?.loopDetail)) {
|
||||
if (item?.toolDetail) children.push(...pretreatmentResponse(item?.toolDetail));
|
||||
if (item?.pluginDetail) children.push(...pretreatmentResponse(item?.pluginDetail));
|
||||
if (item?.loopDetail) children.push(...pretreatmentResponse(item?.loopDetail));
|
||||
}
|
||||
|
||||
return {
|
||||
@@ -611,7 +630,7 @@ export const ResponseBox = React.memo(function ResponseBox({
|
||||
<>
|
||||
{isPc && !useMobile ? (
|
||||
<Flex overflow={'hidden'} height={'100%'}>
|
||||
<Box flex={'2 0 0'} borderRight={'sm'} p={3}>
|
||||
<Box flex={'2 0 0'} w={0} borderRight={'sm'} p={3}>
|
||||
<Box overflow={'auto'} height={'100%'}>
|
||||
<WholeResponseSideTab
|
||||
response={sliderResponseList}
|
||||
@@ -620,7 +639,7 @@ export const ResponseBox = React.memo(function ResponseBox({
|
||||
/>
|
||||
</Box>
|
||||
</Box>
|
||||
<Box flex={'5 0 0'} height={'100%'}>
|
||||
<Box flex={'5 0 0'} w={0} height={'100%'}>
|
||||
<WholeResponseContent
|
||||
activeModule={activeModule}
|
||||
hideTabs={hideTabs}
|
||||
|
Reference in New Issue
Block a user