Skip to content

Commit

Permalink
fix: function schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
jamescalam committed Nov 20, 2024
1 parent 43c2015 commit a2ef8fe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion semantic_router/layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 2 additions & 0 deletions semantic_router/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit a2ef8fe

Please sign in to comment.