Skip to content

Commit

Permalink
chore: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
jamescalam committed Dec 1, 2024
1 parent c0b293d commit 47bce51
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions semantic_router/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,11 @@ def to_str(self, include_metadata: bool = False):
if include_metadata:
# we sort the dicts to ensure consistent order as we need this to compare
# stringified function schemas accurately
function_schemas_sorted = [
json.dumps(schema, sort_keys=True)
for schema in self.function_schemas
]
if self.function_schemas is not None:
function_schemas_sorted = [
json.dumps(schema, sort_keys=True)
for schema in self.function_schemas
]
# we must do the same for metadata
metadata_sorted = json.dumps(self.metadata, sort_keys=True)
return f"{self.route}: {self.utterance} | {function_schemas_sorted} | {metadata_sorted}"
Expand Down

0 comments on commit 47bce51

Please sign in to comment.