diff --git a/semantic_router/index/local.py b/semantic_router/index/local.py index 058ee2bc08e562a56327c61850471b14409dfa6a..f83a43053ea754ef12fc6faa2658a5ba84f4a315 100644 --- a/semantic_router/index/local.py +++ b/semantic_router/index/local.py @@ -22,7 +22,10 @@ class LocalIndex(BaseIndex): ): embeds = np.array(embeddings) # type: ignore routes_arr = np.array(routes) - utterances_arr = np.array(utterances) + if isinstance(utterances[0], str): + utterances_arr = np.array(utterances) + else: + utterances_arr = np.array(utterances, dtype=object) if self.index is None: self.index = embeds # type: ignore self.routes = routes_arr