mirror of
https://github.com/langgenius/dify.git
synced 2026-05-06 10:28:10 +08:00
http request node support template variable
This commit is contained in:
@ -278,21 +278,9 @@ class WorkflowConverter:
|
||||
token=api_based_extension.api_key
|
||||
)
|
||||
|
||||
http_request_variables = []
|
||||
inputs = {}
|
||||
for v in variables:
|
||||
http_request_variables.append({
|
||||
"variable": v.variable,
|
||||
"value_selector": ["start", v.variable]
|
||||
})
|
||||
|
||||
inputs[v.variable] = '{{' + v.variable + '}}'
|
||||
|
||||
if app_model.mode == AppMode.CHAT.value:
|
||||
http_request_variables.append({
|
||||
"variable": "_query",
|
||||
"value_selector": ["sys", ".query"]
|
||||
})
|
||||
inputs[v.variable] = '{{#start.' + v.variable + '#}}'
|
||||
|
||||
request_body = {
|
||||
'point': APIBasedExtensionPoint.APP_EXTERNAL_DATA_TOOL_QUERY.value,
|
||||
@ -313,7 +301,6 @@ class WorkflowConverter:
|
||||
"data": {
|
||||
"title": f"HTTP REQUEST {api_based_extension.name}",
|
||||
"type": NodeType.HTTP_REQUEST.value,
|
||||
"variables": http_request_variables,
|
||||
"method": "post",
|
||||
"url": api_based_extension.api_endpoint,
|
||||
"authorization": {
|
||||
|
||||
Reference in New Issue
Block a user