Skip to content

Feat/add batch & loop_pro#6675

Open
gaga0714 wants to merge 14 commits intolabring:mainfrom
gaga0714:feat/add_loop_pro
Open

Feat/add batch & loop_pro#6675
gaga0714 wants to merge 14 commits intolabring:mainfrom
gaga0714:feat/add_loop_pro

Conversation

@gaga0714
Copy link
Copy Markdown
Contributor

No description provided.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 29, 2026

Docs Preview Deployed!

🔗 👀 Click here to visit preview

registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-docs-pr:c023370d161e2739b820e3134acf635a98353db8

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 29, 2026

Build Successful - Preview fastgpt Image for this PR:

registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-pr:fastgpt_c023370d161e2739b820e3134acf635a98353db8

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 29, 2026

Build Successful - Preview mcp_server Image for this PR:

registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-pr:mcp_server_c023370d161e2739b820e3134acf635a98353db8

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 31, 2026

Build Successful - Preview code-sandbox Image for this PR:

registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt-pr:code-sandbox_c023370d161e2739b820e3134acf635a98353db8

@gaga0714 gaga0714 force-pushed the feat/add_loop_pro branch from 3bc3f13 to c023370 Compare April 1, 2026 03:18

/** 带子画布(parent / child)的父容器节点:loop / batch / loopPro */
export function isParentChildContainerFlowNodeType(flowNodeType: FlowNodeTypeEnum): boolean {
return (
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

用 map 匹配的方式,实现 o1

import { NodeOutputKeyEnum } from '../constants';
import type { ClassifyQuestionAgentItemType } from '../template/system/classifyQuestion/type';
import type { NextApiResponse } from 'next';
import type { ServerResponse } from 'http';
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不能随便改这个

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这是 server 的代码把?

/** 与 WORKFLOW_BATCH_MAX_CONCURRENCY 对齐(Next 注入为 NEXT_PUBLIC_*) */
export function getWorkflowBatchMaxConcurrencyCap(): number {
const n = readIntEnv(
typeof process !== 'undefined' ? process.env.NEXT_PUBLIC_WORKFLOW_BATCH_MAX_CONCURRENCY : ''
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

要用 env 直接调用,不要再用 process.env 了

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

loop/v2/index.ts

adaptCatchError(e.nodes, e.edges);

const nodes = e.nodes?.map((item) => storeNode2FlowNode({ item, t })) || [];
const nodes = (e.nodes || []).map((item) => storeNode2FlowNode({ item, t })) || [];
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

等价的

status: 'warning',
title: t('workflow:can_not_loop')
title: t(
templateNode.flowNodeType === FlowNodeTypeEnum.batch
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不要这么写,条件放外面,t 里不要有任何东西

const isLoopPro = templateNode.flowNodeType === FlowNodeTypeEnum.loopPro;
const startTemplate = isLoopPro
? LoopStartNode
: { ...LoopStartNode, name: 'workflow:loop_graph_start' as any };
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

t()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

待定,需要这么复杂么

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为啥会加这么多代码

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个应该不用变吧

const parent = getNodeById(data.parentNodeId);
const isUnderLoopPro = parent?.flowNodeType === FlowNodeTypeEnum.loopPro;

const intro =
Copy link
Copy Markdown
Collaborator

@c121914yu c121914yu Apr 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不要加工,都是模板设置好的,直接传入使用,不然为啥还要模板渲染。

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里跟以前差了什么

<Avatar src={node.avatar} w={isArray ? '1rem' : '1.05rem'} borderRadius={'xs'} />
<Box ml={1}>{t(node.name as any)}</Box>
<Avatar
src={resolveReferenceListNodeAvatar(node, getNodeById)}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个头像有啥区别,要加工啥,头像样式会不一样么


const isAppNode = node && AppNodeFlowNodeTypeMap[node?.flowNodeType];
const isLoopNode = node?.flowNodeType === FlowNodeTypeEnum.loop;
const isLoopNode = [
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

用统一函数

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

别改

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这些没用的单独删掉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants