Skip to content

Commit

Permalink
Chore/merge (#1072)
Browse files Browse the repository at this point in the history
  • Loading branch information
collindutter authored Aug 16, 2024
1 parent 54efe3b commit 24a6824
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 17 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed
- `JsonExtractionEngine` failing to parse json when the LLM outputs more than just the json.
## [0.29.2] - 2024-08-16

### Fixed
- `Workflow` threads not being properly cleaned up after completion.
- Crash when `ToolAction`s were missing output due to an `ActionsSubtask` exception.

## [0.29.1] - 2024-08-02

Expand Down
31 changes: 16 additions & 15 deletions griptape/structures/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,21 +94,22 @@ def insert_task(
def try_run(self, *args) -> Workflow:
exit_loop = False

while not self.is_finished() and not exit_loop:
futures_list = {}
ordered_tasks = self.order_tasks()

for task in ordered_tasks:
if task.can_execute():
future = self.futures_executor_fn().submit(task.execute)
futures_list[future] = task

# Wait for all tasks to complete
for future in futures.as_completed(futures_list):
if isinstance(future.result(), ErrorArtifact) and self.fail_fast:
exit_loop = True

break
with self.futures_executor_fn() as executor:
while not self.is_finished() and not exit_loop:
futures_list = {}
ordered_tasks = self.order_tasks()

for task in ordered_tasks:
if task.can_execute():
future = executor.submit(task.execute)
futures_list[future] = task

# Wait for all tasks to complete
for future in futures.as_completed(futures_list):
if isinstance(future.result(), ErrorArtifact) and self.fail_fast:
exit_loop = True

break

if self.conversation_memory and self.output is not None:
run = Run(input=self.input_task.input, output=self.output)
Expand Down
7 changes: 6 additions & 1 deletion griptape/tasks/toolkit_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,12 @@ def prompt_stack(self) -> PromptStack:
for action in s.actions
]
action_results = [
ToolAction(name=action.name, path=action.path, tag=action.tag, output=action.output)
ToolAction(
name=action.name,
path=action.path,
tag=action.tag,
output=action.output if action.output is not None else s.output,
)
for action in s.actions
]

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "griptape"
version = "0.29.1"
version = "0.29.2"
description = "Modular Python framework for LLM workflows, tools, memory, and data."
authors = ["Griptape <[email protected]>"]
license = "Apache 2.0"
Expand Down

0 comments on commit 24a6824

Please sign in to comment.