diff --git a/semantic_router/encoders/base.py b/semantic_router/encoders/base.py index 5c26633f..b1e1311e 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 f8a965df..d95a62a8 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 fb5a1439..1cee98ab 100644 --- a/tests/unit/test_layer.py +++ b/tests/unit/test_layer.py @@ -289,7 +289,7 @@ def test_query_filter_pinecone(self, openai_encoder, routes, index_cls): route_layer(text="Hello", route_filter=["Route 8"]).name except ValueError: assert True - + # delete index pineconeindex.delete_index()