-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Output single artifact, move value to name #724
Conversation
griptape/tasks/actions_subtask.py
Outdated
@@ -103,7 +101,9 @@ def run(self) -> BaseArtifact: | |||
else: | |||
results = self.execute_actions(self.actions) | |||
|
|||
self.output = ListArtifact([TextArtifact(format_output(r)) for r in results]) | |||
self.output = ListArtifact( | |||
[TextArtifact(name=f"{r[0]} output: {r[1].to_text()}", value=r[1].to_text()) for r in results] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the correct approach? Using name
doesn't quite feel right.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think name
should just be {r[0]} output
.
griptape/tasks/tool_task.py
Outdated
@@ -63,8 +63,8 @@ def run(self) -> BaseArtifact: | |||
subtask.run() | |||
subtask.after_run() | |||
|
|||
if subtask.output: | |||
self.output = subtask.output | |||
if subtask.output and isinstance(subtask.output, ListArtifact): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can just be if isinstance(subtask.output, ListArtifact)
.
griptape/tasks/actions_subtask.py
Outdated
@@ -103,7 +101,9 @@ def run(self) -> BaseArtifact: | |||
else: | |||
results = self.execute_actions(self.actions) | |||
|
|||
self.output = ListArtifact([TextArtifact(format_output(r)) for r in results]) | |||
self.output = ListArtifact( | |||
[TextArtifact(name=f"{r[0]} output: {r[1].to_text()}", value=r[1].to_text()) for r in results] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think name
should just be {r[0]} output
.
This PR makes the following changes:
ListArtifact
fromToolTask
. Consistent with old behavior.ActionsSubtask
toTextArtifact.name
instead ofTextArtifact.value
. This allows developers to have a formatted output in additional to the raw output (for parsing).