From 5c3f8080c89385ad3dc96ff096aaf2ab928f503b Mon Sep 17 00:00:00 2001 From: jamescalam Date: Sun, 1 Dec 2024 18:18:54 +0100 Subject: [PATCH] fix: func schema string logic --- semantic_router/schema.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/semantic_router/schema.py b/semantic_router/schema.py index 678cd747..b3cee7c2 100644 --- a/semantic_router/schema.py +++ b/semantic_router/schema.py @@ -134,6 +134,8 @@ def to_str(self, include_metadata: bool = False): json.dumps(schema, sort_keys=True) for schema in self.function_schemas ] + else: + function_schemas_sorted = [] # 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}"