Skip to content

fix: [Workflow Tool] Missing Document Segmentation Component#4982

Merged
shaohuzhang1 merged 1 commit intov2from
pr@v2@fix_tool_workflow
Mar 30, 2026
Merged

fix: [Workflow Tool] Missing Document Segmentation Component#4982
shaohuzhang1 merged 1 commit intov2from
pr@v2@fix_tool_workflow

Conversation

@shaohuzhang1
Copy link
Copy Markdown
Contributor

fix: [Workflow Tool] Missing Document Segmentation Component

@f2c-ci-robot
Copy link
Copy Markdown

f2c-ci-robot bot commented Mar 30, 2026

Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@f2c-ci-robot
Copy link
Copy Markdown

f2c-ci-robot bot commented Mar 30, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

fields: [],
},
},
}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

There are no apparent errors or issues with the provided code snippet. The only suggestion would be to consider adding more descriptive labels for some of the nodes, such as "Document Split" instead of just "documentSplit". This could improve readability when using the interface.

return self.execute(**self.node_params_serializer.data, **self.flow_params_serializer.data)

def execute(self, document_list, knowledge_id, split_strategy, paragraph_title_relate_problem_type,
paragraph_title_relate_problem, paragraph_title_relate_problem_reference,
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The provided code seems to have an issue related to handling different workflow modes. The execute method is called regardless of whether the workflow_mode is one of the specified knowledge loop workflows (KNOWLEDGE LOOP, TOOL_LOOP). This can be improved by modifying the logic inside _run() to handle these mode-specific conditions:

def _run(self):
    if [WorkflowMode.KNOWLEDGE, WorkflowMode.KNOWLEDGE_LOOP, WorkflowMode.TOOL,
        WorkflowMode.TOOL_LOOP].__contains__(self.workflow_manage.flow.workflow_mode):
        # Set default values for knowledge_id if needed
        return self.execute(
            **self.node_params_serializer.data,
            **self.flow_params_serializer.data,
            **{'knowledge_id': None}  # Adjust based on actual requirements
        )
    else:
        return self.execute(
            **self.node_params_serializer.data,
            **self.flow_params_serializer.data
        )

This ensures that when a knowledge loop-related workflow mode is detected, the knowledge_id parameter is set to None. You should adjust this according to your actual use case for specifying default or custom values in these cases.

@shaohuzhang1 shaohuzhang1 merged commit 8d47aea into v2 Mar 30, 2026
3 of 4 checks passed
@shaohuzhang1 shaohuzhang1 deleted the pr@v2@fix_tool_workflow branch March 30, 2026 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant