Skip to content

Commit

Permalink
Fix Workflow outputs (#1210)
Browse files Browse the repository at this point in the history
Co-authored-by: Matt Vallillo <matt@griptape.ai>
  • Loading branch information
collindutter and vachillo authored Sep 28, 2024
1 parent e16d23b commit 15907f0
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion griptape/structures/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/structures/test_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 15907f0

Please sign in to comment.