griptape-nodes 0.63.10__py3-none-any.whl → 0.64.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- griptape_nodes/common/node_executor.py +95 -171
- griptape_nodes/exe_types/connections.py +51 -2
- griptape_nodes/exe_types/flow.py +3 -3
- griptape_nodes/exe_types/node_types.py +330 -202
- griptape_nodes/exe_types/param_components/artifact_url/__init__.py +1 -0
- griptape_nodes/exe_types/param_components/artifact_url/public_artifact_url_parameter.py +155 -0
- griptape_nodes/exe_types/param_components/progress_bar_component.py +1 -1
- griptape_nodes/exe_types/param_types/parameter_string.py +27 -0
- griptape_nodes/machines/control_flow.py +64 -203
- griptape_nodes/machines/dag_builder.py +85 -238
- griptape_nodes/machines/parallel_resolution.py +9 -236
- griptape_nodes/machines/sequential_resolution.py +133 -11
- griptape_nodes/retained_mode/events/agent_events.py +2 -0
- griptape_nodes/retained_mode/events/flow_events.py +5 -6
- griptape_nodes/retained_mode/events/node_events.py +151 -1
- griptape_nodes/retained_mode/events/workflow_events.py +10 -0
- griptape_nodes/retained_mode/managers/agent_manager.py +33 -1
- griptape_nodes/retained_mode/managers/flow_manager.py +213 -290
- griptape_nodes/retained_mode/managers/library_manager.py +24 -7
- griptape_nodes/retained_mode/managers/node_manager.py +400 -77
- griptape_nodes/retained_mode/managers/version_compatibility_manager.py +113 -69
- griptape_nodes/retained_mode/managers/workflow_manager.py +45 -10
- griptape_nodes/servers/mcp.py +32 -0
- griptape_nodes/version_compatibility/versions/v0_63_8/__init__.py +1 -0
- griptape_nodes/version_compatibility/versions/v0_63_8/deprecated_nodegroup_parameters.py +105 -0
- {griptape_nodes-0.63.10.dist-info → griptape_nodes-0.64.1.dist-info}/METADATA +3 -1
- {griptape_nodes-0.63.10.dist-info → griptape_nodes-0.64.1.dist-info}/RECORD +31 -28
- griptape_nodes/version_compatibility/workflow_versions/__init__.py +0 -1
- /griptape_nodes/version_compatibility/{workflow_versions → versions}/v0_7_0/__init__.py +0 -0
- /griptape_nodes/version_compatibility/{workflow_versions → versions}/v0_7_0/local_executor_argument_addition.py +0 -0
- {griptape_nodes-0.63.10.dist-info → griptape_nodes-0.64.1.dist-info}/WHEEL +0 -0
- {griptape_nodes-0.63.10.dist-info → griptape_nodes-0.64.1.dist-info}/entry_points.txt +0 -0
|
@@ -441,7 +441,7 @@ class SerializedNodeCommands:
|
|
|
441
441
|
set_parameter_value_command: SetParameterValueRequest
|
|
442
442
|
unique_value_uuid: SerializedNodeCommands.UniqueParameterValueUUID
|
|
443
443
|
|
|
444
|
-
create_node_command: CreateNodeRequest
|
|
444
|
+
create_node_command: CreateNodeRequest | CreateNodeGroupRequest
|
|
445
445
|
element_modification_commands: list[RequestPayload]
|
|
446
446
|
node_dependencies: NodeDependencies
|
|
447
447
|
lock_node_command: SetLockNodeStateRequest | None = None
|
|
@@ -908,3 +908,153 @@ class ResetNodeToDefaultsResultFailure(ResultPayloadFailure):
|
|
|
908
908
|
Common causes: node not found, no current context, failed to create new node,
|
|
909
909
|
failed to delete old node, failed to rename new node.
|
|
910
910
|
"""
|
|
911
|
+
|
|
912
|
+
|
|
913
|
+
@dataclass
|
|
914
|
+
@PayloadRegistry.register
|
|
915
|
+
class AddNodesToNodeGroupRequest(RequestPayload):
|
|
916
|
+
"""Adds nodes to a NodeGroup.
|
|
917
|
+
|
|
918
|
+
Use when: Need to add nodes to an existing NodeGroup, building node groups programmatically,
|
|
919
|
+
organizing nodes into logical groups.
|
|
920
|
+
|
|
921
|
+
Args:
|
|
922
|
+
node_name: Name of the node to add to the group
|
|
923
|
+
node_group_name: Name of the NodeGroup to add the node to
|
|
924
|
+
flow_name: Optional flow name to search in (None for current context flow)
|
|
925
|
+
|
|
926
|
+
Results: AddNodesToNodeGroupResultSuccess | AddNodeToNodeGroupResultFailure (node not found, group not found, add failed)
|
|
927
|
+
"""
|
|
928
|
+
|
|
929
|
+
node_names: list[str]
|
|
930
|
+
node_group_name: str
|
|
931
|
+
flow_name: str | None = None
|
|
932
|
+
|
|
933
|
+
|
|
934
|
+
@dataclass
|
|
935
|
+
@PayloadRegistry.register
|
|
936
|
+
class AddNodesToNodeGroupResultSuccess(WorkflowAlteredMixin, ResultPayloadSuccess):
|
|
937
|
+
"""Node added to NodeGroup successfully."""
|
|
938
|
+
|
|
939
|
+
|
|
940
|
+
@dataclass
|
|
941
|
+
@PayloadRegistry.register
|
|
942
|
+
class AddNodesToNodeGroupResultFailure(ResultPayloadFailure):
|
|
943
|
+
"""Adding node to NodeGroup failed.
|
|
944
|
+
|
|
945
|
+
Common causes: node not found, NodeGroup not found, node already in group,
|
|
946
|
+
flow not found, no current context.
|
|
947
|
+
"""
|
|
948
|
+
|
|
949
|
+
|
|
950
|
+
@dataclass
|
|
951
|
+
@PayloadRegistry.register
|
|
952
|
+
class RemoveNodeFromNodeGroupRequest(RequestPayload):
|
|
953
|
+
"""Remove nodes from a NodeGroup.
|
|
954
|
+
|
|
955
|
+
Use when: Need to remove nodes from a NodeGroup, reorganizing workflow structure,
|
|
956
|
+
implementing undo operations.
|
|
957
|
+
|
|
958
|
+
Args:
|
|
959
|
+
node_names: Names of the nodes to remove from the group
|
|
960
|
+
node_group_name: Name of the NodeGroup to remove the nodes from
|
|
961
|
+
flow_name: Optional flow name to search in (None for current context flow)
|
|
962
|
+
|
|
963
|
+
Results: RemoveNodeFromNodeGroupResultSuccess | RemoveNodeFromNodeGroupResultFailure (node not found, group not found, node not in group)
|
|
964
|
+
"""
|
|
965
|
+
|
|
966
|
+
node_names: list[str]
|
|
967
|
+
node_group_name: str
|
|
968
|
+
flow_name: str | None = None
|
|
969
|
+
|
|
970
|
+
|
|
971
|
+
@dataclass
|
|
972
|
+
@PayloadRegistry.register
|
|
973
|
+
class RemoveNodeFromNodeGroupResultSuccess(WorkflowAlteredMixin, ResultPayloadSuccess):
|
|
974
|
+
"""Nodes removed from NodeGroup successfully."""
|
|
975
|
+
|
|
976
|
+
|
|
977
|
+
@dataclass
|
|
978
|
+
@PayloadRegistry.register
|
|
979
|
+
class RemoveNodeFromNodeGroupResultFailure(ResultPayloadFailure):
|
|
980
|
+
"""Removing node from NodeGroup failed.
|
|
981
|
+
|
|
982
|
+
Common causes: node not found, NodeGroup not found, node not in group,
|
|
983
|
+
flow not found, no current context.
|
|
984
|
+
"""
|
|
985
|
+
|
|
986
|
+
|
|
987
|
+
@dataclass
|
|
988
|
+
@PayloadRegistry.register
|
|
989
|
+
class CreateNodeGroupRequest(RequestPayload):
|
|
990
|
+
"""Create a new NodeGroup node.
|
|
991
|
+
|
|
992
|
+
Use when: Need to create a new NodeGroup for organizing nodes, building workflows
|
|
993
|
+
with grouped nodes programmatically.
|
|
994
|
+
|
|
995
|
+
Args:
|
|
996
|
+
node_group_name: Desired name for the NodeGroup node (None for auto-generated)
|
|
997
|
+
flow_name: Optional flow name to create the NodeGroup in (None for current context flow)
|
|
998
|
+
metadata: Initial metadata for the NodeGroup (position, display properties)
|
|
999
|
+
|
|
1000
|
+
Results: CreateNodeGroupResultSuccess (with assigned name) | CreateNodeGroupResultFailure (creation failed)
|
|
1001
|
+
"""
|
|
1002
|
+
|
|
1003
|
+
node_group_name: str | None = None
|
|
1004
|
+
flow_name: str | None = None
|
|
1005
|
+
metadata: dict | None = None
|
|
1006
|
+
node_names_to_add: list[str] = field(default_factory=list)
|
|
1007
|
+
|
|
1008
|
+
|
|
1009
|
+
@dataclass
|
|
1010
|
+
@PayloadRegistry.register
|
|
1011
|
+
class CreateNodeGroupResultSuccess(WorkflowAlteredMixin, ResultPayloadSuccess):
|
|
1012
|
+
"""NodeGroup created successfully. NodeGroup is now available for adding nodes.
|
|
1013
|
+
|
|
1014
|
+
Args:
|
|
1015
|
+
node_group_name: Final assigned name (may differ from requested)
|
|
1016
|
+
"""
|
|
1017
|
+
|
|
1018
|
+
node_group_name: str
|
|
1019
|
+
|
|
1020
|
+
|
|
1021
|
+
@dataclass
|
|
1022
|
+
@PayloadRegistry.register
|
|
1023
|
+
class CreateNodeGroupResultFailure(ResultPayloadFailure):
|
|
1024
|
+
"""NodeGroup creation failed.
|
|
1025
|
+
|
|
1026
|
+
Common causes: flow not found, no current context, instantiation errors,
|
|
1027
|
+
NodeGroup node type not available.
|
|
1028
|
+
"""
|
|
1029
|
+
|
|
1030
|
+
|
|
1031
|
+
@dataclass
|
|
1032
|
+
@PayloadRegistry.register
|
|
1033
|
+
class DeleteNodeGroupRequest(RequestPayload):
|
|
1034
|
+
"""Delete a NodeGroup node.
|
|
1035
|
+
|
|
1036
|
+
Use when: Removing obsolete NodeGroups, cleaning up workflow structure,
|
|
1037
|
+
implementing undo. Handles cascading cleanup of the NodeGroup node.
|
|
1038
|
+
|
|
1039
|
+
Args:
|
|
1040
|
+
node_group_name: Name of the NodeGroup node to delete
|
|
1041
|
+
|
|
1042
|
+
Results: DeleteNodeGroupResultSuccess | DeleteNodeGroupResultFailure (NodeGroup not found, deletion failed)
|
|
1043
|
+
"""
|
|
1044
|
+
|
|
1045
|
+
node_group_name: str
|
|
1046
|
+
|
|
1047
|
+
|
|
1048
|
+
@dataclass
|
|
1049
|
+
@PayloadRegistry.register
|
|
1050
|
+
class DeleteNodeGroupResultSuccess(WorkflowAlteredMixin, ResultPayloadSuccess):
|
|
1051
|
+
"""NodeGroup deleted successfully. NodeGroup node removed from workflow."""
|
|
1052
|
+
|
|
1053
|
+
|
|
1054
|
+
@dataclass
|
|
1055
|
+
@PayloadRegistry.register
|
|
1056
|
+
class DeleteNodeGroupResultFailure(ResultPayloadFailure):
|
|
1057
|
+
"""NodeGroup deletion failed.
|
|
1058
|
+
|
|
1059
|
+
Common causes: NodeGroup not found, deletion cleanup failed, node is not a NodeGroup.
|
|
1060
|
+
"""
|
|
@@ -376,6 +376,16 @@ class LoadWorkflowMetadataResultFailure(WorkflowNotAlteredMixin, ResultPayloadFa
|
|
|
376
376
|
"""Workflow metadata load failed. Common causes: file not found, invalid format, parse error."""
|
|
377
377
|
|
|
378
378
|
|
|
379
|
+
@dataclass
|
|
380
|
+
class PublishWorkflowRegisteredEventData:
|
|
381
|
+
"""Data specific to registering a PublishWorkflowRequest event handler."""
|
|
382
|
+
|
|
383
|
+
start_flow_node_type: str
|
|
384
|
+
start_flow_node_library_name: str
|
|
385
|
+
end_flow_node_type: str
|
|
386
|
+
end_flow_node_library_name: str
|
|
387
|
+
|
|
388
|
+
|
|
379
389
|
@dataclass
|
|
380
390
|
@PayloadRegistry.register
|
|
381
391
|
class PublishWorkflowRequest(RequestPayload):
|
|
@@ -180,6 +180,11 @@ class AgentManager:
|
|
|
180
180
|
self.prompt_driver = self._initialize_prompt_driver()
|
|
181
181
|
for key, value in request.prompt_driver.items():
|
|
182
182
|
setattr(self.prompt_driver, key, value)
|
|
183
|
+
|
|
184
|
+
if self.image_tool is None:
|
|
185
|
+
self.image_tool = self._initialize_image_tool()
|
|
186
|
+
for key, value in request.image_generation_driver.items():
|
|
187
|
+
setattr(self.image_tool.image_generation_driver, key, value)
|
|
183
188
|
except Exception as e:
|
|
184
189
|
details = f"Error configuring agent: {e}"
|
|
185
190
|
logger.error(details)
|
|
@@ -397,6 +402,33 @@ class AgentManager:
|
|
|
397
402
|
Rule("Only set generated_image_urls with images generated with your tools."),
|
|
398
403
|
],
|
|
399
404
|
),
|
|
405
|
+
# Note: Griptape's MCPTool automatically wraps arguments in a 'values' key, but our MCP server
|
|
406
|
+
# expects arguments directly. This ruleset instructs the agent to provide arguments without
|
|
407
|
+
# the 'values' wrapper to avoid validation errors. If MCPTool behavior changes in the future,
|
|
408
|
+
# this ruleset may need to be updated or removed.
|
|
409
|
+
Ruleset(
|
|
410
|
+
name="mcp_tool_usage",
|
|
411
|
+
rules=[
|
|
412
|
+
Rule(
|
|
413
|
+
"When calling MCP tools (mcpGriptapeNodes), provide arguments directly without wrapping them in a 'values' key. "
|
|
414
|
+
"For example, use {'node_type': 'FluxImageGeneration', 'node_name': 'MyNode'} not {'values': {'node_type': 'FluxImageGeneration'}}."
|
|
415
|
+
),
|
|
416
|
+
],
|
|
417
|
+
),
|
|
418
|
+
Ruleset(
|
|
419
|
+
name="node_rulesets",
|
|
420
|
+
rules=[
|
|
421
|
+
Rule(
|
|
422
|
+
"When asked to create a node, use ListNodeTypesInLibraryRequest or GetAllInfoForAllLibrariesRequest to check available node types and find the appropriate node."
|
|
423
|
+
),
|
|
424
|
+
Rule(
|
|
425
|
+
"When matching user requests to node types, account for variations: users may include spaces (e.g., 'Image Generation' vs 'ImageGeneration') or reorder words (e.g., 'Generate Image' vs 'Image Generation'). Match based on the words present, not exact spelling."
|
|
426
|
+
),
|
|
427
|
+
Rule(
|
|
428
|
+
"If you cannot determine the correct node type or node creation fails, ask the user for clarification."
|
|
429
|
+
),
|
|
430
|
+
],
|
|
431
|
+
),
|
|
400
432
|
],
|
|
401
433
|
)
|
|
402
434
|
|
|
@@ -453,7 +485,7 @@ class AgentManager:
|
|
|
453
485
|
msg = f"Secret '{API_KEY_ENV_VAR}' not found"
|
|
454
486
|
raise ValueError(msg)
|
|
455
487
|
return NodesPromptImageGenerationTool(
|
|
456
|
-
image_generation_driver=GriptapeCloudImageGenerationDriver(api_key=api_key
|
|
488
|
+
image_generation_driver=GriptapeCloudImageGenerationDriver(api_key=api_key),
|
|
457
489
|
static_files_manager=self.static_files_manager,
|
|
458
490
|
)
|
|
459
491
|
|