Skip to content

Commit

Permalink
Remove duplicate class definition
Browse files Browse the repository at this point in the history
  • Loading branch information
jhamon committed Oct 19, 2023
1 parent 91b5728 commit 5a83568
Showing 1 changed file with 1 addition and 32 deletions.
33 changes: 1 addition & 32 deletions pinecone/data/grpc/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5a83568

Please sign in to comment.