promptflow icon indicating copy to clipboard operation
promptflow copied to clipboard

[BUG] Activate feature, cannot treat string type 'yes', 'no' correctly

Open lisagreenview opened this issue 2 years ago • 3 comments

Describe the bug If you want to use output from a node with the string of "yes" or "no" it won't work. Guessing Yes/No is treated like True/False. image

It could be limitation of YAML file, but shall we honor the field type, and make sure string value is quoted with '' or ""? image

lisagreenview avatar Jan 04 '24 00:01 lisagreenview

This seems to be an extension behavior that write yaml as is: yes, while what we expect is is: 'yes', here is the example:

  activate:
    when: ${inputs.input_text}
    is: yes

thy09 avatar Jan 04 '24 02:01 thy09

We found that the root cause is that the extension and promptflow packages use different versions of yaml. In yaml 1.2, terms like 'yes', 'no', 'on', 'off' are no longer treated as boolean values. We have already submitted a PR (https://github.com/microsoft/promptflow/pull/1668) to address this issue, and plan to release the fix in the next version (1.4.0).

TYW-0203 avatar Jan 09 '24 06:01 TYW-0203

The latest version (1.4.0) of promptflow has been released, utilizing version 1.2 of yaml, where terms like 'yes'/'no' are no longer interpreted as booleans.

After testing and verification, the issue has been resolved. You can download the latest version to try it out. image image image

I will close this issue. Thank you~

TYW-0203 avatar Jan 22 '24 09:01 TYW-0203