From b394dd6fb0ef9278a8163948bc84329c15090fb6 Mon Sep 17 00:00:00 2001 From: takatost Date: Fri, 29 Mar 2024 21:43:44 +0800 Subject: [PATCH] fix convert bug --- api/core/workflow/nodes/http_request/http_executor.py | 3 +++ api/services/workflow/workflow_converter.py | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/api/core/workflow/nodes/http_request/http_executor.py b/api/core/workflow/nodes/http_request/http_executor.py index cb636df2f3..17238da11a 100644 --- a/api/core/workflow/nodes/http_request/http_executor.py +++ b/api/core/workflow/nodes/http_request/http_executor.py @@ -378,6 +378,9 @@ class HttpExecutor: target_value_type=ValueType.STRING ) + if value is None: + raise ValueError(f'Variable {variable_selector.variable} not found') + if escape_quotes: value = value.replace('"', '\\"') diff --git a/api/services/workflow/workflow_converter.py b/api/services/workflow/workflow_converter.py index 0c5f453208..86c30bd33f 100644 --- a/api/services/workflow/workflow_converter.py +++ b/api/services/workflow/workflow_converter.py @@ -288,7 +288,7 @@ class WorkflowConverter: 'app_id': app_model.id, 'tool_variable': tool_variable, 'inputs': inputs, - 'query': '{{_query}}' if app_model.mode == AppMode.CHAT.value else '' + 'query': '{{#sys.query#}}' if app_model.mode == AppMode.CHAT.value else '' } } @@ -389,7 +389,7 @@ class WorkflowConverter: } } } - if retrieve_config.retrieve_strategy == DatasetRetrieveConfigEntity.RetrieveStrategy.MULTIPLE + if retrieve_config.retrieve_strategy == DatasetRetrieveConfigEntity.RetrieveStrategy.SINGLE else None, "multiple_retrieval_config": { "top_k": retrieve_config.top_k,