pyspur
pyspur copied to clipboard
feat: add get_node_title_output_map function to map node titles to ou…
This pull request includes changes to the backend/pyspur/api/workflow_run.py file to improve the handling of node outputs in workflow runs. The primary focus is on refactoring the code to use a new helper function for mapping node titles to their outputs.
Refactoring and code simplification:
- Added import for
BaseNodeOutputinbackend/pyspur/api/workflow_run.pyto support the new helper function. - Introduced the
get_node_title_output_mapfunction to create a dictionary mapping node titles to their outputs. - Updated
async def run_workflow_blocking_v2to use the newget_node_title_output_mapfunction, simplifying the code for creating the outputs dictionary. [1] [2] - Modified
async def run_workflow_blockingto use the new helper function for setting the outputs. - Updated
async def run_workflow_taskand_handle_pause_exceptionto use theget_node_title_output_mapfunction, ensuring consistency in how outputs are handled. [1] [2]
[!IMPORTANT] Introduces
get_node_title_output_mapfor mapping node titles to outputs and updates frontend to use UUIDs for node IDs and readable titles.
- Backend Changes:
- Added
get_node_title_output_mapinworkflow_run.pyto map node titles to outputs.- Updated
run_workflow_blocking_v2,run_workflow_blocking,run_workflow_task, and_handle_pause_exceptionto useget_node_title_output_map.- Frontend Changes:
- Updated
createDynamicGroupNodeWithChildreningroupNodeUtils.tsto use UUIDs for node IDs and readable titles.- Modified
addToolToAgentandduplicateNodeinflowSlice.tsto generate readable titles and use UUIDs for IDs.- Updated
createNodeAtCenterandduplicateNodeinflowUtils.tsxto use UUIDs for IDs and generate readable titles.This description was created by
for 544201d3419b049b5de8099303427abd0cdd0d86. It will automatically update as commits are pushed.