From 15907f049a9f9d23441a3b7f8ce4a5e29039afa8 Mon Sep 17 00:00:00 2001 From: Collin Dutter Date: Fri, 27 Sep 2024 17:07:49 -0700 Subject: [PATCH] Fix Workflow outputs (#1210) Co-authored-by: Matt Vallillo --- CHANGELOG.md | 1 - griptape/structures/workflow.py | 2 +- tests/unit/structures/test_workflow.py | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 31a2b3b5a..75010e3a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Added - `Workflow.input_tasks` and `Workflow.output_tasks` to access the input and output tasks of a Workflow. - Ability to pass nested list of `Tasks` to `Structure.tasks` allowing for more complex declarative Structure definitions. -- Parameter `pipeline_task` on `HuggingFacePipelinePromptDriver` for creating different types of `Pipeline`s. - `TavilyWebSearchDriver` to integrate Tavily's web search capabilities. - `Workflow.outputs` to access the outputs of a Workflow. diff --git a/griptape/structures/workflow.py b/griptape/structures/workflow.py index 982ccb5f6..1c65c59c4 100644 --- a/griptape/structures/workflow.py +++ b/griptape/structures/workflow.py @@ -36,7 +36,7 @@ def output_tasks(self) -> list[BaseTask]: @property def outputs(self) -> list[BaseArtifact]: - return [task.output.value for task in self.output_tasks if task.output is not None] + return [task.output for task in self.output_tasks if task.output is not None] def add_task(self, task: BaseTask) -> BaseTask: if (existing_task := self.try_find_task(task.id)) is not None: diff --git a/tests/unit/structures/test_workflow.py b/tests/unit/structures/test_workflow.py index 130b8a426..03698a73c 100644 --- a/tests/unit/structures/test_workflow.py +++ b/tests/unit/structures/test_workflow.py @@ -833,7 +833,7 @@ def test_outputs(self): workflow.run() - assert workflow.outputs == ["mock output"] * 3 + assert [output.value for output in workflow.outputs] == ["mock output"] * 3 @staticmethod def _validate_topology_1(workflow) -> None: