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,