diff --git a/semantic_router/encoders/base.py b/semantic_router/encoders/base.py index 5c26633f3810cacd75fa6c5d22ac3611e5ea0d9e..b1e1311ec6b27fcf6984d5451696f61425b2103e 100644 --- a/semantic_router/encoders/base.py +++ b/semantic_router/encoders/base.py @@ -1,4 +1,4 @@ -from typing import List +from typing import Any, List from pydantic.v1 import BaseModel, Field @@ -11,5 +11,5 @@ class BaseEncoder(BaseModel): class Config: arbitrary_types_allowed = True - def __call__(self, docs: List[str]) -> List[List[float]]: + def __call__(self, docs: List[Any]) -> List[List[float]]: raise NotImplementedError("Subclasses must implement this method") diff --git a/semantic_router/index/base.py b/semantic_router/index/base.py index f8a965df015139cd20afb3bbf3a6b9b0f87531cc..d95a62a8316944a56c80d8b136e8a97d668f3725 100644 --- a/semantic_router/index/base.py +++ b/semantic_router/index/base.py @@ -20,7 +20,7 @@ class BaseIndex(BaseModel): type: str = "base" def add( - self, embeddings: List[List[float]], routes: List[str], utterances: List[str] + self, embeddings: List[List[float]], routes: List[str], utterances: List[Any] ): """ Add embeddings to the index. diff --git a/tests/unit/test_layer.py b/tests/unit/test_layer.py index fb5a1439e332140b5bd87e116930743542c2dc06..1cee98ab3f898782682391b854b2201d76812f87 100644 --- a/tests/unit/test_layer.py +++ b/tests/unit/test_layer.py @@ -289,7 +289,7 @@ class TestRouteLayer: route_layer(text="Hello", route_filter=["Route 8"]).name except ValueError: assert True - + # delete index pineconeindex.delete_index()