From a2f7f6efe555d782130d653cfa6f4350a92730da Mon Sep 17 00:00:00 2001 From: Collin Dutter Date: Tue, 30 Jul 2024 14:25:13 -0700 Subject: [PATCH] WIP --- griptape/mixins/activity_mixin.py | 2 +- tests/unit/mixins/test_activity_mixin.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/griptape/mixins/activity_mixin.py b/griptape/mixins/activity_mixin.py index 13d15dc57b..b94b70ba33 100644 --- a/griptape/mixins/activity_mixin.py +++ b/griptape/mixins/activity_mixin.py @@ -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: diff --git a/tests/unit/mixins/test_activity_mixin.py b/tests/unit/mixins/test_activity_mixin.py index 1d684e2a5d..3a3be3e2e8 100644 --- a/tests/unit/mixins/test_activity_mixin.py +++ b/tests/unit/mixins/test_activity_mixin.py @@ -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",