Skip to content

Commit

Permalink
Add comment, flip conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
collindutter committed Jul 31, 2024
1 parent c4ba2bc commit b406f8a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions griptape/tools/base_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,12 @@ def activity_schemas(self) -> list[Schema]:
}

activity_schema = self.activity_schema(activity)
if activity_schema is not None:
schema_dict[Literal("input")] = activity_schema.schema
else:
# If no schema is defined, we just make `input` optional instead of omitting it.
# This works better with lower-end models that may accidentally pass in an empty dict.
if activity_schema is None:
schema_dict[schema.Optional("input")] = {}
else:
schema_dict[Literal("input")] = activity_schema.schema

schemas.append(Schema(schema_dict))

Expand Down

0 comments on commit b406f8a

Please sign in to comment.