From 5a83568af776eaa7cda87f597ae2bae57c655134 Mon Sep 17 00:00:00 2001 From: Jen Hamon Date: Thu, 19 Oct 2023 14:16:06 -0400 Subject: [PATCH] Remove duplicate class definition --- pinecone/data/grpc/base.py | 33 +-------------------------------- 1 file changed, 1 insertion(+), 32 deletions(-) diff --git a/pinecone/data/grpc/base.py b/pinecone/data/grpc/base.py index 6029dd67..3452f596 100644 --- a/pinecone/data/grpc/base.py +++ b/pinecone/data/grpc/base.py @@ -12,43 +12,12 @@ from pinecone import Config from .utils import _generate_request_id +from .config import GRPCClientConfig from pinecone.utils.constants import MAX_MSG_SIZE, REQUEST_ID, CLIENT_VERSION from pinecone.exceptions import PineconeException _logger = logging.getLogger(__name__) - -class GRPCClientConfig(NamedTuple): - """ - GRPC client configuration options. - - :param secure: Whether to use encrypted protocol (SSL). defaults to True. - :type traceroute: bool, optional - :param timeout: defaults to 2 seconds. Fail if gateway doesn't receive response within timeout. - :type timeout: int, optional - :param conn_timeout: defaults to 1. Timeout to retry connection if gRPC is unavailable. 0 is no retry. - :type conn_timeout: int, optional - :param reuse_channel: Whether to reuse the same grpc channel for multiple requests - :type reuse_channel: bool, optional - :param retry_config: RetryConfig indicating how requests should be retried - :type retry_config: RetryConfig, optional - :param grpc_channel_options: A dict of gRPC channel arguments - :type grpc_channel_options: Dict[str, str] - """ - - secure: bool = True - timeout: int = 20 - conn_timeout: int = 1 - reuse_channel: bool = True - retry_config: Optional[RetryConfig] = None - grpc_channel_options: Dict[str, str] = None - - @classmethod - def _from_dict(cls, kwargs: dict): - cls_kwargs = {kk: vv for kk, vv in kwargs.items() if kk in cls._fields} - return cls(**cls_kwargs) - - class GRPCIndexBase(ABC): """ Base class for grpc-based interaction with Pinecone indexes