Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
collindutter committed Jul 30, 2024
1 parent b28971e commit a2f7f6e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion griptape/mixins/activity_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class ActivityMixin:

allowlist: Optional[list[str]] = field(default=None, kw_only=True)
denylist: Optional[list[str]] = field(default=None, kw_only=True)
extra_schema_properties: dict[str, dict] = field(default=None, kw_only=True)
extra_schema_properties: Optional[dict[str, dict]] = field(default=None, kw_only=True)

@allowlist.validator # pyright: ignore[reportAttributeAccessIssue]
def validate_allowlist(self, _: Attribute, allowlist: Optional[list[str]]) -> None:
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/mixins/test_activity_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ def test_enable_activities(self, tool):
assert len(tool.activities()) > 0

def test_extra_schema_properties(self):
tool = MockTool(
tool_with_extra_properties = MockTool(
test_field="hello",
test_int=5,
extra_schema_properties={"test": {Literal("new_property"): str, Optional("optional_property"): int}},
)
schema = tool.activity_schema(tool.test).json_schema("InputSchema")
schema = tool_with_extra_properties.activity_schema(tool_with_extra_properties.test).json_schema("InputSchema")

assert schema == {
"$id": "InputSchema",
Expand Down

0 comments on commit a2f7f6e

Please sign in to comment.