From 6f4bf2e0436c73d29037a6153bd6cea5ff2813a9 Mon Sep 17 00:00:00 2001 From: jamescalam <james.briggs@hotmail.com> Date: Sun, 1 Dec 2024 18:30:22 +0100 Subject: [PATCH] fix: func schema string type --- semantic_router/schema.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/semantic_router/schema.py b/semantic_router/schema.py index b3cee7c2..2a94b355 100644 --- a/semantic_router/schema.py +++ b/semantic_router/schema.py @@ -130,12 +130,12 @@ class Utterance(BaseModel): # we sort the dicts to ensure consistent order as we need this to compare # stringified function schemas accurately if self.function_schemas is not None: - function_schemas_sorted = [ + function_schemas_sorted: List[str] | None = [ json.dumps(schema, sort_keys=True) for schema in self.function_schemas ] else: - function_schemas_sorted = [] + function_schemas_sorted = None # 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}" -- GitLab