diff --git a/semantic_router/index/base.py b/semantic_router/index/base.py index 750e5d8751b7b15e6ff82e8ed18155873f451f01..44bbecf9c949115b31ee8fcc1c93726accbc4ed9 100644 --- a/semantic_router/index/base.py +++ b/semantic_router/index/base.py @@ -26,7 +26,7 @@ class BaseIndex(BaseModel): embeddings: List[List[float]], routes: List[str], utterances: List[Any], - function_schemas: List[Dict[str, Any]] | None = None, + function_schemas: Optional[List[Dict[str, Any]]] = None, ): """ Add embeddings to the index. diff --git a/semantic_router/index/local.py b/semantic_router/index/local.py index be4b48dd27c1984289089ce486c332850c761f9b..e979c40b3699d157a0d0dd32f635b25c2cd6a95e 100644 --- a/semantic_router/index/local.py +++ b/semantic_router/index/local.py @@ -27,7 +27,7 @@ class LocalIndex(BaseIndex): embeddings: List[List[float]], routes: List[str], utterances: List[str], - function_schemas: List[Dict[str, Any]] | None = None, + function_schemas: Optional[List[Dict[str, Any]]] = None, ): embeds = np.array(embeddings) # type: ignore routes_arr = np.array(routes) diff --git a/semantic_router/index/pinecone.py b/semantic_router/index/pinecone.py index 26e0b40e36ae4debf824706aaa96da6ccaa62b57..875a488cd2dc062597d654b35fbc4792d4df03e8 100644 --- a/semantic_router/index/pinecone.py +++ b/semantic_router/index/pinecone.py @@ -399,7 +399,7 @@ class PineconeIndex(BaseIndex): embeddings: List[List[float]], routes: List[str], utterances: List[str], - function_schemas: List[Dict[str, Any]] | None = None, + function_schemas: Optional[List[Dict[str, Any]]] = None, batch_size: int = 100, ): """Add vectors to Pinecone in batches.""" diff --git a/semantic_router/index/postgres.py b/semantic_router/index/postgres.py index b4e133fe8611cbc1fdc13677db484b2b6fcb7da3..0d18381f4347f5d1dd6fcdd67c8566230a9b6499 100644 --- a/semantic_router/index/postgres.py +++ b/semantic_router/index/postgres.py @@ -259,7 +259,7 @@ class PostgresIndex(BaseIndex): embeddings: List[List[float]], routes: List[str], utterances: List[Any], - function_schemas: List[Dict[str, Any]] | None = None, + function_schemas: Optional[List[Dict[str, Any]]] = None, ) -> None: """ Adds vectors to the index. diff --git a/semantic_router/index/qdrant.py b/semantic_router/index/qdrant.py index 11a0a076d478ffd16efa7bbbf96dce1ff682b0ce..ec809577c0410bfb69041c97deca2e180aeb103e 100644 --- a/semantic_router/index/qdrant.py +++ b/semantic_router/index/qdrant.py @@ -179,7 +179,7 @@ class QdrantIndex(BaseIndex): embeddings: List[List[float]], routes: List[str], utterances: List[str], - function_schemas: List[Dict[str, Any]] | None = None, + function_schemas: Optional[List[Dict[str, Any]]] = None, batch_size: int = DEFAULT_UPLOAD_BATCH_SIZE, ): self.dimensions = self.dimensions or len(embeddings[0])