mirror of
https://github.com/langgenius/dify.git
synced 2024-11-16 03:32:23 +08:00
Compare commits
3 Commits
1a02033d08
...
7c4bbe3275
Author | SHA1 | Date | |
---|---|---|---|
|
7c4bbe3275 | ||
|
925fc39e94 | ||
|
7238ad8078 |
|
@ -289,5 +289,22 @@ class WorkflowEntry:
|
||||||
if new_value:
|
if new_value:
|
||||||
input_value = new_value
|
input_value = new_value
|
||||||
|
|
||||||
|
if node_type == NodeType.TOOL and isinstance(input_value, dict) and "transferMethod" in input_value:
|
||||||
|
if input_value.get("supportFileType"):
|
||||||
|
type = FileType.value_of(input_value.get("supportFileType"))
|
||||||
|
else:
|
||||||
|
type = FileType.CUSTOM
|
||||||
|
transfer_method = FileTransferMethod.value_of(input_value.get("transferMethod"))
|
||||||
|
file = File(
|
||||||
|
tenant_id=tenant_id,
|
||||||
|
type=type,
|
||||||
|
transfer_method=transfer_method,
|
||||||
|
remote_url=input_value.get("url") if transfer_method == FileTransferMethod.REMOTE_URL else None,
|
||||||
|
related_id=input_value.get("uploadedId")
|
||||||
|
if transfer_method == FileTransferMethod.LOCAL_FILE
|
||||||
|
else None,
|
||||||
|
)
|
||||||
|
input_value = file
|
||||||
|
|
||||||
# append variable and value to variable pool
|
# append variable and value to variable pool
|
||||||
variable_pool.add([variable_node_id] + variable_key_list, input_value)
|
variable_pool.add([variable_node_id] + variable_key_list, input_value)
|
||||||
|
|
|
@ -6,6 +6,7 @@ from typing import Optional
|
||||||
|
|
||||||
from core.app.apps.advanced_chat.app_config_manager import AdvancedChatAppConfigManager
|
from core.app.apps.advanced_chat.app_config_manager import AdvancedChatAppConfigManager
|
||||||
from core.app.apps.workflow.app_config_manager import WorkflowAppConfigManager
|
from core.app.apps.workflow.app_config_manager import WorkflowAppConfigManager
|
||||||
|
from core.file.models import File
|
||||||
from core.model_runtime.utils.encoders import jsonable_encoder
|
from core.model_runtime.utils.encoders import jsonable_encoder
|
||||||
from core.variables import Variable
|
from core.variables import Variable
|
||||||
from core.workflow.entities.node_entities import NodeRunResult
|
from core.workflow.entities.node_entities import NodeRunResult
|
||||||
|
@ -262,6 +263,9 @@ class WorkflowService:
|
||||||
|
|
||||||
if run_succeeded and node_run_result:
|
if run_succeeded and node_run_result:
|
||||||
# create workflow node execution
|
# create workflow node execution
|
||||||
|
for key, value in node_run_result.inputs.items():
|
||||||
|
if isinstance(value, File):
|
||||||
|
node_run_result.inputs[key] = value.to_dict()
|
||||||
workflow_node_execution.inputs = json.dumps(node_run_result.inputs) if node_run_result.inputs else None
|
workflow_node_execution.inputs = json.dumps(node_run_result.inputs) if node_run_result.inputs else None
|
||||||
workflow_node_execution.process_data = (
|
workflow_node_execution.process_data = (
|
||||||
json.dumps(node_run_result.process_data) if node_run_result.process_data else None
|
json.dumps(node_run_result.process_data) if node_run_result.process_data else None
|
||||||
|
|
Loading…
Reference in New Issue
Block a user