From ceb67ceb22a860d0b33b9e4a50534ae8cc5aaa7b Mon Sep 17 00:00:00 2001 From: James Briggs <james.briggs@hotmail.com> Date: Sat, 27 Apr 2024 18:32:17 +0800 Subject: [PATCH] type fixes for linter --- semantic_router/encoders/base.py | 4 ++-- semantic_router/index/base.py | 2 +- tests/unit/test_layer.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) 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 @@ class TestRouteLayer: route_layer(text="Hello", route_filter=["Route 8"]).name except ValueError: assert True - + # delete index pineconeindex.delete_index() -- GitLab