-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat: Variable assignment nodes support ending nodes #4247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| import {WorkflowType, WorkflowMode} from '@/enums/application' | ||
| import { WorkflowType, WorkflowMode } from '@/enums/application' | ||
|
|
||
| import {t} from '@/locales' | ||
| import { t } from '@/locales' | ||
|
|
||
| const end_nodes: Array<string> = [ | ||
| WorkflowType.AiChat, | ||
|
|
@@ -18,7 +18,8 @@ const end_nodes: Array<string> = [ | |
| WorkflowType.LoopBodyNode, | ||
| WorkflowType.LoopNode, | ||
| WorkflowType.LoopBreakNode, | ||
| WorkflowType.VideoUnderstandNode | ||
| WorkflowType.VideoUnderstandNode, | ||
| WorkflowType.VariableAssignNode, | ||
| ] | ||
|
|
||
| const loop_end_nodes: Array<string> = [ | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The provided code snippet appears to be importing necessary modules and defining variables used in a TypeScript/JavaScript application related to workflows. There are no apparent irregularities or major issues based on the information given. However, here are some minor optimizations and improvements that could enhance readability and maintainability:
Here's the enhanced version with these suggestions: // Import necessary enums and functions from their respective locations
import { WorkflowType, WorkflowMode } from '@/enums/application';
import { t } from '@/locales';
const workflowEndNodes: Array<string> = [
WorkflowType.AiChat,
WorkflowType.ImageRecognizeNode,
// Add more end nodes as needed
];
const workflowLoopEndNodes: Array<string> = [
WorkflowType.LoopBodyNode,
WorkflowType.LoopNode,
WorkflowType.LoopBreakNode,
WorkflowType.VideoUnderstandNode,
WorkflowType.VariableAssignNode, // Placeholder comment
];These changes focus on improving naming conventions, making the code cleaner, and adding docstring comments where appropriate to enhance understanding of the intended purpose of the arrays. |
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The provided Python code snippet is syntactically correct but can be refined for clarity and maintainability. Here are some suggestions:
Variable Name Consistency: The variable
end_nodescontains nodes related to "function". It might benefit from more consistent naming if these functions have a common theme or type.Import Statement:
Comments: Add comments explaining what each part does, especially regarding the list comprehension used to filter or categorize node names.
Class Definition:
Answerclass serves a specific purpose beyond its name. If it's purely decorative or intended for documentation purposes, consider renaming it accordingly.Here's an improved version of the code with suggested modifications:
This revision improves readability and follows standard coding practices for variables and function/class definitions.