Skip to content
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

workflow 例子代码有bug #136

Open
hotpeppeper opened this issue Jul 19, 2024 · 1 comment
Open

workflow 例子代码有bug #136

hotpeppeper opened this issue Jul 19, 2024 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@hotpeppeper
Copy link

在workflow的第二个例子代码中,condition判断的lambda处有问题,应该是两个入参,例子中只给了一个,导致代码无法运行

workflow.chunks["Start"].connect_to(workflow.chunks["User Input"])
(
    workflow.chunks["User Input"].handle("user_input")
        .if_condition(lambda data: data == "#exit").connect_to(workflow.chunks["Goodbye"])
        .else_condition().connect_to(workflow.chunks["Assistant Reply"].handle("user_input"))
)

应该改成

workflow.chunks["Start"].connect_to(workflow.chunks["User Input"])
(
    workflow.chunks["User Input"].handle("user_input")
        .if_condition(lambda data, _: data == "#exit").connect_to(workflow.chunks["Goodbye"])
        .else_condition().connect_to(workflow.chunks["Assistant Reply"].handle("user_input"))
)
@Maplemx
Copy link
Owner

Maplemx commented Jul 19, 2024

在workflow的第二个例子代码中,condition判断的lambda处有问题,应该是两个入参,例子中只给了一个,导致代码无法运行

workflow.chunks["Start"].connect_to(workflow.chunks["User Input"])
(
    workflow.chunks["User Input"].handle("user_input")
        .if_condition(lambda data: data == "#exit").connect_to(workflow.chunks["Goodbye"])
        .else_condition().connect_to(workflow.chunks["Assistant Reply"].handle("user_input"))
)

应该改成

workflow.chunks["Start"].connect_to(workflow.chunks["User Input"])
(
    workflow.chunks["User Input"].handle("user_input")
        .if_condition(lambda data, _: data == "#exit").connect_to(workflow.chunks["Goodbye"])
        .else_condition().connect_to(workflow.chunks["Assistant Reply"].handle("user_input"))
)

感谢指出,workflow在3.2版本进行了大量的开发交互优化改造,请不要继续使用playground的例子,新的说明参考:https://agently.cn/guides/workflow/index.html

@Maplemx Maplemx added the documentation Improvements or additions to documentation label Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants