|
|
|
|
@ -243,7 +243,10 @@ def test_code_default_value_continue_on_error():
|
|
|
|
|
"edges": DEFAULT_VALUE_EDGE,
|
|
|
|
|
"nodes": [
|
|
|
|
|
{"data": {"title": "start", "type": "start", "variables": []}, "id": "start"},
|
|
|
|
|
{"data": {"title": "answer", "type": "answer", "answer": "{{#node.result#}}"}, "id": "answer"},
|
|
|
|
|
{
|
|
|
|
|
"data": {"title": "answer", "type": "answer", "answer": "{{#node.result#}}", "outputs": []},
|
|
|
|
|
"id": "answer",
|
|
|
|
|
},
|
|
|
|
|
ContinueOnErrorTestHelper.get_code_node(
|
|
|
|
|
error_code, "default-value", [{"key": "result", "type": "number", "value": 132123}]
|
|
|
|
|
),
|
|
|
|
|
@ -270,11 +273,11 @@ def test_code_fail_branch_continue_on_error():
|
|
|
|
|
"nodes": [
|
|
|
|
|
{"data": {"title": "Start", "type": "start", "variables": []}, "id": "start"},
|
|
|
|
|
{
|
|
|
|
|
"data": {"title": "success", "type": "answer", "answer": "node node run successfully"},
|
|
|
|
|
"data": {"title": "success", "type": "answer", "answer": "node node run successfully", "outputs": []},
|
|
|
|
|
"id": "success",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"data": {"title": "error", "type": "answer", "answer": "node node run failed"},
|
|
|
|
|
"data": {"title": "error", "type": "answer", "answer": "node node run failed", "outputs": []},
|
|
|
|
|
"id": "error",
|
|
|
|
|
},
|
|
|
|
|
ContinueOnErrorTestHelper.get_code_node(error_code),
|
|
|
|
|
@ -296,7 +299,10 @@ def test_http_node_default_value_continue_on_error():
|
|
|
|
|
"edges": DEFAULT_VALUE_EDGE,
|
|
|
|
|
"nodes": [
|
|
|
|
|
{"data": {"title": "start", "type": "start", "variables": []}, "id": "start"},
|
|
|
|
|
{"data": {"title": "answer", "type": "answer", "answer": "{{#node.response#}}"}, "id": "answer"},
|
|
|
|
|
{
|
|
|
|
|
"data": {"title": "answer", "type": "answer", "answer": "{{#node.response#}}", "outputs": []},
|
|
|
|
|
"id": "answer",
|
|
|
|
|
},
|
|
|
|
|
ContinueOnErrorTestHelper.get_http_node(
|
|
|
|
|
"default-value", [{"key": "response", "type": "string", "value": "http node got error response"}]
|
|
|
|
|
),
|
|
|
|
|
@ -321,11 +327,11 @@ def test_http_node_fail_branch_continue_on_error():
|
|
|
|
|
"nodes": [
|
|
|
|
|
{"data": {"title": "Start", "type": "start", "variables": []}, "id": "start"},
|
|
|
|
|
{
|
|
|
|
|
"data": {"title": "success", "type": "answer", "answer": "HTTP request successful"},
|
|
|
|
|
"data": {"title": "success", "type": "answer", "answer": "HTTP request successful", "outputs": []},
|
|
|
|
|
"id": "success",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"data": {"title": "error", "type": "answer", "answer": "HTTP request failed"},
|
|
|
|
|
"data": {"title": "error", "type": "answer", "answer": "HTTP request failed", "outputs": []},
|
|
|
|
|
"id": "error",
|
|
|
|
|
},
|
|
|
|
|
ContinueOnErrorTestHelper.get_http_node(),
|
|
|
|
|
@ -399,7 +405,10 @@ def test_llm_node_default_value_continue_on_error():
|
|
|
|
|
"edges": DEFAULT_VALUE_EDGE,
|
|
|
|
|
"nodes": [
|
|
|
|
|
{"data": {"title": "start", "type": "start", "variables": []}, "id": "start"},
|
|
|
|
|
{"data": {"title": "answer", "type": "answer", "answer": "{{#node.answer#}}"}, "id": "answer"},
|
|
|
|
|
{
|
|
|
|
|
"data": {"title": "answer", "type": "answer", "answer": "{{#node.answer#}}", "outputs": []},
|
|
|
|
|
"id": "answer",
|
|
|
|
|
},
|
|
|
|
|
ContinueOnErrorTestHelper.get_llm_node(
|
|
|
|
|
"default-value", [{"key": "answer", "type": "string", "value": "default LLM response"}]
|
|
|
|
|
),
|
|
|
|
|
@ -423,11 +432,11 @@ def test_llm_node_fail_branch_continue_on_error():
|
|
|
|
|
"nodes": [
|
|
|
|
|
{"data": {"title": "Start", "type": "start", "variables": []}, "id": "start"},
|
|
|
|
|
{
|
|
|
|
|
"data": {"title": "success", "type": "answer", "answer": "LLM request successful"},
|
|
|
|
|
"data": {"title": "success", "type": "answer", "answer": "LLM request successful", "outputs": []},
|
|
|
|
|
"id": "success",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"data": {"title": "error", "type": "answer", "answer": "LLM request failed"},
|
|
|
|
|
"data": {"title": "error", "type": "answer", "answer": "LLM request failed", "outputs": []},
|
|
|
|
|
"id": "error",
|
|
|
|
|
},
|
|
|
|
|
ContinueOnErrorTestHelper.get_llm_node(),
|
|
|
|
|
@ -451,11 +460,11 @@ def test_status_code_error_http_node_fail_branch_continue_on_error():
|
|
|
|
|
"nodes": [
|
|
|
|
|
{"data": {"title": "Start", "type": "start", "variables": []}, "id": "start"},
|
|
|
|
|
{
|
|
|
|
|
"data": {"title": "success", "type": "answer", "answer": "http execute successful"},
|
|
|
|
|
"data": {"title": "success", "type": "answer", "answer": "http execute successful", "outputs": []},
|
|
|
|
|
"id": "success",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"data": {"title": "error", "type": "answer", "answer": "http execute failed"},
|
|
|
|
|
"data": {"title": "error", "type": "answer", "answer": "http execute failed", "outputs": []},
|
|
|
|
|
"id": "error",
|
|
|
|
|
},
|
|
|
|
|
ContinueOnErrorTestHelper.get_error_status_code_http_node(),
|
|
|
|
|
@ -478,11 +487,11 @@ def test_variable_pool_error_type_variable():
|
|
|
|
|
"nodes": [
|
|
|
|
|
{"data": {"title": "Start", "type": "start", "variables": []}, "id": "start"},
|
|
|
|
|
{
|
|
|
|
|
"data": {"title": "success", "type": "answer", "answer": "http execute successful"},
|
|
|
|
|
"data": {"title": "success", "type": "answer", "answer": "http execute successful", "outputs": []},
|
|
|
|
|
"id": "success",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"data": {"title": "error", "type": "answer", "answer": "http execute failed"},
|
|
|
|
|
"data": {"title": "error", "type": "answer", "answer": "http execute failed", "outputs": []},
|
|
|
|
|
"id": "error",
|
|
|
|
|
},
|
|
|
|
|
ContinueOnErrorTestHelper.get_error_status_code_http_node(),
|
|
|
|
|
@ -503,7 +512,10 @@ def test_no_node_in_fail_branch_continue_on_error():
|
|
|
|
|
"edges": FAIL_BRANCH_EDGES[:-1],
|
|
|
|
|
"nodes": [
|
|
|
|
|
{"data": {"title": "Start", "type": "start", "variables": []}, "id": "start"},
|
|
|
|
|
{"data": {"title": "success", "type": "answer", "answer": "HTTP request successful"}, "id": "success"},
|
|
|
|
|
{
|
|
|
|
|
"data": {"title": "success", "type": "answer", "answer": "HTTP request successful", "outputs": []},
|
|
|
|
|
"id": "success",
|
|
|
|
|
},
|
|
|
|
|
ContinueOnErrorTestHelper.get_http_node(),
|
|
|
|
|
],
|
|
|
|
|
}
|
|
|
|
|
@ -523,11 +535,11 @@ def test_stream_output_with_fail_branch_continue_on_error():
|
|
|
|
|
"nodes": [
|
|
|
|
|
{"data": {"title": "Start", "type": "start", "variables": []}, "id": "start"},
|
|
|
|
|
{
|
|
|
|
|
"data": {"title": "success", "type": "answer", "answer": "LLM request successful"},
|
|
|
|
|
"data": {"title": "success", "type": "answer", "answer": "LLM request successful", "outputs": []},
|
|
|
|
|
"id": "success",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"data": {"title": "error", "type": "answer", "answer": "{{#node.text#}}"},
|
|
|
|
|
"data": {"title": "error", "type": "answer", "answer": "{{#node.text#}}", "outputs": []},
|
|
|
|
|
"id": "error",
|
|
|
|
|
},
|
|
|
|
|
ContinueOnErrorTestHelper.get_llm_node(),
|
|
|
|
|
|