diff --git a/semantic_router/index/pinecone.py b/semantic_router/index/pinecone.py index e70d8b62d88a1a67f12774f5aacbfdd71e4a835c..3fa22677f074de16869d45f3286fe043cf7cc87a 100644 --- a/semantic_router/index/pinecone.py +++ b/semantic_router/index/pinecone.py @@ -534,7 +534,9 @@ class PineconeIndex(BaseIndex): scope=scope, ) - async def _async_read_config(self, field: str, scope: str | None = None) -> ConfigParameter: + async def _async_read_config( + self, field: str, scope: str | None = None + ) -> ConfigParameter: """Read a config parameter from the index asynchronously. :param field: The field to read. @@ -566,7 +568,9 @@ class PineconeIndex(BaseIndex): scope=scope, ) except KeyError: - raise ValueError(f"Found invalid config record during sync: {config_record}") + raise ValueError( + f"Found invalid config record during sync: {config_record}" + ) else: logger.warning(f"Configuration for {field} parameter not found in index.") return ConfigParameter( @@ -752,7 +756,8 @@ class PineconeIndex(BaseIndex): "namespace": namespace, } async with self.async_client.post( - f"https://{self.host}/vectors/delete", json=params, + f"https://{self.host}/vectors/delete", + json=params, ) as response: return await response.json(content_type=None) diff --git a/tests/unit/test_sync.py b/tests/unit/test_sync.py index 390cab49f36befe34f2282b198d605e2f65c8b37..148e62eeb4ca8625205786909c90470607644123 100644 --- a/tests/unit/test_sync.py +++ b/tests/unit/test_sync.py @@ -154,7 +154,7 @@ def cohere_encoder(mocker): # Handle either docs or utterances parameter texts = docs if docs is not None else utterances return mock_encoder_call(texts) - + mocker.patch.object(CohereEncoder, "acall", side_effect=async_mock_encoder_call) return CohereEncoder(name="test-cohere-encoder", cohere_api_key="test_api_key") @@ -168,7 +168,7 @@ def openai_encoder(mocker): # Handle either docs or utterances parameter texts = docs if docs is not None else utterances return mock_encoder_call(texts) - + mocker.patch.object(OpenAIEncoder, "acall", side_effect=async_mock_encoder_call) return OpenAIEncoder(name="text-embedding-3-small", openai_api_key="test_api_key")