langflow icon indicating copy to clipboard operation
langflow copied to clipboard

[Component Bug] Conditional Router(If-Else in 1.1.0) Cannot Stop Correctly

Open ChunJen opened this issue 3 months ago • 4 comments

Bug Description

I change the conditional Router with self.stop('method_name'), but the components of the subsequent process will still be executed. It happened in both of version 1.0.17 and 1.1.0

    def true_response(self) -> Message:
        result = self.evaluate_condition(self.input_text, self.match_text, self.operator, self.case_sensitive)
        if result:
            return self.message
        else:
            self.stop('true_response')

With the workflow:

[python 3.12.3, langflow 1.0.17]

20241114_debug_conditional_router.json 20241114_debug_conditional_router_v2.json

Test Case

1.input=A, expected_output=A, real_output=A None None

image

2.input=B, expected_output=B, real_output=None B None

  • in this situation will cause 2 user messages to be generated

image

[python 3.12.3, langflow 1.1.0]

Still not work in this version: 20241114_debug_conditional_router_v2_使用langflow1.1.0版本.json

Reproduction

  1. upload the json
  2. try the input with playground

Expected behavior

Just like in Bug Description

Who can help?

No response

Operating System

Windows 11

Langflow Version

1.0.17

Python Version

3.12

Screenshot

No response

Flow File

20241114_debug_conditional_router_v2.json 20241114_debug_conditional_router.json 20241114_debug_conditional_router_v2_使用langflow1.1.0版本.json

ChunJen avatar Nov 14 '24 06:11 ChunJen