pinecone.grpc.config
1from .retry import RetryConfig 2from typing import NamedTuple, Optional, Dict 3 4 5class GRPCClientConfig(NamedTuple): 6 """ 7 GRPC client configuration options. 8 9 :param secure: Whether to use encrypted protocol (SSL). defaults to True. 10 :type secure: bool, optional 11 :param timeout: defaults to 2 seconds. Fail if gateway doesn't receive response within timeout. 12 :type timeout: int, optional 13 :param conn_timeout: defaults to 1. Timeout to retry connection if gRPC is unavailable. 0 is no retry. 14 :type conn_timeout: int, optional 15 :param reuse_channel: Whether to reuse the same grpc channel for multiple requests 16 :type reuse_channel: bool, optional 17 :param retry_config: RetryConfig indicating how requests should be retried 18 :type retry_config: RetryConfig, optional 19 :param grpc_channel_options: A dict of gRPC channel arguments 20 :type grpc_channel_options: Dict[str, str] 21 :param additional_metadata: Additional metadata to be sent to the server with each request. Note that this 22 metadata refers to [gRPC metadata](https://grpc.io/docs/guides/metadata/) which is a concept similar 23 to HTTP headers. This is unrelated to the metadata can be stored with a vector in the index. 24 :type additional_metadata: Dict[str, str] 25 """ 26 27 secure: bool = True 28 timeout: int = 20 29 conn_timeout: int = 1 30 reuse_channel: bool = True 31 retry_config: Optional[RetryConfig] = None 32 grpc_channel_options: Optional[Dict[str, str]] = None 33 additional_metadata: Optional[Dict[str, str]] = None 34 35 @classmethod 36 def _from_dict(cls, kwargs: dict): 37 cls_kwargs = {kk: vv for kk, vv in kwargs.items() if kk in cls._fields} 38 return cls(**cls_kwargs)
class
GRPCClientConfig(typing.NamedTuple):
6class GRPCClientConfig(NamedTuple): 7 """ 8 GRPC client configuration options. 9 10 :param secure: Whether to use encrypted protocol (SSL). defaults to True. 11 :type secure: bool, optional 12 :param timeout: defaults to 2 seconds. Fail if gateway doesn't receive response within timeout. 13 :type timeout: int, optional 14 :param conn_timeout: defaults to 1. Timeout to retry connection if gRPC is unavailable. 0 is no retry. 15 :type conn_timeout: int, optional 16 :param reuse_channel: Whether to reuse the same grpc channel for multiple requests 17 :type reuse_channel: bool, optional 18 :param retry_config: RetryConfig indicating how requests should be retried 19 :type retry_config: RetryConfig, optional 20 :param grpc_channel_options: A dict of gRPC channel arguments 21 :type grpc_channel_options: Dict[str, str] 22 :param additional_metadata: Additional metadata to be sent to the server with each request. Note that this 23 metadata refers to [gRPC metadata](https://grpc.io/docs/guides/metadata/) which is a concept similar 24 to HTTP headers. This is unrelated to the metadata can be stored with a vector in the index. 25 :type additional_metadata: Dict[str, str] 26 """ 27 28 secure: bool = True 29 timeout: int = 20 30 conn_timeout: int = 1 31 reuse_channel: bool = True 32 retry_config: Optional[RetryConfig] = None 33 grpc_channel_options: Optional[Dict[str, str]] = None 34 additional_metadata: Optional[Dict[str, str]] = None 35 36 @classmethod 37 def _from_dict(cls, kwargs: dict): 38 cls_kwargs = {kk: vv for kk, vv in kwargs.items() if kk in cls._fields} 39 return cls(**cls_kwargs)
GRPC client configuration options.
Parameters
- secure: Whether to use encrypted protocol (SSL). defaults to True.
- timeout: defaults to 2 seconds. Fail if gateway doesn't receive response within timeout.
- conn_timeout: defaults to 1. Timeout to retry connection if gRPC is unavailable. 0 is no retry.
- reuse_channel: Whether to reuse the same grpc channel for multiple requests
- retry_config: RetryConfig indicating how requests should be retried
- grpc_channel_options: A dict of gRPC channel arguments
- additional_metadata: Additional metadata to be sent to the server with each request. Note that this metadata refers to gRPC metadata which is a concept similar to HTTP headers. This is unrelated to the metadata can be stored with a vector in the index.
GRPCClientConfig( secure: bool = True, timeout: int = 20, conn_timeout: int = 1, reuse_channel: bool = True, retry_config: Optional[pinecone.grpc.retry.RetryConfig] = None, grpc_channel_options: Optional[Dict[str, str]] = None, additional_metadata: Optional[Dict[str, str]] = None)
Create new instance of GRPCClientConfig(secure, timeout, conn_timeout, reuse_channel, retry_config, grpc_channel_options, additional_metadata)
Inherited Members
- builtins.tuple
- index
- count