From 5ea95ba8b23081dc2fa1c3d55b646168c0185e8e Mon Sep 17 00:00:00 2001
From: James Briggs <35938317+jamescalam@users.noreply.github.com>
Date: Sun, 18 Feb 2024 15:42:53 +0400
Subject: [PATCH] fix to local index to support images

---
 semantic_router/index/local.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/semantic_router/index/local.py b/semantic_router/index/local.py
index 058ee2bc..f83a4305 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
-- 
GitLab