Skip to content

Commit

Permalink
Release v0.21.2 (#523)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewfrench authored Dec 21, 2023
2 parents f1cd112 + 7a3fa16 commit 70d34a8
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 14 deletions.
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
publish:
version:
@poetry version $(v)
@git add pyproject.toml
@git commit -m "Version bump v$$(poetry version -s)"
@git push origin release/v$$(poetry version -s)

publish:
@git tag v$$(poetry version -s)
@git push
@git push --tags
@poetry build
@poetry publish
@poetry publish
4 changes: 3 additions & 1 deletion griptape/tasks/image_generation_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ def _write_to_file(self, image_artifact: ImageArtifact) -> None:
else:
outfile = path.join(self.output_dir, image_artifact.name)

os.makedirs(path.dirname(outfile), exist_ok=True)
if path.dirname(outfile):
os.makedirs(path.dirname(outfile), exist_ok=True)

with open(outfile, "wb") as f:
self.structure.logger.info(f"Saving [{image_artifact.to_text()}] to {os.path.abspath(outfile)}")
f.write(image_artifact.value)
4 changes: 0 additions & 4 deletions griptape/templates/tasks/tool_task/system.j2
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,3 @@ NEVER make up action names. NEVER make up action paths. Actions must ALWAYS be p

{{ rulesets }}
{% endif %}

You can use the following action:

{{ action }}
4 changes: 3 additions & 1 deletion griptape/tools/image_generator/tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ def _write_to_file(self, image_artifact: ImageArtifact) -> None:
else:
outfile = path.join(self.output_dir, image_artifact.name)

os.makedirs(path.dirname(outfile), exist_ok=True)
if path.dirname(outfile):
os.makedirs(path.dirname(outfile), exist_ok=True)

with open(outfile, "wb") as f:
f.write(image_artifact.value)
11 changes: 7 additions & 4 deletions griptape/tools/sql_client/tool.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import annotations
from typing import Optional
from attr import define, field
from griptape.artifacts import InfoArtifact, ListArtifact
from griptape.artifacts import InfoArtifact, ListArtifact, ErrorArtifact
from griptape.tools import BaseTool
from griptape.utils.decorators import activity
from griptape.loaders import SqlLoader
Expand Down Expand Up @@ -38,9 +38,12 @@ def table_schema(self) -> str:
"schema": Schema({"sql_query": str}),
}
)
def execute_query(self, params: dict) -> ListArtifact | InfoArtifact:
query = params["values"]["sql_query"]
rows = self.sql_loader.load(query)
def execute_query(self, params: dict) -> ListArtifact | InfoArtifact | ErrorArtifact:
try:
query = params["values"]["sql_query"]
rows = self.sql_loader.load(query)
except Exception as e:
return ErrorArtifact(f"error executing query: {e}")

if len(rows) > 0:
return ListArtifact(rows)
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.21.1"
version = "0.21.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 70d34a8

Please sign in to comment.