From a2ef8fe56d5b6614fba88f25db05c10f6b80ba31 Mon Sep 17 00:00:00 2001 From: jamescalam Date: Wed, 20 Nov 2024 15:01:59 +0100 Subject: [PATCH] fix: function schemas --- semantic_router/layer.py | 2 +- semantic_router/schema.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/semantic_router/layer.py b/semantic_router/layer.py index f34ec9d1..ec051633 100644 --- a/semantic_router/layer.py +++ b/semantic_router/layer.py @@ -488,7 +488,7 @@ def sync(self, sync_mode: str, force: bool = False) -> List[str]: remote_utterances=remote_utterances, ) # generate sync strategy - sync_strategy = diff.to_sync_strategy() + sync_strategy = diff.get_sync_strategy(sync_mode=sync_mode) # and execute self._execute_sync_strategy(sync_strategy) return diff.to_utterance_str() diff --git a/semantic_router/schema.py b/semantic_router/schema.py index ca5e55c4..ef2b2190 100644 --- a/semantic_router/schema.py +++ b/semantic_router/schema.py @@ -98,6 +98,8 @@ def from_tuple(cls, tuple_obj: Tuple): """ route, utterance = tuple_obj[0], tuple_obj[1] function_schemas = tuple_obj[2] if len(tuple_obj) > 2 else None + if isinstance(function_schemas, dict): + function_schemas = [function_schemas] metadata = tuple_obj[3] if len(tuple_obj) > 3 else {} return cls( route=route,