diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..41338957 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,12 @@ +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v3.2.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + - id: check-added-large-files +- repo: https://github.com/psf/black + rev: 23.9.1 + hooks: + - id: black diff --git a/pinecone/__init__.py b/pinecone/__init__.py index 9324ea72..0b4605c3 100644 --- a/pinecone/__init__.py +++ b/pinecone/__init__.py @@ -7,6 +7,7 @@ from .info import * from .manage import * from .index import * + try: from .core.grpc.index_grpc import * except ImportError: diff --git a/pinecone/config.py b/pinecone/config.py index 4e29f013..f320e9b8 100644 --- a/pinecone/config.py +++ b/pinecone/config.py @@ -16,13 +16,17 @@ from pinecone.core.client.exceptions import ApiKeyError from pinecone.core.api_action import ActionAPI, WhoAmIResponse from pinecone.core.utils import warn_deprecated, check_kwargs -from pinecone.core.utils.constants import CLIENT_VERSION, PARENT_LOGGER_NAME, DEFAULT_PARENT_LOGGER_LEVEL, \ - TCP_KEEPIDLE, TCP_KEEPINTVL, TCP_KEEPCNT +from pinecone.core.utils.constants import ( + CLIENT_VERSION, + PARENT_LOGGER_NAME, + DEFAULT_PARENT_LOGGER_LEVEL, + TCP_KEEPIDLE, + TCP_KEEPINTVL, + TCP_KEEPCNT, +) from pinecone.core.client.configuration import Configuration as OpenApiConfiguration -__all__ = [ - "Config", "init" -] +__all__ = ["Config", "init"] _logger = logging.getLogger(__name__) _parent_logger = logging.getLogger(PARENT_LOGGER_NAME) @@ -63,10 +67,10 @@ def reset(self, config_file=None, **kwargs): # Get the environment first. Make sure that it is not overwritten in subsequent config objects. environment = ( - kwargs.pop("environment", None) - or os.getenv("PINECONE_ENVIRONMENT") - or file_config.pop("environment", None) - or "us-west1-gcp" + kwargs.pop("environment", None) + or os.getenv("PINECONE_ENVIRONMENT") + or file_config.pop("environment", None) + or "us-west1-gcp" ) config = config._replace(environment=environment) @@ -102,24 +106,21 @@ def reset(self, config_file=None, **kwargs): if not self._config.project_name: config = config._replace( - **self._preprocess_and_validate_config({'project_name': whoami_response.projectname})) + **self._preprocess_and_validate_config({"project_name": whoami_response.projectname}) + ) self._config = config # Set OpenAPI client config default_openapi_config = OpenApiConfiguration.get_default_copy() default_openapi_config.ssl_ca_cert = certifi.where() - openapi_config = ( - kwargs.pop("openapi_config", None) - or default_openapi_config - ) + openapi_config = kwargs.pop("openapi_config", None) or default_openapi_config openapi_config.socket_options = self._get_socket_options() config = config._replace(openapi_config=openapi_config) self._config = config - def _preprocess_and_validate_config(self, config: dict) -> dict: """Normalize, filter, and validate config keys/values. @@ -128,9 +129,9 @@ def _preprocess_and_validate_config(self, config: dict) -> dict: """ # general preprocessing and filtering result = {k: v for k, v in config.items() if k in ConfigBase._fields if v is not None} - result.pop('environment', None) + result.pop("environment", None) # validate api key - api_key = result.get('api_key') + api_key = result.get("api_key") # if api_key: # try: # uuid.UUID(api_key) @@ -152,11 +153,12 @@ def _load_config_file(self, config_file: str) -> dict: return config_obj @staticmethod - def _get_socket_options(do_keep_alive: bool = True, - keep_alive_idle_sec: int = TCP_KEEPIDLE, - keep_alive_interval_sec: int = TCP_KEEPINTVL, - keep_alive_tries: int = TCP_KEEPCNT - ) -> List[tuple]: + def _get_socket_options( + do_keep_alive: bool = True, + keep_alive_idle_sec: int = TCP_KEEPIDLE, + keep_alive_interval_sec: int = TCP_KEEPINTVL, + keep_alive_tries: int = TCP_KEEPCNT, + ) -> List[tuple]: """ Returns the socket options to pass to OpenAPI's Rest client Args: @@ -179,8 +181,12 @@ def _get_socket_options(do_keep_alive: bool = True, # TCP Keep Alive Probes for different platforms platform = sys.platform # TCP Keep Alive Probes for Linux - if platform == 'linux' and hasattr(socket, "TCP_KEEPIDLE") and hasattr(socket, "TCP_KEEPINTVL") \ - and hasattr(socket, "TCP_KEEPCNT"): + if ( + platform == "linux" + and hasattr(socket, "TCP_KEEPIDLE") + and hasattr(socket, "TCP_KEEPINTVL") + and hasattr(socket, "TCP_KEEPCNT") + ): socket_params += [(socket.IPPROTO_TCP, socket.TCP_KEEPIDLE, keep_alive_idle_sec)] socket_params += [(socket.IPPROTO_TCP, socket.TCP_KEEPINTVL, keep_alive_interval_sec)] socket_params += [(socket.IPPROTO_TCP, socket.TCP_KEEPCNT, keep_alive_tries)] @@ -193,7 +199,7 @@ def _get_socket_options(do_keep_alive: bool = True, # socket.ioctl((socket.SIO_KEEPALIVE_VALS, (1, keep_alive_idle_sec * 1000, keep_alive_interval_sec * 1000))) # TCP Keep Alive Probes for Mac OS - elif platform == 'darwin': + elif platform == "darwin": TCP_KEEPALIVE = 0x10 socket_params += [(socket.IPPROTO_TCP, TCP_KEEPALIVE, keep_alive_interval_sec)] @@ -226,15 +232,22 @@ def LOG_LEVEL(self): """ warn_deprecated( description='LOG_LEVEL is deprecated. Use the standard logging module logger "pinecone" instead.', - deprecated_in='2.0.2', - removal_in='3.0.0' + deprecated_in="2.0.2", + removal_in="3.0.0", ) - return logging.getLevelName(logging.getLogger('pinecone').level) - - -def init(api_key: str = None, host: str = None, environment: str = None, project_name: str = None, - log_level: str = None, openapi_config: OpenApiConfiguration = None, - config: str = "~/.pinecone", **kwargs): + return logging.getLevelName(logging.getLogger("pinecone").level) + + +def init( + api_key: str = None, + host: str = None, + environment: str = None, + project_name: str = None, + log_level: str = None, + openapi_config: OpenApiConfiguration = None, + config: str = "~/.pinecone", + **kwargs +): """Initializes the Pinecone client. :param api_key: Required if not set in config file or by environment variable ``PINECONE_API_KEY``. @@ -246,13 +259,20 @@ def init(api_key: str = None, host: str = None, environment: str = None, project :param log_level: Deprecated since v2.0.2 [Will be removed in v3.0.0]; use the standard logging module to manage logger "pinecone" instead. """ check_kwargs(init, kwargs) - Config.reset(project_name=project_name, api_key=api_key, controller_host=host, environment=environment, - openapi_config=openapi_config, config_file=config, **kwargs) + Config.reset( + project_name=project_name, + api_key=api_key, + controller_host=host, + environment=environment, + openapi_config=openapi_config, + config_file=config, + **kwargs + ) if log_level: warn_deprecated( description='log_level is deprecated. Use the standard logging module to manage logger "pinecone" instead.', - deprecated_in='2.0.2', - removal_in='3.0.0' + deprecated_in="2.0.2", + removal_in="3.0.0", ) diff --git a/pinecone/core/__init__.py b/pinecone/core/__init__.py index cdeec0d9..72f75876 100644 --- a/pinecone/core/__init__.py +++ b/pinecone/core/__init__.py @@ -1,4 +1,3 @@ # # Copyright (c) 2020-2021 Pinecone Systems Inc. All right reserved. # - diff --git a/pinecone/core/api_action.py b/pinecone/core/api_action.py index ad5de5f7..10a9dd24 100644 --- a/pinecone/core/api_action.py +++ b/pinecone/core/api_action.py @@ -11,9 +11,9 @@ class WhoAmIResponse(NamedTuple): - username: str = 'UNKNOWN' - user_label: str = 'UNKNOWN' - projectname: str = 'UNKNOWN' + username: str = "UNKNOWN" + user_label: str = "UNKNOWN" + projectname: str = "UNKNOWN" class VersionResponse(NamedTuple): @@ -23,6 +23,7 @@ class VersionResponse(NamedTuple): class ActionAPI(BaseAPI): """User related API calls.""" + client_version = get_version() def whoami(self) -> WhoAmIResponse: @@ -37,5 +38,4 @@ def whoami(self) -> WhoAmIResponse: def version(self) -> VersionResponse: """Returns version information.""" response = self.get("/actions/version") - return VersionResponse(server=response.get("version", "UNKNOWN"), - client=self.client_version) + return VersionResponse(server=response.get("version", "UNKNOWN"), client=self.client_version) diff --git a/pinecone/core/api_base.py b/pinecone/core/api_base.py index c400bb7d..185b7174 100644 --- a/pinecone/core/api_base.py +++ b/pinecone/core/api_base.py @@ -18,7 +18,7 @@ def headers(self): return {"api-key": self.api_key} def _send_request(self, request_handler, url, **kwargs): - response = request_handler('{0}{1}'.format(self.host, url), headers=self.headers, **kwargs) + response = request_handler("{0}{1}".format(self.host, url), headers=self.headers, **kwargs) try: response.raise_for_status() except HTTPError as e: @@ -37,4 +37,3 @@ def patch(self, url: str, json: dict = None): def delete(self, url: str): return self._send_request(requests.delete, url) - diff --git a/pinecone/core/client/api/index_operations_api.py b/pinecone/core/client/api/index_operations_api.py index 5bd45245..a5b09dcc 100644 --- a/pinecone/core/client/api/index_operations_api.py +++ b/pinecone/core/client/api/index_operations_api.py @@ -22,7 +22,7 @@ datetime, file_type, none_type, - validate_and_convert_types + validate_and_convert_types, ) from pinecone.core.client.model.collection_meta import CollectionMeta from pinecone.core.client.model.create_collection_request import CreateCollectionRequest @@ -43,11 +43,7 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def __configure_index( - self, - index_name, - **kwargs - ): + def __configure_index(self, index_name, **kwargs): """configure_index # noqa: E501 This operation specifies the pod type and number of replicas for an index. # noqa: E501 @@ -87,103 +83,70 @@ def __configure_index( If the method is called asynchronously, returns the request thread. """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['index_name'] = \ - index_name + kwargs["async_req"] = kwargs.get("async_req", False) + kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) + kwargs["_preload_content"] = kwargs.get("_preload_content", True) + kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) + kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) + kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) + kwargs["_host_index"] = kwargs.get("_host_index") + kwargs["index_name"] = index_name return self.call_with_http_info(**kwargs) self.configure_index = _Endpoint( settings={ - 'response_type': (str,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/databases/{indexName}', - 'operation_id': 'configure_index', - 'http_method': 'PATCH', - 'servers': [ + "response_type": (str,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/databases/{indexName}", + "operation_id": "configure_index", + "http_method": "PATCH", + "servers": [ { - 'url': "https://controller.{environment}.pinecone.io", - 'description': "No description provided", - 'variables': { - 'environment': { - 'description': "No description provided", - 'default_value': "unknown", - } + "url": "https://controller.{environment}.pinecone.io", + "description": "No description provided", + "variables": { + "environment": { + "description": "No description provided", + "default_value": "unknown", } + }, }, - ] + ], }, params_map={ - 'all': [ - 'index_name', - 'patch_request', - ], - 'required': [ - 'index_name', + "all": [ + "index_name", + "patch_request", ], - 'nullable': [ + "required": [ + "index_name", ], - 'enum': [ - ], - 'validation': [ - ] + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "index_name": (str,), + "patch_request": (PatchRequest,), }, - 'openapi_types': { - 'index_name': - (str,), - 'patch_request': - (PatchRequest,), + "attribute_map": { + "index_name": "indexName", }, - 'attribute_map': { - 'index_name': 'indexName', + "location_map": { + "index_name": "path", + "patch_request": "body", }, - 'location_map': { - 'index_name': 'path', - 'patch_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'text/plain' - ], - 'content_type': [ - 'application/json' - ] + "collection_format_map": {}, }, + headers_map={"accept": ["text/plain"], "content_type": ["application/json"]}, api_client=api_client, - callable=__configure_index + callable=__configure_index, ) - def __create_collection( - self, - **kwargs - ): + def __create_collection(self, **kwargs): """create_collection # noqa: E501 This operation creates a Pinecone collection from an existing index. # noqa: E501 @@ -221,94 +184,62 @@ def __create_collection( If the method is called asynchronously, returns the request thread. """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') + kwargs["async_req"] = kwargs.get("async_req", False) + kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) + kwargs["_preload_content"] = kwargs.get("_preload_content", True) + kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) + kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) + kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) + kwargs["_host_index"] = kwargs.get("_host_index") return self.call_with_http_info(**kwargs) self.create_collection = _Endpoint( settings={ - 'response_type': (str,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/collections', - 'operation_id': 'create_collection', - 'http_method': 'POST', - 'servers': [ + "response_type": (str,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/collections", + "operation_id": "create_collection", + "http_method": "POST", + "servers": [ { - 'url': "https://controller.{environment}.pinecone.io", - 'description': "No description provided", - 'variables': { - 'environment': { - 'description': "No description provided", - 'default_value': "unknown", - } + "url": "https://controller.{environment}.pinecone.io", + "description": "No description provided", + "variables": { + "environment": { + "description": "No description provided", + "default_value": "unknown", } + }, }, - ] + ], }, params_map={ - 'all': [ - 'create_collection_request', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ + "all": [ + "create_collection_request", ], - 'validation': [ - ] + "required": [], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'create_collection_request': - (CreateCollectionRequest,), + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "create_collection_request": (CreateCollectionRequest,), }, - 'attribute_map': { + "attribute_map": {}, + "location_map": { + "create_collection_request": "body", }, - 'location_map': { - 'create_collection_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'text/plain' - ], - 'content_type': [ - 'application/json' - ] + "collection_format_map": {}, }, + headers_map={"accept": ["text/plain"], "content_type": ["application/json"]}, api_client=api_client, - callable=__create_collection + callable=__create_collection, ) - def __create_index( - self, - **kwargs - ): + def __create_index(self, **kwargs): """create_index # noqa: E501 This operation creates a Pinecone index. Specify the distance metric, the dimension of vectors to be stored in the index, the numbers replicas to use, and the collection from which to create the index, if applicable. # noqa: E501 @@ -346,95 +277,62 @@ def __create_index( If the method is called asynchronously, returns the request thread. """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') + kwargs["async_req"] = kwargs.get("async_req", False) + kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) + kwargs["_preload_content"] = kwargs.get("_preload_content", True) + kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) + kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) + kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) + kwargs["_host_index"] = kwargs.get("_host_index") return self.call_with_http_info(**kwargs) self.create_index = _Endpoint( settings={ - 'response_type': (str,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/databases', - 'operation_id': 'create_index', - 'http_method': 'POST', - 'servers': [ + "response_type": (str,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/databases", + "operation_id": "create_index", + "http_method": "POST", + "servers": [ { - 'url': "https://controller.{environment}.pinecone.io", - 'description': "No description provided", - 'variables': { - 'environment': { - 'description': "No description provided", - 'default_value': "unknown", - } + "url": "https://controller.{environment}.pinecone.io", + "description": "No description provided", + "variables": { + "environment": { + "description": "No description provided", + "default_value": "unknown", } + }, }, - ] + ], }, params_map={ - 'all': [ - 'create_request', - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ + "all": [ + "create_request", ], - 'validation': [ - ] + "required": [], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'create_request': - (CreateRequest,), + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "create_request": (CreateRequest,), }, - 'attribute_map': { + "attribute_map": {}, + "location_map": { + "create_request": "body", }, - 'location_map': { - 'create_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'text/plain' - ], - 'content_type': [ - 'application/json' - ] + "collection_format_map": {}, }, + headers_map={"accept": ["text/plain"], "content_type": ["application/json"]}, api_client=api_client, - callable=__create_index + callable=__create_index, ) - def __delete_collection( - self, - collection_name, - **kwargs - ): + def __delete_collection(self, collection_name, **kwargs): """delete_collection # noqa: E501 This operation deletes an existing collection. # noqa: E501 @@ -473,98 +371,70 @@ def __delete_collection( If the method is called asynchronously, returns the request thread. """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['collection_name'] = \ - collection_name + kwargs["async_req"] = kwargs.get("async_req", False) + kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) + kwargs["_preload_content"] = kwargs.get("_preload_content", True) + kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) + kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) + kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) + kwargs["_host_index"] = kwargs.get("_host_index") + kwargs["collection_name"] = collection_name return self.call_with_http_info(**kwargs) self.delete_collection = _Endpoint( settings={ - 'response_type': (str,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/collections/{collectionName}', - 'operation_id': 'delete_collection', - 'http_method': 'DELETE', - 'servers': [ + "response_type": (str,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/collections/{collectionName}", + "operation_id": "delete_collection", + "http_method": "DELETE", + "servers": [ { - 'url': "https://controller.{environment}.pinecone.io", - 'description': "No description provided", - 'variables': { - 'environment': { - 'description': "No description provided", - 'default_value': "unknown", - } + "url": "https://controller.{environment}.pinecone.io", + "description": "No description provided", + "variables": { + "environment": { + "description": "No description provided", + "default_value": "unknown", } + }, }, - ] + ], }, params_map={ - 'all': [ - 'collection_name', - ], - 'required': [ - 'collection_name', - ], - 'nullable': [ + "all": [ + "collection_name", ], - 'enum': [ + "required": [ + "collection_name", ], - 'validation': [ - ] + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'collection_name': - (str,), + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "collection_name": (str,), }, - 'attribute_map': { - 'collection_name': 'collectionName', + "attribute_map": { + "collection_name": "collectionName", }, - 'location_map': { - 'collection_name': 'path', + "location_map": { + "collection_name": "path", }, - 'collection_format_map': { - } + "collection_format_map": {}, }, headers_map={ - 'accept': [ - 'text/plain' - ], - 'content_type': [], + "accept": ["text/plain"], + "content_type": [], }, api_client=api_client, - callable=__delete_collection + callable=__delete_collection, ) - def __delete_index( - self, - index_name, - **kwargs - ): + def __delete_index(self, index_name, **kwargs): """delete_index # noqa: E501 This operation deletes an existing index. # noqa: E501 @@ -603,98 +473,70 @@ def __delete_index( If the method is called asynchronously, returns the request thread. """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['index_name'] = \ - index_name + kwargs["async_req"] = kwargs.get("async_req", False) + kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) + kwargs["_preload_content"] = kwargs.get("_preload_content", True) + kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) + kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) + kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) + kwargs["_host_index"] = kwargs.get("_host_index") + kwargs["index_name"] = index_name return self.call_with_http_info(**kwargs) self.delete_index = _Endpoint( settings={ - 'response_type': (str,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/databases/{indexName}', - 'operation_id': 'delete_index', - 'http_method': 'DELETE', - 'servers': [ + "response_type": (str,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/databases/{indexName}", + "operation_id": "delete_index", + "http_method": "DELETE", + "servers": [ { - 'url': "https://controller.{environment}.pinecone.io", - 'description': "No description provided", - 'variables': { - 'environment': { - 'description': "No description provided", - 'default_value': "unknown", - } + "url": "https://controller.{environment}.pinecone.io", + "description": "No description provided", + "variables": { + "environment": { + "description": "No description provided", + "default_value": "unknown", } + }, }, - ] + ], }, params_map={ - 'all': [ - 'index_name', - ], - 'required': [ - 'index_name', - ], - 'nullable': [ + "all": [ + "index_name", ], - 'enum': [ + "required": [ + "index_name", ], - 'validation': [ - ] + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "index_name": (str,), }, - 'allowed_values': { + "attribute_map": { + "index_name": "indexName", }, - 'openapi_types': { - 'index_name': - (str,), + "location_map": { + "index_name": "path", }, - 'attribute_map': { - 'index_name': 'indexName', - }, - 'location_map': { - 'index_name': 'path', - }, - 'collection_format_map': { - } + "collection_format_map": {}, }, headers_map={ - 'accept': [ - 'text/plain' - ], - 'content_type': [], + "accept": ["text/plain"], + "content_type": [], }, api_client=api_client, - callable=__delete_index + callable=__delete_index, ) - def __describe_collection( - self, - collection_name, - **kwargs - ): + def __describe_collection(self, collection_name, **kwargs): """describe_collection # noqa: E501 Get a description of a collection, including the name, size, and status. # noqa: E501 @@ -733,98 +575,70 @@ def __describe_collection( If the method is called asynchronously, returns the request thread. """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['collection_name'] = \ - collection_name + kwargs["async_req"] = kwargs.get("async_req", False) + kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) + kwargs["_preload_content"] = kwargs.get("_preload_content", True) + kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) + kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) + kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) + kwargs["_host_index"] = kwargs.get("_host_index") + kwargs["collection_name"] = collection_name return self.call_with_http_info(**kwargs) self.describe_collection = _Endpoint( settings={ - 'response_type': (CollectionMeta,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/collections/{collectionName}', - 'operation_id': 'describe_collection', - 'http_method': 'GET', - 'servers': [ + "response_type": (CollectionMeta,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/collections/{collectionName}", + "operation_id": "describe_collection", + "http_method": "GET", + "servers": [ { - 'url': "https://controller.{environment}.pinecone.io", - 'description': "No description provided", - 'variables': { - 'environment': { - 'description': "No description provided", - 'default_value': "unknown", - } + "url": "https://controller.{environment}.pinecone.io", + "description": "No description provided", + "variables": { + "environment": { + "description": "No description provided", + "default_value": "unknown", } + }, }, - ] + ], }, params_map={ - 'all': [ - 'collection_name', + "all": [ + "collection_name", ], - 'required': [ - 'collection_name', + "required": [ + "collection_name", ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "collection_name": (str,), }, - 'openapi_types': { - 'collection_name': - (str,), + "attribute_map": { + "collection_name": "collectionName", }, - 'attribute_map': { - 'collection_name': 'collectionName', + "location_map": { + "collection_name": "path", }, - 'location_map': { - 'collection_name': 'path', - }, - 'collection_format_map': { - } + "collection_format_map": {}, }, headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], + "accept": ["application/json"], + "content_type": [], }, api_client=api_client, - callable=__describe_collection + callable=__describe_collection, ) - def __describe_index( - self, - index_name, - **kwargs - ): + def __describe_index(self, index_name, **kwargs): """describe_index # noqa: E501 Get a description of an index, including dimension, distance metric, number of replicas, and more. # noqa: E501 @@ -863,97 +677,70 @@ def __describe_index( If the method is called asynchronously, returns the request thread. """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['index_name'] = \ - index_name + kwargs["async_req"] = kwargs.get("async_req", False) + kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) + kwargs["_preload_content"] = kwargs.get("_preload_content", True) + kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) + kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) + kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) + kwargs["_host_index"] = kwargs.get("_host_index") + kwargs["index_name"] = index_name return self.call_with_http_info(**kwargs) self.describe_index = _Endpoint( settings={ - 'response_type': (IndexMeta,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/databases/{indexName}', - 'operation_id': 'describe_index', - 'http_method': 'GET', - 'servers': [ + "response_type": (IndexMeta,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/databases/{indexName}", + "operation_id": "describe_index", + "http_method": "GET", + "servers": [ { - 'url': "https://controller.{environment}.pinecone.io", - 'description': "No description provided", - 'variables': { - 'environment': { - 'description': "No description provided", - 'default_value': "unknown", - } + "url": "https://controller.{environment}.pinecone.io", + "description": "No description provided", + "variables": { + "environment": { + "description": "No description provided", + "default_value": "unknown", } + }, }, - ] + ], }, params_map={ - 'all': [ - 'index_name', - ], - 'required': [ - 'index_name', + "all": [ + "index_name", ], - 'nullable': [ + "required": [ + "index_name", ], - 'enum': [ - ], - 'validation': [ - ] + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "index_name": (str,), }, - 'openapi_types': { - 'index_name': - (str,), + "attribute_map": { + "index_name": "indexName", }, - 'attribute_map': { - 'index_name': 'indexName', + "location_map": { + "index_name": "path", }, - 'location_map': { - 'index_name': 'path', - }, - 'collection_format_map': { - } + "collection_format_map": {}, }, headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], + "accept": ["application/json"], + "content_type": [], }, api_client=api_client, - callable=__describe_index + callable=__describe_index, ) - def __list_collections( - self, - **kwargs - ): + def __list_collections(self, **kwargs): """list_collections # noqa: E501 This operation returns a list of your Pinecone collections. # noqa: E501 @@ -990,88 +777,53 @@ def __list_collections( If the method is called asynchronously, returns the request thread. """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') + kwargs["async_req"] = kwargs.get("async_req", False) + kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) + kwargs["_preload_content"] = kwargs.get("_preload_content", True) + kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) + kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) + kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) + kwargs["_host_index"] = kwargs.get("_host_index") return self.call_with_http_info(**kwargs) self.list_collections = _Endpoint( settings={ - 'response_type': ([str],), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/collections', - 'operation_id': 'list_collections', - 'http_method': 'GET', - 'servers': [ + "response_type": ([str],), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/collections", + "operation_id": "list_collections", + "http_method": "GET", + "servers": [ { - 'url': "https://controller.{environment}.pinecone.io", - 'description': "No description provided", - 'variables': { - 'environment': { - 'description': "No description provided", - 'default_value': "unknown", - } + "url": "https://controller.{environment}.pinecone.io", + "description": "No description provided", + "variables": { + "environment": { + "description": "No description provided", + "default_value": "unknown", } + }, }, - ] - }, - params_map={ - 'all': [ ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] }, + params_map={"all": [], "required": [], "nullable": [], "enum": [], "validation": []}, root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - }, - 'attribute_map': { - }, - 'location_map': { - }, - 'collection_format_map': { - } + "validations": {}, + "allowed_values": {}, + "openapi_types": {}, + "attribute_map": {}, + "location_map": {}, + "collection_format_map": {}, }, headers_map={ - 'accept': [ - 'application/json; charset=utf-8' - ], - 'content_type': [], + "accept": ["application/json; charset=utf-8"], + "content_type": [], }, api_client=api_client, - callable=__list_collections + callable=__list_collections, ) - def __list_indexes( - self, - **kwargs - ): + def __list_indexes(self, **kwargs): """list_indexes # noqa: E501 This operation returns a list of the indexes in the current project. # noqa: E501 @@ -1108,80 +860,48 @@ def __list_indexes( If the method is called asynchronously, returns the request thread. """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') + kwargs["async_req"] = kwargs.get("async_req", False) + kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) + kwargs["_preload_content"] = kwargs.get("_preload_content", True) + kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) + kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) + kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) + kwargs["_host_index"] = kwargs.get("_host_index") return self.call_with_http_info(**kwargs) self.list_indexes = _Endpoint( settings={ - 'response_type': ([str],), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/databases', - 'operation_id': 'list_indexes', - 'http_method': 'GET', - 'servers': [ + "response_type": ([str],), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/databases", + "operation_id": "list_indexes", + "http_method": "GET", + "servers": [ { - 'url': "https://controller.{environment}.pinecone.io", - 'description': "No description provided", - 'variables': { - 'environment': { - 'description': "No description provided", - 'default_value': "unknown", - } + "url": "https://controller.{environment}.pinecone.io", + "description": "No description provided", + "variables": { + "environment": { + "description": "No description provided", + "default_value": "unknown", } + }, }, - ] - }, - params_map={ - 'all': [ - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ ], - 'validation': [ - ] }, + params_map={"all": [], "required": [], "nullable": [], "enum": [], "validation": []}, root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - }, - 'attribute_map': { - }, - 'location_map': { - }, - 'collection_format_map': { - } + "validations": {}, + "allowed_values": {}, + "openapi_types": {}, + "attribute_map": {}, + "location_map": {}, + "collection_format_map": {}, }, headers_map={ - 'accept': [ - 'application/json; charset=utf-8' - ], - 'content_type': [], + "accept": ["application/json; charset=utf-8"], + "content_type": [], }, api_client=api_client, - callable=__list_indexes + callable=__list_indexes, ) diff --git a/pinecone/core/client/api/vector_operations_api.py b/pinecone/core/client/api/vector_operations_api.py index 05826c7c..5290e1f5 100644 --- a/pinecone/core/client/api/vector_operations_api.py +++ b/pinecone/core/client/api/vector_operations_api.py @@ -24,7 +24,7 @@ datetime, file_type, none_type, - validate_and_convert_types + validate_and_convert_types, ) from pinecone.core.client.model.delete_request import DeleteRequest from pinecone.core.client.model.describe_index_stats_request import DescribeIndexStatsRequest @@ -50,11 +50,7 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def __delete( - self, - delete_request, - **kwargs - ): + def __delete(self, delete_request, **kwargs): """Delete # noqa: E501 The `Delete` operation deletes records by ID from a single namespace. # noqa: E501 @@ -93,87 +89,54 @@ def __delete( If the method is called asynchronously, returns the request thread. """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['delete_request'] = \ - delete_request + kwargs["async_req"] = kwargs.get("async_req", False) + kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) + kwargs["_preload_content"] = kwargs.get("_preload_content", True) + kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) + kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) + kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) + kwargs["_host_index"] = kwargs.get("_host_index") + kwargs["delete_request"] = delete_request return self.call_with_http_info(**kwargs) self.delete = _Endpoint( settings={ - 'response_type': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/vectors/delete', - 'operation_id': 'delete', - 'http_method': 'POST', - 'servers': None, + "response_type": ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/vectors/delete", + "operation_id": "delete", + "http_method": "POST", + "servers": None, }, params_map={ - 'all': [ - 'delete_request', - ], - 'required': [ - 'delete_request', - ], - 'nullable': [ + "all": [ + "delete_request", ], - 'enum': [ + "required": [ + "delete_request", ], - 'validation': [ - ] + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'delete_request': - (DeleteRequest,), + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "delete_request": (DeleteRequest,), }, - 'attribute_map': { + "attribute_map": {}, + "location_map": { + "delete_request": "body", }, - 'location_map': { - 'delete_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__delete + callable=__delete, ) - def __delete1( - self, - **kwargs - ): + def __delete1(self, **kwargs): """Delete # noqa: E501 The `Delete` operation deletes records by ID from a single namespace. # noqa: E501 @@ -213,94 +176,66 @@ def __delete1( If the method is called asynchronously, returns the request thread. """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') + kwargs["async_req"] = kwargs.get("async_req", False) + kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) + kwargs["_preload_content"] = kwargs.get("_preload_content", True) + kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) + kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) + kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) + kwargs["_host_index"] = kwargs.get("_host_index") return self.call_with_http_info(**kwargs) self.delete1 = _Endpoint( settings={ - 'response_type': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/vectors/delete', - 'operation_id': 'delete1', - 'http_method': 'DELETE', - 'servers': None, + "response_type": ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/vectors/delete", + "operation_id": "delete1", + "http_method": "DELETE", + "servers": None, }, params_map={ - 'all': [ - 'ids', - 'delete_all', - 'namespace', - ], - 'required': [], - 'nullable': [ + "all": [ + "ids", + "delete_all", + "namespace", ], - 'enum': [ - ], - 'validation': [ - ] + "required": [], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "ids": ([str],), + "delete_all": (bool,), + "namespace": (str,), }, - 'openapi_types': { - 'ids': - ([str],), - 'delete_all': - (bool,), - 'namespace': - (str,), + "attribute_map": { + "ids": "ids", + "delete_all": "deleteAll", + "namespace": "namespace", }, - 'attribute_map': { - 'ids': 'ids', - 'delete_all': 'deleteAll', - 'namespace': 'namespace', + "location_map": { + "ids": "query", + "delete_all": "query", + "namespace": "query", }, - 'location_map': { - 'ids': 'query', - 'delete_all': 'query', - 'namespace': 'query', + "collection_format_map": { + "ids": "multi", }, - 'collection_format_map': { - 'ids': 'multi', - } }, headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], + "accept": ["application/json"], + "content_type": [], }, api_client=api_client, - callable=__delete1 + callable=__delete1, ) - def __describe_index_stats( - self, - describe_index_stats_request, - **kwargs - ): + def __describe_index_stats(self, describe_index_stats_request, **kwargs): """DescribeIndexStats # noqa: E501 The `DescribeIndexStats` operation returns statistics about the index's contents, including the vector count per namespace, the number of dimensions, and the index fullness. The index fullness result may be inaccurate during pod resizing; to get the status of a pod resizing process, use [`describe_index`](https://www.pinecone.io/docs/api/operation/describe_index/). # noqa: E501 @@ -339,87 +274,54 @@ def __describe_index_stats( If the method is called asynchronously, returns the request thread. """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['describe_index_stats_request'] = \ - describe_index_stats_request + kwargs["async_req"] = kwargs.get("async_req", False) + kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) + kwargs["_preload_content"] = kwargs.get("_preload_content", True) + kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) + kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) + kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) + kwargs["_host_index"] = kwargs.get("_host_index") + kwargs["describe_index_stats_request"] = describe_index_stats_request return self.call_with_http_info(**kwargs) self.describe_index_stats = _Endpoint( settings={ - 'response_type': (DescribeIndexStatsResponse,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/describe_index_stats', - 'operation_id': 'describe_index_stats', - 'http_method': 'POST', - 'servers': None, + "response_type": (DescribeIndexStatsResponse,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/describe_index_stats", + "operation_id": "describe_index_stats", + "http_method": "POST", + "servers": None, }, params_map={ - 'all': [ - 'describe_index_stats_request', - ], - 'required': [ - 'describe_index_stats_request', - ], - 'nullable': [ + "all": [ + "describe_index_stats_request", ], - 'enum': [ + "required": [ + "describe_index_stats_request", ], - 'validation': [ - ] + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "describe_index_stats_request": (DescribeIndexStatsRequest,), }, - 'allowed_values': { + "attribute_map": {}, + "location_map": { + "describe_index_stats_request": "body", }, - 'openapi_types': { - 'describe_index_stats_request': - (DescribeIndexStatsRequest,), - }, - 'attribute_map': { - }, - 'location_map': { - 'describe_index_stats_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__describe_index_stats + callable=__describe_index_stats, ) - def __describe_index_stats1( - self, - **kwargs - ): + def __describe_index_stats1(self, **kwargs): """DescribeIndexStats # noqa: E501 The `DescribeIndexStats` operation returns statistics about the index's contents, including the vector count per namespace, the number of dimensions, and the index fullness. The index fullness result may be inaccurate during pod resizing; to get the status of a pod resizing process, use [`describe_index`](https://www.pinecone.io/docs/api/operation/describe_index/). # noqa: E501 @@ -456,78 +358,42 @@ def __describe_index_stats1( If the method is called asynchronously, returns the request thread. """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') + kwargs["async_req"] = kwargs.get("async_req", False) + kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) + kwargs["_preload_content"] = kwargs.get("_preload_content", True) + kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) + kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) + kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) + kwargs["_host_index"] = kwargs.get("_host_index") return self.call_with_http_info(**kwargs) self.describe_index_stats1 = _Endpoint( settings={ - 'response_type': (DescribeIndexStatsResponse,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/describe_index_stats', - 'operation_id': 'describe_index_stats1', - 'http_method': 'GET', - 'servers': None, - }, - params_map={ - 'all': [ - ], - 'required': [], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] - }, + "response_type": (DescribeIndexStatsResponse,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/describe_index_stats", + "operation_id": "describe_index_stats1", + "http_method": "GET", + "servers": None, + }, + params_map={"all": [], "required": [], "nullable": [], "enum": [], "validation": []}, root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - }, - 'attribute_map': { - }, - 'location_map': { - }, - 'collection_format_map': { - } + "validations": {}, + "allowed_values": {}, + "openapi_types": {}, + "attribute_map": {}, + "location_map": {}, + "collection_format_map": {}, }, headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], + "accept": ["application/json"], + "content_type": [], }, api_client=api_client, - callable=__describe_index_stats1 + callable=__describe_index_stats1, ) - def __fetch( - self, - ids, - **kwargs - ): + def __fetch(self, ids, **kwargs): """Fetch # noqa: E501 The `Fetch` operation looks up and returns vectors by ID from a single namespace. The returned vectors include the vector data and metadata. # noqa: E501 @@ -567,93 +433,65 @@ def __fetch( If the method is called asynchronously, returns the request thread. """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['ids'] = \ - ids + kwargs["async_req"] = kwargs.get("async_req", False) + kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) + kwargs["_preload_content"] = kwargs.get("_preload_content", True) + kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) + kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) + kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) + kwargs["_host_index"] = kwargs.get("_host_index") + kwargs["ids"] = ids return self.call_with_http_info(**kwargs) self.fetch = _Endpoint( settings={ - 'response_type': (FetchResponse,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/vectors/fetch', - 'operation_id': 'fetch', - 'http_method': 'GET', - 'servers': None, + "response_type": (FetchResponse,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/vectors/fetch", + "operation_id": "fetch", + "http_method": "GET", + "servers": None, }, params_map={ - 'all': [ - 'ids', - 'namespace', - ], - 'required': [ - 'ids', - ], - 'nullable': [ + "all": [ + "ids", + "namespace", ], - 'enum': [ + "required": [ + "ids", ], - 'validation': [ - ] + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "ids": ([str],), + "namespace": (str,), }, - 'allowed_values': { + "attribute_map": { + "ids": "ids", + "namespace": "namespace", }, - 'openapi_types': { - 'ids': - ([str],), - 'namespace': - (str,), + "location_map": { + "ids": "query", + "namespace": "query", }, - 'attribute_map': { - 'ids': 'ids', - 'namespace': 'namespace', + "collection_format_map": { + "ids": "multi", }, - 'location_map': { - 'ids': 'query', - 'namespace': 'query', - }, - 'collection_format_map': { - 'ids': 'multi', - } }, headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], + "accept": ["application/json"], + "content_type": [], }, api_client=api_client, - callable=__fetch + callable=__fetch, ) - def __query( - self, - query_request, - **kwargs - ): + def __query(self, query_request, **kwargs): """Query # noqa: E501 The `Query` operation searches a namespace using a query vector. It retrieves the IDs of the most similar records in a namespace along with their similarity scores. # noqa: E501 @@ -692,88 +530,54 @@ def __query( If the method is called asynchronously, returns the request thread. """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['query_request'] = \ - query_request + kwargs["async_req"] = kwargs.get("async_req", False) + kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) + kwargs["_preload_content"] = kwargs.get("_preload_content", True) + kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) + kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) + kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) + kwargs["_host_index"] = kwargs.get("_host_index") + kwargs["query_request"] = query_request return self.call_with_http_info(**kwargs) self.query = _Endpoint( settings={ - 'response_type': (QueryResponse,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/query', - 'operation_id': 'query', - 'http_method': 'POST', - 'servers': None, + "response_type": (QueryResponse,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/query", + "operation_id": "query", + "http_method": "POST", + "servers": None, }, params_map={ - 'all': [ - 'query_request', - ], - 'required': [ - 'query_request', + "all": [ + "query_request", ], - 'nullable': [ + "required": [ + "query_request", ], - 'enum': [ - ], - 'validation': [ - ] + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'query_request': - (QueryRequest,), - }, - 'attribute_map': { + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "query_request": (QueryRequest,), }, - 'location_map': { - 'query_request': 'body', + "attribute_map": {}, + "location_map": { + "query_request": "body", }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__query + callable=__query, ) - def __update( - self, - update_request, - **kwargs - ): + def __update(self, update_request, **kwargs): """Update # noqa: E501 The `Update` operation updates a vector in a namespace. If a value is included, it overwrites the previous value. If set_metadata is included, the values of the fields specified in it are added to or overwrite the previous values. # noqa: E501 @@ -812,88 +616,54 @@ def __update( If the method is called asynchronously, returns the request thread. """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['update_request'] = \ - update_request + kwargs["async_req"] = kwargs.get("async_req", False) + kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) + kwargs["_preload_content"] = kwargs.get("_preload_content", True) + kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) + kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) + kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) + kwargs["_host_index"] = kwargs.get("_host_index") + kwargs["update_request"] = update_request return self.call_with_http_info(**kwargs) self.update = _Endpoint( settings={ - 'response_type': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/vectors/update', - 'operation_id': 'update', - 'http_method': 'POST', - 'servers': None, + "response_type": ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/vectors/update", + "operation_id": "update", + "http_method": "POST", + "servers": None, }, params_map={ - 'all': [ - 'update_request', + "all": [ + "update_request", ], - 'required': [ - 'update_request', + "required": [ + "update_request", ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'update_request': - (UpdateRequest,), - }, - 'attribute_map': { + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "update_request": (UpdateRequest,), }, - 'location_map': { - 'update_request': 'body', + "attribute_map": {}, + "location_map": { + "update_request": "body", }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__update + callable=__update, ) - def __upsert( - self, - upsert_request, - **kwargs - ): + def __upsert(self, upsert_request, **kwargs): """Upsert # noqa: E501 The `Upsert` operation writes vectors into a namespace. If a new value is upserted for an existing vector ID, it overwrites the previous value. # noqa: E501 @@ -932,79 +702,49 @@ def __upsert( If the method is called asynchronously, returns the request thread. """ - kwargs['async_req'] = kwargs.get( - 'async_req', False - ) - kwargs['_return_http_data_only'] = kwargs.get( - '_return_http_data_only', True - ) - kwargs['_preload_content'] = kwargs.get( - '_preload_content', True - ) - kwargs['_request_timeout'] = kwargs.get( - '_request_timeout', None - ) - kwargs['_check_input_type'] = kwargs.get( - '_check_input_type', True - ) - kwargs['_check_return_type'] = kwargs.get( - '_check_return_type', True - ) - kwargs['_host_index'] = kwargs.get('_host_index') - kwargs['upsert_request'] = \ - upsert_request + kwargs["async_req"] = kwargs.get("async_req", False) + kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True) + kwargs["_preload_content"] = kwargs.get("_preload_content", True) + kwargs["_request_timeout"] = kwargs.get("_request_timeout", None) + kwargs["_check_input_type"] = kwargs.get("_check_input_type", True) + kwargs["_check_return_type"] = kwargs.get("_check_return_type", True) + kwargs["_host_index"] = kwargs.get("_host_index") + kwargs["upsert_request"] = upsert_request return self.call_with_http_info(**kwargs) self.upsert = _Endpoint( settings={ - 'response_type': (UpsertResponse,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/vectors/upsert', - 'operation_id': 'upsert', - 'http_method': 'POST', - 'servers': None, + "response_type": (UpsertResponse,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/vectors/upsert", + "operation_id": "upsert", + "http_method": "POST", + "servers": None, }, params_map={ - 'all': [ - 'upsert_request', + "all": [ + "upsert_request", ], - 'required': [ - 'upsert_request', + "required": [ + "upsert_request", ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'upsert_request': - (UpsertRequest,), + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "upsert_request": (UpsertRequest,), }, - 'attribute_map': { + "attribute_map": {}, + "location_map": { + "upsert_request": "body", }, - 'location_map': { - 'upsert_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__upsert + callable=__upsert, ) diff --git a/pinecone/core/client/api_client.py b/pinecone/core/client/api_client.py index d830bd4c..5ef36df6 100644 --- a/pinecone/core/client/api_client.py +++ b/pinecone/core/client/api_client.py @@ -40,7 +40,7 @@ file_type, model_to_dict, none_type, - validate_and_convert_types + validate_and_convert_types, ) @@ -68,8 +68,7 @@ class ApiClient(object): _pool = None - def __init__(self, configuration=None, header_name=None, header_value=None, - cookie=None, pool_threads=1): + def __init__(self, configuration=None, header_name=None, header_value=None, cookie=None, pool_threads=1): if configuration is None: configuration = Configuration.get_default_copy() self.configuration = configuration @@ -81,7 +80,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None, self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/1.0.0/python' + self.user_agent = "OpenAPI-Generator/1.0.0/python" def __enter__(self): return self @@ -94,13 +93,13 @@ def close(self): self._pool.close() self._pool.join() self._pool = None - if hasattr(atexit, 'unregister'): + if hasattr(atexit, "unregister"): atexit.unregister(self.close) @property def pool(self): """Create thread pool on first request - avoids instantiating unused threadpool for blocking clients. + avoids instantiating unused threadpool for blocking clients. """ if self._pool is None: atexit.register(self.close) @@ -110,11 +109,11 @@ def pool(self): @property def user_agent(self): """User agent for this API client""" - return self.default_headers['User-Agent'] + return self.default_headers["User-Agent"] @user_agent.setter def user_agent(self, value): - self.default_headers['User-Agent'] = value + self.default_headers["User-Agent"] = value def set_default_header(self, header_name, header_value): self.default_headers[header_name] = header_value @@ -136,57 +135,47 @@ def __call_api( _preload_content: bool = True, _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, _host: typing.Optional[str] = None, - _check_type: typing.Optional[bool] = None + _check_type: typing.Optional[bool] = None, ): - config = self.configuration # header parameters header_params = header_params or {} header_params.update(self.default_headers) if self.cookie: - header_params['Cookie'] = self.cookie + header_params["Cookie"] = self.cookie if header_params: header_params = self.sanitize_for_serialization(header_params) - header_params = dict(self.parameters_to_tuples(header_params, - collection_formats)) + header_params = dict(self.parameters_to_tuples(header_params, collection_formats)) # path parameters if path_params: path_params = self.sanitize_for_serialization(path_params) - path_params = self.parameters_to_tuples(path_params, - collection_formats) + path_params = self.parameters_to_tuples(path_params, collection_formats) for k, v in path_params: # specified safe chars, encode everything - resource_path = resource_path.replace( - '{%s}' % k, - quote(str(v), safe=config.safe_chars_for_path_param) - ) + resource_path = resource_path.replace("{%s}" % k, quote(str(v), safe=config.safe_chars_for_path_param)) # query parameters if query_params: query_params = self.sanitize_for_serialization(query_params) - query_params = self.parameters_to_tuples(query_params, - collection_formats) + query_params = self.parameters_to_tuples(query_params, collection_formats) # post parameters if post_params or files: post_params = post_params if post_params else [] post_params = self.sanitize_for_serialization(post_params) - post_params = self.parameters_to_tuples(post_params, - collection_formats) + post_params = self.parameters_to_tuples(post_params, collection_formats) post_params.extend(self.files_parameters(files)) - if header_params['Content-Type'].startswith("multipart"): - post_params = self.parameters_to_multipart(post_params, - (dict) ) + if header_params["Content-Type"].startswith("multipart"): + post_params = self.parameters_to_multipart(post_params, (dict)) # body if body: body = self.sanitize_for_serialization(body) # auth setting - self.update_params_for_auth(header_params, query_params, - auth_settings, resource_path, method, body) + self.update_params_for_auth(header_params, query_params, auth_settings, resource_path, method, body) # request url if _host is None: @@ -198,12 +187,17 @@ def __call_api( try: # perform request and return response response_data = self.request( - method, url, query_params=query_params, headers=header_params, - post_params=post_params, body=body, + method, + url, + query_params=query_params, + headers=header_params, + post_params=post_params, + body=body, _preload_content=_preload_content, - _request_timeout=_request_timeout) + _request_timeout=_request_timeout, + ) except ApiException as e: - e.body = e.body.decode('utf-8') + e.body = e.body.decode("utf-8") raise e self.last_response = response_data @@ -211,33 +205,28 @@ def __call_api( return_data = response_data if not _preload_content: - return (return_data) + return return_data return return_data # deserialize response data if response_type: if response_type != (file_type,): encoding = "utf-8" - content_type = response_data.getheader('content-type') + content_type = response_data.getheader("content-type") if content_type is not None: match = re.search(r"charset=([a-zA-Z\-\d]+)[\s\;]?", content_type) if match: encoding = match.group(1) response_data.data = response_data.data.decode(encoding) - return_data = self.deserialize( - response_data, - response_type, - _check_type - ) + return_data = self.deserialize(response_data, response_type, _check_type) else: return_data = None if _return_http_data_only: - return (return_data) + return return_data else: - return (return_data, response_data.status, - response_data.getheaders()) + return (return_data, response_data.status, response_data.getheaders()) def parameters_to_multipart(self, params, collection_types): """Get parameters as list of tuples, formatting as json if value is collection_types @@ -248,15 +237,15 @@ def parameters_to_multipart(self, params, collection_types): """ new_params = [] if collection_types is None: - collection_types = (dict) + collection_types = dict for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 - if isinstance(v, collection_types): # v is instance of collection_type, formatting as application/json - v = json.dumps(v, ensure_ascii=False).encode("utf-8") - field = RequestField(k, v) - field.make_multipart(content_type="application/json; charset=utf-8") - new_params.append(field) + if isinstance(v, collection_types): # v is instance of collection_type, formatting as application/json + v = json.dumps(v, ensure_ascii=False).encode("utf-8") + field = RequestField(k, v) + field.make_multipart(content_type="application/json; charset=utf-8") + new_params.append(field) else: - new_params.append((k, v)) + new_params.append((k, v)) return new_params @classmethod @@ -274,9 +263,7 @@ def sanitize_for_serialization(cls, obj): :return: The serialized form of data. """ if isinstance(obj, (ModelNormal, ModelComposed)): - return { - key: cls.sanitize_for_serialization(val) for key, val in model_to_dict(obj, serialize=True).items() - } + return {key: cls.sanitize_for_serialization(val) for key, val in model_to_dict(obj, serialize=True).items()} elif isinstance(obj, io.IOBase): return cls.get_file_data_and_close_file(obj) elif isinstance(obj, (str, int, float, none_type, bool)): @@ -289,7 +276,7 @@ def sanitize_for_serialization(cls, obj): return [cls.sanitize_for_serialization(item) for item in obj] if isinstance(obj, dict): return {key: cls.sanitize_for_serialization(val) for key, val in obj.items()} - raise ApiValueError('Unable to prepare type {} for serialization'.format(obj.__class__.__name__)) + raise ApiValueError("Unable to prepare type {} for serialization".format(obj.__class__.__name__)) def deserialize(self, response, response_type, _check_type): """Deserializes response into an object. @@ -315,8 +302,7 @@ def deserialize(self, response, response_type, _check_type): # save response body into a tmp file and return the instance if response_type == (file_type,): content_disposition = response.getheader("Content-Disposition") - return deserialize_file(response.data, self.configuration, - content_disposition=content_disposition) + return deserialize_file(response.data, self.configuration, content_disposition=content_disposition) # fetch data from response object try: @@ -327,12 +313,7 @@ def deserialize(self, response, response_type, _check_type): # store our data under the key of 'received_data' so users have some # context if they are deserializing a string and the data type is wrong deserialized_data = validate_and_convert_types( - received_data, - response_type, - ['received_data'], - True, - _check_type, - configuration=self.configuration + received_data, response_type, ["received_data"], True, _check_type, configuration=self.configuration ) return deserialized_data @@ -354,7 +335,7 @@ def call_api( _preload_content: bool = True, _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, _host: typing.Optional[str] = None, - _check_type: typing.Optional[bool] = None + _check_type: typing.Optional[bool] = None, ): """Makes the HTTP request (synchronous) and returns deserialized data. @@ -410,87 +391,126 @@ def call_api( then the method will return the response directly. """ if not async_req: - return self.__call_api(resource_path, method, - path_params, query_params, header_params, - body, post_params, files, - response_type, auth_settings, - _return_http_data_only, collection_formats, - _preload_content, _request_timeout, _host, - _check_type) - - return self.pool.apply_async(self.__call_api, (resource_path, - method, path_params, - query_params, - header_params, body, - post_params, files, - response_type, - auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, - _request_timeout, - _host, _check_type)) - - def request(self, method, url, query_params=None, headers=None, - post_params=None, body=None, _preload_content=True, - _request_timeout=None): + return self.__call_api( + resource_path, + method, + path_params, + query_params, + header_params, + body, + post_params, + files, + response_type, + auth_settings, + _return_http_data_only, + collection_formats, + _preload_content, + _request_timeout, + _host, + _check_type, + ) + + return self.pool.apply_async( + self.__call_api, + ( + resource_path, + method, + path_params, + query_params, + header_params, + body, + post_params, + files, + response_type, + auth_settings, + _return_http_data_only, + collection_formats, + _preload_content, + _request_timeout, + _host, + _check_type, + ), + ) + + def request( + self, + method, + url, + query_params=None, + headers=None, + post_params=None, + body=None, + _preload_content=True, + _request_timeout=None, + ): """Makes the HTTP request using RESTClient.""" if method == "GET": - return self.rest_client.GET(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) + return self.rest_client.GET( + url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers, + ) elif method == "HEAD": - return self.rest_client.HEAD(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) + return self.rest_client.HEAD( + url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers, + ) elif method == "OPTIONS": - return self.rest_client.OPTIONS(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) + return self.rest_client.OPTIONS( + url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body, + ) elif method == "POST": - return self.rest_client.POST(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) + return self.rest_client.POST( + url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body, + ) elif method == "PUT": - return self.rest_client.PUT(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) + return self.rest_client.PUT( + url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body, + ) elif method == "PATCH": - return self.rest_client.PATCH(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) + return self.rest_client.PATCH( + url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body, + ) elif method == "DELETE": - return self.rest_client.DELETE(url, - query_params=query_params, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - else: - raise ApiValueError( - "http method must be `GET`, `HEAD`, `OPTIONS`," - " `POST`, `PATCH`, `PUT` or `DELETE`." + return self.rest_client.DELETE( + url, + query_params=query_params, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body, ) + else: + raise ApiValueError("http method must be `GET`, `HEAD`, `OPTIONS`," " `POST`, `PATCH`, `PUT` or `DELETE`.") def parameters_to_tuples(self, params, collection_formats): """Get parameters as list of tuples, formatting collections. @@ -505,19 +525,18 @@ def parameters_to_tuples(self, params, collection_formats): for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 if k in collection_formats: collection_format = collection_formats[k] - if collection_format == 'multi': + if collection_format == "multi": new_params.extend((k, value) for value in v) else: - if collection_format == 'ssv': - delimiter = ' ' - elif collection_format == 'tsv': - delimiter = '\t' - elif collection_format == 'pipes': - delimiter = '|' + if collection_format == "ssv": + delimiter = " " + elif collection_format == "tsv": + delimiter = "\t" + elif collection_format == "pipes": + delimiter = "|" else: # csv is the default - delimiter = ',' - new_params.append( - (k, delimiter.join(str(value) for value in v))) + delimiter = "," + new_params.append((k, delimiter.join(str(value) for value in v))) else: new_params.append((k, v)) return new_params @@ -549,15 +568,12 @@ def files_parameters(self, files: typing.Optional[typing.Dict[str, typing.List[i continue if file_instance.closed is True: raise ApiValueError( - "Cannot read a closed file. The passed in file_type " - "for %s must be open." % param_name + "Cannot read a closed file. The passed in file_type " "for %s must be open." % param_name ) filename = os.path.basename(file_instance.name) filedata = self.get_file_data_and_close_file(file_instance) - mimetype = (mimetypes.guess_type(filename)[0] or - 'application/octet-stream') - params.append( - tuple([param_name, tuple([filename, filedata, mimetype])])) + mimetype = mimetypes.guess_type(filename)[0] or "application/octet-stream" + params.append(tuple([param_name, tuple([filename, filedata, mimetype])])) return params @@ -572,10 +588,10 @@ def select_header_accept(self, accepts): accepts = [x.lower() for x in accepts] - if 'application/json' in accepts: - return 'application/json' + if "application/json" in accepts: + return "application/json" else: - return ', '.join(accepts) + return ", ".join(accepts) def select_header_content_type(self, content_types): """Returns `Content-Type` based on an array of content_types provided. @@ -584,17 +600,16 @@ def select_header_content_type(self, content_types): :return: Content-Type (e.g. application/json). """ if not content_types: - return 'application/json' + return "application/json" content_types = [x.lower() for x in content_types] - if 'application/json' in content_types or '*/*' in content_types: - return 'application/json' + if "application/json" in content_types or "*/*" in content_types: + return "application/json" else: return content_types[0] - def update_params_for_auth(self, headers, querys, auth_settings, - resource_path, method, body): + def update_params_for_auth(self, headers, querys, auth_settings, resource_path, method, body): """Updates header and query params based on authentication setting. :param headers: Header parameters dict to be updated. @@ -611,22 +626,19 @@ def update_params_for_auth(self, headers, querys, auth_settings, for auth in auth_settings: auth_setting = self.configuration.auth_settings().get(auth) if auth_setting: - if auth_setting['in'] == 'cookie': - headers['Cookie'] = auth_setting['value'] - elif auth_setting['in'] == 'header': - if auth_setting['type'] != 'http-signature': - headers[auth_setting['key']] = auth_setting['value'] - elif auth_setting['in'] == 'query': - querys.append((auth_setting['key'], auth_setting['value'])) + if auth_setting["in"] == "cookie": + headers["Cookie"] = auth_setting["value"] + elif auth_setting["in"] == "header": + if auth_setting["type"] != "http-signature": + headers[auth_setting["key"]] = auth_setting["value"] + elif auth_setting["in"] == "query": + querys.append((auth_setting["key"], auth_setting["value"])) else: - raise ApiValueError( - 'Authentication token must be in `query` or `header`' - ) + raise ApiValueError("Authentication token must be in `query` or `header`") class Endpoint(object): - def __init__(self, settings=None, params_map=None, root_map=None, - headers_map=None, api_client=None, callable=None): + def __init__(self, settings=None, params_map=None, root_map=None, headers_map=None, api_client=None, callable=None): """Creates an endpoint Args: @@ -662,55 +674,50 @@ def __init__(self, settings=None, params_map=None, root_map=None, """ self.settings = settings self.params_map = params_map - self.params_map['all'].extend([ - 'async_req', - '_host_index', - '_preload_content', - '_request_timeout', - '_return_http_data_only', - '_check_input_type', - '_check_return_type' - ]) - self.params_map['nullable'].extend(['_request_timeout']) - self.validations = root_map['validations'] - self.allowed_values = root_map['allowed_values'] - self.openapi_types = root_map['openapi_types'] + self.params_map["all"].extend( + [ + "async_req", + "_host_index", + "_preload_content", + "_request_timeout", + "_return_http_data_only", + "_check_input_type", + "_check_return_type", + ] + ) + self.params_map["nullable"].extend(["_request_timeout"]) + self.validations = root_map["validations"] + self.allowed_values = root_map["allowed_values"] + self.openapi_types = root_map["openapi_types"] extra_types = { - 'async_req': (bool,), - '_host_index': (none_type, int), - '_preload_content': (bool,), - '_request_timeout': (none_type, float, (float,), [float], int, (int,), [int]), - '_return_http_data_only': (bool,), - '_check_input_type': (bool,), - '_check_return_type': (bool,) + "async_req": (bool,), + "_host_index": (none_type, int), + "_preload_content": (bool,), + "_request_timeout": (none_type, float, (float,), [float], int, (int,), [int]), + "_return_http_data_only": (bool,), + "_check_input_type": (bool,), + "_check_return_type": (bool,), } self.openapi_types.update(extra_types) - self.attribute_map = root_map['attribute_map'] - self.location_map = root_map['location_map'] - self.collection_format_map = root_map['collection_format_map'] + self.attribute_map = root_map["attribute_map"] + self.location_map = root_map["location_map"] + self.collection_format_map = root_map["collection_format_map"] self.headers_map = headers_map self.api_client = api_client self.callable = callable def __validate_inputs(self, kwargs): - for param in self.params_map['enum']: + for param in self.params_map["enum"]: if param in kwargs: - check_allowed_values( - self.allowed_values, - (param,), - kwargs[param] - ) + check_allowed_values(self.allowed_values, (param,), kwargs[param]) - for param in self.params_map['validation']: + for param in self.params_map["validation"]: if param in kwargs: check_validations( - self.validations, - (param,), - kwargs[param], - configuration=self.api_client.configuration + self.validations, (param,), kwargs[param], configuration=self.api_client.configuration ) - if kwargs['_check_input_type'] is False: + if kwargs["_check_input_type"] is False: return for key, value in kwargs.items(): @@ -719,51 +726,41 @@ def __validate_inputs(self, kwargs): self.openapi_types[key], [key], False, - kwargs['_check_input_type'], - configuration=self.api_client.configuration + kwargs["_check_input_type"], + configuration=self.api_client.configuration, ) kwargs[key] = fixed_val def __gather_params(self, kwargs): - params = { - 'body': None, - 'collection_format': {}, - 'file': {}, - 'form': [], - 'header': {}, - 'path': {}, - 'query': [] - } + params = {"body": None, "collection_format": {}, "file": {}, "form": [], "header": {}, "path": {}, "query": []} for param_name, param_value in kwargs.items(): param_location = self.location_map.get(param_name) if param_location is None: continue if param_location: - if param_location == 'body': - params['body'] = param_value + if param_location == "body": + params["body"] = param_value continue base_name = self.attribute_map[param_name] - if (param_location == 'form' and - self.openapi_types[param_name] == (file_type,)): - params['file'][param_name] = [param_value] - elif (param_location == 'form' and - self.openapi_types[param_name] == ([file_type],)): + if param_location == "form" and self.openapi_types[param_name] == (file_type,): + params["file"][param_name] = [param_value] + elif param_location == "form" and self.openapi_types[param_name] == ([file_type],): # param_value is already a list - params['file'][param_name] = param_value - elif param_location in {'form', 'query'}: + params["file"][param_name] = param_value + elif param_location in {"form", "query"}: param_value_full = (base_name, param_value) params[param_location].append(param_value_full) - if param_location not in {'form', 'query'}: + if param_location not in {"form", "query"}: params[param_location][base_name] = param_value collection_format = self.collection_format_map.get(param_name) if collection_format: - params['collection_format'][base_name] = collection_format + params["collection_format"][base_name] = collection_format return params def __call__(self, *args, **kwargs): - """ This method is invoked when endpoints are called + """This method is invoked when endpoints are called Example: api_instance = IndexOperationsApi() @@ -776,79 +773,74 @@ def __call__(self, *args, **kwargs): return self.callable(self, *args, **kwargs) def call_with_http_info(self, **kwargs): - try: - index = self.api_client.configuration.server_operation_index.get( - self.settings['operation_id'], self.api_client.configuration.server_index - ) if kwargs['_host_index'] is None else kwargs['_host_index'] + index = ( + self.api_client.configuration.server_operation_index.get( + self.settings["operation_id"], self.api_client.configuration.server_index + ) + if kwargs["_host_index"] is None + else kwargs["_host_index"] + ) server_variables = self.api_client.configuration.server_operation_variables.get( - self.settings['operation_id'], self.api_client.configuration.server_variables + self.settings["operation_id"], self.api_client.configuration.server_variables ) _host = self.api_client.configuration.get_host_from_settings( - index, variables=server_variables, servers=self.settings['servers'] + index, variables=server_variables, servers=self.settings["servers"] ) except IndexError: - if self.settings['servers']: - raise ApiValueError( - "Invalid host index. Must be 0 <= index < %s" % - len(self.settings['servers']) - ) + if self.settings["servers"]: + raise ApiValueError("Invalid host index. Must be 0 <= index < %s" % len(self.settings["servers"])) _host = None for key, value in kwargs.items(): - if key not in self.params_map['all']: + if key not in self.params_map["all"]: raise ApiTypeError( - "Got an unexpected parameter '%s'" - " to method `%s`" % - (key, self.settings['operation_id']) + "Got an unexpected parameter '%s'" " to method `%s`" % (key, self.settings["operation_id"]) ) # only throw this nullable ApiValueError if _check_input_type # is False, if _check_input_type==True we catch this case # in self.__validate_inputs - if (key not in self.params_map['nullable'] and value is None - and kwargs['_check_input_type'] is False): + if key not in self.params_map["nullable"] and value is None and kwargs["_check_input_type"] is False: raise ApiValueError( "Value may not be None for non-nullable parameter `%s`" - " when calling `%s`" % - (key, self.settings['operation_id']) + " when calling `%s`" % (key, self.settings["operation_id"]) ) - for key in self.params_map['required']: + for key in self.params_map["required"]: if key not in kwargs.keys(): raise ApiValueError( - "Missing the required parameter `%s` when calling " - "`%s`" % (key, self.settings['operation_id']) + "Missing the required parameter `%s` when calling " "`%s`" % (key, self.settings["operation_id"]) ) self.__validate_inputs(kwargs) params = self.__gather_params(kwargs) - accept_headers_list = self.headers_map['accept'] + accept_headers_list = self.headers_map["accept"] if accept_headers_list: - params['header']['Accept'] = self.api_client.select_header_accept( - accept_headers_list) + params["header"]["Accept"] = self.api_client.select_header_accept(accept_headers_list) - content_type_headers_list = self.headers_map['content_type'] + content_type_headers_list = self.headers_map["content_type"] if content_type_headers_list: - header_list = self.api_client.select_header_content_type( - content_type_headers_list) - params['header']['Content-Type'] = header_list + header_list = self.api_client.select_header_content_type(content_type_headers_list) + params["header"]["Content-Type"] = header_list return self.api_client.call_api( - self.settings['endpoint_path'], self.settings['http_method'], - params['path'], - params['query'], - params['header'], - body=params['body'], - post_params=params['form'], - files=params['file'], - response_type=self.settings['response_type'], - auth_settings=self.settings['auth'], - async_req=kwargs['async_req'], - _check_type=kwargs['_check_return_type'], - _return_http_data_only=kwargs['_return_http_data_only'], - _preload_content=kwargs['_preload_content'], - _request_timeout=kwargs['_request_timeout'], + self.settings["endpoint_path"], + self.settings["http_method"], + params["path"], + params["query"], + params["header"], + body=params["body"], + post_params=params["form"], + files=params["file"], + response_type=self.settings["response_type"], + auth_settings=self.settings["auth"], + async_req=kwargs["async_req"], + _check_type=kwargs["_check_return_type"], + _return_http_data_only=kwargs["_return_http_data_only"], + _preload_content=kwargs["_preload_content"], + _request_timeout=kwargs["_request_timeout"], _host=_host, - collection_formats=params['collection_format']) + collection_formats=params["collection_format"], + ) diff --git a/pinecone/core/client/configuration.py b/pinecone/core/client/configuration.py index cc97b99e..0d4e289d 100644 --- a/pinecone/core/client/configuration.py +++ b/pinecone/core/client/configuration.py @@ -24,99 +24,112 @@ JSON_SCHEMA_VALIDATION_KEYWORDS = { - 'multipleOf', 'maximum', 'exclusiveMaximum', - 'minimum', 'exclusiveMinimum', 'maxLength', - 'minLength', 'pattern', 'maxItems', 'minItems' + "multipleOf", + "maximum", + "exclusiveMaximum", + "minimum", + "exclusiveMinimum", + "maxLength", + "minLength", + "pattern", + "maxItems", + "minItems", } + class Configuration(object): """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - Do not edit the class manually. - - :param host: Base url - :param api_key: Dict to store API key(s). - Each entry in the dict specifies an API key. - The dict key is the name of the security scheme in the OAS specification. - The dict value is the API key secret. - :param api_key_prefix: Dict to store API prefix (e.g. Bearer) - The dict key is the name of the security scheme in the OAS specification. - The dict value is an API key prefix when generating the auth data. - :param username: Username for HTTP basic authentication - :param password: Password for HTTP basic authentication - :param discard_unknown_keys: Boolean value indicating whether to discard - unknown properties. A server may send a response that includes additional - properties that are not known by the client in the following scenarios: - 1. The OpenAPI document is incomplete, i.e. it does not match the server - implementation. - 2. The client was generated using an older version of the OpenAPI document - and the server has been upgraded since then. - If a schema in the OpenAPI document defines the additionalProperties attribute, - then all undeclared properties received by the server are injected into the - additional properties map. In that case, there are undeclared properties, and - nothing to discard. - :param disabled_client_side_validations (string): Comma-separated list of - JSON schema validation keywords to disable JSON schema structural validation - rules. The following keywords may be specified: multipleOf, maximum, - exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern, - maxItems, minItems. - By default, the validation is performed for data generated locally by the client - and data received from the server, independent of any validation performed by - the server side. If the input data does not satisfy the JSON schema validation - rules specified in the OpenAPI document, an exception is raised. - If disabled_client_side_validations is set, structural validation is - disabled. This can be useful to troubleshoot data validation problem, such as - when the OpenAPI document validation rules do not match the actual API data - received by the server. - :param server_index: Index to servers configuration. - :param server_variables: Mapping with string values to replace variables in - templated server configuration. The validation of enums is performed for - variables with defined enum values before. - :param server_operation_index: Mapping from operation ID to an index to server - configuration. - :param server_operation_variables: Mapping from operation ID to a mapping with - string values to replace variables in templated server configuration. - The validation of enums is performed for variables with defined enum values before. - :param ssl_ca_cert: str - the path to a file of concatenated CA certificates - in PEM format - - :Example: - - API Key Authentication Example. - Given the following security scheme in the OpenAPI specification: - components: - securitySchemes: - cookieAuth: # name for the security scheme - type: apiKey - in: cookie - name: JSESSIONID # cookie name - - You can programmatically set the cookie: - -conf = pinecone.core.client.Configuration( - api_key={'cookieAuth': 'abc123'} - api_key_prefix={'cookieAuth': 'JSESSIONID'} -) - - The following cookie will be added to the HTTP request: - Cookie: JSESSIONID abc123 + Ref: https://openapi-generator.tech + Do not edit the class manually. + + :param host: Base url + :param api_key: Dict to store API key(s). + Each entry in the dict specifies an API key. + The dict key is the name of the security scheme in the OAS specification. + The dict value is the API key secret. + :param api_key_prefix: Dict to store API prefix (e.g. Bearer) + The dict key is the name of the security scheme in the OAS specification. + The dict value is an API key prefix when generating the auth data. + :param username: Username for HTTP basic authentication + :param password: Password for HTTP basic authentication + :param discard_unknown_keys: Boolean value indicating whether to discard + unknown properties. A server may send a response that includes additional + properties that are not known by the client in the following scenarios: + 1. The OpenAPI document is incomplete, i.e. it does not match the server + implementation. + 2. The client was generated using an older version of the OpenAPI document + and the server has been upgraded since then. + If a schema in the OpenAPI document defines the additionalProperties attribute, + then all undeclared properties received by the server are injected into the + additional properties map. In that case, there are undeclared properties, and + nothing to discard. + :param disabled_client_side_validations (string): Comma-separated list of + JSON schema validation keywords to disable JSON schema structural validation + rules. The following keywords may be specified: multipleOf, maximum, + exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern, + maxItems, minItems. + By default, the validation is performed for data generated locally by the client + and data received from the server, independent of any validation performed by + the server side. If the input data does not satisfy the JSON schema validation + rules specified in the OpenAPI document, an exception is raised. + If disabled_client_side_validations is set, structural validation is + disabled. This can be useful to troubleshoot data validation problem, such as + when the OpenAPI document validation rules do not match the actual API data + received by the server. + :param server_index: Index to servers configuration. + :param server_variables: Mapping with string values to replace variables in + templated server configuration. The validation of enums is performed for + variables with defined enum values before. + :param server_operation_index: Mapping from operation ID to an index to server + configuration. + :param server_operation_variables: Mapping from operation ID to a mapping with + string values to replace variables in templated server configuration. + The validation of enums is performed for variables with defined enum values before. + :param ssl_ca_cert: str - the path to a file of concatenated CA certificates + in PEM format + + :Example: + + API Key Authentication Example. + Given the following security scheme in the OpenAPI specification: + components: + securitySchemes: + cookieAuth: # name for the security scheme + type: apiKey + in: cookie + name: JSESSIONID # cookie name + + You can programmatically set the cookie: + + conf = pinecone.core.client.Configuration( + api_key={'cookieAuth': 'abc123'} + api_key_prefix={'cookieAuth': 'JSESSIONID'} + ) + + The following cookie will be added to the HTTP request: + Cookie: JSESSIONID abc123 """ _default = None - def __init__(self, host=None, - api_key=None, api_key_prefix=None, - access_token=None, - username=None, password=None, - discard_unknown_keys=False, - disabled_client_side_validations="", - server_index=None, server_variables=None, - server_operation_index=None, server_operation_variables=None, - ssl_ca_cert=None, - ): - """Constructor - """ + def __init__( + self, + host=None, + api_key=None, + api_key_prefix=None, + access_token=None, + username=None, + password=None, + discard_unknown_keys=False, + disabled_client_side_validations="", + server_index=None, + server_variables=None, + server_operation_index=None, + server_operation_variables=None, + ssl_ca_cert=None, + ): + """Constructor""" self._base_path = "https://unknown-unknown.svc.unknown.pinecone.io" if host is None else host """Default Base url """ @@ -159,7 +172,7 @@ def __init__(self, host=None, """ self.logger["package_logger"] = logging.getLogger("pinecone.core.client") self.logger["urllib3_logger"] = logging.getLogger("urllib3") - self.logger_format = '%(asctime)s %(levelname)s %(message)s' + self.logger_format = "%(asctime)s %(levelname)s %(message)s" """Log format """ self.logger_stream_handler = None @@ -207,7 +220,7 @@ def __init__(self, host=None, self.proxy_headers = None """Proxy headers """ - self.safe_chars_for_path_param = '' + self.safe_chars_for_path_param = "" """Safe chars for path_param """ self.retries = None @@ -224,7 +237,7 @@ def __deepcopy__(self, memo): result = cls.__new__(cls) memo[id(self)] = result for k, v in self.__dict__.items(): - if k not in ('logger', 'logger_file_handler'): + if k not in ("logger", "logger_file_handler"): setattr(result, k, copy.deepcopy(v, memo)) # shallow copy of loggers result.logger = copy.copy(self.logger) @@ -235,12 +248,11 @@ def __deepcopy__(self, memo): def __setattr__(self, name, value): object.__setattr__(self, name, value) - if name == 'disabled_client_side_validations': - s = set(filter(None, value.split(','))) + if name == "disabled_client_side_validations": + s = set(filter(None, value.split(","))) for v in s: if v not in JSON_SCHEMA_VALIDATION_KEYWORDS: - raise ApiValueError( - "Invalid keyword: '{0}''".format(v)) + raise ApiValueError("Invalid keyword: '{0}''".format(v)) self._disabled_client_side_validations = s @classmethod @@ -381,9 +393,7 @@ def get_basic_auth_token(self): password = "" if self.password is not None: password = self.password - return urllib3.util.make_headers( - basic_auth=username + ':' + password - ).get('authorization') + return urllib3.util.make_headers(basic_auth=username + ":" + password).get("authorization") def auth_settings(self): """Gets Auth Settings dict for api client. @@ -391,13 +401,13 @@ def auth_settings(self): :return: The Auth Settings information dict. """ auth = {} - if 'ApiKeyAuth' in self.api_key: - auth['ApiKeyAuth'] = { - 'type': 'api_key', - 'in': 'header', - 'key': 'Api-Key', - 'value': self.get_api_key_with_prefix( - 'ApiKeyAuth', + if "ApiKeyAuth" in self.api_key: + auth["ApiKeyAuth"] = { + "type": "api_key", + "in": "header", + "key": "Api-Key", + "value": self.get_api_key_with_prefix( + "ApiKeyAuth", ), } return auth @@ -407,12 +417,13 @@ def to_debug_report(self): :return: The report for debugging. """ - return "Python SDK Debug Report:\n"\ - "OS: {env}\n"\ - "Python Version: {pyversion}\n"\ - "Version of the API: version not set\n"\ - "SDK Package Version: 1.0.0".\ - format(env=sys.platform, pyversion=sys.version) + return ( + "Python SDK Debug Report:\n" + "OS: {env}\n" + "Python Version: {pyversion}\n" + "Version of the API: version not set\n" + "SDK Package Version: 1.0.0".format(env=sys.platform, pyversion=sys.version) + ) def get_host_settings(self): """Gets an array of host settings @@ -421,22 +432,22 @@ def get_host_settings(self): """ return [ { - 'url': "https://{index_name}-{project_name}.svc.{environment}.pinecone.io", - 'description': "No description provided", - 'variables': { - 'index_name': { - 'description': "No description provided", - 'default_value': "unknown", - }, - 'project_name': { - 'description': "No description provided", - 'default_value': "unknown", - }, - 'environment': { - 'description': "No description provided", - 'default_value': "unknown", - } - } + "url": "https://{index_name}-{project_name}.svc.{environment}.pinecone.io", + "description": "No description provided", + "variables": { + "index_name": { + "description": "No description provided", + "default_value": "unknown", + }, + "project_name": { + "description": "No description provided", + "default_value": "unknown", + }, + "environment": { + "description": "No description provided", + "default_value": "unknown", + }, + }, } ] @@ -458,22 +469,20 @@ def get_host_from_settings(self, index, variables=None, servers=None): except IndexError: raise ValueError( "Invalid index {0} when selecting the host settings. " - "Must be less than {1}".format(index, len(servers))) + "Must be less than {1}".format(index, len(servers)) + ) - url = server['url'] + url = server["url"] # go through variables and replace placeholders - for variable_name, variable in server.get('variables', {}).items(): - used_value = variables.get( - variable_name, variable['default_value']) + for variable_name, variable in server.get("variables", {}).items(): + used_value = variables.get(variable_name, variable["default_value"]) - if 'enum_values' in variable \ - and used_value not in variable['enum_values']: + if "enum_values" in variable and used_value not in variable["enum_values"]: raise ValueError( "The variable `{0}` in the host URL has invalid value " - "{1}. Must be {2}.".format( - variable_name, variables[variable_name], - variable['enum_values'])) + "{1}. Must be {2}.".format(variable_name, variables[variable_name], variable["enum_values"]) + ) url = url.replace("{" + variable_name + "}", used_value) diff --git a/pinecone/core/client/exceptions.py b/pinecone/core/client/exceptions.py index ee18e5e5..78487f40 100644 --- a/pinecone/core/client/exceptions.py +++ b/pinecone/core/client/exceptions.py @@ -21,9 +21,8 @@ class OpenApiException(PineconeException): class ApiTypeError(OpenApiException, TypeError): - def __init__(self, msg, path_to_item=None, valid_classes=None, - key_type=None): - """ Raises an exception for TypeErrors + def __init__(self, msg, path_to_item=None, valid_classes=None, key_type=None): + """Raises an exception for TypeErrors Args: msg (str): the exception message @@ -104,7 +103,6 @@ def __init__(self, msg, path_to_item=None): class ApiException(OpenApiException): - def __init__(self, status=None, reason=None, http_resp=None): if http_resp: self.status = http_resp.status @@ -119,11 +117,9 @@ def __init__(self, status=None, reason=None, http_resp=None): def __str__(self): """Custom error messages for exception""" - error_message = "({0})\n"\ - "Reason: {1}\n".format(self.status, self.reason) + error_message = "({0})\n" "Reason: {1}\n".format(self.status, self.reason) if self.headers: - error_message += "HTTP response headers: {0}\n".format( - self.headers) + error_message += "HTTP response headers: {0}\n".format(self.headers) if self.body: error_message += "HTTP response body: {0}\n".format(self.body) @@ -132,25 +128,21 @@ def __str__(self): class NotFoundException(ApiException): - def __init__(self, status=None, reason=None, http_resp=None): super(NotFoundException, self).__init__(status, reason, http_resp) class UnauthorizedException(ApiException): - def __init__(self, status=None, reason=None, http_resp=None): super(UnauthorizedException, self).__init__(status, reason, http_resp) class ForbiddenException(ApiException): - def __init__(self, status=None, reason=None, http_resp=None): super(ForbiddenException, self).__init__(status, reason, http_resp) class ServiceException(ApiException): - def __init__(self, status=None, reason=None, http_resp=None): super(ServiceException, self).__init__(status, reason, http_resp) diff --git a/pinecone/core/client/model/approximated_config.py b/pinecone/core/client/model/approximated_config.py index fd5586c5..ad90a79f 100644 --- a/pinecone/core/client/model/approximated_config.py +++ b/pinecone/core/client/model/approximated_config.py @@ -34,7 +34,6 @@ from pinecone.core.client.exceptions import ApiAttributeError - class ApproximatedConfig(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -59,11 +58,9 @@ class ApproximatedConfig(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} @cached_property def additional_properties_type(): @@ -71,7 +68,17 @@ def additional_properties_type(): This must be a method because a model may have properties that are of type self, this must run after the class is loaded """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -86,22 +93,20 @@ def openapi_types(): and the value is attribute type. """ return { - 'k_bits': (int,), # noqa: E501 - 'hybrid': (bool,), # noqa: E501 + "k_bits": (int,), # noqa: E501 + "hybrid": (bool,), # noqa: E501 } @cached_property def discriminator(): return None - attribute_map = { - 'k_bits': 'k_bits', # noqa: E501 - 'hybrid': 'hybrid', # noqa: E501 + "k_bits": "k_bits", # noqa: E501 + "hybrid": "hybrid", # noqa: E501 } - read_only_vars = { - } + read_only_vars = {} _composed_schemas = {} @@ -145,17 +150,18 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 hybrid (bool): [optional] if omitted the server will use the default value of False # noqa: E501 """ - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) self = super(OpenApiModel, cls).__new__(cls) if args: raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -171,23 +177,27 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 @@ -228,15 +238,16 @@ def __init__(self, *args, **kwargs): # noqa: E501 hybrid (bool): [optional] if omitted the server will use the default value of False # noqa: E501 """ - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) if args: raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -252,13 +263,17 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/pinecone/core/client/model/collection_meta.py b/pinecone/core/client/model/collection_meta.py index 53144bf8..a643b47a 100644 --- a/pinecone/core/client/model/collection_meta.py +++ b/pinecone/core/client/model/collection_meta.py @@ -34,7 +34,6 @@ from pinecone.core.client.exceptions import ApiAttributeError - class CollectionMeta(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -59,11 +58,9 @@ class CollectionMeta(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} @cached_property def additional_properties_type(): @@ -71,7 +68,17 @@ def additional_properties_type(): This must be a method because a model may have properties that are of type self, this must run after the class is loaded """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -86,24 +93,22 @@ def openapi_types(): and the value is attribute type. """ return { - 'name': (str,), # noqa: E501 - 'size': (int,), # noqa: E501 - 'status': (str,), # noqa: E501 + "name": (str,), # noqa: E501 + "size": (int,), # noqa: E501 + "status": (str,), # noqa: E501 } @cached_property def discriminator(): return None - attribute_map = { - 'name': 'name', # noqa: E501 - 'size': 'size', # noqa: E501 - 'status': 'status', # noqa: E501 + "name": "name", # noqa: E501 + "size": "size", # noqa: E501 + "status": "status", # noqa: E501 } - read_only_vars = { - } + read_only_vars = {} _composed_schemas = {} @@ -148,17 +153,18 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 status (str): The status of the collection.. [optional] # noqa: E501 """ - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) self = super(OpenApiModel, cls).__new__(cls) if args: raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -174,23 +180,27 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 @@ -232,15 +242,16 @@ def __init__(self, *args, **kwargs): # noqa: E501 status (str): The status of the collection.. [optional] # noqa: E501 """ - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) if args: raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -256,13 +267,17 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/pinecone/core/client/model/create_collection_request.py b/pinecone/core/client/model/create_collection_request.py index ad5747f9..7a055765 100644 --- a/pinecone/core/client/model/create_collection_request.py +++ b/pinecone/core/client/model/create_collection_request.py @@ -34,7 +34,6 @@ from pinecone.core.client.exceptions import ApiAttributeError - class CreateCollectionRequest(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -59,11 +58,9 @@ class CreateCollectionRequest(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} @cached_property def additional_properties_type(): @@ -71,7 +68,17 @@ def additional_properties_type(): This must be a method because a model may have properties that are of type self, this must run after the class is loaded """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -86,22 +93,20 @@ def openapi_types(): and the value is attribute type. """ return { - 'name': (str,), # noqa: E501 - 'source': (str,), # noqa: E501 + "name": (str,), # noqa: E501 + "source": (str,), # noqa: E501 } @cached_property def discriminator(): return None - attribute_map = { - 'name': 'name', # noqa: E501 - 'source': 'source', # noqa: E501 + "name": "name", # noqa: E501 + "source": "source", # noqa: E501 } - read_only_vars = { - } + read_only_vars = {} _composed_schemas = {} @@ -147,17 +152,18 @@ def _from_openapi_data(cls, name, source, *args, **kwargs): # noqa: E501 _visited_composed_classes = (Animal,) """ - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) self = super(OpenApiModel, cls).__new__(cls) if args: raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -175,23 +181,27 @@ def _from_openapi_data(cls, name, source, *args, **kwargs): # noqa: E501 self.name = name self.source = source for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) @convert_js_args_to_python_args def __init__(self, name, source, *args, **kwargs): # noqa: E501 @@ -234,15 +244,16 @@ def __init__(self, name, source, *args, **kwargs): # noqa: E501 _visited_composed_classes = (Animal,) """ - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) if args: raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -260,13 +271,17 @@ def __init__(self, name, source, *args, **kwargs): # noqa: E501 self.name = name self.source = source for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/pinecone/core/client/model/create_request.py b/pinecone/core/client/model/create_request.py index eb51b069..493cccc8 100644 --- a/pinecone/core/client/model/create_request.py +++ b/pinecone/core/client/model/create_request.py @@ -34,7 +34,6 @@ from pinecone.core.client.exceptions import ApiAttributeError - class CreateRequest(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -59,11 +58,9 @@ class CreateRequest(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} @cached_property def additional_properties_type(): @@ -71,7 +68,17 @@ def additional_properties_type(): This must be a method because a model may have properties that are of type self, this must run after the class is loaded """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -86,40 +93,41 @@ def openapi_types(): and the value is attribute type. """ return { - 'name': (str,), # noqa: E501 - 'dimension': (int,), # noqa: E501 - 'index_type': (str,), # noqa: E501 - 'metric': (str,), # noqa: E501 - 'pods': (int,), # noqa: E501 - 'replicas': (int,), # noqa: E501 - 'shards': (int,), # noqa: E501 - 'pod_type': (str,), # noqa: E501 - 'index_config': (dict,), # noqa: E501 - 'metadata_config': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type,), # noqa: E501 - 'source_collection': (str,), # noqa: E501 + "name": (str,), # noqa: E501 + "dimension": (int,), # noqa: E501 + "index_type": (str,), # noqa: E501 + "metric": (str,), # noqa: E501 + "pods": (int,), # noqa: E501 + "replicas": (int,), # noqa: E501 + "shards": (int,), # noqa: E501 + "pod_type": (str,), # noqa: E501 + "index_config": (dict,), # noqa: E501 + "metadata_config": ( + {str: (bool, date, datetime, dict, float, int, list, str, none_type)}, + none_type, + ), # noqa: E501 + "source_collection": (str,), # noqa: E501 } @cached_property def discriminator(): return None - attribute_map = { - 'name': 'name', # noqa: E501 - 'dimension': 'dimension', # noqa: E501 - 'index_type': 'index_type', # noqa: E501 - 'metric': 'metric', # noqa: E501 - 'pods': 'pods', # noqa: E501 - 'replicas': 'replicas', # noqa: E501 - 'shards': 'shards', # noqa: E501 - 'pod_type': 'pod_type', # noqa: E501 - 'index_config': 'index_config', # noqa: E501 - 'metadata_config': 'metadata_config', # noqa: E501 - 'source_collection': 'source_collection', # noqa: E501 + "name": "name", # noqa: E501 + "dimension": "dimension", # noqa: E501 + "index_type": "index_type", # noqa: E501 + "metric": "metric", # noqa: E501 + "pods": "pods", # noqa: E501 + "replicas": "replicas", # noqa: E501 + "shards": "shards", # noqa: E501 + "pod_type": "pod_type", # noqa: E501 + "index_config": "index_config", # noqa: E501 + "metadata_config": "metadata_config", # noqa: E501 + "source_collection": "source_collection", # noqa: E501 } - read_only_vars = { - } + read_only_vars = {} _composed_schemas = {} @@ -174,17 +182,18 @@ def _from_openapi_data(cls, name, dimension, *args, **kwargs): # noqa: E501 source_collection (str): The name of the collection to create an index from. [optional] # noqa: E501 """ - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) self = super(OpenApiModel, cls).__new__(cls) if args: raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -202,23 +211,27 @@ def _from_openapi_data(cls, name, dimension, *args, **kwargs): # noqa: E501 self.name = name self.dimension = dimension for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) @convert_js_args_to_python_args def __init__(self, name, dimension, *args, **kwargs): # noqa: E501 @@ -270,15 +283,16 @@ def __init__(self, name, dimension, *args, **kwargs): # noqa: E501 source_collection (str): The name of the collection to create an index from. [optional] # noqa: E501 """ - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) if args: raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -296,13 +310,17 @@ def __init__(self, name, dimension, *args, **kwargs): # noqa: E501 self.name = name self.dimension = dimension for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/pinecone/core/client/model/delete_request.py b/pinecone/core/client/model/delete_request.py index cecfa555..5ad83557 100644 --- a/pinecone/core/client/model/delete_request.py +++ b/pinecone/core/client/model/delete_request.py @@ -34,7 +34,6 @@ from pinecone.core.client.exceptions import ApiAttributeError - class DeleteRequest(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -59,12 +58,10 @@ class DeleteRequest(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} validations = { - ('ids',): { - }, + ("ids",): {}, } @cached_property @@ -73,7 +70,17 @@ def additional_properties_type(): This must be a method because a model may have properties that are of type self, this must run after the class is loaded """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -88,26 +95,24 @@ def openapi_types(): and the value is attribute type. """ return { - 'ids': ([str],), # noqa: E501 - 'delete_all': (bool,), # noqa: E501 - 'namespace': (str,), # noqa: E501 - 'filter': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 + "ids": ([str],), # noqa: E501 + "delete_all": (bool,), # noqa: E501 + "namespace": (str,), # noqa: E501 + "filter": ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 } @cached_property def discriminator(): return None - attribute_map = { - 'ids': 'ids', # noqa: E501 - 'delete_all': 'deleteAll', # noqa: E501 - 'namespace': 'namespace', # noqa: E501 - 'filter': 'filter', # noqa: E501 + "ids": "ids", # noqa: E501 + "delete_all": "deleteAll", # noqa: E501 + "namespace": "namespace", # noqa: E501 + "filter": "filter", # noqa: E501 } - read_only_vars = { - } + read_only_vars = {} _composed_schemas = {} @@ -153,17 +158,18 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 filter ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): If specified, the metadata filter here will be used to select the vectors to delete. This is mutually exclusive with specifying ids to delete in the ids param or using delete_all=True. See https://www.pinecone.io/docs/metadata-filtering/.. [optional] # noqa: E501 """ - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) self = super(OpenApiModel, cls).__new__(cls) if args: raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -179,23 +185,27 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 @@ -238,15 +248,16 @@ def __init__(self, *args, **kwargs): # noqa: E501 filter ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): If specified, the metadata filter here will be used to select the vectors to delete. This is mutually exclusive with specifying ids to delete in the ids param or using delete_all=True. See https://www.pinecone.io/docs/metadata-filtering/.. [optional] # noqa: E501 """ - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) if args: raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -262,13 +273,17 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/pinecone/core/client/model/describe_index_stats_request.py b/pinecone/core/client/model/describe_index_stats_request.py index 6702ec6f..0758a3a8 100644 --- a/pinecone/core/client/model/describe_index_stats_request.py +++ b/pinecone/core/client/model/describe_index_stats_request.py @@ -34,7 +34,6 @@ from pinecone.core.client.exceptions import ApiAttributeError - class DescribeIndexStatsRequest(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -59,11 +58,9 @@ class DescribeIndexStatsRequest(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} @cached_property def additional_properties_type(): @@ -71,7 +68,17 @@ def additional_properties_type(): This must be a method because a model may have properties that are of type self, this must run after the class is loaded """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -86,20 +93,18 @@ def openapi_types(): and the value is attribute type. """ return { - 'filter': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 + "filter": ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 } @cached_property def discriminator(): return None - attribute_map = { - 'filter': 'filter', # noqa: E501 + "filter": "filter", # noqa: E501 } - read_only_vars = { - } + read_only_vars = {} _composed_schemas = {} @@ -142,17 +147,18 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 filter ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): If this parameter is present, the operation only returns statistics for vectors that satisfy the filter. See https://www.pinecone.io/docs/metadata-filtering/.. [optional] # noqa: E501 """ - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) self = super(OpenApiModel, cls).__new__(cls) if args: raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -168,23 +174,27 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 @@ -224,15 +234,16 @@ def __init__(self, *args, **kwargs): # noqa: E501 filter ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): If this parameter is present, the operation only returns statistics for vectors that satisfy the filter. See https://www.pinecone.io/docs/metadata-filtering/.. [optional] # noqa: E501 """ - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) if args: raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -248,13 +259,17 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/pinecone/core/client/model/describe_index_stats_response.py b/pinecone/core/client/model/describe_index_stats_response.py index 12e8bff9..07680d16 100644 --- a/pinecone/core/client/model/describe_index_stats_response.py +++ b/pinecone/core/client/model/describe_index_stats_response.py @@ -36,7 +36,8 @@ def lazy_import(): from pinecone.core.client.model.namespace_summary import NamespaceSummary - globals()['NamespaceSummary'] = NamespaceSummary + + globals()["NamespaceSummary"] = NamespaceSummary class DescribeIndexStatsResponse(ModelNormal): @@ -63,11 +64,9 @@ class DescribeIndexStatsResponse(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} @cached_property def additional_properties_type(): @@ -76,7 +75,17 @@ def additional_properties_type(): of type self, this must run after the class is loaded """ lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -92,26 +101,24 @@ def openapi_types(): """ lazy_import() return { - 'namespaces': ({str: (NamespaceSummary,)},), # noqa: E501 - 'dimension': (int,), # noqa: E501 - 'index_fullness': (float,), # noqa: E501 - 'total_vector_count': (int,), # noqa: E501 + "namespaces": ({str: (NamespaceSummary,)},), # noqa: E501 + "dimension": (int,), # noqa: E501 + "index_fullness": (float,), # noqa: E501 + "total_vector_count": (int,), # noqa: E501 } @cached_property def discriminator(): return None - attribute_map = { - 'namespaces': 'namespaces', # noqa: E501 - 'dimension': 'dimension', # noqa: E501 - 'index_fullness': 'indexFullness', # noqa: E501 - 'total_vector_count': 'totalVectorCount', # noqa: E501 + "namespaces": "namespaces", # noqa: E501 + "dimension": "dimension", # noqa: E501 + "index_fullness": "indexFullness", # noqa: E501 + "total_vector_count": "totalVectorCount", # noqa: E501 } - read_only_vars = { - } + read_only_vars = {} _composed_schemas = {} @@ -157,17 +164,18 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 total_vector_count (int): [optional] # noqa: E501 """ - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) self = super(OpenApiModel, cls).__new__(cls) if args: raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -183,23 +191,27 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 @@ -242,15 +254,16 @@ def __init__(self, *args, **kwargs): # noqa: E501 total_vector_count (int): [optional] # noqa: E501 """ - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) if args: raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -266,13 +279,17 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/pinecone/core/client/model/fetch_response.py b/pinecone/core/client/model/fetch_response.py index e1a1c6e0..ff36f199 100644 --- a/pinecone/core/client/model/fetch_response.py +++ b/pinecone/core/client/model/fetch_response.py @@ -36,7 +36,8 @@ def lazy_import(): from pinecone.core.client.model.vector import Vector - globals()['Vector'] = Vector + + globals()["Vector"] = Vector class FetchResponse(ModelNormal): @@ -63,11 +64,9 @@ class FetchResponse(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} @cached_property def additional_properties_type(): @@ -76,7 +75,17 @@ def additional_properties_type(): of type self, this must run after the class is loaded """ lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -92,22 +101,20 @@ def openapi_types(): """ lazy_import() return { - 'vectors': ({str: (Vector,)},), # noqa: E501 - 'namespace': (str,), # noqa: E501 + "vectors": ({str: (Vector,)},), # noqa: E501 + "namespace": (str,), # noqa: E501 } @cached_property def discriminator(): return None - attribute_map = { - 'vectors': 'vectors', # noqa: E501 - 'namespace': 'namespace', # noqa: E501 + "vectors": "vectors", # noqa: E501 + "namespace": "namespace", # noqa: E501 } - read_only_vars = { - } + read_only_vars = {} _composed_schemas = {} @@ -151,17 +158,18 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 namespace (str): The namespace of the vectors.. [optional] # noqa: E501 """ - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) self = super(OpenApiModel, cls).__new__(cls) if args: raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -177,23 +185,27 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 @@ -234,15 +246,16 @@ def __init__(self, *args, **kwargs): # noqa: E501 namespace (str): The namespace of the vectors.. [optional] # noqa: E501 """ - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) if args: raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -258,13 +271,17 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/pinecone/core/client/model/hnsw_config.py b/pinecone/core/client/model/hnsw_config.py index 82b61d45..f7fdb96f 100644 --- a/pinecone/core/client/model/hnsw_config.py +++ b/pinecone/core/client/model/hnsw_config.py @@ -34,7 +34,6 @@ from pinecone.core.client.exceptions import ApiAttributeError - class HnswConfig(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -59,11 +58,9 @@ class HnswConfig(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} @cached_property def additional_properties_type(): @@ -71,7 +68,17 @@ def additional_properties_type(): This must be a method because a model may have properties that are of type self, this must run after the class is loaded """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -86,26 +93,24 @@ def openapi_types(): and the value is attribute type. """ return { - 'ef_construction': (int,), # noqa: E501 - 'ef': (int,), # noqa: E501 - 'm': (int,), # noqa: E501 - 'max_elements': (int,), # noqa: E501 + "ef_construction": (int,), # noqa: E501 + "ef": (int,), # noqa: E501 + "m": (int,), # noqa: E501 + "max_elements": (int,), # noqa: E501 } @cached_property def discriminator(): return None - attribute_map = { - 'ef_construction': 'ef_construction', # noqa: E501 - 'ef': 'ef', # noqa: E501 - 'm': 'M', # noqa: E501 - 'max_elements': 'max_elements', # noqa: E501 + "ef_construction": "ef_construction", # noqa: E501 + "ef": "ef", # noqa: E501 + "m": "M", # noqa: E501 + "max_elements": "max_elements", # noqa: E501 } - read_only_vars = { - } + read_only_vars = {} _composed_schemas = {} @@ -151,17 +156,18 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 max_elements (int): [optional] if omitted the server will use the default value of 50000000 # noqa: E501 """ - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) self = super(OpenApiModel, cls).__new__(cls) if args: raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -177,23 +183,27 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 @@ -236,15 +246,16 @@ def __init__(self, *args, **kwargs): # noqa: E501 max_elements (int): [optional] if omitted the server will use the default value of 50000000 # noqa: E501 """ - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) if args: raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -260,13 +271,17 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/pinecone/core/client/model/index_meta.py b/pinecone/core/client/model/index_meta.py index ff650b91..af41b93a 100644 --- a/pinecone/core/client/model/index_meta.py +++ b/pinecone/core/client/model/index_meta.py @@ -36,7 +36,8 @@ def lazy_import(): from pinecone.core.client.model.index_meta_database import IndexMetaDatabase - globals()['IndexMetaDatabase'] = IndexMetaDatabase + + globals()["IndexMetaDatabase"] = IndexMetaDatabase class IndexMeta(ModelNormal): @@ -63,11 +64,9 @@ class IndexMeta(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} @cached_property def additional_properties_type(): @@ -76,7 +75,17 @@ def additional_properties_type(): of type self, this must run after the class is loaded """ lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -92,20 +101,18 @@ def openapi_types(): """ lazy_import() return { - 'database': (IndexMetaDatabase,), # noqa: E501 + "database": (IndexMetaDatabase,), # noqa: E501 } @cached_property def discriminator(): return None - attribute_map = { - 'database': 'database', # noqa: E501 + "database": "database", # noqa: E501 } - read_only_vars = { - } + read_only_vars = {} _composed_schemas = {} @@ -148,17 +155,18 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 database (IndexMetaDatabase): [optional] # noqa: E501 """ - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) self = super(OpenApiModel, cls).__new__(cls) if args: raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -174,23 +182,27 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 @@ -230,15 +242,16 @@ def __init__(self, *args, **kwargs): # noqa: E501 database (IndexMetaDatabase): [optional] # noqa: E501 """ - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) if args: raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -254,13 +267,17 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/pinecone/core/client/model/index_meta_database.py b/pinecone/core/client/model/index_meta_database.py index d2fe4d39..78a2e962 100644 --- a/pinecone/core/client/model/index_meta_database.py +++ b/pinecone/core/client/model/index_meta_database.py @@ -36,7 +36,8 @@ def lazy_import(): from pinecone.core.client.model.index_meta_database_status import IndexMetaDatabaseStatus - globals()['IndexMetaDatabaseStatus'] = IndexMetaDatabaseStatus + + globals()["IndexMetaDatabaseStatus"] = IndexMetaDatabaseStatus class IndexMetaDatabase(ModelNormal): @@ -63,11 +64,9 @@ class IndexMetaDatabase(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} @cached_property def additional_properties_type(): @@ -76,7 +75,17 @@ def additional_properties_type(): of type self, this must run after the class is loaded """ lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -92,40 +101,38 @@ def openapi_types(): """ lazy_import() return { - 'name': (str,), # noqa: E501 - 'dimensions': (str,), # noqa: E501 - 'index_type': (str,), # noqa: E501 - 'metric': (str,), # noqa: E501 - 'pods': (int,), # noqa: E501 - 'replicas': (int,), # noqa: E501 - 'shards': (int,), # noqa: E501 - 'pod_type': (str,), # noqa: E501 - 'index_config': (dict,), # noqa: E501 - 'metadata_config': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 - 'status': (IndexMetaDatabaseStatus,), # noqa: E501 + "name": (str,), # noqa: E501 + "dimensions": (str,), # noqa: E501 + "index_type": (str,), # noqa: E501 + "metric": (str,), # noqa: E501 + "pods": (int,), # noqa: E501 + "replicas": (int,), # noqa: E501 + "shards": (int,), # noqa: E501 + "pod_type": (str,), # noqa: E501 + "index_config": (dict,), # noqa: E501 + "metadata_config": ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 + "status": (IndexMetaDatabaseStatus,), # noqa: E501 } @cached_property def discriminator(): return None - attribute_map = { - 'name': 'name', # noqa: E501 - 'dimensions': 'dimensions', # noqa: E501 - 'index_type': 'index_type', # noqa: E501 - 'metric': 'metric', # noqa: E501 - 'pods': 'pods', # noqa: E501 - 'replicas': 'replicas', # noqa: E501 - 'shards': 'shards', # noqa: E501 - 'pod_type': 'pod_type', # noqa: E501 - 'index_config': 'index_config', # noqa: E501 - 'metadata_config': 'metadata_config', # noqa: E501 - 'status': 'status', # noqa: E501 + "name": "name", # noqa: E501 + "dimensions": "dimensions", # noqa: E501 + "index_type": "index_type", # noqa: E501 + "metric": "metric", # noqa: E501 + "pods": "pods", # noqa: E501 + "replicas": "replicas", # noqa: E501 + "shards": "shards", # noqa: E501 + "pod_type": "pod_type", # noqa: E501 + "index_config": "index_config", # noqa: E501 + "metadata_config": "metadata_config", # noqa: E501 + "status": "status", # noqa: E501 } - read_only_vars = { - } + read_only_vars = {} _composed_schemas = {} @@ -178,17 +185,18 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 status (IndexMetaDatabaseStatus): [optional] # noqa: E501 """ - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) self = super(OpenApiModel, cls).__new__(cls) if args: raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -204,23 +212,27 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 @@ -270,15 +282,16 @@ def __init__(self, *args, **kwargs): # noqa: E501 status (IndexMetaDatabaseStatus): [optional] # noqa: E501 """ - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) if args: raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -294,13 +307,17 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/pinecone/core/client/model/index_meta_database_status.py b/pinecone/core/client/model/index_meta_database_status.py index e3453d8c..c0f1f3ec 100644 --- a/pinecone/core/client/model/index_meta_database_status.py +++ b/pinecone/core/client/model/index_meta_database_status.py @@ -34,7 +34,6 @@ from pinecone.core.client.exceptions import ApiAttributeError - class IndexMetaDatabaseStatus(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -60,17 +59,16 @@ class IndexMetaDatabaseStatus(ModelNormal): """ allowed_values = { - ('state',): { - 'INITIALIZING': "Initializing", - 'SCALINGUP': "ScalingUp", - 'SCALINGDOWN': "ScalingDown", - 'TERMINATING': "Terminating", - 'READY': "Ready", + ("state",): { + "INITIALIZING": "Initializing", + "SCALINGUP": "ScalingUp", + "SCALINGDOWN": "ScalingDown", + "TERMINATING": "Terminating", + "READY": "Ready", }, } - validations = { - } + validations = {} @cached_property def additional_properties_type(): @@ -78,7 +76,17 @@ def additional_properties_type(): This must be a method because a model may have properties that are of type self, this must run after the class is loaded """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -93,22 +101,20 @@ def openapi_types(): and the value is attribute type. """ return { - 'ready': (bool,), # noqa: E501 - 'state': (str,), # noqa: E501 + "ready": (bool,), # noqa: E501 + "state": (str,), # noqa: E501 } @cached_property def discriminator(): return None - attribute_map = { - 'ready': 'ready', # noqa: E501 - 'state': 'state', # noqa: E501 + "ready": "ready", # noqa: E501 + "state": "state", # noqa: E501 } - read_only_vars = { - } + read_only_vars = {} _composed_schemas = {} @@ -152,17 +158,18 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 state (str): [optional] # noqa: E501 """ - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) self = super(OpenApiModel, cls).__new__(cls) if args: raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -178,23 +185,27 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 @@ -235,15 +246,16 @@ def __init__(self, *args, **kwargs): # noqa: E501 state (str): [optional] # noqa: E501 """ - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) if args: raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -259,13 +271,17 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/pinecone/core/client/model/index_meta_status.py b/pinecone/core/client/model/index_meta_status.py index 59ae9a6c..a0d143cc 100644 --- a/pinecone/core/client/model/index_meta_status.py +++ b/pinecone/core/client/model/index_meta_status.py @@ -34,7 +34,6 @@ from pinecone.core.client.exceptions import ApiAttributeError - class IndexMetaStatus(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -59,11 +58,9 @@ class IndexMetaStatus(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} @cached_property def additional_properties_type(): @@ -71,7 +68,17 @@ def additional_properties_type(): This must be a method because a model may have properties that are of type self, this must run after the class is loaded """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -86,26 +93,24 @@ def openapi_types(): and the value is attribute type. """ return { - 'crashed': ([str],), # noqa: E501 - 'ready': (bool,), # noqa: E501 - 'port': (int,), # noqa: E501 - 'waiting': ([str],), # noqa: E501 + "crashed": ([str],), # noqa: E501 + "ready": (bool,), # noqa: E501 + "port": (int,), # noqa: E501 + "waiting": ([str],), # noqa: E501 } @cached_property def discriminator(): return None - attribute_map = { - 'crashed': 'crashed', # noqa: E501 - 'ready': 'ready', # noqa: E501 - 'port': 'port', # noqa: E501 - 'waiting': 'waiting', # noqa: E501 + "crashed": "crashed", # noqa: E501 + "ready": "ready", # noqa: E501 + "port": "port", # noqa: E501 + "waiting": "waiting", # noqa: E501 } - read_only_vars = { - } + read_only_vars = {} _composed_schemas = {} @@ -151,17 +156,18 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 waiting ([str]): [optional] # noqa: E501 """ - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) self = super(OpenApiModel, cls).__new__(cls) if args: raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -177,23 +183,27 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 @@ -236,15 +246,16 @@ def __init__(self, *args, **kwargs): # noqa: E501 waiting ([str]): [optional] # noqa: E501 """ - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) if args: raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -260,13 +271,17 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/pinecone/core/client/model/namespace_summary.py b/pinecone/core/client/model/namespace_summary.py index e63295ca..2ffcfc62 100644 --- a/pinecone/core/client/model/namespace_summary.py +++ b/pinecone/core/client/model/namespace_summary.py @@ -34,7 +34,6 @@ from pinecone.core.client.exceptions import ApiAttributeError - class NamespaceSummary(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -59,11 +58,9 @@ class NamespaceSummary(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} @cached_property def additional_properties_type(): @@ -71,7 +68,17 @@ def additional_properties_type(): This must be a method because a model may have properties that are of type self, this must run after the class is loaded """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -86,20 +93,18 @@ def openapi_types(): and the value is attribute type. """ return { - 'vector_count': (int,), # noqa: E501 + "vector_count": (int,), # noqa: E501 } @cached_property def discriminator(): return None - attribute_map = { - 'vector_count': 'vectorCount', # noqa: E501 + "vector_count": "vectorCount", # noqa: E501 } - read_only_vars = { - } + read_only_vars = {} _composed_schemas = {} @@ -142,17 +147,18 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 vector_count (int): The number of vectors stored in this namespace. Note that updates to this field may lag behind updates to the underlying index and corresponding query results, etc.. [optional] # noqa: E501 """ - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) self = super(OpenApiModel, cls).__new__(cls) if args: raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -168,23 +174,27 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 @@ -224,15 +234,16 @@ def __init__(self, *args, **kwargs): # noqa: E501 vector_count (int): The number of vectors stored in this namespace. Note that updates to this field may lag behind updates to the underlying index and corresponding query results, etc.. [optional] # noqa: E501 """ - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) if args: raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -248,13 +259,17 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/pinecone/core/client/model/patch_request.py b/pinecone/core/client/model/patch_request.py index 85b66d12..350c0c60 100644 --- a/pinecone/core/client/model/patch_request.py +++ b/pinecone/core/client/model/patch_request.py @@ -34,7 +34,6 @@ from pinecone.core.client.exceptions import ApiAttributeError - class PatchRequest(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -59,11 +58,9 @@ class PatchRequest(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} @cached_property def additional_properties_type(): @@ -71,7 +68,17 @@ def additional_properties_type(): This must be a method because a model may have properties that are of type self, this must run after the class is loaded """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -86,22 +93,20 @@ def openapi_types(): and the value is attribute type. """ return { - 'replicas': (int,), # noqa: E501 - 'pod_type': (str,), # noqa: E501 + "replicas": (int,), # noqa: E501 + "pod_type": (str,), # noqa: E501 } @cached_property def discriminator(): return None - attribute_map = { - 'replicas': 'replicas', # noqa: E501 - 'pod_type': 'pod_type', # noqa: E501 + "replicas": "replicas", # noqa: E501 + "pod_type": "pod_type", # noqa: E501 } - read_only_vars = { - } + read_only_vars = {} _composed_schemas = {} @@ -145,17 +150,18 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 pod_type (str): The new pod type for the index. One of `s1`, `p1`, or `p2` appended with `.` and one of `x1`, `x2`, `x4`, or `x8`.. [optional] # noqa: E501 """ - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) self = super(OpenApiModel, cls).__new__(cls) if args: raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -171,23 +177,27 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 @@ -228,15 +238,16 @@ def __init__(self, *args, **kwargs): # noqa: E501 pod_type (str): The new pod type for the index. One of `s1`, `p1`, or `p2` appended with `.` and one of `x1`, `x2`, `x4`, or `x8`.. [optional] # noqa: E501 """ - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) if args: raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -252,13 +263,17 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/pinecone/core/client/model/protobuf_any.py b/pinecone/core/client/model/protobuf_any.py index 0db5594e..f136e7f1 100644 --- a/pinecone/core/client/model/protobuf_any.py +++ b/pinecone/core/client/model/protobuf_any.py @@ -34,7 +34,6 @@ from pinecone.core.client.exceptions import ApiAttributeError - class ProtobufAny(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -59,11 +58,9 @@ class ProtobufAny(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} @cached_property def additional_properties_type(): @@ -71,7 +68,17 @@ def additional_properties_type(): This must be a method because a model may have properties that are of type self, this must run after the class is loaded """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -86,22 +93,20 @@ def openapi_types(): and the value is attribute type. """ return { - 'type_url': (str,), # noqa: E501 - 'value': (str,), # noqa: E501 + "type_url": (str,), # noqa: E501 + "value": (str,), # noqa: E501 } @cached_property def discriminator(): return None - attribute_map = { - 'type_url': 'typeUrl', # noqa: E501 - 'value': 'value', # noqa: E501 + "type_url": "typeUrl", # noqa: E501 + "value": "value", # noqa: E501 } - read_only_vars = { - } + read_only_vars = {} _composed_schemas = {} @@ -145,17 +150,18 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 value (str): [optional] # noqa: E501 """ - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) self = super(OpenApiModel, cls).__new__(cls) if args: raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -171,23 +177,27 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 @@ -228,15 +238,16 @@ def __init__(self, *args, **kwargs): # noqa: E501 value (str): [optional] # noqa: E501 """ - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) if args: raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -252,13 +263,17 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/pinecone/core/client/model/protobuf_null_value.py b/pinecone/core/client/model/protobuf_null_value.py index 27ce33c1..868211fe 100644 --- a/pinecone/core/client/model/protobuf_null_value.py +++ b/pinecone/core/client/model/protobuf_null_value.py @@ -34,7 +34,6 @@ from pinecone.core.client.exceptions import ApiAttributeError - class ProtobufNullValue(ModelSimple): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -56,13 +55,12 @@ class ProtobufNullValue(ModelSimple): """ allowed_values = { - ('value',): { - 'NULL_VALUE': "NULL_VALUE", + ("value",): { + "NULL_VALUE": "NULL_VALUE", }, } - validations = { - } + validations = {} @cached_property def additional_properties_type(): @@ -70,7 +68,17 @@ def additional_properties_type(): This must be a method because a model may have properties that are of type self, this must run after the class is loaded """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -85,28 +93,29 @@ def openapi_types(): and the value is attribute type. """ return { - 'value': (str,), + "value": (str,), } @cached_property def discriminator(): return None - attribute_map = {} read_only_vars = set() _composed_schemas = None - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) @convert_js_args_to_python_args def __init__(self, *args, **kwargs): @@ -151,24 +160,25 @@ def __init__(self, *args, **kwargs): _visited_composed_classes = (Animal,) """ # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) + _path_to_item = kwargs.pop("_path_to_item", ()) - if 'value' in kwargs: - value = kwargs.pop('value') + if "value" in kwargs: + value = kwargs.pop("value") elif args: args = list(args) value = args.pop(0) else: value = "NULL_VALUE" - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) if args: raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -185,7 +195,8 @@ def __init__(self, *args, **kwargs): self.value = value if kwargs: raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( kwargs, self.__class__.__name__, ), @@ -237,26 +248,27 @@ def _from_openapi_data(cls, *args, **kwargs): _visited_composed_classes = (Animal,) """ # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) + _path_to_item = kwargs.pop("_path_to_item", ()) self = super(OpenApiModel, cls).__new__(cls) - if 'value' in kwargs: - value = kwargs.pop('value') + if "value" in kwargs: + value = kwargs.pop("value") elif args: args = list(args) value = args.pop(0) else: value = "NULL_VALUE" - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) if args: raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -273,7 +285,8 @@ def _from_openapi_data(cls, *args, **kwargs): self.value = value if kwargs: raise ApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % ( kwargs, self.__class__.__name__, ), diff --git a/pinecone/core/client/model/query_request.py b/pinecone/core/client/model/query_request.py index 8cff6795..12be8142 100644 --- a/pinecone/core/client/model/query_request.py +++ b/pinecone/core/client/model/query_request.py @@ -37,8 +37,9 @@ def lazy_import(): from pinecone.core.client.model.query_vector import QueryVector from pinecone.core.client.model.sparse_values import SparseValues - globals()['QueryVector'] = QueryVector - globals()['SparseValues'] = SparseValues + + globals()["QueryVector"] = QueryVector + globals()["SparseValues"] = SparseValues class QueryRequest(ModelNormal): @@ -65,20 +66,17 @@ class QueryRequest(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} validations = { - ('top_k',): { - 'inclusive_maximum': 10000, - 'inclusive_minimum': 1, - }, - ('queries',): { + ("top_k",): { + "inclusive_maximum": 10000, + "inclusive_minimum": 1, }, - ('vector',): { - }, - ('id',): { - 'max_length': 512, + ("queries",): {}, + ("vector",): {}, + ("id",): { + "max_length": 512, }, } @@ -89,7 +87,17 @@ def additional_properties_type(): of type self, this must run after the class is loaded """ lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -105,36 +113,34 @@ def openapi_types(): """ lazy_import() return { - 'top_k': (int,), # noqa: E501 - 'namespace': (str,), # noqa: E501 - 'filter': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 - 'include_values': (bool,), # noqa: E501 - 'include_metadata': (bool,), # noqa: E501 - 'queries': ([QueryVector],), # noqa: E501 - 'vector': ([float],), # noqa: E501 - 'sparse_vector': (SparseValues,), # noqa: E501 - 'id': (str,), # noqa: E501 + "top_k": (int,), # noqa: E501 + "namespace": (str,), # noqa: E501 + "filter": ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 + "include_values": (bool,), # noqa: E501 + "include_metadata": (bool,), # noqa: E501 + "queries": ([QueryVector],), # noqa: E501 + "vector": ([float],), # noqa: E501 + "sparse_vector": (SparseValues,), # noqa: E501 + "id": (str,), # noqa: E501 } @cached_property def discriminator(): return None - attribute_map = { - 'top_k': 'topK', # noqa: E501 - 'namespace': 'namespace', # noqa: E501 - 'filter': 'filter', # noqa: E501 - 'include_values': 'includeValues', # noqa: E501 - 'include_metadata': 'includeMetadata', # noqa: E501 - 'queries': 'queries', # noqa: E501 - 'vector': 'vector', # noqa: E501 - 'sparse_vector': 'sparseVector', # noqa: E501 - 'id': 'id', # noqa: E501 + "top_k": "topK", # noqa: E501 + "namespace": "namespace", # noqa: E501 + "filter": "filter", # noqa: E501 + "include_values": "includeValues", # noqa: E501 + "include_metadata": "includeMetadata", # noqa: E501 + "queries": "queries", # noqa: E501 + "vector": "vector", # noqa: E501 + "sparse_vector": "sparseVector", # noqa: E501 + "id": "id", # noqa: E501 } - read_only_vars = { - } + read_only_vars = {} _composed_schemas = {} @@ -187,17 +193,18 @@ def _from_openapi_data(cls, top_k, *args, **kwargs): # noqa: E501 id (str): The unique ID of the vector to be used as a query vector. Each `query()` request can contain only one of the parameters `queries`, `vector`, or `id`.. [optional] # noqa: E501 """ - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) self = super(OpenApiModel, cls).__new__(cls) if args: raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -214,23 +221,27 @@ def _from_openapi_data(cls, top_k, *args, **kwargs): # noqa: E501 self.top_k = top_k for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) @convert_js_args_to_python_args def __init__(self, top_k, *args, **kwargs): # noqa: E501 @@ -280,15 +291,16 @@ def __init__(self, top_k, *args, **kwargs): # noqa: E501 id (str): The unique ID of the vector to be used as a query vector. Each `query()` request can contain only one of the parameters `queries`, `vector`, or `id`.. [optional] # noqa: E501 """ - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) if args: raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -305,13 +317,17 @@ def __init__(self, top_k, *args, **kwargs): # noqa: E501 self.top_k = top_k for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/pinecone/core/client/model/query_response.py b/pinecone/core/client/model/query_response.py index d476dd77..2eff20fd 100644 --- a/pinecone/core/client/model/query_response.py +++ b/pinecone/core/client/model/query_response.py @@ -37,8 +37,9 @@ def lazy_import(): from pinecone.core.client.model.scored_vector import ScoredVector from pinecone.core.client.model.single_query_results import SingleQueryResults - globals()['ScoredVector'] = ScoredVector - globals()['SingleQueryResults'] = SingleQueryResults + + globals()["ScoredVector"] = ScoredVector + globals()["SingleQueryResults"] = SingleQueryResults class QueryResponse(ModelNormal): @@ -65,11 +66,9 @@ class QueryResponse(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} @cached_property def additional_properties_type(): @@ -78,7 +77,17 @@ def additional_properties_type(): of type self, this must run after the class is loaded """ lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -94,24 +103,22 @@ def openapi_types(): """ lazy_import() return { - 'results': ([SingleQueryResults],), # noqa: E501 - 'matches': ([ScoredVector],), # noqa: E501 - 'namespace': (str,), # noqa: E501 + "results": ([SingleQueryResults],), # noqa: E501 + "matches": ([ScoredVector],), # noqa: E501 + "namespace": (str,), # noqa: E501 } @cached_property def discriminator(): return None - attribute_map = { - 'results': 'results', # noqa: E501 - 'matches': 'matches', # noqa: E501 - 'namespace': 'namespace', # noqa: E501 + "results": "results", # noqa: E501 + "matches": "matches", # noqa: E501 + "namespace": "namespace", # noqa: E501 } - read_only_vars = { - } + read_only_vars = {} _composed_schemas = {} @@ -156,17 +163,18 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 namespace (str): The namespace for the vectors.. [optional] # noqa: E501 """ - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) self = super(OpenApiModel, cls).__new__(cls) if args: raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -182,23 +190,27 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 @@ -240,15 +252,16 @@ def __init__(self, *args, **kwargs): # noqa: E501 namespace (str): The namespace for the vectors.. [optional] # noqa: E501 """ - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) if args: raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -264,13 +277,17 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/pinecone/core/client/model/query_vector.py b/pinecone/core/client/model/query_vector.py index 72e799b8..8a1dff1d 100644 --- a/pinecone/core/client/model/query_vector.py +++ b/pinecone/core/client/model/query_vector.py @@ -36,7 +36,8 @@ def lazy_import(): from pinecone.core.client.model.sparse_values import SparseValues - globals()['SparseValues'] = SparseValues + + globals()["SparseValues"] = SparseValues class QueryVector(ModelNormal): @@ -63,15 +64,13 @@ class QueryVector(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} validations = { - ('values',): { - }, - ('top_k',): { - 'inclusive_maximum': 10000, - 'inclusive_minimum': 1, + ("values",): {}, + ("top_k",): { + "inclusive_maximum": 10000, + "inclusive_minimum": 1, }, } @@ -82,7 +81,17 @@ def additional_properties_type(): of type self, this must run after the class is loaded """ lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -98,28 +107,26 @@ def openapi_types(): """ lazy_import() return { - 'values': ([float],), # noqa: E501 - 'sparse_values': (SparseValues,), # noqa: E501 - 'top_k': (int,), # noqa: E501 - 'namespace': (str,), # noqa: E501 - 'filter': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 + "values": ([float],), # noqa: E501 + "sparse_values": (SparseValues,), # noqa: E501 + "top_k": (int,), # noqa: E501 + "namespace": (str,), # noqa: E501 + "filter": ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 } @cached_property def discriminator(): return None - attribute_map = { - 'values': 'values', # noqa: E501 - 'sparse_values': 'sparseValues', # noqa: E501 - 'top_k': 'topK', # noqa: E501 - 'namespace': 'namespace', # noqa: E501 - 'filter': 'filter', # noqa: E501 + "values": "values", # noqa: E501 + "sparse_values": "sparseValues", # noqa: E501 + "top_k": "topK", # noqa: E501 + "namespace": "namespace", # noqa: E501 + "filter": "filter", # noqa: E501 } - read_only_vars = { - } + read_only_vars = {} _composed_schemas = {} @@ -168,17 +175,18 @@ def _from_openapi_data(cls, values, *args, **kwargs): # noqa: E501 filter ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): An override for the metadata filter to apply. This replaces the request-level filter.. [optional] # noqa: E501 """ - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) self = super(OpenApiModel, cls).__new__(cls) if args: raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -195,23 +203,27 @@ def _from_openapi_data(cls, values, *args, **kwargs): # noqa: E501 self.values = values for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) @convert_js_args_to_python_args def __init__(self, values, *args, **kwargs): # noqa: E501 @@ -257,15 +269,16 @@ def __init__(self, values, *args, **kwargs): # noqa: E501 filter ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): An override for the metadata filter to apply. This replaces the request-level filter.. [optional] # noqa: E501 """ - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) if args: raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -282,13 +295,17 @@ def __init__(self, values, *args, **kwargs): # noqa: E501 self.values = values for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/pinecone/core/client/model/rpc_status.py b/pinecone/core/client/model/rpc_status.py index 65aeeacc..f0fc1501 100644 --- a/pinecone/core/client/model/rpc_status.py +++ b/pinecone/core/client/model/rpc_status.py @@ -36,7 +36,8 @@ def lazy_import(): from pinecone.core.client.model.protobuf_any import ProtobufAny - globals()['ProtobufAny'] = ProtobufAny + + globals()["ProtobufAny"] = ProtobufAny class RpcStatus(ModelNormal): @@ -63,11 +64,9 @@ class RpcStatus(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} @cached_property def additional_properties_type(): @@ -76,7 +75,17 @@ def additional_properties_type(): of type self, this must run after the class is loaded """ lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -92,24 +101,22 @@ def openapi_types(): """ lazy_import() return { - 'code': (int,), # noqa: E501 - 'message': (str,), # noqa: E501 - 'details': ([ProtobufAny],), # noqa: E501 + "code": (int,), # noqa: E501 + "message": (str,), # noqa: E501 + "details": ([ProtobufAny],), # noqa: E501 } @cached_property def discriminator(): return None - attribute_map = { - 'code': 'code', # noqa: E501 - 'message': 'message', # noqa: E501 - 'details': 'details', # noqa: E501 + "code": "code", # noqa: E501 + "message": "message", # noqa: E501 + "details": "details", # noqa: E501 } - read_only_vars = { - } + read_only_vars = {} _composed_schemas = {} @@ -154,17 +161,18 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 details ([ProtobufAny]): [optional] # noqa: E501 """ - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) self = super(OpenApiModel, cls).__new__(cls) if args: raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -180,23 +188,27 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 @@ -238,15 +250,16 @@ def __init__(self, *args, **kwargs): # noqa: E501 details ([ProtobufAny]): [optional] # noqa: E501 """ - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) if args: raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -262,13 +275,17 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/pinecone/core/client/model/scored_vector.py b/pinecone/core/client/model/scored_vector.py index 6e358fa7..25189c70 100644 --- a/pinecone/core/client/model/scored_vector.py +++ b/pinecone/core/client/model/scored_vector.py @@ -36,7 +36,8 @@ def lazy_import(): from pinecone.core.client.model.sparse_values import SparseValues - globals()['SparseValues'] = SparseValues + + globals()["SparseValues"] = SparseValues class ScoredVector(ModelNormal): @@ -63,13 +64,12 @@ class ScoredVector(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} validations = { - ('id',): { - 'max_length': 512, - 'min_length': 1, + ("id",): { + "max_length": 512, + "min_length": 1, }, } @@ -80,7 +80,17 @@ def additional_properties_type(): of type self, this must run after the class is loaded """ lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -96,28 +106,26 @@ def openapi_types(): """ lazy_import() return { - 'id': (str,), # noqa: E501 - 'score': (float,), # noqa: E501 - 'values': ([float],), # noqa: E501 - 'sparse_values': (SparseValues,), # noqa: E501 - 'metadata': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 + "id": (str,), # noqa: E501 + "score": (float,), # noqa: E501 + "values": ([float],), # noqa: E501 + "sparse_values": (SparseValues,), # noqa: E501 + "metadata": ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 } @cached_property def discriminator(): return None - attribute_map = { - 'id': 'id', # noqa: E501 - 'score': 'score', # noqa: E501 - 'values': 'values', # noqa: E501 - 'sparse_values': 'sparseValues', # noqa: E501 - 'metadata': 'metadata', # noqa: E501 + "id": "id", # noqa: E501 + "score": "score", # noqa: E501 + "values": "values", # noqa: E501 + "sparse_values": "sparseValues", # noqa: E501 + "metadata": "metadata", # noqa: E501 } - read_only_vars = { - } + read_only_vars = {} _composed_schemas = {} @@ -166,17 +174,18 @@ def _from_openapi_data(cls, id, *args, **kwargs): # noqa: E501 metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): This is the metadata, if it is requested.. [optional] # noqa: E501 """ - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) self = super(OpenApiModel, cls).__new__(cls) if args: raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -193,23 +202,27 @@ def _from_openapi_data(cls, id, *args, **kwargs): # noqa: E501 self.id = id for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) @convert_js_args_to_python_args def __init__(self, id, *args, **kwargs): # noqa: E501 @@ -255,15 +268,16 @@ def __init__(self, id, *args, **kwargs): # noqa: E501 metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): This is the metadata, if it is requested.. [optional] # noqa: E501 """ - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) if args: raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -280,13 +294,17 @@ def __init__(self, id, *args, **kwargs): # noqa: E501 self.id = id for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/pinecone/core/client/model/single_query_results.py b/pinecone/core/client/model/single_query_results.py index d5b88457..168eeb39 100644 --- a/pinecone/core/client/model/single_query_results.py +++ b/pinecone/core/client/model/single_query_results.py @@ -36,7 +36,8 @@ def lazy_import(): from pinecone.core.client.model.scored_vector import ScoredVector - globals()['ScoredVector'] = ScoredVector + + globals()["ScoredVector"] = ScoredVector class SingleQueryResults(ModelNormal): @@ -63,11 +64,9 @@ class SingleQueryResults(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} @cached_property def additional_properties_type(): @@ -76,7 +75,17 @@ def additional_properties_type(): of type self, this must run after the class is loaded """ lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -92,22 +101,20 @@ def openapi_types(): """ lazy_import() return { - 'matches': ([ScoredVector],), # noqa: E501 - 'namespace': (str,), # noqa: E501 + "matches": ([ScoredVector],), # noqa: E501 + "namespace": (str,), # noqa: E501 } @cached_property def discriminator(): return None - attribute_map = { - 'matches': 'matches', # noqa: E501 - 'namespace': 'namespace', # noqa: E501 + "matches": "matches", # noqa: E501 + "namespace": "namespace", # noqa: E501 } - read_only_vars = { - } + read_only_vars = {} _composed_schemas = {} @@ -151,17 +158,18 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 namespace (str): The namespace for the vectors.. [optional] # noqa: E501 """ - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) self = super(OpenApiModel, cls).__new__(cls) if args: raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -177,23 +185,27 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 @@ -234,15 +246,16 @@ def __init__(self, *args, **kwargs): # noqa: E501 namespace (str): The namespace for the vectors.. [optional] # noqa: E501 """ - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) if args: raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -258,13 +271,17 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/pinecone/core/client/model/sparse_values.py b/pinecone/core/client/model/sparse_values.py index 0517e8f8..e9963bf1 100644 --- a/pinecone/core/client/model/sparse_values.py +++ b/pinecone/core/client/model/sparse_values.py @@ -34,7 +34,6 @@ from pinecone.core.client.exceptions import ApiAttributeError - class SparseValues(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -59,14 +58,11 @@ class SparseValues(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} validations = { - ('indices',): { - }, - ('values',): { - }, + ("indices",): {}, + ("values",): {}, } @cached_property @@ -75,7 +71,17 @@ def additional_properties_type(): This must be a method because a model may have properties that are of type self, this must run after the class is loaded """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -90,22 +96,20 @@ def openapi_types(): and the value is attribute type. """ return { - 'indices': ([int],), # noqa: E501 - 'values': ([float],), # noqa: E501 + "indices": ([int],), # noqa: E501 + "values": ([float],), # noqa: E501 } @cached_property def discriminator(): return None - attribute_map = { - 'indices': 'indices', # noqa: E501 - 'values': 'values', # noqa: E501 + "indices": "indices", # noqa: E501 + "values": "values", # noqa: E501 } - read_only_vars = { - } + read_only_vars = {} _composed_schemas = {} @@ -151,17 +155,18 @@ def _from_openapi_data(cls, indices, values, *args, **kwargs): # noqa: E501 _visited_composed_classes = (Animal,) """ - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) self = super(OpenApiModel, cls).__new__(cls) if args: raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -179,23 +184,27 @@ def _from_openapi_data(cls, indices, values, *args, **kwargs): # noqa: E501 self.indices = indices self.values = values for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) @convert_js_args_to_python_args def __init__(self, indices, values, *args, **kwargs): # noqa: E501 @@ -238,15 +247,16 @@ def __init__(self, indices, values, *args, **kwargs): # noqa: E501 _visited_composed_classes = (Animal,) """ - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) if args: raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -264,13 +274,17 @@ def __init__(self, indices, values, *args, **kwargs): # noqa: E501 self.indices = indices self.values = values for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/pinecone/core/client/model/update_request.py b/pinecone/core/client/model/update_request.py index 06744e78..92667b68 100644 --- a/pinecone/core/client/model/update_request.py +++ b/pinecone/core/client/model/update_request.py @@ -36,7 +36,8 @@ def lazy_import(): from pinecone.core.client.model.sparse_values import SparseValues - globals()['SparseValues'] = SparseValues + + globals()["SparseValues"] = SparseValues class UpdateRequest(ModelNormal): @@ -63,16 +64,14 @@ class UpdateRequest(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} validations = { - ('id',): { - 'max_length': 512, - 'min_length': 1, - }, - ('values',): { + ("id",): { + "max_length": 512, + "min_length": 1, }, + ("values",): {}, } @cached_property @@ -82,7 +81,17 @@ def additional_properties_type(): of type self, this must run after the class is loaded """ lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -98,28 +107,26 @@ def openapi_types(): """ lazy_import() return { - 'id': (str,), # noqa: E501 - 'values': ([float],), # noqa: E501 - 'sparse_values': (SparseValues,), # noqa: E501 - 'set_metadata': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 - 'namespace': (str,), # noqa: E501 + "id": (str,), # noqa: E501 + "values": ([float],), # noqa: E501 + "sparse_values": (SparseValues,), # noqa: E501 + "set_metadata": ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 + "namespace": (str,), # noqa: E501 } @cached_property def discriminator(): return None - attribute_map = { - 'id': 'id', # noqa: E501 - 'values': 'values', # noqa: E501 - 'sparse_values': 'sparseValues', # noqa: E501 - 'set_metadata': 'setMetadata', # noqa: E501 - 'namespace': 'namespace', # noqa: E501 + "id": "id", # noqa: E501 + "values": "values", # noqa: E501 + "sparse_values": "sparseValues", # noqa: E501 + "set_metadata": "setMetadata", # noqa: E501 + "namespace": "namespace", # noqa: E501 } - read_only_vars = { - } + read_only_vars = {} _composed_schemas = {} @@ -168,17 +175,18 @@ def _from_openapi_data(cls, id, *args, **kwargs): # noqa: E501 namespace (str): Namespace name where to update the vector.. [optional] # noqa: E501 """ - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) self = super(OpenApiModel, cls).__new__(cls) if args: raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -195,23 +203,27 @@ def _from_openapi_data(cls, id, *args, **kwargs): # noqa: E501 self.id = id for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) @convert_js_args_to_python_args def __init__(self, id, *args, **kwargs): # noqa: E501 @@ -257,15 +269,16 @@ def __init__(self, id, *args, **kwargs): # noqa: E501 namespace (str): Namespace name where to update the vector.. [optional] # noqa: E501 """ - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) if args: raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -282,13 +295,17 @@ def __init__(self, id, *args, **kwargs): # noqa: E501 self.id = id for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/pinecone/core/client/model/upsert_request.py b/pinecone/core/client/model/upsert_request.py index ce3fc0a6..6fea90d8 100644 --- a/pinecone/core/client/model/upsert_request.py +++ b/pinecone/core/client/model/upsert_request.py @@ -36,7 +36,8 @@ def lazy_import(): from pinecone.core.client.model.vector import Vector - globals()['Vector'] = Vector + + globals()["Vector"] = Vector class UpsertRequest(ModelNormal): @@ -63,12 +64,10 @@ class UpsertRequest(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} validations = { - ('vectors',): { - }, + ("vectors",): {}, } @cached_property @@ -78,7 +77,17 @@ def additional_properties_type(): of type self, this must run after the class is loaded """ lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -94,22 +103,20 @@ def openapi_types(): """ lazy_import() return { - 'vectors': ([Vector],), # noqa: E501 - 'namespace': (str,), # noqa: E501 + "vectors": ([Vector],), # noqa: E501 + "namespace": (str,), # noqa: E501 } @cached_property def discriminator(): return None - attribute_map = { - 'vectors': 'vectors', # noqa: E501 - 'namespace': 'namespace', # noqa: E501 + "vectors": "vectors", # noqa: E501 + "namespace": "namespace", # noqa: E501 } - read_only_vars = { - } + read_only_vars = {} _composed_schemas = {} @@ -155,17 +162,18 @@ def _from_openapi_data(cls, vectors, *args, **kwargs): # noqa: E501 namespace (str): This is the namespace name where you upsert vectors.. [optional] # noqa: E501 """ - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) self = super(OpenApiModel, cls).__new__(cls) if args: raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -182,23 +190,27 @@ def _from_openapi_data(cls, vectors, *args, **kwargs): # noqa: E501 self.vectors = vectors for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) @convert_js_args_to_python_args def __init__(self, vectors, *args, **kwargs): # noqa: E501 @@ -241,15 +253,16 @@ def __init__(self, vectors, *args, **kwargs): # noqa: E501 namespace (str): This is the namespace name where you upsert vectors.. [optional] # noqa: E501 """ - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) if args: raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -266,13 +279,17 @@ def __init__(self, vectors, *args, **kwargs): # noqa: E501 self.vectors = vectors for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/pinecone/core/client/model/upsert_response.py b/pinecone/core/client/model/upsert_response.py index 781c2e5b..a111bcf2 100644 --- a/pinecone/core/client/model/upsert_response.py +++ b/pinecone/core/client/model/upsert_response.py @@ -34,7 +34,6 @@ from pinecone.core.client.exceptions import ApiAttributeError - class UpsertResponse(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech @@ -59,11 +58,9 @@ class UpsertResponse(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} - validations = { - } + validations = {} @cached_property def additional_properties_type(): @@ -71,7 +68,17 @@ def additional_properties_type(): This must be a method because a model may have properties that are of type self, this must run after the class is loaded """ - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -86,20 +93,18 @@ def openapi_types(): and the value is attribute type. """ return { - 'upserted_count': (int,), # noqa: E501 + "upserted_count": (int,), # noqa: E501 } @cached_property def discriminator(): return None - attribute_map = { - 'upserted_count': 'upsertedCount', # noqa: E501 + "upserted_count": "upsertedCount", # noqa: E501 } - read_only_vars = { - } + read_only_vars = {} _composed_schemas = {} @@ -142,17 +147,18 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 upserted_count (int): The number of vectors upserted.. [optional] # noqa: E501 """ - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) self = super(OpenApiModel, cls).__new__(cls) if args: raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -168,23 +174,27 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) @convert_js_args_to_python_args def __init__(self, *args, **kwargs): # noqa: E501 @@ -224,15 +234,16 @@ def __init__(self, *args, **kwargs): # noqa: E501 upserted_count (int): The number of vectors upserted.. [optional] # noqa: E501 """ - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) if args: raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -248,13 +259,17 @@ def __init__(self, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/pinecone/core/client/model/vector.py b/pinecone/core/client/model/vector.py index cd2195f3..4d9148de 100644 --- a/pinecone/core/client/model/vector.py +++ b/pinecone/core/client/model/vector.py @@ -36,7 +36,8 @@ def lazy_import(): from pinecone.core.client.model.sparse_values import SparseValues - globals()['SparseValues'] = SparseValues + + globals()["SparseValues"] = SparseValues class Vector(ModelNormal): @@ -63,16 +64,14 @@ class Vector(ModelNormal): as additional properties values. """ - allowed_values = { - } + allowed_values = {} validations = { - ('id',): { - 'max_length': 512, - 'min_length': 1, - }, - ('values',): { + ("id",): { + "max_length": 512, + "min_length": 1, }, + ("values",): {}, } @cached_property @@ -82,7 +81,17 @@ def additional_properties_type(): of type self, this must run after the class is loaded """ lazy_import() - return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501 + return ( + bool, + date, + datetime, + dict, + float, + int, + list, + str, + none_type, + ) # noqa: E501 _nullable = False @@ -98,26 +107,24 @@ def openapi_types(): """ lazy_import() return { - 'id': (str,), # noqa: E501 - 'values': ([float],), # noqa: E501 - 'sparse_values': (SparseValues,), # noqa: E501 - 'metadata': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 + "id": (str,), # noqa: E501 + "values": ([float],), # noqa: E501 + "sparse_values": (SparseValues,), # noqa: E501 + "metadata": ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501 } @cached_property def discriminator(): return None - attribute_map = { - 'id': 'id', # noqa: E501 - 'values': 'values', # noqa: E501 - 'sparse_values': 'sparseValues', # noqa: E501 - 'metadata': 'metadata', # noqa: E501 + "id": "id", # noqa: E501 + "values": "values", # noqa: E501 + "sparse_values": "sparseValues", # noqa: E501 + "metadata": "metadata", # noqa: E501 } - read_only_vars = { - } + read_only_vars = {} _composed_schemas = {} @@ -165,17 +172,18 @@ def _from_openapi_data(cls, id, values, *args, **kwargs): # noqa: E501 metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): This is the metadata included in the request.. [optional] # noqa: E501 """ - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) self = super(OpenApiModel, cls).__new__(cls) if args: raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -193,23 +201,27 @@ def _from_openapi_data(cls, id, values, *args, **kwargs): # noqa: E501 self.id = id self.values = values for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + required_properties = set( + [ + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) @convert_js_args_to_python_args def __init__(self, id, values, *args, **kwargs): # noqa: E501 @@ -254,15 +266,16 @@ def __init__(self, id, values, *args, **kwargs): # noqa: E501 metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): This is the metadata included in the request.. [optional] # noqa: E501 """ - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) if args: raise ApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % ( args, self.__class__.__name__, ), @@ -280,13 +293,17 @@ def __init__(self, id, values, *args, **kwargs): # noqa: E501 self.id = id self.values = values for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + raise ApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/pinecone/core/client/model_utils.py b/pinecone/core/client/model_utils.py index d9f36f88..517a9f0d 100644 --- a/pinecone/core/client/model_utils.py +++ b/pinecone/core/client/model_utils.py @@ -36,6 +36,7 @@ def convert_js_args_to_python_args(fn): from functools import wraps + @wraps(fn) def wrapped_init(_self, *args, **kwargs): """ @@ -43,10 +44,11 @@ def wrapped_init(_self, *args, **kwargs): parameter of a class method. During generation, `self` attributes are mapped to `_self` in models. Here, we name `_self` instead of `self` to avoid conflicts. """ - spec_property_naming = kwargs.get('_spec_property_naming', False) + spec_property_naming = kwargs.get("_spec_property_naming", False) if spec_property_naming: kwargs = change_keys_js_to_python(kwargs, _self if isinstance(_self, type) else _self.__class__) return fn(_self, *args, **kwargs) + return wrapped_init @@ -54,7 +56,7 @@ class cached_property(object): # this caches the result of the function call for fn with no inputs # use this as a decorator on function methods that you want converted # into cached properties - result_key = '_results' + result_key = "_results" def __init__(self, fn): self._fn = fn @@ -70,6 +72,7 @@ def __get__(self, instance, cls=None): PRIMITIVE_TYPES = (list, float, int, bool, datetime, date, str, file_type) + def allows_single_value_input(cls): """ This function returns True if the input composed schema model or any @@ -83,17 +86,15 @@ def allows_single_value_input(cls): - null TODO: lru_cache this """ - if ( - issubclass(cls, ModelSimple) or - cls in PRIMITIVE_TYPES - ): + if issubclass(cls, ModelSimple) or cls in PRIMITIVE_TYPES: return True elif issubclass(cls, ModelComposed): - if not cls._composed_schemas['oneOf']: + if not cls._composed_schemas["oneOf"]: return False - return any(allows_single_value_input(c) for c in cls._composed_schemas['oneOf']) + return any(allows_single_value_input(c) for c in cls._composed_schemas["oneOf"]) return False + def composed_model_input_classes(cls): """ This function returns a list of the possible models that can be accepted as @@ -108,11 +109,11 @@ def composed_model_input_classes(cls): else: return get_discriminated_classes(cls) elif issubclass(cls, ModelComposed): - if not cls._composed_schemas['oneOf']: + if not cls._composed_schemas["oneOf"]: return [] if cls.discriminator is None: input_classes = [] - for c in cls._composed_schemas['oneOf']: + for c in cls._composed_schemas["oneOf"]: input_classes.extend(composed_model_input_classes(c)) return input_classes else: @@ -134,46 +135,28 @@ def set_attribute(self, name, value): if name in self.openapi_types: required_types_mixed = self.openapi_types[name] elif self.additional_properties_type is None: - raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - path_to_item - ) + raise ApiAttributeError("{0} has no attribute '{1}'".format(type(self).__name__, name), path_to_item) elif self.additional_properties_type is not None: required_types_mixed = self.additional_properties_type if get_simple_class(name) != str: - error_msg = type_error_message( - var_name=name, - var_value=name, - valid_classes=(str,), - key_type=True - ) - raise ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=(str,), - key_type=True - ) + error_msg = type_error_message(var_name=name, var_value=name, valid_classes=(str,), key_type=True) + raise ApiTypeError(error_msg, path_to_item=path_to_item, valid_classes=(str,), key_type=True) if self._check_type: value = validate_and_convert_types( - value, required_types_mixed, path_to_item, self._spec_property_naming, - self._check_type, configuration=self._configuration) - if (name,) in self.allowed_values: - check_allowed_values( - self.allowed_values, - (name,), - value - ) - if (name,) in self.validations: - check_validations( - self.validations, - (name,), value, - self._configuration + required_types_mixed, + path_to_item, + self._spec_property_naming, + self._check_type, + configuration=self._configuration, ) - self.__dict__['_data_store'][name] = value + if (name,) in self.allowed_values: + check_allowed_values(self.allowed_values, (name,), value) + if (name,) in self.validations: + check_validations(self.validations, (name,), value, self._configuration) + self.__dict__["_data_store"][name] = value def __repr__(self): """For `print` and `pprint`""" @@ -207,12 +190,8 @@ def __new__(cls, *args, **kwargs): oneof_instance = get_oneof_instance(cls, model_kwargs, kwargs, model_arg=arg) return oneof_instance - - visited_composed_classes = kwargs.get('_visited_composed_classes', ()) - if ( - cls.discriminator is None or - cls in visited_composed_classes - ): + visited_composed_classes = kwargs.get("_visited_composed_classes", ()) + if cls.discriminator is None or cls in visited_composed_classes: # Use case 1: this openapi schema (cls) does not have a discriminator # Use case 2: we have already visited this class before and are sure that we # want to instantiate it this time. We have visited this class deserializing @@ -242,28 +221,24 @@ def __new__(cls, *args, **kwargs): discr_value = kwargs[discr_propertyname_py] else: # The input data does not contain the discriminator property. - path_to_item = kwargs.get('_path_to_item', ()) + path_to_item = kwargs.get("_path_to_item", ()) raise ApiValueError( "Cannot deserialize input data due to missing discriminator. " - "The discriminator property '%s' is missing at path: %s" % - (discr_propertyname_js, path_to_item) + "The discriminator property '%s' is missing at path: %s" % (discr_propertyname_js, path_to_item) ) # Implementation note: the last argument to get_discriminator_class # is a list of visited classes. get_discriminator_class may recursively # call itself and update the list of visited classes, and the initial # value must be an empty list. Hence not using 'visited_composed_classes' - new_cls = get_discriminator_class( - cls, discr_propertyname_py, discr_value, []) + new_cls = get_discriminator_class(cls, discr_propertyname_py, discr_value, []) if new_cls is None: - path_to_item = kwargs.get('_path_to_item', ()) - disc_prop_value = kwargs.get( - discr_propertyname_js, kwargs.get(discr_propertyname_py)) + path_to_item = kwargs.get("_path_to_item", ()) + disc_prop_value = kwargs.get(discr_propertyname_js, kwargs.get(discr_propertyname_py)) raise ApiValueError( "Cannot deserialize input data due to invalid discriminator " "value. The OpenAPI document has no mapping for discriminator " - "property '%s'='%s' at path: %s" % - (discr_propertyname_js, disc_prop_value, path_to_item) + "property '%s'='%s' at path: %s" % (discr_propertyname_js, disc_prop_value, path_to_item) ) if new_cls in visited_composed_classes: @@ -288,13 +263,11 @@ def __new__(cls, *args, **kwargs): # Build a list containing all oneOf and anyOf descendants. oneof_anyof_classes = None if cls._composed_schemas is not None: - oneof_anyof_classes = ( - cls._composed_schemas.get('oneOf', ()) + - cls._composed_schemas.get('anyOf', ())) + oneof_anyof_classes = cls._composed_schemas.get("oneOf", ()) + cls._composed_schemas.get("anyOf", ()) oneof_anyof_child = new_cls in oneof_anyof_classes - kwargs['_visited_composed_classes'] = visited_composed_classes + (cls,) + kwargs["_visited_composed_classes"] = visited_composed_classes + (cls,) - if cls._composed_schemas.get('allOf') and oneof_anyof_child: + if cls._composed_schemas.get("allOf") and oneof_anyof_child: # Validate that we can make self because when we make the # new_cls it will not include the allOf validations in self self_inst = super(OpenApiModel, cls).__new__(cls) @@ -304,7 +277,6 @@ def __new__(cls, *args, **kwargs): new_inst.__init__(*args, **kwargs) return new_inst - @classmethod @convert_js_args_to_python_args def _new_from_openapi_data(cls, *args, **kwargs): @@ -323,12 +295,8 @@ def _new_from_openapi_data(cls, *args, **kwargs): oneof_instance = get_oneof_instance(cls, model_kwargs, kwargs, model_arg=arg) return oneof_instance - - visited_composed_classes = kwargs.get('_visited_composed_classes', ()) - if ( - cls.discriminator is None or - cls in visited_composed_classes - ): + visited_composed_classes = kwargs.get("_visited_composed_classes", ()) + if cls.discriminator is None or cls in visited_composed_classes: # Use case 1: this openapi schema (cls) does not have a discriminator # Use case 2: we have already visited this class before and are sure that we # want to instantiate it this time. We have visited this class deserializing @@ -358,28 +326,24 @@ def _new_from_openapi_data(cls, *args, **kwargs): discr_value = kwargs[discr_propertyname_py] else: # The input data does not contain the discriminator property. - path_to_item = kwargs.get('_path_to_item', ()) + path_to_item = kwargs.get("_path_to_item", ()) raise ApiValueError( "Cannot deserialize input data due to missing discriminator. " - "The discriminator property '%s' is missing at path: %s" % - (discr_propertyname_js, path_to_item) + "The discriminator property '%s' is missing at path: %s" % (discr_propertyname_js, path_to_item) ) # Implementation note: the last argument to get_discriminator_class # is a list of visited classes. get_discriminator_class may recursively # call itself and update the list of visited classes, and the initial # value must be an empty list. Hence not using 'visited_composed_classes' - new_cls = get_discriminator_class( - cls, discr_propertyname_py, discr_value, []) + new_cls = get_discriminator_class(cls, discr_propertyname_py, discr_value, []) if new_cls is None: - path_to_item = kwargs.get('_path_to_item', ()) - disc_prop_value = kwargs.get( - discr_propertyname_js, kwargs.get(discr_propertyname_py)) + path_to_item = kwargs.get("_path_to_item", ()) + disc_prop_value = kwargs.get(discr_propertyname_js, kwargs.get(discr_propertyname_py)) raise ApiValueError( "Cannot deserialize input data due to invalid discriminator " "value. The OpenAPI document has no mapping for discriminator " - "property '%s'='%s' at path: %s" % - (discr_propertyname_js, disc_prop_value, path_to_item) + "property '%s'='%s' at path: %s" % (discr_propertyname_js, disc_prop_value, path_to_item) ) if new_cls in visited_composed_classes: @@ -404,18 +368,15 @@ def _new_from_openapi_data(cls, *args, **kwargs): # Build a list containing all oneOf and anyOf descendants. oneof_anyof_classes = None if cls._composed_schemas is not None: - oneof_anyof_classes = ( - cls._composed_schemas.get('oneOf', ()) + - cls._composed_schemas.get('anyOf', ())) + oneof_anyof_classes = cls._composed_schemas.get("oneOf", ()) + cls._composed_schemas.get("anyOf", ()) oneof_anyof_child = new_cls in oneof_anyof_classes - kwargs['_visited_composed_classes'] = visited_composed_classes + (cls,) + kwargs["_visited_composed_classes"] = visited_composed_classes + (cls,) - if cls._composed_schemas.get('allOf') and oneof_anyof_child: + if cls._composed_schemas.get("allOf") and oneof_anyof_child: # Validate that we can make self because when we make the # new_cls it will not include the allOf validations in self self_inst = cls._from_openapi_data(*args, **kwargs) - new_inst = new_cls._new_from_openapi_data(*args, **kwargs) return new_inst @@ -437,7 +398,7 @@ def get(self, name, default=None): if name in self.required_properties: return self.__dict__[name] - return self.__dict__['_data_store'].get(name, default) + return self.__dict__["_data_store"].get(name, default) def __getitem__(self, name): """get the value of an attribute using square-bracket notation: `instance[attr]`""" @@ -445,9 +406,7 @@ def __getitem__(self, name): return self.get(name) raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - [e for e in [self._path_to_item, name] if e] + "{0} has no attribute '{1}'".format(type(self).__name__, name), [e for e in [self._path_to_item, name] if e] ) def __contains__(self, name): @@ -455,7 +414,7 @@ def __contains__(self, name): if name in self.required_properties: return name in self.__dict__ - return name in self.__dict__['_data_store'] + return name in self.__dict__["_data_store"] def to_str(self): """Returns the string representation of the model""" @@ -466,8 +425,8 @@ def __eq__(self, other): if not isinstance(other, self.__class__): return False - this_val = self._data_store['value'] - that_val = other._data_store['value'] + this_val = self._data_store["value"] + that_val = other._data_store["value"] types = set() types.add(this_val.__class__) types.add(that_val.__class__) @@ -492,7 +451,7 @@ def get(self, name, default=None): if name in self.required_properties: return self.__dict__[name] - return self.__dict__['_data_store'].get(name, default) + return self.__dict__["_data_store"].get(name, default) def __getitem__(self, name): """get the value of an attribute using square-bracket notation: `instance[attr]`""" @@ -500,9 +459,7 @@ def __getitem__(self, name): return self.get(name) raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - [e for e in [self._path_to_item, name] if e] + "{0} has no attribute '{1}'".format(type(self).__name__, name), [e for e in [self._path_to_item, name] if e] ) def __contains__(self, name): @@ -510,7 +467,7 @@ def __contains__(self, name): if name in self.required_properties: return name in self.__dict__ - return name in self.__dict__['_data_store'] + return name in self.__dict__["_data_store"] def to_dict(self): """Returns the model properties as a dict""" @@ -595,9 +552,8 @@ def __setitem__(self, name, value): """ if name not in self.openapi_types: raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - [e for e in [self._path_to_item, name] if e] + "{0} has no attribute '{1}'".format(type(self).__name__, name), + [e for e in [self._path_to_item, name] if e], ) # attribute must be set on self and composed instances self.set_attribute(name, value) @@ -605,7 +561,7 @@ def __setitem__(self, name, value): setattr(model_instance, name, value) if name not in self._var_name_to_model_instances: # we assigned an additional property - self.__dict__['_var_name_to_model_instances'][name] = self._composed_instances + [self] + self.__dict__["_var_name_to_model_instances"][name] = self._composed_instances + [self] return None __unset_attribute_value__ = object() @@ -638,7 +594,7 @@ def get(self, name, default=None): "Values stored for property {0} in {1} differ when looking " "at self and self's composed instances. All values must be " "the same".format(name, type(self).__name__), - [e for e in [self._path_to_item, name] if e] + [e for e in [self._path_to_item, name] if e], ) def __getitem__(self, name): @@ -646,9 +602,8 @@ def __getitem__(self, name): value = self.get(name, self.__unset_attribute_value__) if value is self.__unset_attribute_value__: raise ApiAttributeError( - "{0} has no attribute '{1}'".format( - type(self).__name__, name), - [e for e in [self._path_to_item, name] if e] + "{0} has no attribute '{1}'".format(type(self).__name__, name), + [e for e in [self._path_to_item, name] if e], ) return value @@ -658,8 +613,7 @@ def __contains__(self, name): if name in self.required_properties: return name in self.__dict__ - model_instances = self._var_name_to_model_instances.get( - name, self._additional_properties_model_instances) + model_instances = self._var_name_to_model_instances.get(name, self._additional_properties_model_instances) if model_instances: for model_instance in model_instances: @@ -698,7 +652,7 @@ def __eq__(self, other): ModelComposed: 0, ModelNormal: 1, ModelSimple: 2, - none_type: 3, # The type of 'None'. + none_type: 3, # The type of 'None'. list: 4, dict: 5, float: 6, @@ -707,7 +661,7 @@ def __eq__(self, other): datetime: 9, date: 10, str: 11, - file_type: 12, # 'file_type' is an alias for the built-in 'file' or 'io.IOBase' type. + file_type: 12, # 'file_type' is an alias for the built-in 'file' or 'io.IOBase' type. } # these are used to limit what type conversions we try to do @@ -716,7 +670,7 @@ def __eq__(self, other): UPCONVERSION_TYPE_PAIRS = ( (str, datetime), (str, date), - (int, float), # A float may be serialized as an integer, e.g. '3' is a valid serialized float. + (int, float), # A float may be serialized as an integer, e.g. '3' is a valid serialized float. (list, ModelComposed), (dict, ModelComposed), (str, ModelComposed), @@ -763,7 +717,7 @@ def __eq__(self, other): (str, date), # (int, str), # (float, str), - (str, file_type) + (str, file_type), ), } @@ -820,41 +774,22 @@ def check_allowed_values(allowed_values, input_variable_path, input_values): are checking to see if they are in allowed_values """ these_allowed_values = list(allowed_values[input_variable_path].values()) - if (isinstance(input_values, list) - and not set(input_values).issubset( - set(these_allowed_values))): - invalid_values = ", ".join( - map(str, set(input_values) - set(these_allowed_values))), + if isinstance(input_values, list) and not set(input_values).issubset(set(these_allowed_values)): + invalid_values = (", ".join(map(str, set(input_values) - set(these_allowed_values))),) raise ApiValueError( - "Invalid values for `%s` [%s], must be a subset of [%s]" % - ( - input_variable_path[0], - invalid_values, - ", ".join(map(str, these_allowed_values)) - ) + "Invalid values for `%s` [%s], must be a subset of [%s]" + % (input_variable_path[0], invalid_values, ", ".join(map(str, these_allowed_values))) ) - elif (isinstance(input_values, dict) - and not set( - input_values.keys()).issubset(set(these_allowed_values))): - invalid_values = ", ".join( - map(str, set(input_values.keys()) - set(these_allowed_values))) + elif isinstance(input_values, dict) and not set(input_values.keys()).issubset(set(these_allowed_values)): + invalid_values = ", ".join(map(str, set(input_values.keys()) - set(these_allowed_values))) raise ApiValueError( - "Invalid keys in `%s` [%s], must be a subset of [%s]" % - ( - input_variable_path[0], - invalid_values, - ", ".join(map(str, these_allowed_values)) - ) + "Invalid keys in `%s` [%s], must be a subset of [%s]" + % (input_variable_path[0], invalid_values, ", ".join(map(str, these_allowed_values))) ) - elif (not isinstance(input_values, (list, dict)) - and input_values not in these_allowed_values): + elif not isinstance(input_values, (list, dict)) and input_values not in these_allowed_values: raise ApiValueError( - "Invalid value for `%s` (%s), must be one of %s" % - ( - input_variable_path[0], - input_values, - these_allowed_values - ) + "Invalid value for `%s` (%s), must be one of %s" + % (input_variable_path[0], input_values, these_allowed_values) ) @@ -868,14 +803,14 @@ def is_json_validation_enabled(schema_keyword, configuration=None): configuration (Configuration): the configuration class. """ - return (configuration is None or - not hasattr(configuration, '_disabled_client_side_validations') or - schema_keyword not in configuration._disabled_client_side_validations) + return ( + configuration is None + or not hasattr(configuration, "_disabled_client_side_validations") + or schema_keyword not in configuration._disabled_client_side_validations + ) -def check_validations( - validations, input_variable_path, input_values, - configuration=None): +def check_validations(validations, input_variable_path, input_values, configuration=None): """Raises an exception if the input_values are invalid Args: @@ -890,66 +825,60 @@ def check_validations( return current_validations = validations[input_variable_path] - if (is_json_validation_enabled('multipleOf', configuration) and - 'multiple_of' in current_validations and - isinstance(input_values, (int, float)) and - not (float(input_values) / current_validations['multiple_of']).is_integer()): + if ( + is_json_validation_enabled("multipleOf", configuration) + and "multiple_of" in current_validations + and isinstance(input_values, (int, float)) + and not (float(input_values) / current_validations["multiple_of"]).is_integer() + ): # Note 'multipleOf' will be as good as the floating point arithmetic. raise ApiValueError( "Invalid value for `%s`, value must be a multiple of " - "`%s`" % ( - input_variable_path[0], - current_validations['multiple_of'] - ) + "`%s`" % (input_variable_path[0], current_validations["multiple_of"]) ) - if (is_json_validation_enabled('maxLength', configuration) and - 'max_length' in current_validations and - len(input_values) > current_validations['max_length']): + if ( + is_json_validation_enabled("maxLength", configuration) + and "max_length" in current_validations + and len(input_values) > current_validations["max_length"] + ): raise ApiValueError( "Invalid value for `%s`, length must be less than or equal to " - "`%s`" % ( - input_variable_path[0], - current_validations['max_length'] - ) + "`%s`" % (input_variable_path[0], current_validations["max_length"]) ) - if (is_json_validation_enabled('minLength', configuration) and - 'min_length' in current_validations and - len(input_values) < current_validations['min_length']): + if ( + is_json_validation_enabled("minLength", configuration) + and "min_length" in current_validations + and len(input_values) < current_validations["min_length"] + ): raise ApiValueError( "Invalid value for `%s`, length must be greater than or equal to " - "`%s`" % ( - input_variable_path[0], - current_validations['min_length'] - ) + "`%s`" % (input_variable_path[0], current_validations["min_length"]) ) - if (is_json_validation_enabled('maxItems', configuration) and - 'max_items' in current_validations and - len(input_values) > current_validations['max_items']): + if ( + is_json_validation_enabled("maxItems", configuration) + and "max_items" in current_validations + and len(input_values) > current_validations["max_items"] + ): raise ApiValueError( "Invalid value for `%s`, number of items must be less than or " - "equal to `%s`" % ( - input_variable_path[0], - current_validations['max_items'] - ) + "equal to `%s`" % (input_variable_path[0], current_validations["max_items"]) ) - if (is_json_validation_enabled('minItems', configuration) and - 'min_items' in current_validations and - len(input_values) < current_validations['min_items']): + if ( + is_json_validation_enabled("minItems", configuration) + and "min_items" in current_validations + and len(input_values) < current_validations["min_items"] + ): raise ValueError( "Invalid value for `%s`, number of items must be greater than or " - "equal to `%s`" % ( - input_variable_path[0], - current_validations['min_items'] - ) + "equal to `%s`" % (input_variable_path[0], current_validations["min_items"]) ) - items = ('exclusive_maximum', 'inclusive_maximum', 'exclusive_minimum', - 'inclusive_minimum') - if (any(item in current_validations for item in items)): + items = ("exclusive_maximum", "inclusive_maximum", "exclusive_minimum", "inclusive_minimum") + if any(item in current_validations for item in items): if isinstance(input_values, list): max_val = max(input_values) min_val = min(input_values) @@ -960,57 +889,55 @@ def check_validations( max_val = input_values min_val = input_values - if (is_json_validation_enabled('exclusiveMaximum', configuration) and - 'exclusive_maximum' in current_validations and - max_val >= current_validations['exclusive_maximum']): + if ( + is_json_validation_enabled("exclusiveMaximum", configuration) + and "exclusive_maximum" in current_validations + and max_val >= current_validations["exclusive_maximum"] + ): raise ApiValueError( - "Invalid value for `%s`, must be a value less than `%s`" % ( - input_variable_path[0], - current_validations['exclusive_maximum'] - ) + "Invalid value for `%s`, must be a value less than `%s`" + % (input_variable_path[0], current_validations["exclusive_maximum"]) ) - if (is_json_validation_enabled('maximum', configuration) and - 'inclusive_maximum' in current_validations and - max_val > current_validations['inclusive_maximum']): + if ( + is_json_validation_enabled("maximum", configuration) + and "inclusive_maximum" in current_validations + and max_val > current_validations["inclusive_maximum"] + ): raise ApiValueError( "Invalid value for `%s`, must be a value less than or equal to " - "`%s`" % ( - input_variable_path[0], - current_validations['inclusive_maximum'] - ) + "`%s`" % (input_variable_path[0], current_validations["inclusive_maximum"]) ) - if (is_json_validation_enabled('exclusiveMinimum', configuration) and - 'exclusive_minimum' in current_validations and - min_val <= current_validations['exclusive_minimum']): + if ( + is_json_validation_enabled("exclusiveMinimum", configuration) + and "exclusive_minimum" in current_validations + and min_val <= current_validations["exclusive_minimum"] + ): raise ApiValueError( - "Invalid value for `%s`, must be a value greater than `%s`" % - ( - input_variable_path[0], - current_validations['exclusive_maximum'] - ) + "Invalid value for `%s`, must be a value greater than `%s`" + % (input_variable_path[0], current_validations["exclusive_maximum"]) ) - if (is_json_validation_enabled('minimum', configuration) and - 'inclusive_minimum' in current_validations and - min_val < current_validations['inclusive_minimum']): + if ( + is_json_validation_enabled("minimum", configuration) + and "inclusive_minimum" in current_validations + and min_val < current_validations["inclusive_minimum"] + ): raise ApiValueError( "Invalid value for `%s`, must be a value greater than or equal " - "to `%s`" % ( - input_variable_path[0], - current_validations['inclusive_minimum'] - ) + "to `%s`" % (input_variable_path[0], current_validations["inclusive_minimum"]) ) - flags = current_validations.get('regex', {}).get('flags', 0) - if (is_json_validation_enabled('pattern', configuration) and - 'regex' in current_validations and - not re.search(current_validations['regex']['pattern'], - input_values, flags=flags)): + flags = current_validations.get("regex", {}).get("flags", 0) + if ( + is_json_validation_enabled("pattern", configuration) + and "regex" in current_validations + and not re.search(current_validations["regex"]["pattern"], input_values, flags=flags) + ): err_msg = r"Invalid value for `%s`, must match regular expression `%s`" % ( - input_variable_path[0], - current_validations['regex']['pattern'] - ) + input_variable_path[0], + current_validations["regex"]["pattern"], + ) if flags != 0: # Don't print the regex flags if the flags are not # specified in the OAS document. @@ -1035,28 +962,21 @@ def index_getter(class_or_instance): return COERCION_INDEX_BY_TYPE[list] elif isinstance(class_or_instance, dict): return COERCION_INDEX_BY_TYPE[dict] - elif (inspect.isclass(class_or_instance) - and issubclass(class_or_instance, ModelComposed)): + elif inspect.isclass(class_or_instance) and issubclass(class_or_instance, ModelComposed): return COERCION_INDEX_BY_TYPE[ModelComposed] - elif (inspect.isclass(class_or_instance) - and issubclass(class_or_instance, ModelNormal)): + elif inspect.isclass(class_or_instance) and issubclass(class_or_instance, ModelNormal): return COERCION_INDEX_BY_TYPE[ModelNormal] - elif (inspect.isclass(class_or_instance) - and issubclass(class_or_instance, ModelSimple)): + elif inspect.isclass(class_or_instance) and issubclass(class_or_instance, ModelSimple): return COERCION_INDEX_BY_TYPE[ModelSimple] elif class_or_instance in COERCION_INDEX_BY_TYPE: return COERCION_INDEX_BY_TYPE[class_or_instance] raise ApiValueError("Unsupported type: %s" % class_or_instance) - sorted_types = sorted( - required_types, - key=lambda class_or_instance: index_getter(class_or_instance) - ) + sorted_types = sorted(required_types, key=lambda class_or_instance: index_getter(class_or_instance)) return sorted_types -def remove_uncoercible(required_types_classes, current_item, spec_property_naming, - must_convert=True): +def remove_uncoercible(required_types_classes, current_item, spec_property_naming, must_convert=True): """Only keeps the type conversions that are possible Args: @@ -1101,6 +1021,7 @@ def remove_uncoercible(required_types_classes, current_item, spec_property_namin results_classes.append(required_type_class) return results_classes + def get_discriminated_classes(cls): """ Returns all the classes that a discriminator converts to @@ -1111,7 +1032,7 @@ def get_discriminated_classes(cls): if is_type_nullable(cls): possible_classes.append(cls) for discr_cls in cls.discriminator[key].values(): - if hasattr(discr_cls, 'discriminator') and discr_cls.discriminator is not None: + if hasattr(discr_cls, "discriminator") and discr_cls.discriminator is not None: possible_classes.extend(get_discriminated_classes(discr_cls)) else: possible_classes.append(discr_cls) @@ -1123,7 +1044,7 @@ def get_possible_classes(cls, from_server_context): possible_classes = [cls] if from_server_context: return possible_classes - if hasattr(cls, 'discriminator') and cls.discriminator is not None: + if hasattr(cls, "discriminator") and cls.discriminator is not None: possible_classes = [] possible_classes.extend(get_discriminated_classes(cls)) elif issubclass(cls, ModelComposed): @@ -1179,11 +1100,10 @@ def change_keys_js_to_python(input_dict, model_class): document). """ - if getattr(model_class, 'attribute_map', None) is None: + if getattr(model_class, "attribute_map", None) is None: return input_dict output_dict = {} - reversed_attr_map = {value: key for key, value in - model_class.attribute_map.items()} + reversed_attr_map = {value: key for key, value in model_class.attribute_map.items()} for javascript_key, value in input_dict.items(): python_key = reversed_attr_map.get(javascript_key) if python_key is None: @@ -1196,17 +1116,9 @@ def change_keys_js_to_python(input_dict, model_class): def get_type_error(var_value, path_to_item, valid_classes, key_type=False): error_msg = type_error_message( - var_name=path_to_item[-1], - var_value=var_value, - valid_classes=valid_classes, - key_type=key_type - ) - return ApiTypeError( - error_msg, - path_to_item=path_to_item, - valid_classes=valid_classes, - key_type=key_type + var_name=path_to_item[-1], var_value=var_value, valid_classes=valid_classes, key_type=key_type ) + return ApiTypeError(error_msg, path_to_item=path_to_item, valid_classes=valid_classes, key_type=key_type) def deserialize_primitive(data, klass, path_to_item): @@ -1231,11 +1143,11 @@ def deserialize_primitive(data, klass, path_to_item): # The string should be in iso8601 datetime format. parsed_datetime = parse(data) date_only = ( - parsed_datetime.hour == 0 and - parsed_datetime.minute == 0 and - parsed_datetime.second == 0 and - parsed_datetime.tzinfo is None and - 8 <= len(data) <= 10 + parsed_datetime.hour == 0 + and parsed_datetime.minute == 0 + and parsed_datetime.second == 0 + and parsed_datetime.tzinfo is None + and 8 <= len(data) <= 10 ) if date_only: raise ValueError("This is a date, not a datetime") @@ -1249,21 +1161,17 @@ def deserialize_primitive(data, klass, path_to_item): if isinstance(data, str) and klass == float: if str(converted_value) != data: # '7' -> 7.0 -> '7.0' != '7' - raise ValueError('This is not a float') + raise ValueError("This is not a float") return converted_value except (OverflowError, ValueError) as ex: # parse can raise OverflowError raise ApiValueError( - "{0}Failed to parse {1} as {2}".format( - additional_message, repr(data), klass.__name__ - ), - path_to_item=path_to_item + "{0}Failed to parse {1} as {2}".format(additional_message, repr(data), klass.__name__), + path_to_item=path_to_item, ) from ex -def get_discriminator_class(model_class, - discr_name, - discr_value, cls_visited): +def get_discriminator_class(model_class, discr_name, discr_value, cls_visited): """Returns the child class specified by the discriminator. Args: @@ -1299,22 +1207,21 @@ def get_discriminator_class(model_class, # Descendant example: mammal -> whale/zebra/Pig -> BasquePig/DanishPig # if we try to make BasquePig from mammal, we need to travel through # the oneOf descendant discriminators to find BasquePig - descendant_classes = model_class._composed_schemas.get('oneOf', ()) + \ - model_class._composed_schemas.get('anyOf', ()) - ancestor_classes = model_class._composed_schemas.get('allOf', ()) + descendant_classes = model_class._composed_schemas.get("oneOf", ()) + model_class._composed_schemas.get( + "anyOf", () + ) + ancestor_classes = model_class._composed_schemas.get("allOf", ()) possible_classes = descendant_classes + ancestor_classes for cls in possible_classes: # Check if the schema has inherited discriminators. - if hasattr(cls, 'discriminator') and cls.discriminator is not None: - used_model_class = get_discriminator_class( - cls, discr_name, discr_value, cls_visited) + if hasattr(cls, "discriminator") and cls.discriminator is not None: + used_model_class = get_discriminator_class(cls, discr_name, discr_value, cls_visited) if used_model_class is not None: return used_model_class return used_model_class -def deserialize_model(model_data, model_class, path_to_item, check_type, - configuration, spec_property_naming): +def deserialize_model(model_data, model_class, path_to_item, check_type, configuration, spec_property_naming): """Deserializes model_data to model instance. Args: @@ -1338,10 +1245,12 @@ def deserialize_model(model_data, model_class, path_to_item, check_type, ApiKeyError """ - kw_args = dict(_check_type=check_type, - _path_to_item=path_to_item, - _configuration=configuration, - _spec_property_naming=spec_property_naming) + kw_args = dict( + _check_type=check_type, + _path_to_item=path_to_item, + _configuration=configuration, + _spec_property_naming=spec_property_naming, + ) if issubclass(model_class, ModelSimple): return model_class._new_from_openapi_data(model_data, **kw_args) @@ -1377,23 +1286,29 @@ def deserialize_file(response_data, configuration, content_disposition=None): os.remove(path) if content_disposition: - filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', - content_disposition).group(1) + filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', content_disposition).group(1) path = os.path.join(os.path.dirname(path), filename) with open(path, "wb") as f: if isinstance(response_data, str): # change str to bytes so we can write it - response_data = response_data.encode('utf-8') + response_data = response_data.encode("utf-8") f.write(response_data) f = open(path, "rb") return f -def attempt_convert_item(input_value, valid_classes, path_to_item, - configuration, spec_property_naming, key_type=False, - must_convert=False, check_type=True): +def attempt_convert_item( + input_value, + valid_classes, + path_to_item, + configuration, + spec_property_naming, + key_type=False, + must_convert=False, + check_type=True, +): """ Args: input_value (any): the data to convert @@ -1418,24 +1333,21 @@ def attempt_convert_item(input_value, valid_classes, path_to_item, ApiKeyError """ valid_classes_ordered = order_response_types(valid_classes) - valid_classes_coercible = remove_uncoercible( - valid_classes_ordered, input_value, spec_property_naming) + valid_classes_coercible = remove_uncoercible(valid_classes_ordered, input_value, spec_property_naming) if not valid_classes_coercible or key_type: # we do not handle keytype errors, json will take care # of this for us if configuration is None or not configuration.discard_unknown_keys: - raise get_type_error(input_value, path_to_item, valid_classes, - key_type=key_type) + raise get_type_error(input_value, path_to_item, valid_classes, key_type=key_type) for valid_class in valid_classes_coercible: try: if issubclass(valid_class, OpenApiModel): - return deserialize_model(input_value, valid_class, - path_to_item, check_type, - configuration, spec_property_naming) + return deserialize_model( + input_value, valid_class, path_to_item, check_type, configuration, spec_property_naming + ) elif valid_class == file_type: return deserialize_file(input_value, configuration) - return deserialize_primitive(input_value, valid_class, - path_to_item) + return deserialize_primitive(input_value, valid_class, path_to_item) except (ApiTypeError, ApiValueError, ApiKeyError) as conversion_exc: if must_convert: raise conversion_exc @@ -1467,10 +1379,12 @@ def is_type_nullable(input_type): return True if issubclass(input_type, ModelComposed): # If oneOf/anyOf, check if the 'null' type is one of the allowed types. - for t in input_type._composed_schemas.get('oneOf', ()): - if is_type_nullable(t): return True - for t in input_type._composed_schemas.get('anyOf', ()): - if is_type_nullable(t): return True + for t in input_type._composed_schemas.get("oneOf", ()): + if is_type_nullable(t): + return True + for t in input_type._composed_schemas.get("anyOf", ()): + if is_type_nullable(t): + return True return False @@ -1485,9 +1399,7 @@ def is_valid_type(input_class_simple, valid_classes): bool """ valid_type = input_class_simple in valid_classes - if not valid_type and ( - issubclass(input_class_simple, OpenApiModel) or - input_class_simple is none_type): + if not valid_type and (issubclass(input_class_simple, OpenApiModel) or input_class_simple is none_type): for valid_class in valid_classes: if input_class_simple is none_type and is_type_nullable(valid_class): # Schema is oneOf/anyOf and the 'null' type is one of the allowed types. @@ -1495,17 +1407,16 @@ def is_valid_type(input_class_simple, valid_classes): if not (issubclass(valid_class, OpenApiModel) and valid_class.discriminator): continue discr_propertyname_py = list(valid_class.discriminator.keys())[0] - discriminator_classes = ( - valid_class.discriminator[discr_propertyname_py].values() - ) + discriminator_classes = valid_class.discriminator[discr_propertyname_py].values() valid_type = is_valid_type(input_class_simple, discriminator_classes) if valid_type: return True return valid_type -def validate_and_convert_types(input_value, required_types_mixed, path_to_item, - spec_property_naming, _check_type, configuration=None): +def validate_and_convert_types( + input_value, required_types_mixed, path_to_item, spec_property_naming, _check_type, configuration=None +): """Raises a TypeError is there is a problem, otherwise returns value Args: @@ -1550,18 +1461,18 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item, spec_property_naming, key_type=False, must_convert=True, - check_type=_check_type + check_type=_check_type, ) return converted_instance else: - raise get_type_error(input_value, path_to_item, valid_classes, - key_type=False) + raise get_type_error(input_value, path_to_item, valid_classes, key_type=False) # input_value's type is in valid_classes if len(valid_classes) > 1 and configuration: # there are valid classes which are not the current class valid_classes_coercible = remove_uncoercible( - valid_classes, input_value, spec_property_naming, must_convert=False) + valid_classes, input_value, spec_property_naming, must_convert=False + ) if valid_classes_coercible: converted_instance = attempt_convert_item( input_value, @@ -1571,7 +1482,7 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item, spec_property_naming, key_type=False, must_convert=False, - check_type=_check_type + check_type=_check_type, ) return converted_instance @@ -1579,9 +1490,7 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item, # all types are of the required types and there are no more inner # variables left to look at return input_value - inner_required_types = child_req_types_by_current_type.get( - type(input_value) - ) + inner_required_types = child_req_types_by_current_type.get(type(input_value)) if inner_required_types is None: # for this type, there are not more inner variables left to look at return input_value @@ -1598,7 +1507,7 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item, inner_path, spec_property_naming, _check_type, - configuration=configuration + configuration=configuration, ) elif isinstance(input_value, dict): if input_value == {}: @@ -1608,15 +1517,14 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item, inner_path = list(path_to_item) inner_path.append(inner_key) if get_simple_class(inner_key) != str: - raise get_type_error(inner_key, inner_path, valid_classes, - key_type=True) + raise get_type_error(inner_key, inner_path, valid_classes, key_type=True) input_value[inner_key] = validate_and_convert_types( inner_val, inner_required_types, inner_path, spec_property_naming, _check_type, - configuration=configuration + configuration=configuration, ) return input_value @@ -1652,29 +1560,31 @@ def model_to_dict(model_instance, serialize=True): except KeyError: used_fallback_python_attribute_names.add(attr) if isinstance(value, list): - if not value: - # empty list or None - result[attr] = value - else: - res = [] - for v in value: - if isinstance(v, PRIMITIVE_TYPES) or v is None: - res.append(v) - elif isinstance(v, ModelSimple): - res.append(v.value) - else: - res.append(model_to_dict(v, serialize=serialize)) - result[attr] = res + if not value: + # empty list or None + result[attr] = value + else: + res = [] + for v in value: + if isinstance(v, PRIMITIVE_TYPES) or v is None: + res.append(v) + elif isinstance(v, ModelSimple): + res.append(v.value) + else: + res.append(model_to_dict(v, serialize=serialize)) + result[attr] = res elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], - model_to_dict(item[1], serialize=serialize)) - if hasattr(item[1], '_data_store') else item, - value.items() - )) + result[attr] = dict( + map( + lambda item: (item[0], model_to_dict(item[1], serialize=serialize)) + if hasattr(item[1], "_data_store") + else item, + value.items(), + ) + ) elif isinstance(value, ModelSimple): result[attr] = value.value - elif hasattr(value, '_data_store'): + elif hasattr(value, "_data_store"): result[attr] = model_to_dict(value, serialize=serialize) else: result[attr] = value @@ -1692,8 +1602,7 @@ def model_to_dict(model_instance, serialize=True): return result -def type_error_message(var_value=None, var_name=None, valid_classes=None, - key_type=None): +def type_error_message(var_value=None, var_name=None, valid_classes=None, key_type=None): """ Keyword Args: var_value (any): the variable which has the type_error @@ -1704,30 +1613,26 @@ def type_error_message(var_value=None, var_name=None, valid_classes=None, True if it is a key in a dict False if our item is an item in a list """ - key_or_value = 'value' + key_or_value = "value" if key_type: - key_or_value = 'key' + key_or_value = "key" valid_classes_phrase = get_valid_classes_phrase(valid_classes) - msg = ( - "Invalid type for variable '{0}'. Required {1} type {2} and " - "passed type was {3}".format( - var_name, - key_or_value, - valid_classes_phrase, - type(var_value).__name__, - ) + msg = "Invalid type for variable '{0}'. Required {1} type {2} and " "passed type was {3}".format( + var_name, + key_or_value, + valid_classes_phrase, + type(var_value).__name__, ) return msg def get_valid_classes_phrase(input_classes): - """Returns a string phrase describing what types are allowed - """ + """Returns a string phrase describing what types are allowed""" all_classes = list(input_classes) all_classes = sorted(all_classes, key=lambda cls: cls.__name__) all_class_names = [cls.__name__ for cls in all_classes] if len(all_class_names) == 1: - return 'is {0}'.format(all_class_names[0]) + return "is {0}".format(all_class_names[0]) return "is one of [{0}]".format(", ".join(all_class_names)) @@ -1749,8 +1654,7 @@ def get_allof_instances(self, model_args, constant_args): composed_instances (list) """ composed_instances = [] - for allof_class in self._composed_schemas['allOf']: - + for allof_class in self._composed_schemas["allOf"]: try: allof_instance = allof_class(**model_args, **constant_args) composed_instances.append(allof_instance) @@ -1758,12 +1662,7 @@ def get_allof_instances(self, model_args, constant_args): raise ApiValueError( "Invalid inputs given to generate an instance of '%s'. The " "input data was invalid for the allOf schema '%s' in the composed " - "schema '%s'. Error=%s" % ( - allof_class.__name__, - allof_class.__name__, - self.__class__.__name__, - str(ex) - ) + "schema '%s'. Error=%s" % (allof_class.__name__, allof_class.__name__, self.__class__.__name__, str(ex)) ) from ex return composed_instances @@ -1796,13 +1695,13 @@ def get_oneof_instance(cls, model_kwargs, constant_kwargs, model_arg=None): Returns oneof_instance (instance) """ - if len(cls._composed_schemas['oneOf']) == 0: + if len(cls._composed_schemas["oneOf"]) == 0: return None oneof_instances = [] # Iterate over each oneOf schema and determine if the input data # matches the oneOf schemas. - for oneof_class in cls._composed_schemas['oneOf']: + for oneof_class in cls._composed_schemas["oneOf"]: # The composed oneOf schema allows the 'null' type and the input data # is the null value. This is a OAS >= 3.1 feature. if oneof_class is none_type: @@ -1822,10 +1721,10 @@ def get_oneof_instance(cls, model_kwargs, constant_kwargs, model_arg=None): oneof_instance = validate_and_convert_types( model_arg, (oneof_class,), - constant_kwargs['_path_to_item'], - constant_kwargs['_spec_property_naming'], - constant_kwargs['_check_type'], - configuration=constant_kwargs['_configuration'] + constant_kwargs["_path_to_item"], + constant_kwargs["_spec_property_naming"], + constant_kwargs["_check_type"], + configuration=constant_kwargs["_configuration"], ) oneof_instances.append(oneof_instance) except Exception: @@ -1833,14 +1732,12 @@ def get_oneof_instance(cls, model_kwargs, constant_kwargs, model_arg=None): if len(oneof_instances) == 0: raise ApiValueError( "Invalid inputs given to generate an instance of %s. None " - "of the oneOf schemas matched the input data." % - cls.__name__ + "of the oneOf schemas matched the input data." % cls.__name__ ) elif len(oneof_instances) > 1: raise ApiValueError( "Invalid inputs given to generate an instance of %s. Multiple " - "oneOf schemas matched the inputs, but a max of one is allowed." % - cls.__name__ + "oneOf schemas matched the inputs, but a max of one is allowed." % cls.__name__ ) return oneof_instances[0] @@ -1860,10 +1757,10 @@ def get_anyof_instances(self, model_args, constant_args): anyof_instances (list) """ anyof_instances = [] - if len(self._composed_schemas['anyOf']) == 0: + if len(self._composed_schemas["anyOf"]) == 0: return anyof_instances - for anyof_class in self._composed_schemas['anyOf']: + for anyof_class in self._composed_schemas["anyOf"]: # The composed oneOf schema allows the 'null' type and the input data # is the null value. This is a OAS >= 3.1 feature. if anyof_class is none_type: @@ -1879,8 +1776,7 @@ def get_anyof_instances(self, model_args, constant_args): if len(anyof_instances) == 0: raise ApiValueError( "Invalid inputs given to generate an instance of %s. None of the " - "anyOf schemas matched the inputs." % - self.__class__.__name__ + "anyOf schemas matched the inputs." % self.__class__.__name__ ) return anyof_instances @@ -1894,7 +1790,7 @@ def get_discarded_args(self, composed_instances, model_args): # arguments passed to self were already converted to python names # before __init__ was called for instance in composed_instances: - if instance.__class__ in self._composed_schemas['allOf']: + if instance.__class__ in self._composed_schemas["allOf"]: try: keys = instance.to_dict().keys() discarded_keys = model_args - keys @@ -1989,9 +1885,4 @@ def validate_get_composed_info(constant_args, model_args, self): if prop_name not in discarded_args: var_name_to_model_instances[prop_name] = [self] + composed_instances - return [ - composed_instances, - var_name_to_model_instances, - additional_properties_model_instances, - discarded_args - ] + return [composed_instances, var_name_to_model_instances, additional_properties_model_instances, discarded_args] diff --git a/pinecone/core/client/rest.py b/pinecone/core/client/rest.py index a0f04981..d8601ba5 100644 --- a/pinecone/core/client/rest.py +++ b/pinecone/core/client/rest.py @@ -22,14 +22,20 @@ import urllib3 -from pinecone.core.client.exceptions import ApiException, UnauthorizedException, ForbiddenException, NotFoundException, ServiceException, ApiValueError +from pinecone.core.client.exceptions import ( + ApiException, + UnauthorizedException, + ForbiddenException, + NotFoundException, + ServiceException, + ApiValueError, +) logger = logging.getLogger(__name__) class RESTResponse(io.IOBase): - def __init__(self, resp): self.urllib3_response = resp self.status = resp.status @@ -46,7 +52,6 @@ def getheader(self, name, default=None): class RESTClientObject(object): - def __init__(self, configuration, pools_size=4, maxsize=None): # urllib3.PoolManager will pass all kw parameters to connectionpool # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 @@ -62,13 +67,13 @@ def __init__(self, configuration, pools_size=4, maxsize=None): addition_pool_args = {} if configuration.assert_hostname is not None: - addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 + addition_pool_args["assert_hostname"] = configuration.assert_hostname # noqa: E501 if configuration.retries is not None: - addition_pool_args['retries'] = configuration.retries + addition_pool_args["retries"] = configuration.retries if configuration.socket_options is not None: - addition_pool_args['socket_options'] = configuration.socket_options + addition_pool_args["socket_options"] = configuration.socket_options if maxsize is None: if configuration.connection_pool_maxsize is not None: @@ -100,9 +105,17 @@ def __init__(self, configuration, pools_size=4, maxsize=None): **addition_pool_args ) - def request(self, method, url, query_params=None, headers=None, - body=None, post_params=None, _preload_content=True, - _request_timeout=None): + def request( + self, + method, + url, + query_params=None, + headers=None, + body=None, + post_params=None, + _preload_content=True, + _request_timeout=None, + ): """Perform requests. :param method: http request method @@ -122,13 +135,10 @@ def request(self, method, url, query_params=None, headers=None, (connection, read) timeouts. """ method = method.upper() - assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', - 'PATCH', 'OPTIONS'] + assert method in ["GET", "HEAD", "DELETE", "POST", "PUT", "PATCH", "OPTIONS"] if post_params and body: - raise ApiValueError( - "body parameter cannot be used with post_params parameter." - ) + raise ApiValueError("body parameter cannot be used with post_params parameter.") post_params = post_params or {} headers = headers or {} @@ -137,60 +147,66 @@ def request(self, method, url, query_params=None, headers=None, if _request_timeout: if isinstance(_request_timeout, (int, float)): # noqa: E501,F821 timeout = urllib3.Timeout(total=_request_timeout) - elif (isinstance(_request_timeout, tuple) and - len(_request_timeout) == 2): - timeout = urllib3.Timeout( - connect=_request_timeout[0], read=_request_timeout[1]) + elif isinstance(_request_timeout, tuple) and len(_request_timeout) == 2: + timeout = urllib3.Timeout(connect=_request_timeout[0], read=_request_timeout[1]) try: # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` - if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: + if method in ["POST", "PUT", "PATCH", "OPTIONS", "DELETE"]: # Only set a default Content-Type for POST, PUT, PATCH and OPTIONS requests - if (method != 'DELETE') and ('Content-Type' not in headers): - headers['Content-Type'] = 'application/json' + if (method != "DELETE") and ("Content-Type" not in headers): + headers["Content-Type"] = "application/json" if query_params: - url += '?' + urlencode(query_params) - if ('Content-Type' not in headers) or (re.search('json', headers['Content-Type'], re.IGNORECASE)): + url += "?" + urlencode(query_params) + if ("Content-Type" not in headers) or (re.search("json", headers["Content-Type"], re.IGNORECASE)): request_body = None if body is not None: request_body = json.dumps(body) r = self.pool_manager.request( - method, url, + method, + url, body=request_body, preload_content=_preload_content, timeout=timeout, - headers=headers) - elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 + headers=headers, + ) + elif headers["Content-Type"] == "application/x-www-form-urlencoded": # noqa: E501 r = self.pool_manager.request( - method, url, + method, + url, fields=post_params, encode_multipart=False, preload_content=_preload_content, timeout=timeout, - headers=headers) - elif headers['Content-Type'] == 'multipart/form-data': + headers=headers, + ) + elif headers["Content-Type"] == "multipart/form-data": # must del headers['Content-Type'], or the correct # Content-Type which generated by urllib3 will be # overwritten. - del headers['Content-Type'] + del headers["Content-Type"] r = self.pool_manager.request( - method, url, + method, + url, fields=post_params, encode_multipart=True, preload_content=_preload_content, timeout=timeout, - headers=headers) + headers=headers, + ) # Pass a `string` parameter directly in the body to support # other content types than Json when `body` argument is # provided in serialized form elif isinstance(body, str) or isinstance(body, bytes): request_body = body r = self.pool_manager.request( - method, url, + method, + url, body=request_body, preload_content=_preload_content, timeout=timeout, - headers=headers) + headers=headers, + ) else: # Cannot generate the request from given parameters msg = """Cannot prepare a request message for provided @@ -199,11 +215,9 @@ def request(self, method, url, query_params=None, headers=None, raise ApiException(status=0, reason=msg) # For `GET`, `HEAD` else: - r = self.pool_manager.request(method, url, - fields=query_params, - preload_content=_preload_content, - timeout=timeout, - headers=headers) + r = self.pool_manager.request( + method, url, fields=query_params, preload_content=_preload_content, timeout=timeout, headers=headers + ) except urllib3.exceptions.SSLError as e: msg = "{0}\n{1}".format(type(e).__name__, str(e)) raise ApiException(status=0, reason=msg) @@ -231,67 +245,117 @@ def request(self, method, url, query_params=None, headers=None, return r - def GET(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): - return self.request("GET", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) - - def HEAD(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): - return self.request("HEAD", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) - - def OPTIONS(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("OPTIONS", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def DELETE(self, url, headers=None, query_params=None, body=None, - _preload_content=True, _request_timeout=None): - return self.request("DELETE", url, - headers=headers, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def POST(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("POST", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def PUT(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("PUT", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def PATCH(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("PATCH", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) + def GET(self, url, headers=None, query_params=None, _preload_content=True, _request_timeout=None): + return self.request( + "GET", + url, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + query_params=query_params, + ) + + def HEAD(self, url, headers=None, query_params=None, _preload_content=True, _request_timeout=None): + return self.request( + "HEAD", + url, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + query_params=query_params, + ) + + def OPTIONS( + self, + url, + headers=None, + query_params=None, + post_params=None, + body=None, + _preload_content=True, + _request_timeout=None, + ): + return self.request( + "OPTIONS", + url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body, + ) + + def DELETE(self, url, headers=None, query_params=None, body=None, _preload_content=True, _request_timeout=None): + return self.request( + "DELETE", + url, + headers=headers, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body, + ) + + def POST( + self, + url, + headers=None, + query_params=None, + post_params=None, + body=None, + _preload_content=True, + _request_timeout=None, + ): + return self.request( + "POST", + url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body, + ) + + def PUT( + self, + url, + headers=None, + query_params=None, + post_params=None, + body=None, + _preload_content=True, + _request_timeout=None, + ): + return self.request( + "PUT", + url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body, + ) + + def PATCH( + self, + url, + headers=None, + query_params=None, + post_params=None, + body=None, + _preload_content=True, + _request_timeout=None, + ): + return self.request( + "PATCH", + url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body, + ) diff --git a/pinecone/core/exceptions.py b/pinecone/core/exceptions.py index 7ec92a97..f97c7152 100644 --- a/pinecone/core/exceptions.py +++ b/pinecone/core/exceptions.py @@ -2,6 +2,7 @@ # Copyright (c) 2020-2021 Pinecone Systems Inc. All right reserved. # + class PineconeException(Exception): """The base exception class for all Pinecone client exceptions.""" diff --git a/pinecone/core/grpc/__init__.py b/pinecone/core/grpc/__init__.py index cdeec0d9..72f75876 100644 --- a/pinecone/core/grpc/__init__.py +++ b/pinecone/core/grpc/__init__.py @@ -1,4 +1,3 @@ # # Copyright (c) 2020-2021 Pinecone Systems Inc. All right reserved. # - diff --git a/pinecone/core/grpc/index_grpc.py b/pinecone/core/grpc/index_grpc.py index c852c10d..909bfe68 100644 --- a/pinecone/core/grpc/index_grpc.py +++ b/pinecone/core/grpc/index_grpc.py @@ -20,16 +20,31 @@ from pinecone.config import Config from pinecone.core.client.model.namespace_summary import NamespaceSummary from pinecone.core.client.model.vector import Vector as _Vector -from pinecone.core.grpc.protos.vector_service_pb2 import Vector as GRPCVector, \ - QueryVector as GRPCQueryVector, UpsertRequest, UpsertResponse, DeleteRequest, QueryRequest, \ - FetchRequest, UpdateRequest, DescribeIndexStatsRequest, DeleteResponse, UpdateResponse, \ - SparseValues as GRPCSparseValues +from pinecone.core.grpc.protos.vector_service_pb2 import ( + Vector as GRPCVector, + QueryVector as GRPCQueryVector, + UpsertRequest, + UpsertResponse, + DeleteRequest, + QueryRequest, + FetchRequest, + UpdateRequest, + DescribeIndexStatsRequest, + DeleteResponse, + UpdateResponse, + SparseValues as GRPCSparseValues, +) from pinecone.core.client.model.sparse_values import SparseValues from pinecone.core.grpc.protos.vector_service_pb2_grpc import VectorServiceStub from pinecone.core.grpc.retry import RetryOnRpcErrorClientInterceptor, RetryConfig from pinecone.core.utils import _generate_request_id, dict_to_proto_struct, fix_tuple_length -from pinecone.core.utils.constants import MAX_MSG_SIZE, REQUEST_ID, CLIENT_VERSION, REQUIRED_VECTOR_FIELDS, \ - OPTIONAL_VECTOR_FIELDS +from pinecone.core.utils.constants import ( + MAX_MSG_SIZE, + REQUEST_ID, + CLIENT_VERSION, + REQUIRED_VECTOR_FIELDS, + OPTIONAL_VECTOR_FIELDS, +) from pinecone.exceptions import PineconeException __all__ = ["GRPCIndex", "GRPCVector", "GRPCQueryVector", "GRPCSparseValues"] @@ -54,6 +69,7 @@ class GRPCClientConfig(NamedTuple): :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 @@ -74,17 +90,14 @@ class GRPCIndexBase(ABC): _pool = None - def __init__(self, index_name: str, channel=None, grpc_config: GRPCClientConfig = None, - _endpoint_override: str = None): + def __init__( + self, index_name: str, channel=None, grpc_config: GRPCClientConfig = None, _endpoint_override: str = None + ): self.name = index_name self.grpc_client_config = grpc_config or GRPCClientConfig() self.retry_config = self.grpc_client_config.retry_config or RetryConfig() - self.fixed_metadata = { - "api-key": Config.API_KEY, - "service-name": index_name, - "client-version": CLIENT_VERSION - } + self.fixed_metadata = {"api-key": Config.API_KEY, "service-name": index_name, "client-version": CLIENT_VERSION} self._endpoint_override = _endpoint_override self.method_config = json.dumps( @@ -109,7 +122,7 @@ def __init__(self, index_name: str, channel=None, grpc_config: GRPCClientConfig "backoffMultiplier": 2, "retryableStatusCodes": ["UNAVAILABLE"], }, - } + }, ] } ) @@ -117,15 +130,17 @@ def __init__(self, index_name: str, channel=None, grpc_config: GRPCClientConfig self._channel = channel or self._gen_channel() self.stub = self.stub_class(self._channel) - @property @abstractmethod def stub_class(self): pass def _endpoint(self): - return self._endpoint_override if self._endpoint_override \ + return ( + self._endpoint_override + if self._endpoint_override else f"{self.name}-{Config.PROJECT_NAME}.svc.{Config.ENVIRONMENT}.pinecone.io:443" + ) def _gen_channel(self, options=None): target = self._endpoint() @@ -133,14 +148,15 @@ def _gen_channel(self, options=None): "grpc.max_send_message_length": MAX_MSG_SIZE, "grpc.max_receive_message_length": MAX_MSG_SIZE, "grpc.service_config": self.method_config, - "grpc.enable_retries": True + "grpc.enable_retries": True, } if self.grpc_client_config.secure: - default_options['grpc.ssl_target_name_override'] = target.split(':')[0] + default_options["grpc.ssl_target_name_override"] = target.split(":")[0] user_provided_options = options or {} _options = tuple((k, v) for k, v in {**default_options, **user_provided_options}.items()) - _logger.debug('creating new channel with endpoint %s options %s and config %s', - target, _options, self.grpc_client_config) + _logger.debug( + "creating new channel with endpoint %s options %s and config %s", target, _options, self.grpc_client_config + ) if not self.grpc_client_config.secure: channel = grpc.insecure_channel(target, options=_options) else: @@ -172,17 +188,24 @@ def close(self): except TypeError: pass - def _wrap_grpc_call(self, func, request, timeout=None, metadata=None, credentials=None, wait_for_ready=None, - compression=None): + def _wrap_grpc_call( + self, func, request, timeout=None, metadata=None, credentials=None, wait_for_ready=None, compression=None + ): @wraps(func) def wrapped(): user_provided_metadata = metadata or {} - _metadata = tuple((k, v) for k, v in { - **self.fixed_metadata, **self._request_metadata(), **user_provided_metadata - }.items()) + _metadata = tuple( + (k, v) for k, v in {**self.fixed_metadata, **self._request_metadata(), **user_provided_metadata}.items() + ) try: - return func(request, timeout=timeout, metadata=_metadata, credentials=credentials, - wait_for_ready=wait_for_ready, compression=compression) + return func( + request, + timeout=timeout, + metadata=_metadata, + credentials=credentials, + wait_for_ready=wait_for_ready, + compression=compression, + ) except _InactiveRpcError as e: raise PineconeException(e._state.debug_error_string) from e @@ -199,19 +222,28 @@ def __exit__(self, exc_type, exc_value, traceback): def parse_sparse_values(sparse_values: dict): - return SparseValues(indices=sparse_values['indices'], values=sparse_values['values']) if sparse_values else SparseValues(indices=[], values=[]) + return ( + SparseValues(indices=sparse_values["indices"], values=sparse_values["values"]) + if sparse_values + else SparseValues(indices=[], values=[]) + ) def parse_fetch_response(response: dict): vd = {} - vectors = response.get('vectors') + vectors = response.get("vectors") if not vectors: return None for id, vec in vectors.items(): - v_obj = _Vector(id=vec['id'], values=vec['values'], sparse_values=parse_sparse_values(vec.get('sparseValues')), - metadata=vec.get('metadata', None), _check_type=False) + v_obj = _Vector( + id=vec["id"], + values=vec["values"], + sparse_values=parse_sparse_values(vec.get("sparseValues")), + metadata=vec.get("metadata", None), + _check_type=False, + ) vd[id] = v_obj - namespace = response.get('namespace', '') + namespace = response.get("namespace", "") return FetchResponse(vectors=vd, namespace=namespace, _check_type=False) @@ -219,43 +251,58 @@ def parse_query_response(response: dict, unary_query: bool, _check_type: bool = res = [] # TODO: consider deleting this deprecated case - for match in response.get('results', []): - namespace = match.get('namespace', '') + for match in response.get("results", []): + namespace = match.get("namespace", "") m = [] - if 'matches' in match: - for item in match['matches']: - sc = ScoredVector(id=item['id'], score=item.get('score', 0.0), values=item.get('values', []), - sparse_values=parse_sparse_values(item.get('sparseValues')), metadata=item.get('metadata', {})) + if "matches" in match: + for item in match["matches"]: + sc = ScoredVector( + id=item["id"], + score=item.get("score", 0.0), + values=item.get("values", []), + sparse_values=parse_sparse_values(item.get("sparseValues")), + metadata=item.get("metadata", {}), + ) m.append(sc) res.append(SingleQueryResults(matches=m, namespace=namespace)) m = [] - for item in response.get('matches', []): - sc = ScoredVector(id=item['id'], score=item.get('score', 0.0), values=item.get('values', []), - sparse_values=parse_sparse_values(item.get('sparseValues')), metadata=item.get('metadata', {}), - _check_type=_check_type) + for item in response.get("matches", []): + sc = ScoredVector( + id=item["id"], + score=item.get("score", 0.0), + values=item.get("values", []), + sparse_values=parse_sparse_values(item.get("sparseValues")), + metadata=item.get("metadata", {}), + _check_type=_check_type, + ) m.append(sc) - kwargs = {'_check_type': _check_type} + kwargs = {"_check_type": _check_type} if unary_query: - kwargs['namespace'] = response.get('namespace', '') - kwargs['matches'] = m + kwargs["namespace"] = response.get("namespace", "") + kwargs["matches"] = m else: - kwargs['results'] = res + kwargs["results"] = res return QueryResponse(**kwargs) def parse_stats_response(response: dict): - fullness = response.get('indexFullness', 0.0) - total_vector_count = response.get('totalVectorCount', 0) - dimension = response.get('dimension', 0) - summaries = response.get('namespaces', {}) + fullness = response.get("indexFullness", 0.0) + total_vector_count = response.get("totalVectorCount", 0) + dimension = response.get("dimension", 0) + summaries = response.get("namespaces", {}) namespace_summaries = {} for key in summaries: - vc = summaries[key].get('vectorCount', 0) + vc = summaries[key].get("vectorCount", 0) namespace_summaries[key] = NamespaceSummary(vector_count=vc) - return DescribeIndexStatsResponse(namespaces=namespace_summaries, dimension=dimension, index_fullness=fullness, - total_vector_count=total_vector_count, _check_type=False) + return DescribeIndexStatsResponse( + namespaces=namespace_summaries, + dimension=dimension, + index_fullness=fullness, + total_vector_count=total_vector_count, + _check_type=False, + ) class PineconeGrpcFuture: @@ -298,13 +345,15 @@ class GRPCIndex(GRPCIndexBase): def stub_class(self): return VectorServiceStub - def upsert(self, - vectors: Union[List[GRPCVector], List[tuple], List[dict]], - async_req: bool = False, - namespace: Optional[str] = None, - batch_size: Optional[int] = None, - show_progress: bool = True, - **kwargs) -> Union[UpsertResponse, PineconeGrpcFuture]: + def upsert( + self, + vectors: Union[List[GRPCVector], List[tuple], List[dict]], + async_req: bool = False, + namespace: Optional[str] = None, + batch_size: Optional[int] = None, + show_progress: bool = True, + **kwargs + ) -> Union[UpsertResponse, PineconeGrpcFuture]: """ The upsert operation writes vectors into a namespace. If a new value is upserted for an existing vector id, it will overwrite the previous value. @@ -360,45 +409,57 @@ def upsert(self, Returns: UpsertResponse, contains the number of vectors upserted """ if async_req and batch_size is not None: - raise ValueError('async_req is not supported when batch_size is provided.' - 'To upsert in parallel, please follow: ' - 'https://docs.pinecone.io/docs/performance-tuning') + raise ValueError( + "async_req is not supported when batch_size is provided." + "To upsert in parallel, please follow: " + "https://docs.pinecone.io/docs/performance-tuning" + ) def _dict_to_grpc_vector(item): item_keys = set(item.keys()) if not item_keys.issuperset(REQUIRED_VECTOR_FIELDS): raise ValueError( - f"Vector dictionary is missing required fields: {list(REQUIRED_VECTOR_FIELDS - item_keys)}") + f"Vector dictionary is missing required fields: {list(REQUIRED_VECTOR_FIELDS - item_keys)}" + ) excessive_keys = item_keys - (REQUIRED_VECTOR_FIELDS | OPTIONAL_VECTOR_FIELDS) if len(excessive_keys) > 0: - raise ValueError(f"Found excess keys in the vector dictionary: {list(excessive_keys)}. " - f"The allowed keys are: {list(REQUIRED_VECTOR_FIELDS | OPTIONAL_VECTOR_FIELDS)}") + raise ValueError( + f"Found excess keys in the vector dictionary: {list(excessive_keys)}. " + f"The allowed keys are: {list(REQUIRED_VECTOR_FIELDS | OPTIONAL_VECTOR_FIELDS)}" + ) sparse_values = None - if 'sparse_values' in item: - if not isinstance(item['sparse_values'], Mapping): - raise TypeError(f"Column `sparse_values` is expected to be a dictionary, found {type(item['sparse_values'])}") - indices = item['sparse_values'].get('indices', None) - values = item['sparse_values'].get('values', None) + if "sparse_values" in item: + if not isinstance(item["sparse_values"], Mapping): + raise TypeError( + f"Column `sparse_values` is expected to be a dictionary, found {type(item['sparse_values'])}" + ) + indices = item["sparse_values"].get("indices", None) + values = item["sparse_values"].get("values", None) try: sparse_values = GRPCSparseValues(indices=indices, values=values) except TypeError as e: - raise TypeError("Found unexpected data in column `sparse_values`. " - "Expected format is `'sparse_values': {'indices': List[int], 'values': List[float]}`." - ) from e + raise TypeError( + "Found unexpected data in column `sparse_values`. " + "Expected format is `'sparse_values': {'indices': List[int], 'values': List[float]}`." + ) from e - metadata = item.get('metadata', None) + metadata = item.get("metadata", None) if metadata is not None and not isinstance(metadata, Mapping): raise TypeError(f"Column `metadata` is expected to be a dictionary, found {type(metadata)}") try: - return GRPCVector(id=item['id'], values=item['values'], sparse_values=sparse_values, - metadata=dict_to_proto_struct(metadata)) + return GRPCVector( + id=item["id"], + values=item["values"], + sparse_values=sparse_values, + metadata=dict_to_proto_struct(metadata), + ) except TypeError as e: # No need to raise a dedicated error for `id` - protobuf's error message is clear enough - if not isinstance(item['values'], Iterable) or not isinstance(item['values'][0], numbers.Real): + if not isinstance(item["values"], Iterable) or not isinstance(item["values"][0], numbers.Real): raise TypeError(f"Column `values` is expected to be a list of floats") raise @@ -407,20 +468,22 @@ def _vector_transform(item): return item elif isinstance(item, tuple): if len(item) > 3: - raise ValueError(f"Found a tuple of length {len(item)} which is not supported. " - f"Vectors can be represented as tuples either the form (id, values, metadata) or (id, values). " - f"To pass sparse values please use either dicts or GRPCVector objects as inputs.") + raise ValueError( + f"Found a tuple of length {len(item)} which is not supported. " + f"Vectors can be represented as tuples either the form (id, values, metadata) or (id, values). " + f"To pass sparse values please use either dicts or GRPCVector objects as inputs." + ) id, values, metadata = fix_tuple_length(item, 3) return GRPCVector(id=id, values=values, metadata=dict_to_proto_struct(metadata) or {}) elif isinstance(item, Mapping): return _dict_to_grpc_vector(item) raise ValueError(f"Invalid vector value passed: cannot interpret type {type(item)}") - timeout = kwargs.pop('timeout', None) + timeout = kwargs.pop("timeout", None) vectors = list(map(_vector_transform, vectors)) if async_req: - args_dict = self._parse_non_empty_args([('namespace', namespace)]) + args_dict = self._parse_non_empty_args([("namespace", namespace)]) request = UpsertRequest(vectors=vectors, **args_dict, **kwargs) future = self._wrap_grpc_call(self.stub.Upsert.future, request, timeout=timeout) return PineconeGrpcFuture(future) @@ -429,33 +492,33 @@ def _vector_transform(item): return self._upsert_batch(vectors, namespace, timeout=timeout, **kwargs) if not isinstance(batch_size, int) or batch_size <= 0: - raise ValueError('batch_size must be a positive integer') + raise ValueError("batch_size must be a positive integer") - pbar = tqdm(total=len(vectors), disable=not show_progress, desc='Upserted vectors') + pbar = tqdm(total=len(vectors), disable=not show_progress, desc="Upserted vectors") total_upserted = 0 for i in range(0, len(vectors), batch_size): - batch_result = self._upsert_batch(vectors[i:i + batch_size], namespace, timeout=timeout, **kwargs) + batch_result = self._upsert_batch(vectors[i : i + batch_size], namespace, timeout=timeout, **kwargs) pbar.update(batch_result.upserted_count) # we can't use here pbar.n for the case show_progress=False total_upserted += batch_result.upserted_count return UpsertResponse(upserted_count=total_upserted) - def _upsert_batch(self, - vectors: List[GRPCVector], - namespace: Optional[str], - timeout: Optional[float], - **kwargs) -> UpsertResponse: - args_dict = self._parse_non_empty_args([('namespace', namespace)]) + def _upsert_batch( + self, vectors: List[GRPCVector], namespace: Optional[str], timeout: Optional[float], **kwargs + ) -> UpsertResponse: + args_dict = self._parse_non_empty_args([("namespace", namespace)]) request = UpsertRequest(vectors=vectors, **args_dict) return self._wrap_grpc_call(self.stub.Upsert, request, timeout=timeout, **kwargs) - def upsert_from_dataframe(self, - df, - namespace: str = None, - batch_size: int = 500, - use_async_requests: bool = True, - show_progress: bool = True) -> None: + def upsert_from_dataframe( + self, + df, + namespace: str = None, + batch_size: int = 500, + use_async_requests: bool = True, + show_progress: bool = True, + ) -> None: """Upserts a dataframe into the index. Args: @@ -469,7 +532,9 @@ def upsert_from_dataframe(self, try: import pandas as pd except ImportError: - raise RuntimeError("The `pandas` package is not installed. Please install pandas to use `upsert_from_dataframe()`") + raise RuntimeError( + "The `pandas` package is not installed. Please install pandas to use `upsert_from_dataframe()`" + ) if not isinstance(df, pd.DataFrame): raise ValueError(f"Only pandas dataframes are supported. Found: {type(df)}") @@ -493,16 +558,18 @@ def upsert_from_dataframe(self, @staticmethod def _iter_dataframe(df, batch_size): for i in range(0, len(df), batch_size): - batch = df.iloc[i:i + batch_size].to_dict(orient="records") + batch = df.iloc[i : i + batch_size].to_dict(orient="records") yield batch - def delete(self, - ids: Optional[List[str]] = None, - delete_all: Optional[bool] = None, - namespace: Optional[str] = None, - filter: Optional[Dict[str, Union[str, float, int, bool, List, dict]]] = None, - async_req: bool = False, - **kwargs) -> Union[DeleteResponse, PineconeGrpcFuture]: + def delete( + self, + ids: Optional[List[str]] = None, + delete_all: Optional[bool] = None, + namespace: Optional[str] = None, + filter: Optional[Dict[str, Union[str, float, int, bool, List, dict]]] = None, + async_req: bool = False, + **kwargs + ) -> Union[DeleteResponse, PineconeGrpcFuture]: """ The Delete operation deletes vectors from the index, from a single namespace. No error raised if the vector id does not exist. @@ -538,11 +605,10 @@ def delete(self, if filter is not None: filter = dict_to_proto_struct(filter) - args_dict = self._parse_non_empty_args([('ids', ids), - ('delete_all', delete_all), - ('namespace', namespace), - ('filter', filter)]) - timeout = kwargs.pop('timeout', None) + args_dict = self._parse_non_empty_args( + [("ids", ids), ("delete_all", delete_all), ("namespace", namespace), ("filter", filter)] + ) + timeout = kwargs.pop("timeout", None) request = DeleteRequest(**args_dict, **kwargs) if async_req: @@ -551,10 +617,7 @@ def delete(self, else: return self._wrap_grpc_call(self.stub.Delete, request, timeout=timeout) - def fetch(self, - ids: Optional[List[str]], - namespace: Optional[str] = None, - **kwargs) -> FetchResponse: + def fetch(self, ids: Optional[List[str]], namespace: Optional[str] = None, **kwargs) -> FetchResponse: """ The fetch operation looks up and returns vectors, by ID, from a single namespace. The returned vectors include the vector data and/or metadata. @@ -570,26 +633,28 @@ def fetch(self, Returns: FetchResponse object which contains the list of Vector objects, and namespace name. """ - timeout = kwargs.pop('timeout', None) + timeout = kwargs.pop("timeout", None) - args_dict = self._parse_non_empty_args([('namespace', namespace)]) + args_dict = self._parse_non_empty_args([("namespace", namespace)]) request = FetchRequest(ids=ids, **args_dict, **kwargs) response = self._wrap_grpc_call(self.stub.Fetch, request, timeout=timeout) json_response = json_format.MessageToDict(response) return parse_fetch_response(json_response) - def query(self, - vector: Optional[List[float]] = None, - id: Optional[str] = None, - queries: Optional[Union[List[GRPCQueryVector], List[Tuple]]] = None, - namespace: Optional[str] = None, - top_k: Optional[int] = None, - filter: Optional[Dict[str, Union[str, float, int, bool, List, dict]]] = None, - include_values: Optional[bool] = None, - include_metadata: Optional[bool] = None, - sparse_vector: Optional[Union[GRPCSparseValues, Dict[str, Union[List[float], List[int]]]]] = None, - **kwargs) -> QueryResponse: + def query( + self, + vector: Optional[List[float]] = None, + id: Optional[str] = None, + queries: Optional[Union[List[GRPCQueryVector], List[Tuple]]] = None, + namespace: Optional[str] = None, + top_k: Optional[int] = None, + filter: Optional[Dict[str, Union[str, float, int, bool, List, dict]]] = None, + include_values: Optional[bool] = None, + include_metadata: Optional[bool] = None, + sparse_vector: Optional[Union[GRPCSparseValues, Dict[str, Union[List[float], List[int]]]]] = None, + **kwargs + ) -> QueryResponse: """ The Query operation searches a namespace, using a query vector. It retrieves the ids of the most similar items in a namespace, along with their similarity scores. @@ -631,6 +696,7 @@ def query(self, Returns: QueryResponse object which contains the list of the closest vectors as ScoredVector objects, and namespace name. """ + def _query_transform(item): if isinstance(item, GRPCQueryVector): return item @@ -648,32 +714,37 @@ def _query_transform(item): filter = dict_to_proto_struct(filter) sparse_vector = self._parse_sparse_values_arg(sparse_vector) - args_dict = self._parse_non_empty_args([('vector', vector), - ('id', id), - ('queries', queries), - ('namespace', namespace), - ('top_k', top_k), - ('filter', filter), - ('include_values', include_values), - ('include_metadata', include_metadata), - ('sparse_vector', sparse_vector)]) + args_dict = self._parse_non_empty_args( + [ + ("vector", vector), + ("id", id), + ("queries", queries), + ("namespace", namespace), + ("top_k", top_k), + ("filter", filter), + ("include_values", include_values), + ("include_metadata", include_metadata), + ("sparse_vector", sparse_vector), + ] + ) request = QueryRequest(**args_dict) - timeout = kwargs.pop('timeout', None) + timeout = kwargs.pop("timeout", None) response = self._wrap_grpc_call(self.stub.Query, request, timeout=timeout) json_response = json_format.MessageToDict(response) return parse_query_response(json_response, vector is not None or id, _check_type=False) - def update(self, - id: str, - async_req: bool = False, - values: Optional[List[float]] = None, - set_metadata: Optional[Dict[str, - Union[str, float, int, bool, List[int], List[float], List[str]]]] = None, - namespace: Optional[str] = None, - sparse_values: Optional[Union[GRPCSparseValues, Dict[str, Union[List[float], List[int]]]]] = None, - **kwargs) -> Union[UpdateResponse, PineconeGrpcFuture]: + def update( + self, + id: str, + async_req: bool = False, + values: Optional[List[float]] = None, + set_metadata: Optional[Dict[str, Union[str, float, int, bool, List[int], List[float], List[str]]]] = None, + namespace: Optional[str] = None, + sparse_values: Optional[Union[GRPCSparseValues, Dict[str, Union[List[float], List[int]]]]] = None, + **kwargs + ) -> Union[UpdateResponse, PineconeGrpcFuture]: """ The Update operation updates vector in a namespace. If a value is included, it will overwrite the previous value. @@ -705,13 +776,17 @@ def update(self, """ if set_metadata is not None: set_metadata = dict_to_proto_struct(set_metadata) - timeout = kwargs.pop('timeout', None) + timeout = kwargs.pop("timeout", None) sparse_values = self._parse_sparse_values_arg(sparse_values) - args_dict = self._parse_non_empty_args([('values', values), - ('set_metadata', set_metadata), - ('namespace', namespace), - ('sparse_values', sparse_values)]) + args_dict = self._parse_non_empty_args( + [ + ("values", values), + ("set_metadata", set_metadata), + ("namespace", namespace), + ("sparse_values", sparse_values), + ] + ) request = UpdateRequest(id=id, **args_dict) if async_req: @@ -720,9 +795,9 @@ def update(self, else: return self._wrap_grpc_call(self.stub.Update, request, timeout=timeout) - def describe_index_stats(self, - filter: Optional[Dict[str, Union[str, float, int, bool, List, dict]]] = None, - **kwargs) -> DescribeIndexStatsResponse: + def describe_index_stats( + self, filter: Optional[Dict[str, Union[str, float, int, bool, List, dict]]] = None, **kwargs + ) -> DescribeIndexStatsResponse: """ The DescribeIndexStats operation returns statistics about the index's contents. For example: The vector count per namespace and the number of dimensions. @@ -740,8 +815,8 @@ def describe_index_stats(self, """ if filter is not None: filter = dict_to_proto_struct(filter) - args_dict = self._parse_non_empty_args([('filter', filter)]) - timeout = kwargs.pop('timeout', None) + args_dict = self._parse_non_empty_args([("filter", filter)]) + timeout = kwargs.pop("timeout", None) request = DescribeIndexStatsRequest(**args_dict) response = self._wrap_grpc_call(self.stub.DescribeIndexStats, request, timeout=timeout) @@ -754,8 +829,8 @@ def _parse_non_empty_args(args: List[Tuple[str, Any]]) -> Dict[str, Any]: @staticmethod def _parse_sparse_values_arg( - sparse_values: Optional[Union[GRPCSparseValues, - Dict[str, Union[List[float], List[int]]]]]) -> Optional[GRPCSparseValues]: + sparse_values: Optional[Union[GRPCSparseValues, Dict[str, Union[List[float], List[int]]]]] + ) -> Optional[GRPCSparseValues]: if sparse_values is None: return None @@ -765,6 +840,7 @@ def _parse_sparse_values_arg( if not isinstance(sparse_values, dict) or "indices" not in sparse_values or "values" not in sparse_values: raise ValueError( "Invalid sparse values argument. Expected a dict of: {'indices': List[int], 'values': List[float]}." - f"Received: {sparse_values}") + f"Received: {sparse_values}" + ) return GRPCSparseValues(indices=sparse_values["indices"], values=sparse_values["values"]) diff --git a/pinecone/core/grpc/protos/vector_column_service_pb2.py b/pinecone/core/grpc/protos/vector_column_service_pb2.py index 30beb0c1..1dc8f91d 100644 --- a/pinecone/core/grpc/protos/vector_column_service_pb2.py +++ b/pinecone/core/grpc/protos/vector_column_service_pb2.py @@ -10,6 +10,7 @@ from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database + # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() @@ -19,751 +20,1207 @@ DESCRIPTOR = _descriptor.FileDescriptor( - name='vector_column_service.proto', - package='pinecone_columnar', - syntax='proto3', - serialized_options=b'\n\021io.pinecone.protoZ+github.com/pinecone-io/go-pinecone/pinecone', - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\x1bvector_column_service.proto\x12\x11pinecone_columnar\x1a\x1cgoogle/protobuf/struct.proto\"K\n\x07NdArray\x12\x0e\n\x06\x62uffer\x18\x01 \x01(\x0c\x12\r\n\x05shape\x18\x02 \x03(\r\x12\r\n\x05\x64type\x18\x03 \x01(\t\x12\x12\n\ncompressed\x18\x04 \x01(\x08\"\xbc\x01\n\rScoredResults\x12\'\n\x03ids\x18\x01 \x01(\x0b\x32\x1a.pinecone_columnar.NdArray\x12*\n\x06scores\x18\x02 \x01(\x0b\x32\x1a.pinecone_columnar.NdArray\x12(\n\x04\x64\x61ta\x18\x03 \x01(\x0b\x32\x1a.pinecone_columnar.NdArray\x12,\n\x08metadata\x18\x04 \x01(\x0b\x32\x1a.pinecone_columnar.NdArray\"\x84\x01\n\rUpsertRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x0b\n\x03ids\x18\x02 \x03(\t\x12(\n\x04\x64\x61ta\x18\x03 \x01(\x0b\x32\x1a.pinecone_columnar.NdArray\x12)\n\x08metadata\x18\x04 \x03(\x0b\x32\x17.google.protobuf.Struct\"(\n\x0eUpsertResponse\x12\x16\n\x0eupserted_count\x18\x01 \x01(\r\"C\n\rDeleteRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x0b\n\x03ids\x18\x02 \x03(\t\x12\x12\n\ndelete_all\x18\x03 \x01(\x08\"\x10\n\x0e\x44\x65leteResponse\".\n\x0c\x46\x65tchRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x0b\n\x03ids\x18\x02 \x03(\t\"\x87\x01\n\rFetchResponse\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x0b\n\x03ids\x18\x02 \x03(\t\x12+\n\x07vectors\x18\x03 \x03(\x0b\x32\x1a.pinecone_columnar.NdArray\x12)\n\x08metadata\x18\x04 \x03(\x0b\x32\x17.google.protobuf.Struct\"\xa1\x02\n\x0cQueryRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x1b\n\x13namespace_overrides\x18\x06 \x03(\t\x12\r\n\x05top_k\x18\x02 \x01(\r\x12\x17\n\x0ftop_k_overrides\x18\x05 \x03(\r\x12\'\n\x06\x66ilter\x18\x07 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x31\n\x10\x66ilter_overrides\x18\x08 \x03(\x0b\x32\x17.google.protobuf.Struct\x12\x16\n\x0einclude_values\x18\x03 \x01(\x08\x12\x18\n\x10include_metadata\x18\t \x01(\x08\x12+\n\x07queries\x18\x04 \x01(\x0b\x32\x1a.pinecone_columnar.NdArray\"B\n\rQueryResponse\x12\x31\n\x07matches\x18\x01 \x03(\x0b\x32 .pinecone_columnar.ScoredResults\"\x1b\n\x19\x44\x65scribeIndexStatsRequest\"(\n\x10NamespaceSummary\x12\x14\n\x0cvector_count\x18\x01 \x01(\r\"\xda\x01\n\x1a\x44\x65scribeIndexStatsResponse\x12Q\n\nnamespaces\x18\x01 \x03(\x0b\x32=.pinecone_columnar.DescribeIndexStatsResponse.NamespacesEntry\x12\x11\n\tdimension\x18\x02 \x01(\r\x1aV\n\x0fNamespacesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x32\n\x05value\x18\x02 \x01(\x0b\x32#.pinecone_columnar.NamespaceSummary:\x02\x38\x01\x32\xc8\x03\n\x13VectorColumnService\x12O\n\x06Upsert\x12 .pinecone_columnar.UpsertRequest\x1a!.pinecone_columnar.UpsertResponse\"\x00\x12O\n\x06\x44\x65lete\x12 .pinecone_columnar.DeleteRequest\x1a!.pinecone_columnar.DeleteResponse\"\x00\x12L\n\x05\x46\x65tch\x12\x1f.pinecone_columnar.FetchRequest\x1a .pinecone_columnar.FetchResponse\"\x00\x12L\n\x05Query\x12\x1f.pinecone_columnar.QueryRequest\x1a .pinecone_columnar.QueryResponse\"\x00\x12s\n\x12\x44\x65scribeIndexStats\x12,.pinecone_columnar.DescribeIndexStatsRequest\x1a-.pinecone_columnar.DescribeIndexStatsResponse\"\x00\x42@\n\x11io.pinecone.protoZ+github.com/pinecone-io/go-pinecone/pineconeb\x06proto3' - , - dependencies=[google_dot_protobuf_dot_struct__pb2.DESCRIPTOR,]) - - + name="vector_column_service.proto", + package="pinecone_columnar", + syntax="proto3", + serialized_options=b"\n\021io.pinecone.protoZ+github.com/pinecone-io/go-pinecone/pinecone", + create_key=_descriptor._internal_create_key, + serialized_pb=b'\n\x1bvector_column_service.proto\x12\x11pinecone_columnar\x1a\x1cgoogle/protobuf/struct.proto"K\n\x07NdArray\x12\x0e\n\x06\x62uffer\x18\x01 \x01(\x0c\x12\r\n\x05shape\x18\x02 \x03(\r\x12\r\n\x05\x64type\x18\x03 \x01(\t\x12\x12\n\ncompressed\x18\x04 \x01(\x08"\xbc\x01\n\rScoredResults\x12\'\n\x03ids\x18\x01 \x01(\x0b\x32\x1a.pinecone_columnar.NdArray\x12*\n\x06scores\x18\x02 \x01(\x0b\x32\x1a.pinecone_columnar.NdArray\x12(\n\x04\x64\x61ta\x18\x03 \x01(\x0b\x32\x1a.pinecone_columnar.NdArray\x12,\n\x08metadata\x18\x04 \x01(\x0b\x32\x1a.pinecone_columnar.NdArray"\x84\x01\n\rUpsertRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x0b\n\x03ids\x18\x02 \x03(\t\x12(\n\x04\x64\x61ta\x18\x03 \x01(\x0b\x32\x1a.pinecone_columnar.NdArray\x12)\n\x08metadata\x18\x04 \x03(\x0b\x32\x17.google.protobuf.Struct"(\n\x0eUpsertResponse\x12\x16\n\x0eupserted_count\x18\x01 \x01(\r"C\n\rDeleteRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x0b\n\x03ids\x18\x02 \x03(\t\x12\x12\n\ndelete_all\x18\x03 \x01(\x08"\x10\n\x0e\x44\x65leteResponse".\n\x0c\x46\x65tchRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x0b\n\x03ids\x18\x02 \x03(\t"\x87\x01\n\rFetchResponse\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x0b\n\x03ids\x18\x02 \x03(\t\x12+\n\x07vectors\x18\x03 \x03(\x0b\x32\x1a.pinecone_columnar.NdArray\x12)\n\x08metadata\x18\x04 \x03(\x0b\x32\x17.google.protobuf.Struct"\xa1\x02\n\x0cQueryRequest\x12\x11\n\tnamespace\x18\x01 \x01(\t\x12\x1b\n\x13namespace_overrides\x18\x06 \x03(\t\x12\r\n\x05top_k\x18\x02 \x01(\r\x12\x17\n\x0ftop_k_overrides\x18\x05 \x03(\r\x12\'\n\x06\x66ilter\x18\x07 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x31\n\x10\x66ilter_overrides\x18\x08 \x03(\x0b\x32\x17.google.protobuf.Struct\x12\x16\n\x0einclude_values\x18\x03 \x01(\x08\x12\x18\n\x10include_metadata\x18\t \x01(\x08\x12+\n\x07queries\x18\x04 \x01(\x0b\x32\x1a.pinecone_columnar.NdArray"B\n\rQueryResponse\x12\x31\n\x07matches\x18\x01 \x03(\x0b\x32 .pinecone_columnar.ScoredResults"\x1b\n\x19\x44\x65scribeIndexStatsRequest"(\n\x10NamespaceSummary\x12\x14\n\x0cvector_count\x18\x01 \x01(\r"\xda\x01\n\x1a\x44\x65scribeIndexStatsResponse\x12Q\n\nnamespaces\x18\x01 \x03(\x0b\x32=.pinecone_columnar.DescribeIndexStatsResponse.NamespacesEntry\x12\x11\n\tdimension\x18\x02 \x01(\r\x1aV\n\x0fNamespacesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x32\n\x05value\x18\x02 \x01(\x0b\x32#.pinecone_columnar.NamespaceSummary:\x02\x38\x01\x32\xc8\x03\n\x13VectorColumnService\x12O\n\x06Upsert\x12 .pinecone_columnar.UpsertRequest\x1a!.pinecone_columnar.UpsertResponse"\x00\x12O\n\x06\x44\x65lete\x12 .pinecone_columnar.DeleteRequest\x1a!.pinecone_columnar.DeleteResponse"\x00\x12L\n\x05\x46\x65tch\x12\x1f.pinecone_columnar.FetchRequest\x1a .pinecone_columnar.FetchResponse"\x00\x12L\n\x05Query\x12\x1f.pinecone_columnar.QueryRequest\x1a .pinecone_columnar.QueryResponse"\x00\x12s\n\x12\x44\x65scribeIndexStats\x12,.pinecone_columnar.DescribeIndexStatsRequest\x1a-.pinecone_columnar.DescribeIndexStatsResponse"\x00\x42@\n\x11io.pinecone.protoZ+github.com/pinecone-io/go-pinecone/pineconeb\x06proto3', + dependencies=[ + google_dot_protobuf_dot_struct__pb2.DESCRIPTOR, + ], +) _NDARRAY = _descriptor.Descriptor( - name='NdArray', - full_name='pinecone_columnar.NdArray', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='buffer', full_name='pinecone_columnar.NdArray.buffer', index=0, - number=1, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=b"", - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='shape', full_name='pinecone_columnar.NdArray.shape', index=1, - number=2, type=13, cpp_type=3, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='dtype', full_name='pinecone_columnar.NdArray.dtype', index=2, - number=3, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='compressed', full_name='pinecone_columnar.NdArray.compressed', index=3, - number=4, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=80, - serialized_end=155, + name="NdArray", + full_name="pinecone_columnar.NdArray", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="buffer", + full_name="pinecone_columnar.NdArray.buffer", + index=0, + number=1, + type=12, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"", + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="shape", + full_name="pinecone_columnar.NdArray.shape", + index=1, + number=2, + type=13, + cpp_type=3, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="dtype", + full_name="pinecone_columnar.NdArray.dtype", + index=2, + number=3, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="compressed", + full_name="pinecone_columnar.NdArray.compressed", + index=3, + number=4, + type=8, + cpp_type=7, + label=1, + has_default_value=False, + default_value=False, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=80, + serialized_end=155, ) _SCOREDRESULTS = _descriptor.Descriptor( - name='ScoredResults', - full_name='pinecone_columnar.ScoredResults', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='ids', full_name='pinecone_columnar.ScoredResults.ids', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='scores', full_name='pinecone_columnar.ScoredResults.scores', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='data', full_name='pinecone_columnar.ScoredResults.data', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='metadata', full_name='pinecone_columnar.ScoredResults.metadata', index=3, - number=4, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=158, - serialized_end=346, + name="ScoredResults", + full_name="pinecone_columnar.ScoredResults", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="ids", + full_name="pinecone_columnar.ScoredResults.ids", + index=0, + number=1, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="scores", + full_name="pinecone_columnar.ScoredResults.scores", + index=1, + number=2, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="data", + full_name="pinecone_columnar.ScoredResults.data", + index=2, + number=3, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="metadata", + full_name="pinecone_columnar.ScoredResults.metadata", + index=3, + number=4, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=158, + serialized_end=346, ) _UPSERTREQUEST = _descriptor.Descriptor( - name='UpsertRequest', - full_name='pinecone_columnar.UpsertRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='namespace', full_name='pinecone_columnar.UpsertRequest.namespace', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='ids', full_name='pinecone_columnar.UpsertRequest.ids', index=1, - number=2, type=9, cpp_type=9, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='data', full_name='pinecone_columnar.UpsertRequest.data', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='metadata', full_name='pinecone_columnar.UpsertRequest.metadata', index=3, - number=4, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=349, - serialized_end=481, + name="UpsertRequest", + full_name="pinecone_columnar.UpsertRequest", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="namespace", + full_name="pinecone_columnar.UpsertRequest.namespace", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="ids", + full_name="pinecone_columnar.UpsertRequest.ids", + index=1, + number=2, + type=9, + cpp_type=9, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="data", + full_name="pinecone_columnar.UpsertRequest.data", + index=2, + number=3, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="metadata", + full_name="pinecone_columnar.UpsertRequest.metadata", + index=3, + number=4, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=349, + serialized_end=481, ) _UPSERTRESPONSE = _descriptor.Descriptor( - name='UpsertResponse', - full_name='pinecone_columnar.UpsertResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='upserted_count', full_name='pinecone_columnar.UpsertResponse.upserted_count', index=0, - number=1, type=13, cpp_type=3, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=483, - serialized_end=523, + name="UpsertResponse", + full_name="pinecone_columnar.UpsertResponse", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="upserted_count", + full_name="pinecone_columnar.UpsertResponse.upserted_count", + index=0, + number=1, + type=13, + cpp_type=3, + label=1, + has_default_value=False, + default_value=0, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=483, + serialized_end=523, ) _DELETEREQUEST = _descriptor.Descriptor( - name='DeleteRequest', - full_name='pinecone_columnar.DeleteRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='namespace', full_name='pinecone_columnar.DeleteRequest.namespace', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='ids', full_name='pinecone_columnar.DeleteRequest.ids', index=1, - number=2, type=9, cpp_type=9, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='delete_all', full_name='pinecone_columnar.DeleteRequest.delete_all', index=2, - number=3, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=525, - serialized_end=592, + name="DeleteRequest", + full_name="pinecone_columnar.DeleteRequest", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="namespace", + full_name="pinecone_columnar.DeleteRequest.namespace", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="ids", + full_name="pinecone_columnar.DeleteRequest.ids", + index=1, + number=2, + type=9, + cpp_type=9, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="delete_all", + full_name="pinecone_columnar.DeleteRequest.delete_all", + index=2, + number=3, + type=8, + cpp_type=7, + label=1, + has_default_value=False, + default_value=False, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=525, + serialized_end=592, ) _DELETERESPONSE = _descriptor.Descriptor( - name='DeleteResponse', - full_name='pinecone_columnar.DeleteResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=594, - serialized_end=610, + name="DeleteResponse", + full_name="pinecone_columnar.DeleteResponse", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=594, + serialized_end=610, ) _FETCHREQUEST = _descriptor.Descriptor( - name='FetchRequest', - full_name='pinecone_columnar.FetchRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='namespace', full_name='pinecone_columnar.FetchRequest.namespace', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='ids', full_name='pinecone_columnar.FetchRequest.ids', index=1, - number=2, type=9, cpp_type=9, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=612, - serialized_end=658, + name="FetchRequest", + full_name="pinecone_columnar.FetchRequest", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="namespace", + full_name="pinecone_columnar.FetchRequest.namespace", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="ids", + full_name="pinecone_columnar.FetchRequest.ids", + index=1, + number=2, + type=9, + cpp_type=9, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=612, + serialized_end=658, ) _FETCHRESPONSE = _descriptor.Descriptor( - name='FetchResponse', - full_name='pinecone_columnar.FetchResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='namespace', full_name='pinecone_columnar.FetchResponse.namespace', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='ids', full_name='pinecone_columnar.FetchResponse.ids', index=1, - number=2, type=9, cpp_type=9, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='vectors', full_name='pinecone_columnar.FetchResponse.vectors', index=2, - number=3, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='metadata', full_name='pinecone_columnar.FetchResponse.metadata', index=3, - number=4, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=661, - serialized_end=796, + name="FetchResponse", + full_name="pinecone_columnar.FetchResponse", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="namespace", + full_name="pinecone_columnar.FetchResponse.namespace", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="ids", + full_name="pinecone_columnar.FetchResponse.ids", + index=1, + number=2, + type=9, + cpp_type=9, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="vectors", + full_name="pinecone_columnar.FetchResponse.vectors", + index=2, + number=3, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="metadata", + full_name="pinecone_columnar.FetchResponse.metadata", + index=3, + number=4, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=661, + serialized_end=796, ) _QUERYREQUEST = _descriptor.Descriptor( - name='QueryRequest', - full_name='pinecone_columnar.QueryRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='namespace', full_name='pinecone_columnar.QueryRequest.namespace', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='namespace_overrides', full_name='pinecone_columnar.QueryRequest.namespace_overrides', index=1, - number=6, type=9, cpp_type=9, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='top_k', full_name='pinecone_columnar.QueryRequest.top_k', index=2, - number=2, type=13, cpp_type=3, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='top_k_overrides', full_name='pinecone_columnar.QueryRequest.top_k_overrides', index=3, - number=5, type=13, cpp_type=3, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='filter', full_name='pinecone_columnar.QueryRequest.filter', index=4, - number=7, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='filter_overrides', full_name='pinecone_columnar.QueryRequest.filter_overrides', index=5, - number=8, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='include_values', full_name='pinecone_columnar.QueryRequest.include_values', index=6, - number=3, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='include_metadata', full_name='pinecone_columnar.QueryRequest.include_metadata', index=7, - number=9, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='queries', full_name='pinecone_columnar.QueryRequest.queries', index=8, - number=4, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=799, - serialized_end=1088, + name="QueryRequest", + full_name="pinecone_columnar.QueryRequest", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="namespace", + full_name="pinecone_columnar.QueryRequest.namespace", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="namespace_overrides", + full_name="pinecone_columnar.QueryRequest.namespace_overrides", + index=1, + number=6, + type=9, + cpp_type=9, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="top_k", + full_name="pinecone_columnar.QueryRequest.top_k", + index=2, + number=2, + type=13, + cpp_type=3, + label=1, + has_default_value=False, + default_value=0, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="top_k_overrides", + full_name="pinecone_columnar.QueryRequest.top_k_overrides", + index=3, + number=5, + type=13, + cpp_type=3, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="filter", + full_name="pinecone_columnar.QueryRequest.filter", + index=4, + number=7, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="filter_overrides", + full_name="pinecone_columnar.QueryRequest.filter_overrides", + index=5, + number=8, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="include_values", + full_name="pinecone_columnar.QueryRequest.include_values", + index=6, + number=3, + type=8, + cpp_type=7, + label=1, + has_default_value=False, + default_value=False, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="include_metadata", + full_name="pinecone_columnar.QueryRequest.include_metadata", + index=7, + number=9, + type=8, + cpp_type=7, + label=1, + has_default_value=False, + default_value=False, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="queries", + full_name="pinecone_columnar.QueryRequest.queries", + index=8, + number=4, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=799, + serialized_end=1088, ) _QUERYRESPONSE = _descriptor.Descriptor( - name='QueryResponse', - full_name='pinecone_columnar.QueryResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='matches', full_name='pinecone_columnar.QueryResponse.matches', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1090, - serialized_end=1156, + name="QueryResponse", + full_name="pinecone_columnar.QueryResponse", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="matches", + full_name="pinecone_columnar.QueryResponse.matches", + index=0, + number=1, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=1090, + serialized_end=1156, ) _DESCRIBEINDEXSTATSREQUEST = _descriptor.Descriptor( - name='DescribeIndexStatsRequest', - full_name='pinecone_columnar.DescribeIndexStatsRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1158, - serialized_end=1185, + name="DescribeIndexStatsRequest", + full_name="pinecone_columnar.DescribeIndexStatsRequest", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=1158, + serialized_end=1185, ) _NAMESPACESUMMARY = _descriptor.Descriptor( - name='NamespaceSummary', - full_name='pinecone_columnar.NamespaceSummary', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='vector_count', full_name='pinecone_columnar.NamespaceSummary.vector_count', index=0, - number=1, type=13, cpp_type=3, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1187, - serialized_end=1227, + name="NamespaceSummary", + full_name="pinecone_columnar.NamespaceSummary", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="vector_count", + full_name="pinecone_columnar.NamespaceSummary.vector_count", + index=0, + number=1, + type=13, + cpp_type=3, + label=1, + has_default_value=False, + default_value=0, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=1187, + serialized_end=1227, ) _DESCRIBEINDEXSTATSRESPONSE_NAMESPACESENTRY = _descriptor.Descriptor( - name='NamespacesEntry', - full_name='pinecone_columnar.DescribeIndexStatsResponse.NamespacesEntry', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='key', full_name='pinecone_columnar.DescribeIndexStatsResponse.NamespacesEntry.key', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='value', full_name='pinecone_columnar.DescribeIndexStatsResponse.NamespacesEntry.value', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=b'8\001', - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1362, - serialized_end=1448, + name="NamespacesEntry", + full_name="pinecone_columnar.DescribeIndexStatsResponse.NamespacesEntry", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="key", + full_name="pinecone_columnar.DescribeIndexStatsResponse.NamespacesEntry.key", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="value", + full_name="pinecone_columnar.DescribeIndexStatsResponse.NamespacesEntry.value", + index=1, + number=2, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=b"8\001", + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=1362, + serialized_end=1448, ) _DESCRIBEINDEXSTATSRESPONSE = _descriptor.Descriptor( - name='DescribeIndexStatsResponse', - full_name='pinecone_columnar.DescribeIndexStatsResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='namespaces', full_name='pinecone_columnar.DescribeIndexStatsResponse.namespaces', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='dimension', full_name='pinecone_columnar.DescribeIndexStatsResponse.dimension', index=1, - number=2, type=13, cpp_type=3, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[_DESCRIBEINDEXSTATSRESPONSE_NAMESPACESENTRY, ], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1230, - serialized_end=1448, + name="DescribeIndexStatsResponse", + full_name="pinecone_columnar.DescribeIndexStatsResponse", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="namespaces", + full_name="pinecone_columnar.DescribeIndexStatsResponse.namespaces", + index=0, + number=1, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="dimension", + full_name="pinecone_columnar.DescribeIndexStatsResponse.dimension", + index=1, + number=2, + type=13, + cpp_type=3, + label=1, + has_default_value=False, + default_value=0, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[ + _DESCRIBEINDEXSTATSRESPONSE_NAMESPACESENTRY, + ], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=1230, + serialized_end=1448, ) -_SCOREDRESULTS.fields_by_name['ids'].message_type = _NDARRAY -_SCOREDRESULTS.fields_by_name['scores'].message_type = _NDARRAY -_SCOREDRESULTS.fields_by_name['data'].message_type = _NDARRAY -_SCOREDRESULTS.fields_by_name['metadata'].message_type = _NDARRAY -_UPSERTREQUEST.fields_by_name['data'].message_type = _NDARRAY -_UPSERTREQUEST.fields_by_name['metadata'].message_type = google_dot_protobuf_dot_struct__pb2._STRUCT -_FETCHRESPONSE.fields_by_name['vectors'].message_type = _NDARRAY -_FETCHRESPONSE.fields_by_name['metadata'].message_type = google_dot_protobuf_dot_struct__pb2._STRUCT -_QUERYREQUEST.fields_by_name['filter'].message_type = google_dot_protobuf_dot_struct__pb2._STRUCT -_QUERYREQUEST.fields_by_name['filter_overrides'].message_type = google_dot_protobuf_dot_struct__pb2._STRUCT -_QUERYREQUEST.fields_by_name['queries'].message_type = _NDARRAY -_QUERYRESPONSE.fields_by_name['matches'].message_type = _SCOREDRESULTS -_DESCRIBEINDEXSTATSRESPONSE_NAMESPACESENTRY.fields_by_name['value'].message_type = _NAMESPACESUMMARY +_SCOREDRESULTS.fields_by_name["ids"].message_type = _NDARRAY +_SCOREDRESULTS.fields_by_name["scores"].message_type = _NDARRAY +_SCOREDRESULTS.fields_by_name["data"].message_type = _NDARRAY +_SCOREDRESULTS.fields_by_name["metadata"].message_type = _NDARRAY +_UPSERTREQUEST.fields_by_name["data"].message_type = _NDARRAY +_UPSERTREQUEST.fields_by_name["metadata"].message_type = google_dot_protobuf_dot_struct__pb2._STRUCT +_FETCHRESPONSE.fields_by_name["vectors"].message_type = _NDARRAY +_FETCHRESPONSE.fields_by_name["metadata"].message_type = google_dot_protobuf_dot_struct__pb2._STRUCT +_QUERYREQUEST.fields_by_name["filter"].message_type = google_dot_protobuf_dot_struct__pb2._STRUCT +_QUERYREQUEST.fields_by_name["filter_overrides"].message_type = google_dot_protobuf_dot_struct__pb2._STRUCT +_QUERYREQUEST.fields_by_name["queries"].message_type = _NDARRAY +_QUERYRESPONSE.fields_by_name["matches"].message_type = _SCOREDRESULTS +_DESCRIBEINDEXSTATSRESPONSE_NAMESPACESENTRY.fields_by_name["value"].message_type = _NAMESPACESUMMARY _DESCRIBEINDEXSTATSRESPONSE_NAMESPACESENTRY.containing_type = _DESCRIBEINDEXSTATSRESPONSE -_DESCRIBEINDEXSTATSRESPONSE.fields_by_name['namespaces'].message_type = _DESCRIBEINDEXSTATSRESPONSE_NAMESPACESENTRY -DESCRIPTOR.message_types_by_name['NdArray'] = _NDARRAY -DESCRIPTOR.message_types_by_name['ScoredResults'] = _SCOREDRESULTS -DESCRIPTOR.message_types_by_name['UpsertRequest'] = _UPSERTREQUEST -DESCRIPTOR.message_types_by_name['UpsertResponse'] = _UPSERTRESPONSE -DESCRIPTOR.message_types_by_name['DeleteRequest'] = _DELETEREQUEST -DESCRIPTOR.message_types_by_name['DeleteResponse'] = _DELETERESPONSE -DESCRIPTOR.message_types_by_name['FetchRequest'] = _FETCHREQUEST -DESCRIPTOR.message_types_by_name['FetchResponse'] = _FETCHRESPONSE -DESCRIPTOR.message_types_by_name['QueryRequest'] = _QUERYREQUEST -DESCRIPTOR.message_types_by_name['QueryResponse'] = _QUERYRESPONSE -DESCRIPTOR.message_types_by_name['DescribeIndexStatsRequest'] = _DESCRIBEINDEXSTATSREQUEST -DESCRIPTOR.message_types_by_name['NamespaceSummary'] = _NAMESPACESUMMARY -DESCRIPTOR.message_types_by_name['DescribeIndexStatsResponse'] = _DESCRIBEINDEXSTATSRESPONSE +_DESCRIBEINDEXSTATSRESPONSE.fields_by_name["namespaces"].message_type = _DESCRIBEINDEXSTATSRESPONSE_NAMESPACESENTRY +DESCRIPTOR.message_types_by_name["NdArray"] = _NDARRAY +DESCRIPTOR.message_types_by_name["ScoredResults"] = _SCOREDRESULTS +DESCRIPTOR.message_types_by_name["UpsertRequest"] = _UPSERTREQUEST +DESCRIPTOR.message_types_by_name["UpsertResponse"] = _UPSERTRESPONSE +DESCRIPTOR.message_types_by_name["DeleteRequest"] = _DELETEREQUEST +DESCRIPTOR.message_types_by_name["DeleteResponse"] = _DELETERESPONSE +DESCRIPTOR.message_types_by_name["FetchRequest"] = _FETCHREQUEST +DESCRIPTOR.message_types_by_name["FetchResponse"] = _FETCHRESPONSE +DESCRIPTOR.message_types_by_name["QueryRequest"] = _QUERYREQUEST +DESCRIPTOR.message_types_by_name["QueryResponse"] = _QUERYRESPONSE +DESCRIPTOR.message_types_by_name["DescribeIndexStatsRequest"] = _DESCRIBEINDEXSTATSREQUEST +DESCRIPTOR.message_types_by_name["NamespaceSummary"] = _NAMESPACESUMMARY +DESCRIPTOR.message_types_by_name["DescribeIndexStatsResponse"] = _DESCRIBEINDEXSTATSRESPONSE _sym_db.RegisterFileDescriptor(DESCRIPTOR) -NdArray = _reflection.GeneratedProtocolMessageType('NdArray', (_message.Message,), { - 'DESCRIPTOR' : _NDARRAY, - '__module__' : 'vector_column_service_pb2' - # @@protoc_insertion_point(class_scope:pinecone_columnar.NdArray) - }) +NdArray = _reflection.GeneratedProtocolMessageType( + "NdArray", + (_message.Message,), + { + "DESCRIPTOR": _NDARRAY, + "__module__": "vector_column_service_pb2" + # @@protoc_insertion_point(class_scope:pinecone_columnar.NdArray) + }, +) _sym_db.RegisterMessage(NdArray) -ScoredResults = _reflection.GeneratedProtocolMessageType('ScoredResults', (_message.Message,), { - 'DESCRIPTOR' : _SCOREDRESULTS, - '__module__' : 'vector_column_service_pb2' - # @@protoc_insertion_point(class_scope:pinecone_columnar.ScoredResults) - }) +ScoredResults = _reflection.GeneratedProtocolMessageType( + "ScoredResults", + (_message.Message,), + { + "DESCRIPTOR": _SCOREDRESULTS, + "__module__": "vector_column_service_pb2" + # @@protoc_insertion_point(class_scope:pinecone_columnar.ScoredResults) + }, +) _sym_db.RegisterMessage(ScoredResults) -UpsertRequest = _reflection.GeneratedProtocolMessageType('UpsertRequest', (_message.Message,), { - 'DESCRIPTOR' : _UPSERTREQUEST, - '__module__' : 'vector_column_service_pb2' - # @@protoc_insertion_point(class_scope:pinecone_columnar.UpsertRequest) - }) +UpsertRequest = _reflection.GeneratedProtocolMessageType( + "UpsertRequest", + (_message.Message,), + { + "DESCRIPTOR": _UPSERTREQUEST, + "__module__": "vector_column_service_pb2" + # @@protoc_insertion_point(class_scope:pinecone_columnar.UpsertRequest) + }, +) _sym_db.RegisterMessage(UpsertRequest) -UpsertResponse = _reflection.GeneratedProtocolMessageType('UpsertResponse', (_message.Message,), { - 'DESCRIPTOR' : _UPSERTRESPONSE, - '__module__' : 'vector_column_service_pb2' - # @@protoc_insertion_point(class_scope:pinecone_columnar.UpsertResponse) - }) +UpsertResponse = _reflection.GeneratedProtocolMessageType( + "UpsertResponse", + (_message.Message,), + { + "DESCRIPTOR": _UPSERTRESPONSE, + "__module__": "vector_column_service_pb2" + # @@protoc_insertion_point(class_scope:pinecone_columnar.UpsertResponse) + }, +) _sym_db.RegisterMessage(UpsertResponse) -DeleteRequest = _reflection.GeneratedProtocolMessageType('DeleteRequest', (_message.Message,), { - 'DESCRIPTOR' : _DELETEREQUEST, - '__module__' : 'vector_column_service_pb2' - # @@protoc_insertion_point(class_scope:pinecone_columnar.DeleteRequest) - }) +DeleteRequest = _reflection.GeneratedProtocolMessageType( + "DeleteRequest", + (_message.Message,), + { + "DESCRIPTOR": _DELETEREQUEST, + "__module__": "vector_column_service_pb2" + # @@protoc_insertion_point(class_scope:pinecone_columnar.DeleteRequest) + }, +) _sym_db.RegisterMessage(DeleteRequest) -DeleteResponse = _reflection.GeneratedProtocolMessageType('DeleteResponse', (_message.Message,), { - 'DESCRIPTOR' : _DELETERESPONSE, - '__module__' : 'vector_column_service_pb2' - # @@protoc_insertion_point(class_scope:pinecone_columnar.DeleteResponse) - }) +DeleteResponse = _reflection.GeneratedProtocolMessageType( + "DeleteResponse", + (_message.Message,), + { + "DESCRIPTOR": _DELETERESPONSE, + "__module__": "vector_column_service_pb2" + # @@protoc_insertion_point(class_scope:pinecone_columnar.DeleteResponse) + }, +) _sym_db.RegisterMessage(DeleteResponse) -FetchRequest = _reflection.GeneratedProtocolMessageType('FetchRequest', (_message.Message,), { - 'DESCRIPTOR' : _FETCHREQUEST, - '__module__' : 'vector_column_service_pb2' - # @@protoc_insertion_point(class_scope:pinecone_columnar.FetchRequest) - }) +FetchRequest = _reflection.GeneratedProtocolMessageType( + "FetchRequest", + (_message.Message,), + { + "DESCRIPTOR": _FETCHREQUEST, + "__module__": "vector_column_service_pb2" + # @@protoc_insertion_point(class_scope:pinecone_columnar.FetchRequest) + }, +) _sym_db.RegisterMessage(FetchRequest) -FetchResponse = _reflection.GeneratedProtocolMessageType('FetchResponse', (_message.Message,), { - 'DESCRIPTOR' : _FETCHRESPONSE, - '__module__' : 'vector_column_service_pb2' - # @@protoc_insertion_point(class_scope:pinecone_columnar.FetchResponse) - }) +FetchResponse = _reflection.GeneratedProtocolMessageType( + "FetchResponse", + (_message.Message,), + { + "DESCRIPTOR": _FETCHRESPONSE, + "__module__": "vector_column_service_pb2" + # @@protoc_insertion_point(class_scope:pinecone_columnar.FetchResponse) + }, +) _sym_db.RegisterMessage(FetchResponse) -QueryRequest = _reflection.GeneratedProtocolMessageType('QueryRequest', (_message.Message,), { - 'DESCRIPTOR' : _QUERYREQUEST, - '__module__' : 'vector_column_service_pb2' - # @@protoc_insertion_point(class_scope:pinecone_columnar.QueryRequest) - }) +QueryRequest = _reflection.GeneratedProtocolMessageType( + "QueryRequest", + (_message.Message,), + { + "DESCRIPTOR": _QUERYREQUEST, + "__module__": "vector_column_service_pb2" + # @@protoc_insertion_point(class_scope:pinecone_columnar.QueryRequest) + }, +) _sym_db.RegisterMessage(QueryRequest) -QueryResponse = _reflection.GeneratedProtocolMessageType('QueryResponse', (_message.Message,), { - 'DESCRIPTOR' : _QUERYRESPONSE, - '__module__' : 'vector_column_service_pb2' - # @@protoc_insertion_point(class_scope:pinecone_columnar.QueryResponse) - }) +QueryResponse = _reflection.GeneratedProtocolMessageType( + "QueryResponse", + (_message.Message,), + { + "DESCRIPTOR": _QUERYRESPONSE, + "__module__": "vector_column_service_pb2" + # @@protoc_insertion_point(class_scope:pinecone_columnar.QueryResponse) + }, +) _sym_db.RegisterMessage(QueryResponse) -DescribeIndexStatsRequest = _reflection.GeneratedProtocolMessageType('DescribeIndexStatsRequest', (_message.Message,), { - 'DESCRIPTOR' : _DESCRIBEINDEXSTATSREQUEST, - '__module__' : 'vector_column_service_pb2' - # @@protoc_insertion_point(class_scope:pinecone_columnar.DescribeIndexStatsRequest) - }) +DescribeIndexStatsRequest = _reflection.GeneratedProtocolMessageType( + "DescribeIndexStatsRequest", + (_message.Message,), + { + "DESCRIPTOR": _DESCRIBEINDEXSTATSREQUEST, + "__module__": "vector_column_service_pb2" + # @@protoc_insertion_point(class_scope:pinecone_columnar.DescribeIndexStatsRequest) + }, +) _sym_db.RegisterMessage(DescribeIndexStatsRequest) -NamespaceSummary = _reflection.GeneratedProtocolMessageType('NamespaceSummary', (_message.Message,), { - 'DESCRIPTOR' : _NAMESPACESUMMARY, - '__module__' : 'vector_column_service_pb2' - # @@protoc_insertion_point(class_scope:pinecone_columnar.NamespaceSummary) - }) +NamespaceSummary = _reflection.GeneratedProtocolMessageType( + "NamespaceSummary", + (_message.Message,), + { + "DESCRIPTOR": _NAMESPACESUMMARY, + "__module__": "vector_column_service_pb2" + # @@protoc_insertion_point(class_scope:pinecone_columnar.NamespaceSummary) + }, +) _sym_db.RegisterMessage(NamespaceSummary) -DescribeIndexStatsResponse = _reflection.GeneratedProtocolMessageType('DescribeIndexStatsResponse', (_message.Message,), { - - 'NamespacesEntry' : _reflection.GeneratedProtocolMessageType('NamespacesEntry', (_message.Message,), { - 'DESCRIPTOR' : _DESCRIBEINDEXSTATSRESPONSE_NAMESPACESENTRY, - '__module__' : 'vector_column_service_pb2' - # @@protoc_insertion_point(class_scope:pinecone_columnar.DescribeIndexStatsResponse.NamespacesEntry) - }) - , - 'DESCRIPTOR' : _DESCRIBEINDEXSTATSRESPONSE, - '__module__' : 'vector_column_service_pb2' - # @@protoc_insertion_point(class_scope:pinecone_columnar.DescribeIndexStatsResponse) - }) +DescribeIndexStatsResponse = _reflection.GeneratedProtocolMessageType( + "DescribeIndexStatsResponse", + (_message.Message,), + { + "NamespacesEntry": _reflection.GeneratedProtocolMessageType( + "NamespacesEntry", + (_message.Message,), + { + "DESCRIPTOR": _DESCRIBEINDEXSTATSRESPONSE_NAMESPACESENTRY, + "__module__": "vector_column_service_pb2" + # @@protoc_insertion_point(class_scope:pinecone_columnar.DescribeIndexStatsResponse.NamespacesEntry) + }, + ), + "DESCRIPTOR": _DESCRIBEINDEXSTATSRESPONSE, + "__module__": "vector_column_service_pb2" + # @@protoc_insertion_point(class_scope:pinecone_columnar.DescribeIndexStatsResponse) + }, +) _sym_db.RegisterMessage(DescribeIndexStatsResponse) _sym_db.RegisterMessage(DescribeIndexStatsResponse.NamespacesEntry) @@ -772,68 +1229,69 @@ _DESCRIBEINDEXSTATSRESPONSE_NAMESPACESENTRY._options = None _VECTORCOLUMNSERVICE = _descriptor.ServiceDescriptor( - name='VectorColumnService', - full_name='pinecone_columnar.VectorColumnService', - file=DESCRIPTOR, - index=0, - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_start=1451, - serialized_end=1907, - methods=[ - _descriptor.MethodDescriptor( - name='Upsert', - full_name='pinecone_columnar.VectorColumnService.Upsert', + name="VectorColumnService", + full_name="pinecone_columnar.VectorColumnService", + file=DESCRIPTOR, index=0, - containing_service=None, - input_type=_UPSERTREQUEST, - output_type=_UPSERTRESPONSE, serialized_options=None, create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='Delete', - full_name='pinecone_columnar.VectorColumnService.Delete', - index=1, - containing_service=None, - input_type=_DELETEREQUEST, - output_type=_DELETERESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='Fetch', - full_name='pinecone_columnar.VectorColumnService.Fetch', - index=2, - containing_service=None, - input_type=_FETCHREQUEST, - output_type=_FETCHRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='Query', - full_name='pinecone_columnar.VectorColumnService.Query', - index=3, - containing_service=None, - input_type=_QUERYREQUEST, - output_type=_QUERYRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='DescribeIndexStats', - full_name='pinecone_columnar.VectorColumnService.DescribeIndexStats', - index=4, - containing_service=None, - input_type=_DESCRIBEINDEXSTATSREQUEST, - output_type=_DESCRIBEINDEXSTATSRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), -]) + serialized_start=1451, + serialized_end=1907, + methods=[ + _descriptor.MethodDescriptor( + name="Upsert", + full_name="pinecone_columnar.VectorColumnService.Upsert", + index=0, + containing_service=None, + input_type=_UPSERTREQUEST, + output_type=_UPSERTRESPONSE, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name="Delete", + full_name="pinecone_columnar.VectorColumnService.Delete", + index=1, + containing_service=None, + input_type=_DELETEREQUEST, + output_type=_DELETERESPONSE, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name="Fetch", + full_name="pinecone_columnar.VectorColumnService.Fetch", + index=2, + containing_service=None, + input_type=_FETCHREQUEST, + output_type=_FETCHRESPONSE, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name="Query", + full_name="pinecone_columnar.VectorColumnService.Query", + index=3, + containing_service=None, + input_type=_QUERYREQUEST, + output_type=_QUERYRESPONSE, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name="DescribeIndexStats", + full_name="pinecone_columnar.VectorColumnService.DescribeIndexStats", + index=4, + containing_service=None, + input_type=_DESCRIBEINDEXSTATSREQUEST, + output_type=_DESCRIBEINDEXSTATSRESPONSE, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + ], +) _sym_db.RegisterServiceDescriptor(_VECTORCOLUMNSERVICE) -DESCRIPTOR.services_by_name['VectorColumnService'] = _VECTORCOLUMNSERVICE +DESCRIPTOR.services_by_name["VectorColumnService"] = _VECTORCOLUMNSERVICE # @@protoc_insertion_point(module_scope) diff --git a/pinecone/core/grpc/protos/vector_column_service_pb2.pyi b/pinecone/core/grpc/protos/vector_column_service_pb2.pyi index 2678875a..3b85ddb1 100644 --- a/pinecone/core/grpc/protos/vector_column_service_pb2.pyi +++ b/pinecone/core/grpc/protos/vector_column_service_pb2.pyi @@ -30,13 +30,11 @@ from typing_extensions import ( Literal as typing_extensions___Literal, ) - builtin___bool = bool builtin___bytes = bytes builtin___float = float builtin___int = int - DESCRIPTOR: google___protobuf___descriptor___FileDescriptor = ... class NdArray(google___protobuf___message___Message): @@ -46,14 +44,21 @@ class NdArray(google___protobuf___message___Message): dtype: typing___Text = ... compressed: builtin___bool = ... - def __init__(self, + def __init__( + self, *, - buffer : typing___Optional[builtin___bytes] = None, - shape : typing___Optional[typing___Iterable[builtin___int]] = None, - dtype : typing___Optional[typing___Text] = None, - compressed : typing___Optional[builtin___bool] = None, - ) -> None: ... - def ClearField(self, field_name: typing_extensions___Literal[u"buffer",b"buffer",u"compressed",b"compressed",u"dtype",b"dtype",u"shape",b"shape"]) -> None: ... + buffer: typing___Optional[builtin___bytes] = None, + shape: typing___Optional[typing___Iterable[builtin___int]] = None, + dtype: typing___Optional[typing___Text] = None, + compressed: typing___Optional[builtin___bool] = None, + ) -> None: ... + def ClearField( + self, + field_name: typing_extensions___Literal[ + "buffer", b"buffer", "compressed", b"compressed", "dtype", b"dtype", "shape", b"shape" + ], + ) -> None: ... + type___NdArray = NdArray class ScoredResults(google___protobuf___message___Message): @@ -61,25 +66,33 @@ class ScoredResults(google___protobuf___message___Message): @property def ids(self) -> type___NdArray: ... - @property def scores(self) -> type___NdArray: ... - @property def data(self) -> type___NdArray: ... - @property def metadata(self) -> type___NdArray: ... - - def __init__(self, + def __init__( + self, *, - ids : typing___Optional[type___NdArray] = None, - scores : typing___Optional[type___NdArray] = None, - data : typing___Optional[type___NdArray] = None, - metadata : typing___Optional[type___NdArray] = None, - ) -> None: ... - def HasField(self, field_name: typing_extensions___Literal[u"data",b"data",u"ids",b"ids",u"metadata",b"metadata",u"scores",b"scores"]) -> builtin___bool: ... - def ClearField(self, field_name: typing_extensions___Literal[u"data",b"data",u"ids",b"ids",u"metadata",b"metadata",u"scores",b"scores"]) -> None: ... + ids: typing___Optional[type___NdArray] = None, + scores: typing___Optional[type___NdArray] = None, + data: typing___Optional[type___NdArray] = None, + metadata: typing___Optional[type___NdArray] = None, + ) -> None: ... + def HasField( + self, + field_name: typing_extensions___Literal[ + "data", b"data", "ids", b"ids", "metadata", b"metadata", "scores", b"scores" + ], + ) -> builtin___bool: ... + def ClearField( + self, + field_name: typing_extensions___Literal[ + "data", b"data", "ids", b"ids", "metadata", b"metadata", "scores", b"scores" + ], + ) -> None: ... + type___ScoredResults = ScoredResults class UpsertRequest(google___protobuf___message___Message): @@ -89,30 +102,41 @@ class UpsertRequest(google___protobuf___message___Message): @property def data(self) -> type___NdArray: ... - @property - def metadata(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[google___protobuf___struct_pb2___Struct]: ... - - def __init__(self, + def metadata( + self, + ) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[ + google___protobuf___struct_pb2___Struct + ]: ... + def __init__( + self, *, - namespace : typing___Optional[typing___Text] = None, - ids : typing___Optional[typing___Iterable[typing___Text]] = None, - data : typing___Optional[type___NdArray] = None, - metadata : typing___Optional[typing___Iterable[google___protobuf___struct_pb2___Struct]] = None, - ) -> None: ... - def HasField(self, field_name: typing_extensions___Literal[u"data",b"data"]) -> builtin___bool: ... - def ClearField(self, field_name: typing_extensions___Literal[u"data",b"data",u"ids",b"ids",u"metadata",b"metadata",u"namespace",b"namespace"]) -> None: ... + namespace: typing___Optional[typing___Text] = None, + ids: typing___Optional[typing___Iterable[typing___Text]] = None, + data: typing___Optional[type___NdArray] = None, + metadata: typing___Optional[typing___Iterable[google___protobuf___struct_pb2___Struct]] = None, + ) -> None: ... + def HasField(self, field_name: typing_extensions___Literal["data", b"data"]) -> builtin___bool: ... + def ClearField( + self, + field_name: typing_extensions___Literal[ + "data", b"data", "ids", b"ids", "metadata", b"metadata", "namespace", b"namespace" + ], + ) -> None: ... + type___UpsertRequest = UpsertRequest class UpsertResponse(google___protobuf___message___Message): DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... upserted_count: builtin___int = ... - def __init__(self, + def __init__( + self, *, - upserted_count : typing___Optional[builtin___int] = None, - ) -> None: ... - def ClearField(self, field_name: typing_extensions___Literal[u"upserted_count",b"upserted_count"]) -> None: ... + upserted_count: typing___Optional[builtin___int] = None, + ) -> None: ... + def ClearField(self, field_name: typing_extensions___Literal["upserted_count", b"upserted_count"]) -> None: ... + type___UpsertResponse = UpsertResponse class DeleteRequest(google___protobuf___message___Message): @@ -121,20 +145,27 @@ class DeleteRequest(google___protobuf___message___Message): ids: google___protobuf___internal___containers___RepeatedScalarFieldContainer[typing___Text] = ... delete_all: builtin___bool = ... - def __init__(self, + def __init__( + self, *, - namespace : typing___Optional[typing___Text] = None, - ids : typing___Optional[typing___Iterable[typing___Text]] = None, - delete_all : typing___Optional[builtin___bool] = None, - ) -> None: ... - def ClearField(self, field_name: typing_extensions___Literal[u"delete_all",b"delete_all",u"ids",b"ids",u"namespace",b"namespace"]) -> None: ... + namespace: typing___Optional[typing___Text] = None, + ids: typing___Optional[typing___Iterable[typing___Text]] = None, + delete_all: typing___Optional[builtin___bool] = None, + ) -> None: ... + def ClearField( + self, + field_name: typing_extensions___Literal["delete_all", b"delete_all", "ids", b"ids", "namespace", b"namespace"], + ) -> None: ... + type___DeleteRequest = DeleteRequest class DeleteResponse(google___protobuf___message___Message): DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... - def __init__(self, - ) -> None: ... + def __init__( + self, + ) -> None: ... + type___DeleteResponse = DeleteResponse class FetchRequest(google___protobuf___message___Message): @@ -142,12 +173,14 @@ class FetchRequest(google___protobuf___message___Message): namespace: typing___Text = ... ids: google___protobuf___internal___containers___RepeatedScalarFieldContainer[typing___Text] = ... - def __init__(self, + def __init__( + self, *, - namespace : typing___Optional[typing___Text] = None, - ids : typing___Optional[typing___Iterable[typing___Text]] = None, - ) -> None: ... - def ClearField(self, field_name: typing_extensions___Literal[u"ids",b"ids",u"namespace",b"namespace"]) -> None: ... + namespace: typing___Optional[typing___Text] = None, + ids: typing___Optional[typing___Iterable[typing___Text]] = None, + ) -> None: ... + def ClearField(self, field_name: typing_extensions___Literal["ids", b"ids", "namespace", b"namespace"]) -> None: ... + type___FetchRequest = FetchRequest class FetchResponse(google___protobuf___message___Message): @@ -156,19 +189,30 @@ class FetchResponse(google___protobuf___message___Message): ids: google___protobuf___internal___containers___RepeatedScalarFieldContainer[typing___Text] = ... @property - def vectors(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___NdArray]: ... - + def vectors( + self, + ) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___NdArray]: ... @property - def metadata(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[google___protobuf___struct_pb2___Struct]: ... - - def __init__(self, + def metadata( + self, + ) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[ + google___protobuf___struct_pb2___Struct + ]: ... + def __init__( + self, *, - namespace : typing___Optional[typing___Text] = None, - ids : typing___Optional[typing___Iterable[typing___Text]] = None, - vectors : typing___Optional[typing___Iterable[type___NdArray]] = None, - metadata : typing___Optional[typing___Iterable[google___protobuf___struct_pb2___Struct]] = None, - ) -> None: ... - def ClearField(self, field_name: typing_extensions___Literal[u"ids",b"ids",u"metadata",b"metadata",u"namespace",b"namespace",u"vectors",b"vectors"]) -> None: ... + namespace: typing___Optional[typing___Text] = None, + ids: typing___Optional[typing___Iterable[typing___Text]] = None, + vectors: typing___Optional[typing___Iterable[type___NdArray]] = None, + metadata: typing___Optional[typing___Iterable[google___protobuf___struct_pb2___Struct]] = None, + ) -> None: ... + def ClearField( + self, + field_name: typing_extensions___Literal[ + "ids", b"ids", "metadata", b"metadata", "namespace", b"namespace", "vectors", b"vectors" + ], + ) -> None: ... + type___FetchResponse = FetchResponse class QueryRequest(google___protobuf___message___Message): @@ -182,87 +226,125 @@ class QueryRequest(google___protobuf___message___Message): @property def filter(self) -> google___protobuf___struct_pb2___Struct: ... - @property - def filter_overrides(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[google___protobuf___struct_pb2___Struct]: ... - + def filter_overrides( + self, + ) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[ + google___protobuf___struct_pb2___Struct + ]: ... @property def queries(self) -> type___NdArray: ... - - def __init__(self, + def __init__( + self, *, - namespace : typing___Optional[typing___Text] = None, - namespace_overrides : typing___Optional[typing___Iterable[typing___Text]] = None, - top_k : typing___Optional[builtin___int] = None, - top_k_overrides : typing___Optional[typing___Iterable[builtin___int]] = None, - filter : typing___Optional[google___protobuf___struct_pb2___Struct] = None, - filter_overrides : typing___Optional[typing___Iterable[google___protobuf___struct_pb2___Struct]] = None, - include_values : typing___Optional[builtin___bool] = None, - include_metadata : typing___Optional[builtin___bool] = None, - queries : typing___Optional[type___NdArray] = None, - ) -> None: ... - def HasField(self, field_name: typing_extensions___Literal[u"filter",b"filter",u"queries",b"queries"]) -> builtin___bool: ... - def ClearField(self, field_name: typing_extensions___Literal[u"filter",b"filter",u"filter_overrides",b"filter_overrides",u"include_metadata",b"include_metadata",u"include_values",b"include_values",u"namespace",b"namespace",u"namespace_overrides",b"namespace_overrides",u"queries",b"queries",u"top_k",b"top_k",u"top_k_overrides",b"top_k_overrides"]) -> None: ... + namespace: typing___Optional[typing___Text] = None, + namespace_overrides: typing___Optional[typing___Iterable[typing___Text]] = None, + top_k: typing___Optional[builtin___int] = None, + top_k_overrides: typing___Optional[typing___Iterable[builtin___int]] = None, + filter: typing___Optional[google___protobuf___struct_pb2___Struct] = None, + filter_overrides: typing___Optional[typing___Iterable[google___protobuf___struct_pb2___Struct]] = None, + include_values: typing___Optional[builtin___bool] = None, + include_metadata: typing___Optional[builtin___bool] = None, + queries: typing___Optional[type___NdArray] = None, + ) -> None: ... + def HasField( + self, field_name: typing_extensions___Literal["filter", b"filter", "queries", b"queries"] + ) -> builtin___bool: ... + def ClearField( + self, + field_name: typing_extensions___Literal[ + "filter", + b"filter", + "filter_overrides", + b"filter_overrides", + "include_metadata", + b"include_metadata", + "include_values", + b"include_values", + "namespace", + b"namespace", + "namespace_overrides", + b"namespace_overrides", + "queries", + b"queries", + "top_k", + b"top_k", + "top_k_overrides", + b"top_k_overrides", + ], + ) -> None: ... + type___QueryRequest = QueryRequest class QueryResponse(google___protobuf___message___Message): DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... @property - def matches(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___ScoredResults]: ... - - def __init__(self, + def matches( + self, + ) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___ScoredResults]: ... + def __init__( + self, *, - matches : typing___Optional[typing___Iterable[type___ScoredResults]] = None, - ) -> None: ... - def ClearField(self, field_name: typing_extensions___Literal[u"matches",b"matches"]) -> None: ... + matches: typing___Optional[typing___Iterable[type___ScoredResults]] = None, + ) -> None: ... + def ClearField(self, field_name: typing_extensions___Literal["matches", b"matches"]) -> None: ... + type___QueryResponse = QueryResponse class DescribeIndexStatsRequest(google___protobuf___message___Message): DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... - def __init__(self, - ) -> None: ... + def __init__( + self, + ) -> None: ... + type___DescribeIndexStatsRequest = DescribeIndexStatsRequest class NamespaceSummary(google___protobuf___message___Message): DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... vector_count: builtin___int = ... - def __init__(self, + def __init__( + self, *, - vector_count : typing___Optional[builtin___int] = None, - ) -> None: ... - def ClearField(self, field_name: typing_extensions___Literal[u"vector_count",b"vector_count"]) -> None: ... + vector_count: typing___Optional[builtin___int] = None, + ) -> None: ... + def ClearField(self, field_name: typing_extensions___Literal["vector_count", b"vector_count"]) -> None: ... + type___NamespaceSummary = NamespaceSummary class DescribeIndexStatsResponse(google___protobuf___message___Message): DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... + class NamespacesEntry(google___protobuf___message___Message): DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... key: typing___Text = ... @property def value(self) -> type___NamespaceSummary: ... - - def __init__(self, + def __init__( + self, *, - key : typing___Optional[typing___Text] = None, - value : typing___Optional[type___NamespaceSummary] = None, - ) -> None: ... - def HasField(self, field_name: typing_extensions___Literal[u"value",b"value"]) -> builtin___bool: ... - def ClearField(self, field_name: typing_extensions___Literal[u"key",b"key",u"value",b"value"]) -> None: ... + key: typing___Optional[typing___Text] = None, + value: typing___Optional[type___NamespaceSummary] = None, + ) -> None: ... + def HasField(self, field_name: typing_extensions___Literal["value", b"value"]) -> builtin___bool: ... + def ClearField(self, field_name: typing_extensions___Literal["key", b"key", "value", b"value"]) -> None: ... type___NamespacesEntry = NamespacesEntry dimension: builtin___int = ... @property def namespaces(self) -> typing___MutableMapping[typing___Text, type___NamespaceSummary]: ... - - def __init__(self, + def __init__( + self, *, - namespaces : typing___Optional[typing___Mapping[typing___Text, type___NamespaceSummary]] = None, - dimension : typing___Optional[builtin___int] = None, - ) -> None: ... - def ClearField(self, field_name: typing_extensions___Literal[u"dimension",b"dimension",u"namespaces",b"namespaces"]) -> None: ... + namespaces: typing___Optional[typing___Mapping[typing___Text, type___NamespaceSummary]] = None, + dimension: typing___Optional[builtin___int] = None, + ) -> None: ... + def ClearField( + self, field_name: typing_extensions___Literal["dimension", b"dimension", "namespaces", b"namespaces"] + ) -> None: ... + type___DescribeIndexStatsResponse = DescribeIndexStatsResponse diff --git a/pinecone/core/grpc/protos/vector_column_service_pb2_grpc.py b/pinecone/core/grpc/protos/vector_column_service_pb2_grpc.py index 0e66805b..f4a95518 100644 --- a/pinecone/core/grpc/protos/vector_column_service_pb2_grpc.py +++ b/pinecone/core/grpc/protos/vector_column_service_pb2_grpc.py @@ -8,6 +8,7 @@ import pinecone.core.grpc.protos.vector_column_service_pb2 as vector__column__service__pb2 + class VectorColumnServiceStub(object): """The `VectorColumnService` interface is exposed by Pinecone vector index services. The `Upsert` operation is for uploading the data (the vector ids and values) to be indexed. @@ -20,30 +21,30 @@ def __init__(self, channel): channel: A grpc.Channel. """ self.Upsert = channel.unary_unary( - '/pinecone_columnar.VectorColumnService/Upsert', - request_serializer=vector__column__service__pb2.UpsertRequest.SerializeToString, - response_deserializer=vector__column__service__pb2.UpsertResponse.FromString, - ) + "/pinecone_columnar.VectorColumnService/Upsert", + request_serializer=vector__column__service__pb2.UpsertRequest.SerializeToString, + response_deserializer=vector__column__service__pb2.UpsertResponse.FromString, + ) self.Delete = channel.unary_unary( - '/pinecone_columnar.VectorColumnService/Delete', - request_serializer=vector__column__service__pb2.DeleteRequest.SerializeToString, - response_deserializer=vector__column__service__pb2.DeleteResponse.FromString, - ) + "/pinecone_columnar.VectorColumnService/Delete", + request_serializer=vector__column__service__pb2.DeleteRequest.SerializeToString, + response_deserializer=vector__column__service__pb2.DeleteResponse.FromString, + ) self.Fetch = channel.unary_unary( - '/pinecone_columnar.VectorColumnService/Fetch', - request_serializer=vector__column__service__pb2.FetchRequest.SerializeToString, - response_deserializer=vector__column__service__pb2.FetchResponse.FromString, - ) + "/pinecone_columnar.VectorColumnService/Fetch", + request_serializer=vector__column__service__pb2.FetchRequest.SerializeToString, + response_deserializer=vector__column__service__pb2.FetchResponse.FromString, + ) self.Query = channel.unary_unary( - '/pinecone_columnar.VectorColumnService/Query', - request_serializer=vector__column__service__pb2.QueryRequest.SerializeToString, - response_deserializer=vector__column__service__pb2.QueryResponse.FromString, - ) + "/pinecone_columnar.VectorColumnService/Query", + request_serializer=vector__column__service__pb2.QueryRequest.SerializeToString, + response_deserializer=vector__column__service__pb2.QueryResponse.FromString, + ) self.DescribeIndexStats = channel.unary_unary( - '/pinecone_columnar.VectorColumnService/DescribeIndexStats', - request_serializer=vector__column__service__pb2.DescribeIndexStatsRequest.SerializeToString, - response_deserializer=vector__column__service__pb2.DescribeIndexStatsResponse.FromString, - ) + "/pinecone_columnar.VectorColumnService/DescribeIndexStats", + request_serializer=vector__column__service__pb2.DescribeIndexStatsRequest.SerializeToString, + response_deserializer=vector__column__service__pb2.DescribeIndexStatsResponse.FromString, + ) class VectorColumnServiceServicer(object): @@ -52,163 +53,219 @@ class VectorColumnServiceServicer(object): """ def Upsert(self, request, context): - """If a user upserts a new value for an existing vector id, it overwrites the previous value. - """ + """If a user upserts a new value for an existing vector id, it overwrites the previous value.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") def Delete(self, request, context): - """The `Delete` operation deletes multiple vectors ids from a single namespace. + """The `Delete` operation deletes multiple vectors ids from a single namespace. Specifying `delete_all` will delete all vectors from the default namespace. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") def Fetch(self, request, context): - """The `Fetch` operation returns a vector value by id. - """ + """The `Fetch` operation returns a vector value by id.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") def Query(self, request, context): """The `Query` operation queries the index for the nearest stored vectors to one or more query vectors, and returns their ids and/or values. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") def DescribeIndexStats(self, request, context): - """The `DescribeIndexStats` operation returns summary statistics about the index contents. - """ + """The `DescribeIndexStats` operation returns summary statistics about the index contents.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") def add_VectorColumnServiceServicer_to_server(servicer, server): rpc_method_handlers = { - 'Upsert': grpc.unary_unary_rpc_method_handler( - servicer.Upsert, - request_deserializer=vector__column__service__pb2.UpsertRequest.FromString, - response_serializer=vector__column__service__pb2.UpsertResponse.SerializeToString, - ), - 'Delete': grpc.unary_unary_rpc_method_handler( - servicer.Delete, - request_deserializer=vector__column__service__pb2.DeleteRequest.FromString, - response_serializer=vector__column__service__pb2.DeleteResponse.SerializeToString, - ), - 'Fetch': grpc.unary_unary_rpc_method_handler( - servicer.Fetch, - request_deserializer=vector__column__service__pb2.FetchRequest.FromString, - response_serializer=vector__column__service__pb2.FetchResponse.SerializeToString, - ), - 'Query': grpc.unary_unary_rpc_method_handler( - servicer.Query, - request_deserializer=vector__column__service__pb2.QueryRequest.FromString, - response_serializer=vector__column__service__pb2.QueryResponse.SerializeToString, - ), - 'DescribeIndexStats': grpc.unary_unary_rpc_method_handler( - servicer.DescribeIndexStats, - request_deserializer=vector__column__service__pb2.DescribeIndexStatsRequest.FromString, - response_serializer=vector__column__service__pb2.DescribeIndexStatsResponse.SerializeToString, - ), + "Upsert": grpc.unary_unary_rpc_method_handler( + servicer.Upsert, + request_deserializer=vector__column__service__pb2.UpsertRequest.FromString, + response_serializer=vector__column__service__pb2.UpsertResponse.SerializeToString, + ), + "Delete": grpc.unary_unary_rpc_method_handler( + servicer.Delete, + request_deserializer=vector__column__service__pb2.DeleteRequest.FromString, + response_serializer=vector__column__service__pb2.DeleteResponse.SerializeToString, + ), + "Fetch": grpc.unary_unary_rpc_method_handler( + servicer.Fetch, + request_deserializer=vector__column__service__pb2.FetchRequest.FromString, + response_serializer=vector__column__service__pb2.FetchResponse.SerializeToString, + ), + "Query": grpc.unary_unary_rpc_method_handler( + servicer.Query, + request_deserializer=vector__column__service__pb2.QueryRequest.FromString, + response_serializer=vector__column__service__pb2.QueryResponse.SerializeToString, + ), + "DescribeIndexStats": grpc.unary_unary_rpc_method_handler( + servicer.DescribeIndexStats, + request_deserializer=vector__column__service__pb2.DescribeIndexStatsRequest.FromString, + response_serializer=vector__column__service__pb2.DescribeIndexStatsResponse.SerializeToString, + ), } - generic_handler = grpc.method_handlers_generic_handler( - 'pinecone_columnar.VectorColumnService', rpc_method_handlers) + generic_handler = grpc.method_handlers_generic_handler("pinecone_columnar.VectorColumnService", rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) - # This class is part of an EXPERIMENTAL API. +# This class is part of an EXPERIMENTAL API. class VectorColumnService(object): """The `VectorColumnService` interface is exposed by Pinecone vector index services. The `Upsert` operation is for uploading the data (the vector ids and values) to be indexed. """ @staticmethod - def Upsert(request, + def Upsert( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/pinecone_columnar.VectorColumnService/Upsert', + "/pinecone_columnar.VectorColumnService/Upsert", vector__column__service__pb2.UpsertRequest.SerializeToString, vector__column__service__pb2.UpsertResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) @staticmethod - def Delete(request, + def Delete( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/pinecone_columnar.VectorColumnService/Delete', + "/pinecone_columnar.VectorColumnService/Delete", vector__column__service__pb2.DeleteRequest.SerializeToString, vector__column__service__pb2.DeleteResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) @staticmethod - def Fetch(request, + def Fetch( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/pinecone_columnar.VectorColumnService/Fetch', + "/pinecone_columnar.VectorColumnService/Fetch", vector__column__service__pb2.FetchRequest.SerializeToString, vector__column__service__pb2.FetchResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) @staticmethod - def Query(request, + def Query( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/pinecone_columnar.VectorColumnService/Query', + "/pinecone_columnar.VectorColumnService/Query", vector__column__service__pb2.QueryRequest.SerializeToString, vector__column__service__pb2.QueryResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) @staticmethod - def DescribeIndexStats(request, + def DescribeIndexStats( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/pinecone_columnar.VectorColumnService/DescribeIndexStats', + "/pinecone_columnar.VectorColumnService/DescribeIndexStats", vector__column__service__pb2.DescribeIndexStatsRequest.SerializeToString, vector__column__service__pb2.DescribeIndexStatsResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) diff --git a/pinecone/core/grpc/protos/vector_service_pb2.py b/pinecone/core/grpc/protos/vector_service_pb2.py index 8acbcd3e..456ab251 100644 --- a/pinecone/core/grpc/protos/vector_service_pb2.py +++ b/pinecone/core/grpc/protos/vector_service_pb2.py @@ -10,6 +10,7 @@ from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database + # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() @@ -22,1211 +23,1905 @@ DESCRIPTOR = _descriptor.FileDescriptor( - name='vector_service.proto', - package='', - syntax='proto3', - serialized_options=b'\n\021io.pinecone.protoP\001Z/github.com/pinecone-io/new-go-pinecone/pinecone\222A\366\002\022K\n\014Pinecone API\";\n\017Pinecone.io Ops\022\023https://pinecone.io\032\023support@pinecone.io\0329{index_name}-{project_name}.svc.{environment}.pinecone.io*\001\0022\020application/json:\020application/jsonZx\nv\n\nApiKeyAuth\022h\010\002\022YAn API Key is required to call Pinecone APIs. Get yours at https://www.pinecone.io/start/\032\007Api-Key \002b\020\n\016\n\nApiKeyAuth\022\000r9\n\031More Pinecone.io API docs\022\034https://www.pinecone.io/docs', - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\x14vector_service.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a.protoc-gen-openapiv2/options/annotations.proto\"~\n\x0cSparseValues\x12\x35\n\x07indices\x18\x01 \x03(\rB$\x92\x41\x1eJ\x16[1, 312, 822, 14, 980]x\xe8\x07\x80\x01\x01\xe0\x41\x02\x12\x37\n\x06values\x18\x02 \x03(\x02\x42\'\x92\x41!J\x19[0.1, 0.2, 0.3, 0.4, 0.5]x\xe8\x07\x80\x01\x01\xe0\x41\x02\"\xfd\x01\n\x06Vector\x12,\n\x02id\x18\x01 \x01(\tB \x92\x41\x1aJ\x12\"example-vector-1\"x\x80\x04\x80\x01\x01\xe0\x41\x02\x12G\n\x06values\x18\x02 \x03(\x02\x42\x37\x92\x41\x31J([0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8]x\xa0\x9c\x01\x80\x01\x01\xe0\x41\x02\x12$\n\rsparse_values\x18\x04 \x01(\x0b\x32\r.SparseValues\x12V\n\x08metadata\x18\x03 \x01(\x0b\x32\x17.google.protobuf.StructB+\x92\x41(J&{\"genre\": \"documentary\", \"year\": 2019}\"\x93\x02\n\x0cScoredVector\x12,\n\x02id\x18\x01 \x01(\tB \x92\x41\x1aJ\x12\"example-vector-1\"x\x80\x04\x80\x01\x01\xe0\x41\x02\x12\x18\n\x05score\x18\x02 \x01(\x02\x42\t\x92\x41\x06J\x04\x30.08\x12=\n\x06values\x18\x03 \x03(\x02\x42-\x92\x41*J([0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8]\x12$\n\rsparse_values\x18\x05 \x01(\x0b\x32\r.SparseValues\x12V\n\x08metadata\x18\x04 \x01(\x0b\x32\x17.google.protobuf.StructB+\x92\x41(J&{\"genre\": \"documentary\", \"year\": 2019}\"d\n\rUpsertRequest\x12&\n\x07vectors\x18\x01 \x03(\x0b\x32\x07.VectorB\x0c\x92\x41\x06x\xe8\x07\x80\x01\x01\xe0\x41\x02\x12+\n\tnamespace\x18\x02 \x01(\tB\x18\x92\x41\x15J\x13\"example-namespace\"\"1\n\x0eUpsertResponse\x12\x1f\n\x0eupserted_count\x18\x01 \x01(\rB\x07\x92\x41\x04J\x02\x31\x30\"\xb6\x01\n\rDeleteRequest\x12(\n\x03ids\x18\x01 \x03(\tB\x1b\x92\x41\x18J\x10[\"id-0\", \"id-1\"]x\xe8\x07\x80\x01\x01\x12%\n\ndelete_all\x18\x02 \x01(\x08\x42\x11\x92\x41\x0e:\x05\x66\x61lseJ\x05\x66\x61lse\x12+\n\tnamespace\x18\x03 \x01(\tB\x18\x92\x41\x15J\x13\"example-namespace\"\x12\'\n\x06\x66ilter\x18\x04 \x01(\x0b\x32\x17.google.protobuf.Struct\"\x10\n\x0e\x44\x65leteResponse\"h\n\x0c\x46\x65tchRequest\x12+\n\x03ids\x18\x01 \x03(\tB\x1e\x92\x41\x18J\x10[\"id-0\", \"id-1\"]x\xe8\x07\x80\x01\x01\xe0\x41\x02\x12+\n\tnamespace\x18\x02 \x01(\tB\x18\x92\x41\x15J\x13\"example-namespace\"\"\xa3\x01\n\rFetchResponse\x12,\n\x07vectors\x18\x01 \x03(\x0b\x32\x1b.FetchResponse.VectorsEntry\x12+\n\tnamespace\x18\x02 \x01(\tB\x18\x92\x41\x15J\x13\"example-namespace\"\x1a\x37\n\x0cVectorsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x16\n\x05value\x18\x02 \x01(\x0b\x32\x07.Vector:\x02\x38\x01\"\xd0\x02\n\x0bQueryVector\x12G\n\x06values\x18\x01 \x03(\x02\x42\x37\x92\x41\x31J([0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8]x\xa0\x9c\x01\x80\x01\x01\xe0\x41\x02\x12$\n\rsparse_values\x18\x05 \x01(\x0b\x32\r.SparseValues\x12(\n\x05top_k\x18\x02 \x01(\rB\x19\x92\x41\x16J\x02\x31\x30Y\x00\x00\x00\x00\x00\x88\xc3@i\x00\x00\x00\x00\x00\x00\xf0?\x12+\n\tnamespace\x18\x03 \x01(\tB\x18\x92\x41\x15J\x13\"example-namespace\"\x12{\n\x06\x66ilter\x18\x04 \x01(\x0b\x32\x17.google.protobuf.StructBR\x92\x41OJM{\"genre\": {\"$in\": [\"comedy\", \"documentary\", \"drama\"]}, \"year\": {\"$eq\": 2019}}\"\xfa\x03\n\x0cQueryRequest\x12+\n\tnamespace\x18\x01 \x01(\tB\x18\x92\x41\x15J\x13\"example-namespace\"\x12+\n\x05top_k\x18\x02 \x01(\rB\x1c\x92\x41\x16J\x02\x31\x30Y\x00\x00\x00\x00\x00\x88\xc3@i\x00\x00\x00\x00\x00\x00\xf0?\xe0\x41\x02\x12{\n\x06\x66ilter\x18\x03 \x01(\x0b\x32\x17.google.protobuf.StructBR\x92\x41OJM{\"genre\": {\"$in\": [\"comedy\", \"documentary\", \"drama\"]}, \"year\": {\"$eq\": 2019}}\x12(\n\x0einclude_values\x18\x04 \x01(\x08\x42\x10\x92\x41\r:\x05\x66\x61lseJ\x04true\x12*\n\x10include_metadata\x18\x05 \x01(\x08\x42\x10\x92\x41\r:\x05\x66\x61lseJ\x04true\x12)\n\x07queries\x18\x06 \x03(\x0b\x32\x0c.QueryVectorB\n\x18\x01\x92\x41\x05x\n\x80\x01\x01\x12\x44\n\x06vector\x18\x07 \x03(\x02\x42\x34\x92\x41\x31J([0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8]x\xa0\x9c\x01\x80\x01\x01\x12$\n\rsparse_vector\x18\t \x01(\x0b\x32\r.SparseValues\x12&\n\x02id\x18\x08 \x01(\tB\x1a\x92\x41\x17J\x12\"example-vector-1\"x\x80\x04\"a\n\x12SingleQueryResults\x12\x1e\n\x07matches\x18\x01 \x03(\x0b\x32\r.ScoredVector\x12+\n\tnamespace\x18\x02 \x01(\tB\x18\x92\x41\x15J\x13\"example-namespace\"\"l\n\rQueryResponse\x12(\n\x07results\x18\x01 \x03(\x0b\x32\x13.SingleQueryResultsB\x02\x18\x01\x12\x1e\n\x07matches\x18\x02 \x03(\x0b\x32\r.ScoredVector\x12\x11\n\tnamespace\x18\x03 \x01(\t\"\xb2\x02\n\rUpdateRequest\x12,\n\x02id\x18\x01 \x01(\tB \x92\x41\x1aJ\x12\"example-vector-1\"x\x80\x04\x80\x01\x01\xe0\x41\x02\x12\x44\n\x06values\x18\x02 \x03(\x02\x42\x34\x92\x41\x31J([0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8]x\xa0\x9c\x01\x80\x01\x01\x12$\n\rsparse_values\x18\x05 \x01(\x0b\x32\r.SparseValues\x12Z\n\x0cset_metadata\x18\x03 \x01(\x0b\x32\x17.google.protobuf.StructB+\x92\x41(J&{\"genre\": \"documentary\", \"year\": 2019}\x12+\n\tnamespace\x18\x04 \x01(\tB\x18\x92\x41\x15J\x13\"example-namespace\"\"\x10\n\x0eUpdateResponse\"D\n\x19\x44\x65scribeIndexStatsRequest\x12\'\n\x06\x66ilter\x18\x01 \x01(\x0b\x32\x17.google.protobuf.Struct\"4\n\x10NamespaceSummary\x12 \n\x0cvector_count\x18\x01 \x01(\rB\n\x92\x41\x07J\x05\x35\x30\x30\x30\x30\"\x9a\x03\n\x1a\x44\x65scribeIndexStatsResponse\x12?\n\nnamespaces\x18\x01 \x03(\x0b\x32+.DescribeIndexStatsResponse.NamespacesEntry\x12\x1c\n\tdimension\x18\x02 \x01(\rB\t\x92\x41\x06J\x04\x31\x30\x32\x34\x12 \n\x0eindex_fullness\x18\x03 \x01(\x02\x42\x08\x92\x41\x05J\x03\x30.4\x12&\n\x12total_vector_count\x18\x04 \x01(\rB\n\x92\x41\x07J\x05\x38\x30\x30\x30\x30\x1a\x44\n\x0fNamespacesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12 \n\x05value\x18\x02 \x01(\x0b\x32\x11.NamespaceSummary:\x02\x38\x01:\x8c\x01\x92\x41\x88\x01\x32\x85\x01{\"namespaces\": {\"\": {\"vectorCount\": 50000}, \"example-namespace-2\": {\"vectorCount\": 30000}}, \"dimension\": 1024, \"index_fullness\": 0.4}2\xbd\x05\n\rVectorService\x12\x63\n\x06Upsert\x12\x0e.UpsertRequest\x1a\x0f.UpsertResponse\"8\x82\xd3\xe4\x93\x02\x14\"\x0f/vectors/upsert:\x01*\x92\x41\x1b\n\x11Vector Operations*\x06upsert\x12v\n\x06\x44\x65lete\x12\x0e.DeleteRequest\x1a\x0f.DeleteResponse\"K\x82\xd3\xe4\x93\x02\'\"\x0f/vectors/delete:\x01*Z\x11*\x0f/vectors/delete\x92\x41\x1b\n\x11Vector Operations*\x06\x64\x65lete\x12[\n\x05\x46\x65tch\x12\r.FetchRequest\x1a\x0e.FetchResponse\"3\x82\xd3\xe4\x93\x02\x10\x12\x0e/vectors/fetch\x92\x41\x1a\n\x11Vector Operations*\x05\x66\x65tch\x12V\n\x05Query\x12\r.QueryRequest\x1a\x0e.QueryResponse\".\x82\xd3\xe4\x93\x02\x0b\"\x06/query:\x01*\x92\x41\x1a\n\x11Vector Operations*\x05query\x12\x63\n\x06Update\x12\x0e.UpdateRequest\x1a\x0f.UpdateResponse\"8\x82\xd3\xe4\x93\x02\x14\"\x0f/vectors/update:\x01*\x92\x41\x1b\n\x11Vector Operations*\x06update\x12\xb4\x01\n\x12\x44\x65scribeIndexStats\x12\x1a.DescribeIndexStatsRequest\x1a\x1b.DescribeIndexStatsResponse\"e\x82\xd3\xe4\x93\x02\x33\"\x15/describe_index_stats:\x01*Z\x17\x12\x15/describe_index_stats\x92\x41)\n\x11Vector Operations*\x14\x64\x65scribe_index_statsB\xc0\x03\n\x11io.pinecone.protoP\x01Z/github.com/pinecone-io/new-go-pinecone/pinecone\x92\x41\xf6\x02\x12K\n\x0cPinecone API\";\n\x0fPinecone.io Ops\x12\x13https://pinecone.io\x1a\x13support@pinecone.io\x1a\x39{index_name}-{project_name}.svc.{environment}.pinecone.io*\x01\x02\x32\x10\x61pplication/json:\x10\x61pplication/jsonZx\nv\n\nApiKeyAuth\x12h\x08\x02\x12YAn API Key is required to call Pinecone APIs. Get yours at https://www.pinecone.io/start/\x1a\x07\x41pi-Key \x02\x62\x10\n\x0e\n\nApiKeyAuth\x12\x00r9\n\x19More Pinecone.io API docs\x12\x1chttps://www.pinecone.io/docsb\x06proto3' - , - dependencies=[google_dot_protobuf_dot_struct__pb2.DESCRIPTOR,google_dot_api_dot_annotations__pb2.DESCRIPTOR,google_dot_api_dot_field__behavior__pb2.DESCRIPTOR,protoc__gen__openapiv2_dot_options_dot_annotations__pb2.DESCRIPTOR,]) - - + name="vector_service.proto", + package="", + syntax="proto3", + serialized_options=b'\n\021io.pinecone.protoP\001Z/github.com/pinecone-io/new-go-pinecone/pinecone\222A\366\002\022K\n\014Pinecone API";\n\017Pinecone.io Ops\022\023https://pinecone.io\032\023support@pinecone.io\0329{index_name}-{project_name}.svc.{environment}.pinecone.io*\001\0022\020application/json:\020application/jsonZx\nv\n\nApiKeyAuth\022h\010\002\022YAn API Key is required to call Pinecone APIs. Get yours at https://www.pinecone.io/start/\032\007Api-Key \002b\020\n\016\n\nApiKeyAuth\022\000r9\n\031More Pinecone.io API docs\022\034https://www.pinecone.io/docs', + create_key=_descriptor._internal_create_key, + serialized_pb=b'\n\x14vector_service.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a.protoc-gen-openapiv2/options/annotations.proto"~\n\x0cSparseValues\x12\x35\n\x07indices\x18\x01 \x03(\rB$\x92\x41\x1eJ\x16[1, 312, 822, 14, 980]x\xe8\x07\x80\x01\x01\xe0\x41\x02\x12\x37\n\x06values\x18\x02 \x03(\x02\x42\'\x92\x41!J\x19[0.1, 0.2, 0.3, 0.4, 0.5]x\xe8\x07\x80\x01\x01\xe0\x41\x02"\xfd\x01\n\x06Vector\x12,\n\x02id\x18\x01 \x01(\tB \x92\x41\x1aJ\x12"example-vector-1"x\x80\x04\x80\x01\x01\xe0\x41\x02\x12G\n\x06values\x18\x02 \x03(\x02\x42\x37\x92\x41\x31J([0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8]x\xa0\x9c\x01\x80\x01\x01\xe0\x41\x02\x12$\n\rsparse_values\x18\x04 \x01(\x0b\x32\r.SparseValues\x12V\n\x08metadata\x18\x03 \x01(\x0b\x32\x17.google.protobuf.StructB+\x92\x41(J&{"genre": "documentary", "year": 2019}"\x93\x02\n\x0cScoredVector\x12,\n\x02id\x18\x01 \x01(\tB \x92\x41\x1aJ\x12"example-vector-1"x\x80\x04\x80\x01\x01\xe0\x41\x02\x12\x18\n\x05score\x18\x02 \x01(\x02\x42\t\x92\x41\x06J\x04\x30.08\x12=\n\x06values\x18\x03 \x03(\x02\x42-\x92\x41*J([0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8]\x12$\n\rsparse_values\x18\x05 \x01(\x0b\x32\r.SparseValues\x12V\n\x08metadata\x18\x04 \x01(\x0b\x32\x17.google.protobuf.StructB+\x92\x41(J&{"genre": "documentary", "year": 2019}"d\n\rUpsertRequest\x12&\n\x07vectors\x18\x01 \x03(\x0b\x32\x07.VectorB\x0c\x92\x41\x06x\xe8\x07\x80\x01\x01\xe0\x41\x02\x12+\n\tnamespace\x18\x02 \x01(\tB\x18\x92\x41\x15J\x13"example-namespace""1\n\x0eUpsertResponse\x12\x1f\n\x0eupserted_count\x18\x01 \x01(\rB\x07\x92\x41\x04J\x02\x31\x30"\xb6\x01\n\rDeleteRequest\x12(\n\x03ids\x18\x01 \x03(\tB\x1b\x92\x41\x18J\x10["id-0", "id-1"]x\xe8\x07\x80\x01\x01\x12%\n\ndelete_all\x18\x02 \x01(\x08\x42\x11\x92\x41\x0e:\x05\x66\x61lseJ\x05\x66\x61lse\x12+\n\tnamespace\x18\x03 \x01(\tB\x18\x92\x41\x15J\x13"example-namespace"\x12\'\n\x06\x66ilter\x18\x04 \x01(\x0b\x32\x17.google.protobuf.Struct"\x10\n\x0e\x44\x65leteResponse"h\n\x0c\x46\x65tchRequest\x12+\n\x03ids\x18\x01 \x03(\tB\x1e\x92\x41\x18J\x10["id-0", "id-1"]x\xe8\x07\x80\x01\x01\xe0\x41\x02\x12+\n\tnamespace\x18\x02 \x01(\tB\x18\x92\x41\x15J\x13"example-namespace""\xa3\x01\n\rFetchResponse\x12,\n\x07vectors\x18\x01 \x03(\x0b\x32\x1b.FetchResponse.VectorsEntry\x12+\n\tnamespace\x18\x02 \x01(\tB\x18\x92\x41\x15J\x13"example-namespace"\x1a\x37\n\x0cVectorsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x16\n\x05value\x18\x02 \x01(\x0b\x32\x07.Vector:\x02\x38\x01"\xd0\x02\n\x0bQueryVector\x12G\n\x06values\x18\x01 \x03(\x02\x42\x37\x92\x41\x31J([0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8]x\xa0\x9c\x01\x80\x01\x01\xe0\x41\x02\x12$\n\rsparse_values\x18\x05 \x01(\x0b\x32\r.SparseValues\x12(\n\x05top_k\x18\x02 \x01(\rB\x19\x92\x41\x16J\x02\x31\x30Y\x00\x00\x00\x00\x00\x88\xc3@i\x00\x00\x00\x00\x00\x00\xf0?\x12+\n\tnamespace\x18\x03 \x01(\tB\x18\x92\x41\x15J\x13"example-namespace"\x12{\n\x06\x66ilter\x18\x04 \x01(\x0b\x32\x17.google.protobuf.StructBR\x92\x41OJM{"genre": {"$in": ["comedy", "documentary", "drama"]}, "year": {"$eq": 2019}}"\xfa\x03\n\x0cQueryRequest\x12+\n\tnamespace\x18\x01 \x01(\tB\x18\x92\x41\x15J\x13"example-namespace"\x12+\n\x05top_k\x18\x02 \x01(\rB\x1c\x92\x41\x16J\x02\x31\x30Y\x00\x00\x00\x00\x00\x88\xc3@i\x00\x00\x00\x00\x00\x00\xf0?\xe0\x41\x02\x12{\n\x06\x66ilter\x18\x03 \x01(\x0b\x32\x17.google.protobuf.StructBR\x92\x41OJM{"genre": {"$in": ["comedy", "documentary", "drama"]}, "year": {"$eq": 2019}}\x12(\n\x0einclude_values\x18\x04 \x01(\x08\x42\x10\x92\x41\r:\x05\x66\x61lseJ\x04true\x12*\n\x10include_metadata\x18\x05 \x01(\x08\x42\x10\x92\x41\r:\x05\x66\x61lseJ\x04true\x12)\n\x07queries\x18\x06 \x03(\x0b\x32\x0c.QueryVectorB\n\x18\x01\x92\x41\x05x\n\x80\x01\x01\x12\x44\n\x06vector\x18\x07 \x03(\x02\x42\x34\x92\x41\x31J([0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8]x\xa0\x9c\x01\x80\x01\x01\x12$\n\rsparse_vector\x18\t \x01(\x0b\x32\r.SparseValues\x12&\n\x02id\x18\x08 \x01(\tB\x1a\x92\x41\x17J\x12"example-vector-1"x\x80\x04"a\n\x12SingleQueryResults\x12\x1e\n\x07matches\x18\x01 \x03(\x0b\x32\r.ScoredVector\x12+\n\tnamespace\x18\x02 \x01(\tB\x18\x92\x41\x15J\x13"example-namespace""l\n\rQueryResponse\x12(\n\x07results\x18\x01 \x03(\x0b\x32\x13.SingleQueryResultsB\x02\x18\x01\x12\x1e\n\x07matches\x18\x02 \x03(\x0b\x32\r.ScoredVector\x12\x11\n\tnamespace\x18\x03 \x01(\t"\xb2\x02\n\rUpdateRequest\x12,\n\x02id\x18\x01 \x01(\tB \x92\x41\x1aJ\x12"example-vector-1"x\x80\x04\x80\x01\x01\xe0\x41\x02\x12\x44\n\x06values\x18\x02 \x03(\x02\x42\x34\x92\x41\x31J([0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8]x\xa0\x9c\x01\x80\x01\x01\x12$\n\rsparse_values\x18\x05 \x01(\x0b\x32\r.SparseValues\x12Z\n\x0cset_metadata\x18\x03 \x01(\x0b\x32\x17.google.protobuf.StructB+\x92\x41(J&{"genre": "documentary", "year": 2019}\x12+\n\tnamespace\x18\x04 \x01(\tB\x18\x92\x41\x15J\x13"example-namespace""\x10\n\x0eUpdateResponse"D\n\x19\x44\x65scribeIndexStatsRequest\x12\'\n\x06\x66ilter\x18\x01 \x01(\x0b\x32\x17.google.protobuf.Struct"4\n\x10NamespaceSummary\x12 \n\x0cvector_count\x18\x01 \x01(\rB\n\x92\x41\x07J\x05\x35\x30\x30\x30\x30"\x9a\x03\n\x1a\x44\x65scribeIndexStatsResponse\x12?\n\nnamespaces\x18\x01 \x03(\x0b\x32+.DescribeIndexStatsResponse.NamespacesEntry\x12\x1c\n\tdimension\x18\x02 \x01(\rB\t\x92\x41\x06J\x04\x31\x30\x32\x34\x12 \n\x0eindex_fullness\x18\x03 \x01(\x02\x42\x08\x92\x41\x05J\x03\x30.4\x12&\n\x12total_vector_count\x18\x04 \x01(\rB\n\x92\x41\x07J\x05\x38\x30\x30\x30\x30\x1a\x44\n\x0fNamespacesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12 \n\x05value\x18\x02 \x01(\x0b\x32\x11.NamespaceSummary:\x02\x38\x01:\x8c\x01\x92\x41\x88\x01\x32\x85\x01{"namespaces": {"": {"vectorCount": 50000}, "example-namespace-2": {"vectorCount": 30000}}, "dimension": 1024, "index_fullness": 0.4}2\xbd\x05\n\rVectorService\x12\x63\n\x06Upsert\x12\x0e.UpsertRequest\x1a\x0f.UpsertResponse"8\x82\xd3\xe4\x93\x02\x14"\x0f/vectors/upsert:\x01*\x92\x41\x1b\n\x11Vector Operations*\x06upsert\x12v\n\x06\x44\x65lete\x12\x0e.DeleteRequest\x1a\x0f.DeleteResponse"K\x82\xd3\xe4\x93\x02\'"\x0f/vectors/delete:\x01*Z\x11*\x0f/vectors/delete\x92\x41\x1b\n\x11Vector Operations*\x06\x64\x65lete\x12[\n\x05\x46\x65tch\x12\r.FetchRequest\x1a\x0e.FetchResponse"3\x82\xd3\xe4\x93\x02\x10\x12\x0e/vectors/fetch\x92\x41\x1a\n\x11Vector Operations*\x05\x66\x65tch\x12V\n\x05Query\x12\r.QueryRequest\x1a\x0e.QueryResponse".\x82\xd3\xe4\x93\x02\x0b"\x06/query:\x01*\x92\x41\x1a\n\x11Vector Operations*\x05query\x12\x63\n\x06Update\x12\x0e.UpdateRequest\x1a\x0f.UpdateResponse"8\x82\xd3\xe4\x93\x02\x14"\x0f/vectors/update:\x01*\x92\x41\x1b\n\x11Vector Operations*\x06update\x12\xb4\x01\n\x12\x44\x65scribeIndexStats\x12\x1a.DescribeIndexStatsRequest\x1a\x1b.DescribeIndexStatsResponse"e\x82\xd3\xe4\x93\x02\x33"\x15/describe_index_stats:\x01*Z\x17\x12\x15/describe_index_stats\x92\x41)\n\x11Vector Operations*\x14\x64\x65scribe_index_statsB\xc0\x03\n\x11io.pinecone.protoP\x01Z/github.com/pinecone-io/new-go-pinecone/pinecone\x92\x41\xf6\x02\x12K\n\x0cPinecone API";\n\x0fPinecone.io Ops\x12\x13https://pinecone.io\x1a\x13support@pinecone.io\x1a\x39{index_name}-{project_name}.svc.{environment}.pinecone.io*\x01\x02\x32\x10\x61pplication/json:\x10\x61pplication/jsonZx\nv\n\nApiKeyAuth\x12h\x08\x02\x12YAn API Key is required to call Pinecone APIs. Get yours at https://www.pinecone.io/start/\x1a\x07\x41pi-Key \x02\x62\x10\n\x0e\n\nApiKeyAuth\x12\x00r9\n\x19More Pinecone.io API docs\x12\x1chttps://www.pinecone.io/docsb\x06proto3', + dependencies=[ + google_dot_protobuf_dot_struct__pb2.DESCRIPTOR, + google_dot_api_dot_annotations__pb2.DESCRIPTOR, + google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, + protoc__gen__openapiv2_dot_options_dot_annotations__pb2.DESCRIPTOR, + ], +) _SPARSEVALUES = _descriptor.Descriptor( - name='SparseValues', - full_name='SparseValues', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='indices', full_name='SparseValues.indices', index=0, - number=1, type=13, cpp_type=3, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'\222A\036J\026[1, 312, 822, 14, 980]x\350\007\200\001\001\340A\002', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='values', full_name='SparseValues.values', index=1, - number=2, type=2, cpp_type=6, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'\222A!J\031[0.1, 0.2, 0.3, 0.4, 0.5]x\350\007\200\001\001\340A\002', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=165, - serialized_end=291, + name="SparseValues", + full_name="SparseValues", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="indices", + full_name="SparseValues.indices", + index=0, + number=1, + type=13, + cpp_type=3, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=b"\222A\036J\026[1, 312, 822, 14, 980]x\350\007\200\001\001\340A\002", + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="values", + full_name="SparseValues.values", + index=1, + number=2, + type=2, + cpp_type=6, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=b"\222A!J\031[0.1, 0.2, 0.3, 0.4, 0.5]x\350\007\200\001\001\340A\002", + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=165, + serialized_end=291, ) _VECTOR = _descriptor.Descriptor( - name='Vector', - full_name='Vector', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='id', full_name='Vector.id', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'\222A\032J\022\"example-vector-1\"x\200\004\200\001\001\340A\002', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='values', full_name='Vector.values', index=1, - number=2, type=2, cpp_type=6, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'\222A1J([0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8]x\240\234\001\200\001\001\340A\002', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='sparse_values', full_name='Vector.sparse_values', index=2, - number=4, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='metadata', full_name='Vector.metadata', index=3, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'\222A(J&{\"genre\": \"documentary\", \"year\": 2019}', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=294, - serialized_end=547, + name="Vector", + full_name="Vector", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="id", + full_name="Vector.id", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=b'\222A\032J\022"example-vector-1"x\200\004\200\001\001\340A\002', + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="values", + full_name="Vector.values", + index=1, + number=2, + type=2, + cpp_type=6, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=b"\222A1J([0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8]x\240\234\001\200\001\001\340A\002", + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="sparse_values", + full_name="Vector.sparse_values", + index=2, + number=4, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="metadata", + full_name="Vector.metadata", + index=3, + number=3, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=b'\222A(J&{"genre": "documentary", "year": 2019}', + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=294, + serialized_end=547, ) _SCOREDVECTOR = _descriptor.Descriptor( - name='ScoredVector', - full_name='ScoredVector', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='id', full_name='ScoredVector.id', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'\222A\032J\022\"example-vector-1\"x\200\004\200\001\001\340A\002', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='score', full_name='ScoredVector.score', index=1, - number=2, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'\222A\006J\0040.08', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='values', full_name='ScoredVector.values', index=2, - number=3, type=2, cpp_type=6, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'\222A*J([0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8]', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='sparse_values', full_name='ScoredVector.sparse_values', index=3, - number=5, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='metadata', full_name='ScoredVector.metadata', index=4, - number=4, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'\222A(J&{\"genre\": \"documentary\", \"year\": 2019}', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=550, - serialized_end=825, + name="ScoredVector", + full_name="ScoredVector", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="id", + full_name="ScoredVector.id", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=b'\222A\032J\022"example-vector-1"x\200\004\200\001\001\340A\002', + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="score", + full_name="ScoredVector.score", + index=1, + number=2, + type=2, + cpp_type=6, + label=1, + has_default_value=False, + default_value=float(0), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=b"\222A\006J\0040.08", + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="values", + full_name="ScoredVector.values", + index=2, + number=3, + type=2, + cpp_type=6, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=b"\222A*J([0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8]", + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="sparse_values", + full_name="ScoredVector.sparse_values", + index=3, + number=5, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="metadata", + full_name="ScoredVector.metadata", + index=4, + number=4, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=b'\222A(J&{"genre": "documentary", "year": 2019}', + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=550, + serialized_end=825, ) _UPSERTREQUEST = _descriptor.Descriptor( - name='UpsertRequest', - full_name='UpsertRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='vectors', full_name='UpsertRequest.vectors', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'\222A\006x\350\007\200\001\001\340A\002', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='namespace', full_name='UpsertRequest.namespace', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'\222A\025J\023\"example-namespace\"', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=827, - serialized_end=927, + name="UpsertRequest", + full_name="UpsertRequest", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="vectors", + full_name="UpsertRequest.vectors", + index=0, + number=1, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=b"\222A\006x\350\007\200\001\001\340A\002", + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="namespace", + full_name="UpsertRequest.namespace", + index=1, + number=2, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=b'\222A\025J\023"example-namespace"', + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=827, + serialized_end=927, ) _UPSERTRESPONSE = _descriptor.Descriptor( - name='UpsertResponse', - full_name='UpsertResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='upserted_count', full_name='UpsertResponse.upserted_count', index=0, - number=1, type=13, cpp_type=3, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'\222A\004J\00210', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=929, - serialized_end=978, + name="UpsertResponse", + full_name="UpsertResponse", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="upserted_count", + full_name="UpsertResponse.upserted_count", + index=0, + number=1, + type=13, + cpp_type=3, + label=1, + has_default_value=False, + default_value=0, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=b"\222A\004J\00210", + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=929, + serialized_end=978, ) _DELETEREQUEST = _descriptor.Descriptor( - name='DeleteRequest', - full_name='DeleteRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='ids', full_name='DeleteRequest.ids', index=0, - number=1, type=9, cpp_type=9, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'\222A\030J\020[\"id-0\", \"id-1\"]x\350\007\200\001\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='delete_all', full_name='DeleteRequest.delete_all', index=1, - number=2, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'\222A\016:\005falseJ\005false', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='namespace', full_name='DeleteRequest.namespace', index=2, - number=3, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'\222A\025J\023\"example-namespace\"', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='filter', full_name='DeleteRequest.filter', index=3, - number=4, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=981, - serialized_end=1163, + name="DeleteRequest", + full_name="DeleteRequest", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="ids", + full_name="DeleteRequest.ids", + index=0, + number=1, + type=9, + cpp_type=9, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=b'\222A\030J\020["id-0", "id-1"]x\350\007\200\001\001', + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="delete_all", + full_name="DeleteRequest.delete_all", + index=1, + number=2, + type=8, + cpp_type=7, + label=1, + has_default_value=False, + default_value=False, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=b"\222A\016:\005falseJ\005false", + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="namespace", + full_name="DeleteRequest.namespace", + index=2, + number=3, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=b'\222A\025J\023"example-namespace"', + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="filter", + full_name="DeleteRequest.filter", + index=3, + number=4, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=981, + serialized_end=1163, ) _DELETERESPONSE = _descriptor.Descriptor( - name='DeleteResponse', - full_name='DeleteResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1165, - serialized_end=1181, + name="DeleteResponse", + full_name="DeleteResponse", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=1165, + serialized_end=1181, ) _FETCHREQUEST = _descriptor.Descriptor( - name='FetchRequest', - full_name='FetchRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='ids', full_name='FetchRequest.ids', index=0, - number=1, type=9, cpp_type=9, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'\222A\030J\020[\"id-0\", \"id-1\"]x\350\007\200\001\001\340A\002', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='namespace', full_name='FetchRequest.namespace', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'\222A\025J\023\"example-namespace\"', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1183, - serialized_end=1287, + name="FetchRequest", + full_name="FetchRequest", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="ids", + full_name="FetchRequest.ids", + index=0, + number=1, + type=9, + cpp_type=9, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=b'\222A\030J\020["id-0", "id-1"]x\350\007\200\001\001\340A\002', + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="namespace", + full_name="FetchRequest.namespace", + index=1, + number=2, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=b'\222A\025J\023"example-namespace"', + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=1183, + serialized_end=1287, ) _FETCHRESPONSE_VECTORSENTRY = _descriptor.Descriptor( - name='VectorsEntry', - full_name='FetchResponse.VectorsEntry', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='key', full_name='FetchResponse.VectorsEntry.key', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='value', full_name='FetchResponse.VectorsEntry.value', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=b'8\001', - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1398, - serialized_end=1453, + name="VectorsEntry", + full_name="FetchResponse.VectorsEntry", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="key", + full_name="FetchResponse.VectorsEntry.key", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="value", + full_name="FetchResponse.VectorsEntry.value", + index=1, + number=2, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=b"8\001", + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=1398, + serialized_end=1453, ) _FETCHRESPONSE = _descriptor.Descriptor( - name='FetchResponse', - full_name='FetchResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='vectors', full_name='FetchResponse.vectors', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='namespace', full_name='FetchResponse.namespace', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'\222A\025J\023\"example-namespace\"', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[_FETCHRESPONSE_VECTORSENTRY, ], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1290, - serialized_end=1453, + name="FetchResponse", + full_name="FetchResponse", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="vectors", + full_name="FetchResponse.vectors", + index=0, + number=1, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="namespace", + full_name="FetchResponse.namespace", + index=1, + number=2, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=b'\222A\025J\023"example-namespace"', + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[ + _FETCHRESPONSE_VECTORSENTRY, + ], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=1290, + serialized_end=1453, ) _QUERYVECTOR = _descriptor.Descriptor( - name='QueryVector', - full_name='QueryVector', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='values', full_name='QueryVector.values', index=0, - number=1, type=2, cpp_type=6, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'\222A1J([0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8]x\240\234\001\200\001\001\340A\002', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='sparse_values', full_name='QueryVector.sparse_values', index=1, - number=5, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='top_k', full_name='QueryVector.top_k', index=2, - number=2, type=13, cpp_type=3, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'\222A\026J\00210Y\000\000\000\000\000\210\303@i\000\000\000\000\000\000\360?', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='namespace', full_name='QueryVector.namespace', index=3, - number=3, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'\222A\025J\023\"example-namespace\"', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='filter', full_name='QueryVector.filter', index=4, - number=4, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'\222AOJM{\"genre\": {\"$in\": [\"comedy\", \"documentary\", \"drama\"]}, \"year\": {\"$eq\": 2019}}', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1456, - serialized_end=1792, + name="QueryVector", + full_name="QueryVector", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="values", + full_name="QueryVector.values", + index=0, + number=1, + type=2, + cpp_type=6, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=b"\222A1J([0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8]x\240\234\001\200\001\001\340A\002", + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="sparse_values", + full_name="QueryVector.sparse_values", + index=1, + number=5, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="top_k", + full_name="QueryVector.top_k", + index=2, + number=2, + type=13, + cpp_type=3, + label=1, + has_default_value=False, + default_value=0, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=b"\222A\026J\00210Y\000\000\000\000\000\210\303@i\000\000\000\000\000\000\360?", + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="namespace", + full_name="QueryVector.namespace", + index=3, + number=3, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=b'\222A\025J\023"example-namespace"', + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="filter", + full_name="QueryVector.filter", + index=4, + number=4, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=b'\222AOJM{"genre": {"$in": ["comedy", "documentary", "drama"]}, "year": {"$eq": 2019}}', + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=1456, + serialized_end=1792, ) _QUERYREQUEST = _descriptor.Descriptor( - name='QueryRequest', - full_name='QueryRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='namespace', full_name='QueryRequest.namespace', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'\222A\025J\023\"example-namespace\"', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='top_k', full_name='QueryRequest.top_k', index=1, - number=2, type=13, cpp_type=3, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'\222A\026J\00210Y\000\000\000\000\000\210\303@i\000\000\000\000\000\000\360?\340A\002', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='filter', full_name='QueryRequest.filter', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'\222AOJM{\"genre\": {\"$in\": [\"comedy\", \"documentary\", \"drama\"]}, \"year\": {\"$eq\": 2019}}', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='include_values', full_name='QueryRequest.include_values', index=3, - number=4, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'\222A\r:\005falseJ\004true', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='include_metadata', full_name='QueryRequest.include_metadata', index=4, - number=5, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'\222A\r:\005falseJ\004true', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='queries', full_name='QueryRequest.queries', index=5, - number=6, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'\030\001\222A\005x\n\200\001\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='vector', full_name='QueryRequest.vector', index=6, - number=7, type=2, cpp_type=6, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'\222A1J([0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8]x\240\234\001\200\001\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='sparse_vector', full_name='QueryRequest.sparse_vector', index=7, - number=9, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='id', full_name='QueryRequest.id', index=8, - number=8, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'\222A\027J\022\"example-vector-1\"x\200\004', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1795, - serialized_end=2301, + name="QueryRequest", + full_name="QueryRequest", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="namespace", + full_name="QueryRequest.namespace", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=b'\222A\025J\023"example-namespace"', + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="top_k", + full_name="QueryRequest.top_k", + index=1, + number=2, + type=13, + cpp_type=3, + label=1, + has_default_value=False, + default_value=0, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=b"\222A\026J\00210Y\000\000\000\000\000\210\303@i\000\000\000\000\000\000\360?\340A\002", + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="filter", + full_name="QueryRequest.filter", + index=2, + number=3, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=b'\222AOJM{"genre": {"$in": ["comedy", "documentary", "drama"]}, "year": {"$eq": 2019}}', + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="include_values", + full_name="QueryRequest.include_values", + index=3, + number=4, + type=8, + cpp_type=7, + label=1, + has_default_value=False, + default_value=False, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=b"\222A\r:\005falseJ\004true", + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="include_metadata", + full_name="QueryRequest.include_metadata", + index=4, + number=5, + type=8, + cpp_type=7, + label=1, + has_default_value=False, + default_value=False, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=b"\222A\r:\005falseJ\004true", + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="queries", + full_name="QueryRequest.queries", + index=5, + number=6, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=b"\030\001\222A\005x\n\200\001\001", + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="vector", + full_name="QueryRequest.vector", + index=6, + number=7, + type=2, + cpp_type=6, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=b"\222A1J([0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8]x\240\234\001\200\001\001", + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="sparse_vector", + full_name="QueryRequest.sparse_vector", + index=7, + number=9, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="id", + full_name="QueryRequest.id", + index=8, + number=8, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=b'\222A\027J\022"example-vector-1"x\200\004', + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=1795, + serialized_end=2301, ) _SINGLEQUERYRESULTS = _descriptor.Descriptor( - name='SingleQueryResults', - full_name='SingleQueryResults', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='matches', full_name='SingleQueryResults.matches', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='namespace', full_name='SingleQueryResults.namespace', index=1, - number=2, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'\222A\025J\023\"example-namespace\"', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2303, - serialized_end=2400, + name="SingleQueryResults", + full_name="SingleQueryResults", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="matches", + full_name="SingleQueryResults.matches", + index=0, + number=1, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="namespace", + full_name="SingleQueryResults.namespace", + index=1, + number=2, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=b'\222A\025J\023"example-namespace"', + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=2303, + serialized_end=2400, ) _QUERYRESPONSE = _descriptor.Descriptor( - name='QueryResponse', - full_name='QueryResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='results', full_name='QueryResponse.results', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'\030\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='matches', full_name='QueryResponse.matches', index=1, - number=2, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='namespace', full_name='QueryResponse.namespace', index=2, - number=3, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2402, - serialized_end=2510, + name="QueryResponse", + full_name="QueryResponse", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="results", + full_name="QueryResponse.results", + index=0, + number=1, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=b"\030\001", + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="matches", + full_name="QueryResponse.matches", + index=1, + number=2, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="namespace", + full_name="QueryResponse.namespace", + index=2, + number=3, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=2402, + serialized_end=2510, ) _UPDATEREQUEST = _descriptor.Descriptor( - name='UpdateRequest', - full_name='UpdateRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='id', full_name='UpdateRequest.id', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'\222A\032J\022\"example-vector-1\"x\200\004\200\001\001\340A\002', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='values', full_name='UpdateRequest.values', index=1, - number=2, type=2, cpp_type=6, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'\222A1J([0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8]x\240\234\001\200\001\001', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='sparse_values', full_name='UpdateRequest.sparse_values', index=2, - number=5, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='set_metadata', full_name='UpdateRequest.set_metadata', index=3, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'\222A(J&{\"genre\": \"documentary\", \"year\": 2019}', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='namespace', full_name='UpdateRequest.namespace', index=4, - number=4, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'\222A\025J\023\"example-namespace\"', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2513, - serialized_end=2819, + name="UpdateRequest", + full_name="UpdateRequest", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="id", + full_name="UpdateRequest.id", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=b'\222A\032J\022"example-vector-1"x\200\004\200\001\001\340A\002', + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="values", + full_name="UpdateRequest.values", + index=1, + number=2, + type=2, + cpp_type=6, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=b"\222A1J([0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8]x\240\234\001\200\001\001", + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="sparse_values", + full_name="UpdateRequest.sparse_values", + index=2, + number=5, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="set_metadata", + full_name="UpdateRequest.set_metadata", + index=3, + number=3, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=b'\222A(J&{"genre": "documentary", "year": 2019}', + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="namespace", + full_name="UpdateRequest.namespace", + index=4, + number=4, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=b'\222A\025J\023"example-namespace"', + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=2513, + serialized_end=2819, ) _UPDATERESPONSE = _descriptor.Descriptor( - name='UpdateResponse', - full_name='UpdateResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2821, - serialized_end=2837, + name="UpdateResponse", + full_name="UpdateResponse", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=2821, + serialized_end=2837, ) _DESCRIBEINDEXSTATSREQUEST = _descriptor.Descriptor( - name='DescribeIndexStatsRequest', - full_name='DescribeIndexStatsRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='filter', full_name='DescribeIndexStatsRequest.filter', index=0, - number=1, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2839, - serialized_end=2907, + name="DescribeIndexStatsRequest", + full_name="DescribeIndexStatsRequest", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="filter", + full_name="DescribeIndexStatsRequest.filter", + index=0, + number=1, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=2839, + serialized_end=2907, ) _NAMESPACESUMMARY = _descriptor.Descriptor( - name='NamespaceSummary', - full_name='NamespaceSummary', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='vector_count', full_name='NamespaceSummary.vector_count', index=0, - number=1, type=13, cpp_type=3, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'\222A\007J\00550000', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2909, - serialized_end=2961, + name="NamespaceSummary", + full_name="NamespaceSummary", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="vector_count", + full_name="NamespaceSummary.vector_count", + index=0, + number=1, + type=13, + cpp_type=3, + label=1, + has_default_value=False, + default_value=0, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=b"\222A\007J\00550000", + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=None, + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=2909, + serialized_end=2961, ) _DESCRIBEINDEXSTATSRESPONSE_NAMESPACESENTRY = _descriptor.Descriptor( - name='NamespacesEntry', - full_name='DescribeIndexStatsResponse.NamespacesEntry', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='key', full_name='DescribeIndexStatsResponse.NamespacesEntry.key', index=0, - number=1, type=9, cpp_type=9, label=1, - has_default_value=False, default_value=b"".decode('utf-8'), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='value', full_name='DescribeIndexStatsResponse.NamespacesEntry.value', index=1, - number=2, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - serialized_options=b'8\001', - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3163, - serialized_end=3231, + name="NamespacesEntry", + full_name="DescribeIndexStatsResponse.NamespacesEntry", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="key", + full_name="DescribeIndexStatsResponse.NamespacesEntry.key", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="value", + full_name="DescribeIndexStatsResponse.NamespacesEntry.value", + index=1, + number=2, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=b"8\001", + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=3163, + serialized_end=3231, ) _DESCRIBEINDEXSTATSRESPONSE = _descriptor.Descriptor( - name='DescribeIndexStatsResponse', - full_name='DescribeIndexStatsResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name='namespaces', full_name='DescribeIndexStatsResponse.namespaces', index=0, - number=1, type=11, cpp_type=10, label=3, - has_default_value=False, default_value=[], - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='dimension', full_name='DescribeIndexStatsResponse.dimension', index=1, - number=2, type=13, cpp_type=3, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'\222A\006J\0041024', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='index_fullness', full_name='DescribeIndexStatsResponse.index_fullness', index=2, - number=3, type=2, cpp_type=6, label=1, - has_default_value=False, default_value=float(0), - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'\222A\005J\0030.4', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='total_vector_count', full_name='DescribeIndexStatsResponse.total_vector_count', index=3, - number=4, type=13, cpp_type=3, label=1, - has_default_value=False, default_value=0, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=b'\222A\007J\00580000', file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - ], - extensions=[ - ], - nested_types=[_DESCRIBEINDEXSTATSRESPONSE_NAMESPACESENTRY, ], - enum_types=[ - ], - serialized_options=b'\222A\210\0012\205\001{\"namespaces\": {\"\": {\"vectorCount\": 50000}, \"example-namespace-2\": {\"vectorCount\": 30000}}, \"dimension\": 1024, \"index_fullness\": 0.4}', - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2964, - serialized_end=3374, + name="DescribeIndexStatsResponse", + full_name="DescribeIndexStatsResponse", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="namespaces", + full_name="DescribeIndexStatsResponse.namespaces", + index=0, + number=1, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="dimension", + full_name="DescribeIndexStatsResponse.dimension", + index=1, + number=2, + type=13, + cpp_type=3, + label=1, + has_default_value=False, + default_value=0, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=b"\222A\006J\0041024", + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="index_fullness", + full_name="DescribeIndexStatsResponse.index_fullness", + index=2, + number=3, + type=2, + cpp_type=6, + label=1, + has_default_value=False, + default_value=float(0), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=b"\222A\005J\0030.4", + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="total_vector_count", + full_name="DescribeIndexStatsResponse.total_vector_count", + index=3, + number=4, + type=13, + cpp_type=3, + label=1, + has_default_value=False, + default_value=0, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=b"\222A\007J\00580000", + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[ + _DESCRIBEINDEXSTATSRESPONSE_NAMESPACESENTRY, + ], + enum_types=[], + serialized_options=b'\222A\210\0012\205\001{"namespaces": {"": {"vectorCount": 50000}, "example-namespace-2": {"vectorCount": 30000}}, "dimension": 1024, "index_fullness": 0.4}', + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=2964, + serialized_end=3374, ) -_VECTOR.fields_by_name['sparse_values'].message_type = _SPARSEVALUES -_VECTOR.fields_by_name['metadata'].message_type = google_dot_protobuf_dot_struct__pb2._STRUCT -_SCOREDVECTOR.fields_by_name['sparse_values'].message_type = _SPARSEVALUES -_SCOREDVECTOR.fields_by_name['metadata'].message_type = google_dot_protobuf_dot_struct__pb2._STRUCT -_UPSERTREQUEST.fields_by_name['vectors'].message_type = _VECTOR -_DELETEREQUEST.fields_by_name['filter'].message_type = google_dot_protobuf_dot_struct__pb2._STRUCT -_FETCHRESPONSE_VECTORSENTRY.fields_by_name['value'].message_type = _VECTOR +_VECTOR.fields_by_name["sparse_values"].message_type = _SPARSEVALUES +_VECTOR.fields_by_name["metadata"].message_type = google_dot_protobuf_dot_struct__pb2._STRUCT +_SCOREDVECTOR.fields_by_name["sparse_values"].message_type = _SPARSEVALUES +_SCOREDVECTOR.fields_by_name["metadata"].message_type = google_dot_protobuf_dot_struct__pb2._STRUCT +_UPSERTREQUEST.fields_by_name["vectors"].message_type = _VECTOR +_DELETEREQUEST.fields_by_name["filter"].message_type = google_dot_protobuf_dot_struct__pb2._STRUCT +_FETCHRESPONSE_VECTORSENTRY.fields_by_name["value"].message_type = _VECTOR _FETCHRESPONSE_VECTORSENTRY.containing_type = _FETCHRESPONSE -_FETCHRESPONSE.fields_by_name['vectors'].message_type = _FETCHRESPONSE_VECTORSENTRY -_QUERYVECTOR.fields_by_name['sparse_values'].message_type = _SPARSEVALUES -_QUERYVECTOR.fields_by_name['filter'].message_type = google_dot_protobuf_dot_struct__pb2._STRUCT -_QUERYREQUEST.fields_by_name['filter'].message_type = google_dot_protobuf_dot_struct__pb2._STRUCT -_QUERYREQUEST.fields_by_name['queries'].message_type = _QUERYVECTOR -_QUERYREQUEST.fields_by_name['sparse_vector'].message_type = _SPARSEVALUES -_SINGLEQUERYRESULTS.fields_by_name['matches'].message_type = _SCOREDVECTOR -_QUERYRESPONSE.fields_by_name['results'].message_type = _SINGLEQUERYRESULTS -_QUERYRESPONSE.fields_by_name['matches'].message_type = _SCOREDVECTOR -_UPDATEREQUEST.fields_by_name['sparse_values'].message_type = _SPARSEVALUES -_UPDATEREQUEST.fields_by_name['set_metadata'].message_type = google_dot_protobuf_dot_struct__pb2._STRUCT -_DESCRIBEINDEXSTATSREQUEST.fields_by_name['filter'].message_type = google_dot_protobuf_dot_struct__pb2._STRUCT -_DESCRIBEINDEXSTATSRESPONSE_NAMESPACESENTRY.fields_by_name['value'].message_type = _NAMESPACESUMMARY +_FETCHRESPONSE.fields_by_name["vectors"].message_type = _FETCHRESPONSE_VECTORSENTRY +_QUERYVECTOR.fields_by_name["sparse_values"].message_type = _SPARSEVALUES +_QUERYVECTOR.fields_by_name["filter"].message_type = google_dot_protobuf_dot_struct__pb2._STRUCT +_QUERYREQUEST.fields_by_name["filter"].message_type = google_dot_protobuf_dot_struct__pb2._STRUCT +_QUERYREQUEST.fields_by_name["queries"].message_type = _QUERYVECTOR +_QUERYREQUEST.fields_by_name["sparse_vector"].message_type = _SPARSEVALUES +_SINGLEQUERYRESULTS.fields_by_name["matches"].message_type = _SCOREDVECTOR +_QUERYRESPONSE.fields_by_name["results"].message_type = _SINGLEQUERYRESULTS +_QUERYRESPONSE.fields_by_name["matches"].message_type = _SCOREDVECTOR +_UPDATEREQUEST.fields_by_name["sparse_values"].message_type = _SPARSEVALUES +_UPDATEREQUEST.fields_by_name["set_metadata"].message_type = google_dot_protobuf_dot_struct__pb2._STRUCT +_DESCRIBEINDEXSTATSREQUEST.fields_by_name["filter"].message_type = google_dot_protobuf_dot_struct__pb2._STRUCT +_DESCRIBEINDEXSTATSRESPONSE_NAMESPACESENTRY.fields_by_name["value"].message_type = _NAMESPACESUMMARY _DESCRIBEINDEXSTATSRESPONSE_NAMESPACESENTRY.containing_type = _DESCRIBEINDEXSTATSRESPONSE -_DESCRIBEINDEXSTATSRESPONSE.fields_by_name['namespaces'].message_type = _DESCRIBEINDEXSTATSRESPONSE_NAMESPACESENTRY -DESCRIPTOR.message_types_by_name['SparseValues'] = _SPARSEVALUES -DESCRIPTOR.message_types_by_name['Vector'] = _VECTOR -DESCRIPTOR.message_types_by_name['ScoredVector'] = _SCOREDVECTOR -DESCRIPTOR.message_types_by_name['UpsertRequest'] = _UPSERTREQUEST -DESCRIPTOR.message_types_by_name['UpsertResponse'] = _UPSERTRESPONSE -DESCRIPTOR.message_types_by_name['DeleteRequest'] = _DELETEREQUEST -DESCRIPTOR.message_types_by_name['DeleteResponse'] = _DELETERESPONSE -DESCRIPTOR.message_types_by_name['FetchRequest'] = _FETCHREQUEST -DESCRIPTOR.message_types_by_name['FetchResponse'] = _FETCHRESPONSE -DESCRIPTOR.message_types_by_name['QueryVector'] = _QUERYVECTOR -DESCRIPTOR.message_types_by_name['QueryRequest'] = _QUERYREQUEST -DESCRIPTOR.message_types_by_name['SingleQueryResults'] = _SINGLEQUERYRESULTS -DESCRIPTOR.message_types_by_name['QueryResponse'] = _QUERYRESPONSE -DESCRIPTOR.message_types_by_name['UpdateRequest'] = _UPDATEREQUEST -DESCRIPTOR.message_types_by_name['UpdateResponse'] = _UPDATERESPONSE -DESCRIPTOR.message_types_by_name['DescribeIndexStatsRequest'] = _DESCRIBEINDEXSTATSREQUEST -DESCRIPTOR.message_types_by_name['NamespaceSummary'] = _NAMESPACESUMMARY -DESCRIPTOR.message_types_by_name['DescribeIndexStatsResponse'] = _DESCRIBEINDEXSTATSRESPONSE +_DESCRIBEINDEXSTATSRESPONSE.fields_by_name["namespaces"].message_type = _DESCRIBEINDEXSTATSRESPONSE_NAMESPACESENTRY +DESCRIPTOR.message_types_by_name["SparseValues"] = _SPARSEVALUES +DESCRIPTOR.message_types_by_name["Vector"] = _VECTOR +DESCRIPTOR.message_types_by_name["ScoredVector"] = _SCOREDVECTOR +DESCRIPTOR.message_types_by_name["UpsertRequest"] = _UPSERTREQUEST +DESCRIPTOR.message_types_by_name["UpsertResponse"] = _UPSERTRESPONSE +DESCRIPTOR.message_types_by_name["DeleteRequest"] = _DELETEREQUEST +DESCRIPTOR.message_types_by_name["DeleteResponse"] = _DELETERESPONSE +DESCRIPTOR.message_types_by_name["FetchRequest"] = _FETCHREQUEST +DESCRIPTOR.message_types_by_name["FetchResponse"] = _FETCHRESPONSE +DESCRIPTOR.message_types_by_name["QueryVector"] = _QUERYVECTOR +DESCRIPTOR.message_types_by_name["QueryRequest"] = _QUERYREQUEST +DESCRIPTOR.message_types_by_name["SingleQueryResults"] = _SINGLEQUERYRESULTS +DESCRIPTOR.message_types_by_name["QueryResponse"] = _QUERYRESPONSE +DESCRIPTOR.message_types_by_name["UpdateRequest"] = _UPDATEREQUEST +DESCRIPTOR.message_types_by_name["UpdateResponse"] = _UPDATERESPONSE +DESCRIPTOR.message_types_by_name["DescribeIndexStatsRequest"] = _DESCRIBEINDEXSTATSREQUEST +DESCRIPTOR.message_types_by_name["NamespaceSummary"] = _NAMESPACESUMMARY +DESCRIPTOR.message_types_by_name["DescribeIndexStatsResponse"] = _DESCRIBEINDEXSTATSRESPONSE _sym_db.RegisterFileDescriptor(DESCRIPTOR) -SparseValues = _reflection.GeneratedProtocolMessageType('SparseValues', (_message.Message,), { - 'DESCRIPTOR' : _SPARSEVALUES, - '__module__' : 'vector_service_pb2' - # @@protoc_insertion_point(class_scope:SparseValues) - }) +SparseValues = _reflection.GeneratedProtocolMessageType( + "SparseValues", + (_message.Message,), + { + "DESCRIPTOR": _SPARSEVALUES, + "__module__": "vector_service_pb2" + # @@protoc_insertion_point(class_scope:SparseValues) + }, +) _sym_db.RegisterMessage(SparseValues) -Vector = _reflection.GeneratedProtocolMessageType('Vector', (_message.Message,), { - 'DESCRIPTOR' : _VECTOR, - '__module__' : 'vector_service_pb2' - # @@protoc_insertion_point(class_scope:Vector) - }) +Vector = _reflection.GeneratedProtocolMessageType( + "Vector", + (_message.Message,), + { + "DESCRIPTOR": _VECTOR, + "__module__": "vector_service_pb2" + # @@protoc_insertion_point(class_scope:Vector) + }, +) _sym_db.RegisterMessage(Vector) -ScoredVector = _reflection.GeneratedProtocolMessageType('ScoredVector', (_message.Message,), { - 'DESCRIPTOR' : _SCOREDVECTOR, - '__module__' : 'vector_service_pb2' - # @@protoc_insertion_point(class_scope:ScoredVector) - }) +ScoredVector = _reflection.GeneratedProtocolMessageType( + "ScoredVector", + (_message.Message,), + { + "DESCRIPTOR": _SCOREDVECTOR, + "__module__": "vector_service_pb2" + # @@protoc_insertion_point(class_scope:ScoredVector) + }, +) _sym_db.RegisterMessage(ScoredVector) -UpsertRequest = _reflection.GeneratedProtocolMessageType('UpsertRequest', (_message.Message,), { - 'DESCRIPTOR' : _UPSERTREQUEST, - '__module__' : 'vector_service_pb2' - # @@protoc_insertion_point(class_scope:UpsertRequest) - }) +UpsertRequest = _reflection.GeneratedProtocolMessageType( + "UpsertRequest", + (_message.Message,), + { + "DESCRIPTOR": _UPSERTREQUEST, + "__module__": "vector_service_pb2" + # @@protoc_insertion_point(class_scope:UpsertRequest) + }, +) _sym_db.RegisterMessage(UpsertRequest) -UpsertResponse = _reflection.GeneratedProtocolMessageType('UpsertResponse', (_message.Message,), { - 'DESCRIPTOR' : _UPSERTRESPONSE, - '__module__' : 'vector_service_pb2' - # @@protoc_insertion_point(class_scope:UpsertResponse) - }) +UpsertResponse = _reflection.GeneratedProtocolMessageType( + "UpsertResponse", + (_message.Message,), + { + "DESCRIPTOR": _UPSERTRESPONSE, + "__module__": "vector_service_pb2" + # @@protoc_insertion_point(class_scope:UpsertResponse) + }, +) _sym_db.RegisterMessage(UpsertResponse) -DeleteRequest = _reflection.GeneratedProtocolMessageType('DeleteRequest', (_message.Message,), { - 'DESCRIPTOR' : _DELETEREQUEST, - '__module__' : 'vector_service_pb2' - # @@protoc_insertion_point(class_scope:DeleteRequest) - }) +DeleteRequest = _reflection.GeneratedProtocolMessageType( + "DeleteRequest", + (_message.Message,), + { + "DESCRIPTOR": _DELETEREQUEST, + "__module__": "vector_service_pb2" + # @@protoc_insertion_point(class_scope:DeleteRequest) + }, +) _sym_db.RegisterMessage(DeleteRequest) -DeleteResponse = _reflection.GeneratedProtocolMessageType('DeleteResponse', (_message.Message,), { - 'DESCRIPTOR' : _DELETERESPONSE, - '__module__' : 'vector_service_pb2' - # @@protoc_insertion_point(class_scope:DeleteResponse) - }) +DeleteResponse = _reflection.GeneratedProtocolMessageType( + "DeleteResponse", + (_message.Message,), + { + "DESCRIPTOR": _DELETERESPONSE, + "__module__": "vector_service_pb2" + # @@protoc_insertion_point(class_scope:DeleteResponse) + }, +) _sym_db.RegisterMessage(DeleteResponse) -FetchRequest = _reflection.GeneratedProtocolMessageType('FetchRequest', (_message.Message,), { - 'DESCRIPTOR' : _FETCHREQUEST, - '__module__' : 'vector_service_pb2' - # @@protoc_insertion_point(class_scope:FetchRequest) - }) +FetchRequest = _reflection.GeneratedProtocolMessageType( + "FetchRequest", + (_message.Message,), + { + "DESCRIPTOR": _FETCHREQUEST, + "__module__": "vector_service_pb2" + # @@protoc_insertion_point(class_scope:FetchRequest) + }, +) _sym_db.RegisterMessage(FetchRequest) -FetchResponse = _reflection.GeneratedProtocolMessageType('FetchResponse', (_message.Message,), { - - 'VectorsEntry' : _reflection.GeneratedProtocolMessageType('VectorsEntry', (_message.Message,), { - 'DESCRIPTOR' : _FETCHRESPONSE_VECTORSENTRY, - '__module__' : 'vector_service_pb2' - # @@protoc_insertion_point(class_scope:FetchResponse.VectorsEntry) - }) - , - 'DESCRIPTOR' : _FETCHRESPONSE, - '__module__' : 'vector_service_pb2' - # @@protoc_insertion_point(class_scope:FetchResponse) - }) +FetchResponse = _reflection.GeneratedProtocolMessageType( + "FetchResponse", + (_message.Message,), + { + "VectorsEntry": _reflection.GeneratedProtocolMessageType( + "VectorsEntry", + (_message.Message,), + { + "DESCRIPTOR": _FETCHRESPONSE_VECTORSENTRY, + "__module__": "vector_service_pb2" + # @@protoc_insertion_point(class_scope:FetchResponse.VectorsEntry) + }, + ), + "DESCRIPTOR": _FETCHRESPONSE, + "__module__": "vector_service_pb2" + # @@protoc_insertion_point(class_scope:FetchResponse) + }, +) _sym_db.RegisterMessage(FetchResponse) _sym_db.RegisterMessage(FetchResponse.VectorsEntry) -QueryVector = _reflection.GeneratedProtocolMessageType('QueryVector', (_message.Message,), { - 'DESCRIPTOR' : _QUERYVECTOR, - '__module__' : 'vector_service_pb2' - # @@protoc_insertion_point(class_scope:QueryVector) - }) +QueryVector = _reflection.GeneratedProtocolMessageType( + "QueryVector", + (_message.Message,), + { + "DESCRIPTOR": _QUERYVECTOR, + "__module__": "vector_service_pb2" + # @@protoc_insertion_point(class_scope:QueryVector) + }, +) _sym_db.RegisterMessage(QueryVector) -QueryRequest = _reflection.GeneratedProtocolMessageType('QueryRequest', (_message.Message,), { - 'DESCRIPTOR' : _QUERYREQUEST, - '__module__' : 'vector_service_pb2' - # @@protoc_insertion_point(class_scope:QueryRequest) - }) +QueryRequest = _reflection.GeneratedProtocolMessageType( + "QueryRequest", + (_message.Message,), + { + "DESCRIPTOR": _QUERYREQUEST, + "__module__": "vector_service_pb2" + # @@protoc_insertion_point(class_scope:QueryRequest) + }, +) _sym_db.RegisterMessage(QueryRequest) -SingleQueryResults = _reflection.GeneratedProtocolMessageType('SingleQueryResults', (_message.Message,), { - 'DESCRIPTOR' : _SINGLEQUERYRESULTS, - '__module__' : 'vector_service_pb2' - # @@protoc_insertion_point(class_scope:SingleQueryResults) - }) +SingleQueryResults = _reflection.GeneratedProtocolMessageType( + "SingleQueryResults", + (_message.Message,), + { + "DESCRIPTOR": _SINGLEQUERYRESULTS, + "__module__": "vector_service_pb2" + # @@protoc_insertion_point(class_scope:SingleQueryResults) + }, +) _sym_db.RegisterMessage(SingleQueryResults) -QueryResponse = _reflection.GeneratedProtocolMessageType('QueryResponse', (_message.Message,), { - 'DESCRIPTOR' : _QUERYRESPONSE, - '__module__' : 'vector_service_pb2' - # @@protoc_insertion_point(class_scope:QueryResponse) - }) +QueryResponse = _reflection.GeneratedProtocolMessageType( + "QueryResponse", + (_message.Message,), + { + "DESCRIPTOR": _QUERYRESPONSE, + "__module__": "vector_service_pb2" + # @@protoc_insertion_point(class_scope:QueryResponse) + }, +) _sym_db.RegisterMessage(QueryResponse) -UpdateRequest = _reflection.GeneratedProtocolMessageType('UpdateRequest', (_message.Message,), { - 'DESCRIPTOR' : _UPDATEREQUEST, - '__module__' : 'vector_service_pb2' - # @@protoc_insertion_point(class_scope:UpdateRequest) - }) +UpdateRequest = _reflection.GeneratedProtocolMessageType( + "UpdateRequest", + (_message.Message,), + { + "DESCRIPTOR": _UPDATEREQUEST, + "__module__": "vector_service_pb2" + # @@protoc_insertion_point(class_scope:UpdateRequest) + }, +) _sym_db.RegisterMessage(UpdateRequest) -UpdateResponse = _reflection.GeneratedProtocolMessageType('UpdateResponse', (_message.Message,), { - 'DESCRIPTOR' : _UPDATERESPONSE, - '__module__' : 'vector_service_pb2' - # @@protoc_insertion_point(class_scope:UpdateResponse) - }) +UpdateResponse = _reflection.GeneratedProtocolMessageType( + "UpdateResponse", + (_message.Message,), + { + "DESCRIPTOR": _UPDATERESPONSE, + "__module__": "vector_service_pb2" + # @@protoc_insertion_point(class_scope:UpdateResponse) + }, +) _sym_db.RegisterMessage(UpdateResponse) -DescribeIndexStatsRequest = _reflection.GeneratedProtocolMessageType('DescribeIndexStatsRequest', (_message.Message,), { - 'DESCRIPTOR' : _DESCRIBEINDEXSTATSREQUEST, - '__module__' : 'vector_service_pb2' - # @@protoc_insertion_point(class_scope:DescribeIndexStatsRequest) - }) +DescribeIndexStatsRequest = _reflection.GeneratedProtocolMessageType( + "DescribeIndexStatsRequest", + (_message.Message,), + { + "DESCRIPTOR": _DESCRIBEINDEXSTATSREQUEST, + "__module__": "vector_service_pb2" + # @@protoc_insertion_point(class_scope:DescribeIndexStatsRequest) + }, +) _sym_db.RegisterMessage(DescribeIndexStatsRequest) -NamespaceSummary = _reflection.GeneratedProtocolMessageType('NamespaceSummary', (_message.Message,), { - 'DESCRIPTOR' : _NAMESPACESUMMARY, - '__module__' : 'vector_service_pb2' - # @@protoc_insertion_point(class_scope:NamespaceSummary) - }) +NamespaceSummary = _reflection.GeneratedProtocolMessageType( + "NamespaceSummary", + (_message.Message,), + { + "DESCRIPTOR": _NAMESPACESUMMARY, + "__module__": "vector_service_pb2" + # @@protoc_insertion_point(class_scope:NamespaceSummary) + }, +) _sym_db.RegisterMessage(NamespaceSummary) -DescribeIndexStatsResponse = _reflection.GeneratedProtocolMessageType('DescribeIndexStatsResponse', (_message.Message,), { - - 'NamespacesEntry' : _reflection.GeneratedProtocolMessageType('NamespacesEntry', (_message.Message,), { - 'DESCRIPTOR' : _DESCRIBEINDEXSTATSRESPONSE_NAMESPACESENTRY, - '__module__' : 'vector_service_pb2' - # @@protoc_insertion_point(class_scope:DescribeIndexStatsResponse.NamespacesEntry) - }) - , - 'DESCRIPTOR' : _DESCRIBEINDEXSTATSRESPONSE, - '__module__' : 'vector_service_pb2' - # @@protoc_insertion_point(class_scope:DescribeIndexStatsResponse) - }) +DescribeIndexStatsResponse = _reflection.GeneratedProtocolMessageType( + "DescribeIndexStatsResponse", + (_message.Message,), + { + "NamespacesEntry": _reflection.GeneratedProtocolMessageType( + "NamespacesEntry", + (_message.Message,), + { + "DESCRIPTOR": _DESCRIBEINDEXSTATSRESPONSE_NAMESPACESENTRY, + "__module__": "vector_service_pb2" + # @@protoc_insertion_point(class_scope:DescribeIndexStatsResponse.NamespacesEntry) + }, + ), + "DESCRIPTOR": _DESCRIBEINDEXSTATSRESPONSE, + "__module__": "vector_service_pb2" + # @@protoc_insertion_point(class_scope:DescribeIndexStatsResponse) + }, +) _sym_db.RegisterMessage(DescribeIndexStatsResponse) _sym_db.RegisterMessage(DescribeIndexStatsResponse.NamespacesEntry) DESCRIPTOR._options = None -_SPARSEVALUES.fields_by_name['indices']._options = None -_SPARSEVALUES.fields_by_name['values']._options = None -_VECTOR.fields_by_name['id']._options = None -_VECTOR.fields_by_name['values']._options = None -_VECTOR.fields_by_name['metadata']._options = None -_SCOREDVECTOR.fields_by_name['id']._options = None -_SCOREDVECTOR.fields_by_name['score']._options = None -_SCOREDVECTOR.fields_by_name['values']._options = None -_SCOREDVECTOR.fields_by_name['metadata']._options = None -_UPSERTREQUEST.fields_by_name['vectors']._options = None -_UPSERTREQUEST.fields_by_name['namespace']._options = None -_UPSERTRESPONSE.fields_by_name['upserted_count']._options = None -_DELETEREQUEST.fields_by_name['ids']._options = None -_DELETEREQUEST.fields_by_name['delete_all']._options = None -_DELETEREQUEST.fields_by_name['namespace']._options = None -_FETCHREQUEST.fields_by_name['ids']._options = None -_FETCHREQUEST.fields_by_name['namespace']._options = None +_SPARSEVALUES.fields_by_name["indices"]._options = None +_SPARSEVALUES.fields_by_name["values"]._options = None +_VECTOR.fields_by_name["id"]._options = None +_VECTOR.fields_by_name["values"]._options = None +_VECTOR.fields_by_name["metadata"]._options = None +_SCOREDVECTOR.fields_by_name["id"]._options = None +_SCOREDVECTOR.fields_by_name["score"]._options = None +_SCOREDVECTOR.fields_by_name["values"]._options = None +_SCOREDVECTOR.fields_by_name["metadata"]._options = None +_UPSERTREQUEST.fields_by_name["vectors"]._options = None +_UPSERTREQUEST.fields_by_name["namespace"]._options = None +_UPSERTRESPONSE.fields_by_name["upserted_count"]._options = None +_DELETEREQUEST.fields_by_name["ids"]._options = None +_DELETEREQUEST.fields_by_name["delete_all"]._options = None +_DELETEREQUEST.fields_by_name["namespace"]._options = None +_FETCHREQUEST.fields_by_name["ids"]._options = None +_FETCHREQUEST.fields_by_name["namespace"]._options = None _FETCHRESPONSE_VECTORSENTRY._options = None -_FETCHRESPONSE.fields_by_name['namespace']._options = None -_QUERYVECTOR.fields_by_name['values']._options = None -_QUERYVECTOR.fields_by_name['top_k']._options = None -_QUERYVECTOR.fields_by_name['namespace']._options = None -_QUERYVECTOR.fields_by_name['filter']._options = None -_QUERYREQUEST.fields_by_name['namespace']._options = None -_QUERYREQUEST.fields_by_name['top_k']._options = None -_QUERYREQUEST.fields_by_name['filter']._options = None -_QUERYREQUEST.fields_by_name['include_values']._options = None -_QUERYREQUEST.fields_by_name['include_metadata']._options = None -_QUERYREQUEST.fields_by_name['queries']._options = None -_QUERYREQUEST.fields_by_name['vector']._options = None -_QUERYREQUEST.fields_by_name['id']._options = None -_SINGLEQUERYRESULTS.fields_by_name['namespace']._options = None -_QUERYRESPONSE.fields_by_name['results']._options = None -_UPDATEREQUEST.fields_by_name['id']._options = None -_UPDATEREQUEST.fields_by_name['values']._options = None -_UPDATEREQUEST.fields_by_name['set_metadata']._options = None -_UPDATEREQUEST.fields_by_name['namespace']._options = None -_NAMESPACESUMMARY.fields_by_name['vector_count']._options = None +_FETCHRESPONSE.fields_by_name["namespace"]._options = None +_QUERYVECTOR.fields_by_name["values"]._options = None +_QUERYVECTOR.fields_by_name["top_k"]._options = None +_QUERYVECTOR.fields_by_name["namespace"]._options = None +_QUERYVECTOR.fields_by_name["filter"]._options = None +_QUERYREQUEST.fields_by_name["namespace"]._options = None +_QUERYREQUEST.fields_by_name["top_k"]._options = None +_QUERYREQUEST.fields_by_name["filter"]._options = None +_QUERYREQUEST.fields_by_name["include_values"]._options = None +_QUERYREQUEST.fields_by_name["include_metadata"]._options = None +_QUERYREQUEST.fields_by_name["queries"]._options = None +_QUERYREQUEST.fields_by_name["vector"]._options = None +_QUERYREQUEST.fields_by_name["id"]._options = None +_SINGLEQUERYRESULTS.fields_by_name["namespace"]._options = None +_QUERYRESPONSE.fields_by_name["results"]._options = None +_UPDATEREQUEST.fields_by_name["id"]._options = None +_UPDATEREQUEST.fields_by_name["values"]._options = None +_UPDATEREQUEST.fields_by_name["set_metadata"]._options = None +_UPDATEREQUEST.fields_by_name["namespace"]._options = None +_NAMESPACESUMMARY.fields_by_name["vector_count"]._options = None _DESCRIBEINDEXSTATSRESPONSE_NAMESPACESENTRY._options = None -_DESCRIBEINDEXSTATSRESPONSE.fields_by_name['dimension']._options = None -_DESCRIBEINDEXSTATSRESPONSE.fields_by_name['index_fullness']._options = None -_DESCRIBEINDEXSTATSRESPONSE.fields_by_name['total_vector_count']._options = None +_DESCRIBEINDEXSTATSRESPONSE.fields_by_name["dimension"]._options = None +_DESCRIBEINDEXSTATSRESPONSE.fields_by_name["index_fullness"]._options = None +_DESCRIBEINDEXSTATSRESPONSE.fields_by_name["total_vector_count"]._options = None _DESCRIBEINDEXSTATSRESPONSE._options = None _VECTORSERVICE = _descriptor.ServiceDescriptor( - name='VectorService', - full_name='VectorService', - file=DESCRIPTOR, - index=0, - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_start=3377, - serialized_end=4078, - methods=[ - _descriptor.MethodDescriptor( - name='Upsert', - full_name='VectorService.Upsert', + name="VectorService", + full_name="VectorService", + file=DESCRIPTOR, index=0, - containing_service=None, - input_type=_UPSERTREQUEST, - output_type=_UPSERTRESPONSE, - serialized_options=b'\202\323\344\223\002\024\"\017/vectors/upsert:\001*\222A\033\n\021Vector Operations*\006upsert', + serialized_options=None, create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='Delete', - full_name='VectorService.Delete', - index=1, - containing_service=None, - input_type=_DELETEREQUEST, - output_type=_DELETERESPONSE, - serialized_options=b'\202\323\344\223\002\'\"\017/vectors/delete:\001*Z\021*\017/vectors/delete\222A\033\n\021Vector Operations*\006delete', - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='Fetch', - full_name='VectorService.Fetch', - index=2, - containing_service=None, - input_type=_FETCHREQUEST, - output_type=_FETCHRESPONSE, - serialized_options=b'\202\323\344\223\002\020\022\016/vectors/fetch\222A\032\n\021Vector Operations*\005fetch', - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='Query', - full_name='VectorService.Query', - index=3, - containing_service=None, - input_type=_QUERYREQUEST, - output_type=_QUERYRESPONSE, - serialized_options=b'\202\323\344\223\002\013\"\006/query:\001*\222A\032\n\021Vector Operations*\005query', - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='Update', - full_name='VectorService.Update', - index=4, - containing_service=None, - input_type=_UPDATEREQUEST, - output_type=_UPDATERESPONSE, - serialized_options=b'\202\323\344\223\002\024\"\017/vectors/update:\001*\222A\033\n\021Vector Operations*\006update', - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name='DescribeIndexStats', - full_name='VectorService.DescribeIndexStats', - index=5, - containing_service=None, - input_type=_DESCRIBEINDEXSTATSREQUEST, - output_type=_DESCRIBEINDEXSTATSRESPONSE, - serialized_options=b'\202\323\344\223\0023\"\025/describe_index_stats:\001*Z\027\022\025/describe_index_stats\222A)\n\021Vector Operations*\024describe_index_stats', - create_key=_descriptor._internal_create_key, - ), -]) + serialized_start=3377, + serialized_end=4078, + methods=[ + _descriptor.MethodDescriptor( + name="Upsert", + full_name="VectorService.Upsert", + index=0, + containing_service=None, + input_type=_UPSERTREQUEST, + output_type=_UPSERTRESPONSE, + serialized_options=b'\202\323\344\223\002\024"\017/vectors/upsert:\001*\222A\033\n\021Vector Operations*\006upsert', + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name="Delete", + full_name="VectorService.Delete", + index=1, + containing_service=None, + input_type=_DELETEREQUEST, + output_type=_DELETERESPONSE, + serialized_options=b"\202\323\344\223\002'\"\017/vectors/delete:\001*Z\021*\017/vectors/delete\222A\033\n\021Vector Operations*\006delete", + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name="Fetch", + full_name="VectorService.Fetch", + index=2, + containing_service=None, + input_type=_FETCHREQUEST, + output_type=_FETCHRESPONSE, + serialized_options=b"\202\323\344\223\002\020\022\016/vectors/fetch\222A\032\n\021Vector Operations*\005fetch", + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name="Query", + full_name="VectorService.Query", + index=3, + containing_service=None, + input_type=_QUERYREQUEST, + output_type=_QUERYRESPONSE, + serialized_options=b'\202\323\344\223\002\013"\006/query:\001*\222A\032\n\021Vector Operations*\005query', + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name="Update", + full_name="VectorService.Update", + index=4, + containing_service=None, + input_type=_UPDATEREQUEST, + output_type=_UPDATERESPONSE, + serialized_options=b'\202\323\344\223\002\024"\017/vectors/update:\001*\222A\033\n\021Vector Operations*\006update', + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name="DescribeIndexStats", + full_name="VectorService.DescribeIndexStats", + index=5, + containing_service=None, + input_type=_DESCRIBEINDEXSTATSREQUEST, + output_type=_DESCRIBEINDEXSTATSRESPONSE, + serialized_options=b'\202\323\344\223\0023"\025/describe_index_stats:\001*Z\027\022\025/describe_index_stats\222A)\n\021Vector Operations*\024describe_index_stats', + create_key=_descriptor._internal_create_key, + ), + ], +) _sym_db.RegisterServiceDescriptor(_VECTORSERVICE) -DESCRIPTOR.services_by_name['VectorService'] = _VECTORSERVICE +DESCRIPTOR.services_by_name["VectorService"] = _VECTORSERVICE # @@protoc_insertion_point(module_scope) diff --git a/pinecone/core/grpc/protos/vector_service_pb2.pyi b/pinecone/core/grpc/protos/vector_service_pb2.pyi index 0c2c73f6..a8c3c4d0 100644 --- a/pinecone/core/grpc/protos/vector_service_pb2.pyi +++ b/pinecone/core/grpc/protos/vector_service_pb2.pyi @@ -30,13 +30,11 @@ from typing_extensions import ( Literal as typing_extensions___Literal, ) - builtin___bool = bool builtin___bytes = bytes builtin___float = float builtin___int = int - DESCRIPTOR: google___protobuf___descriptor___FileDescriptor = ... class SparseValues(google___protobuf___message___Message): @@ -44,12 +42,16 @@ class SparseValues(google___protobuf___message___Message): indices: google___protobuf___internal___containers___RepeatedScalarFieldContainer[builtin___int] = ... values: google___protobuf___internal___containers___RepeatedScalarFieldContainer[builtin___float] = ... - def __init__(self, + def __init__( + self, *, - indices : typing___Optional[typing___Iterable[builtin___int]] = None, - values : typing___Optional[typing___Iterable[builtin___float]] = None, - ) -> None: ... - def ClearField(self, field_name: typing_extensions___Literal[u"indices",b"indices",u"values",b"values"]) -> None: ... + indices: typing___Optional[typing___Iterable[builtin___int]] = None, + values: typing___Optional[typing___Iterable[builtin___float]] = None, + ) -> None: ... + def ClearField( + self, field_name: typing_extensions___Literal["indices", b"indices", "values", b"values"] + ) -> None: ... + type___SparseValues = SparseValues class Vector(google___protobuf___message___Message): @@ -59,19 +61,26 @@ class Vector(google___protobuf___message___Message): @property def sparse_values(self) -> type___SparseValues: ... - @property def metadata(self) -> google___protobuf___struct_pb2___Struct: ... - - def __init__(self, + def __init__( + self, *, - id : typing___Optional[typing___Text] = None, - values : typing___Optional[typing___Iterable[builtin___float]] = None, - sparse_values : typing___Optional[type___SparseValues] = None, - metadata : typing___Optional[google___protobuf___struct_pb2___Struct] = None, - ) -> None: ... - def HasField(self, field_name: typing_extensions___Literal[u"metadata",b"metadata",u"sparse_values",b"sparse_values"]) -> builtin___bool: ... - def ClearField(self, field_name: typing_extensions___Literal[u"id",b"id",u"metadata",b"metadata",u"sparse_values",b"sparse_values",u"values",b"values"]) -> None: ... + id: typing___Optional[typing___Text] = None, + values: typing___Optional[typing___Iterable[builtin___float]] = None, + sparse_values: typing___Optional[type___SparseValues] = None, + metadata: typing___Optional[google___protobuf___struct_pb2___Struct] = None, + ) -> None: ... + def HasField( + self, field_name: typing_extensions___Literal["metadata", b"metadata", "sparse_values", b"sparse_values"] + ) -> builtin___bool: ... + def ClearField( + self, + field_name: typing_extensions___Literal[ + "id", b"id", "metadata", b"metadata", "sparse_values", b"sparse_values", "values", b"values" + ], + ) -> None: ... + type___Vector = Vector class ScoredVector(google___protobuf___message___Message): @@ -82,20 +91,36 @@ class ScoredVector(google___protobuf___message___Message): @property def sparse_values(self) -> type___SparseValues: ... - @property def metadata(self) -> google___protobuf___struct_pb2___Struct: ... - - def __init__(self, + def __init__( + self, *, - id : typing___Optional[typing___Text] = None, - score : typing___Optional[builtin___float] = None, - values : typing___Optional[typing___Iterable[builtin___float]] = None, - sparse_values : typing___Optional[type___SparseValues] = None, - metadata : typing___Optional[google___protobuf___struct_pb2___Struct] = None, - ) -> None: ... - def HasField(self, field_name: typing_extensions___Literal[u"metadata",b"metadata",u"sparse_values",b"sparse_values"]) -> builtin___bool: ... - def ClearField(self, field_name: typing_extensions___Literal[u"id",b"id",u"metadata",b"metadata",u"score",b"score",u"sparse_values",b"sparse_values",u"values",b"values"]) -> None: ... + id: typing___Optional[typing___Text] = None, + score: typing___Optional[builtin___float] = None, + values: typing___Optional[typing___Iterable[builtin___float]] = None, + sparse_values: typing___Optional[type___SparseValues] = None, + metadata: typing___Optional[google___protobuf___struct_pb2___Struct] = None, + ) -> None: ... + def HasField( + self, field_name: typing_extensions___Literal["metadata", b"metadata", "sparse_values", b"sparse_values"] + ) -> builtin___bool: ... + def ClearField( + self, + field_name: typing_extensions___Literal[ + "id", + b"id", + "metadata", + b"metadata", + "score", + b"score", + "sparse_values", + b"sparse_values", + "values", + b"values", + ], + ) -> None: ... + type___ScoredVector = ScoredVector class UpsertRequest(google___protobuf___message___Message): @@ -104,24 +129,29 @@ class UpsertRequest(google___protobuf___message___Message): @property def vectors(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___Vector]: ... - - def __init__(self, + def __init__( + self, *, - vectors : typing___Optional[typing___Iterable[type___Vector]] = None, - namespace : typing___Optional[typing___Text] = None, - ) -> None: ... - def ClearField(self, field_name: typing_extensions___Literal[u"namespace",b"namespace",u"vectors",b"vectors"]) -> None: ... + vectors: typing___Optional[typing___Iterable[type___Vector]] = None, + namespace: typing___Optional[typing___Text] = None, + ) -> None: ... + def ClearField( + self, field_name: typing_extensions___Literal["namespace", b"namespace", "vectors", b"vectors"] + ) -> None: ... + type___UpsertRequest = UpsertRequest class UpsertResponse(google___protobuf___message___Message): DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... upserted_count: builtin___int = ... - def __init__(self, + def __init__( + self, *, - upserted_count : typing___Optional[builtin___int] = None, - ) -> None: ... - def ClearField(self, field_name: typing_extensions___Literal[u"upserted_count",b"upserted_count"]) -> None: ... + upserted_count: typing___Optional[builtin___int] = None, + ) -> None: ... + def ClearField(self, field_name: typing_extensions___Literal["upserted_count", b"upserted_count"]) -> None: ... + type___UpsertResponse = UpsertResponse class DeleteRequest(google___protobuf___message___Message): @@ -132,23 +162,31 @@ class DeleteRequest(google___protobuf___message___Message): @property def filter(self) -> google___protobuf___struct_pb2___Struct: ... - - def __init__(self, + def __init__( + self, *, - ids : typing___Optional[typing___Iterable[typing___Text]] = None, - delete_all : typing___Optional[builtin___bool] = None, - namespace : typing___Optional[typing___Text] = None, - filter : typing___Optional[google___protobuf___struct_pb2___Struct] = None, - ) -> None: ... - def HasField(self, field_name: typing_extensions___Literal[u"filter",b"filter"]) -> builtin___bool: ... - def ClearField(self, field_name: typing_extensions___Literal[u"delete_all",b"delete_all",u"filter",b"filter",u"ids",b"ids",u"namespace",b"namespace"]) -> None: ... + ids: typing___Optional[typing___Iterable[typing___Text]] = None, + delete_all: typing___Optional[builtin___bool] = None, + namespace: typing___Optional[typing___Text] = None, + filter: typing___Optional[google___protobuf___struct_pb2___Struct] = None, + ) -> None: ... + def HasField(self, field_name: typing_extensions___Literal["filter", b"filter"]) -> builtin___bool: ... + def ClearField( + self, + field_name: typing_extensions___Literal[ + "delete_all", b"delete_all", "filter", b"filter", "ids", b"ids", "namespace", b"namespace" + ], + ) -> None: ... + type___DeleteRequest = DeleteRequest class DeleteResponse(google___protobuf___message___Message): DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... - def __init__(self, - ) -> None: ... + def __init__( + self, + ) -> None: ... + type___DeleteResponse = DeleteResponse class FetchRequest(google___protobuf___message___Message): @@ -156,43 +194,49 @@ class FetchRequest(google___protobuf___message___Message): ids: google___protobuf___internal___containers___RepeatedScalarFieldContainer[typing___Text] = ... namespace: typing___Text = ... - def __init__(self, + def __init__( + self, *, - ids : typing___Optional[typing___Iterable[typing___Text]] = None, - namespace : typing___Optional[typing___Text] = None, - ) -> None: ... - def ClearField(self, field_name: typing_extensions___Literal[u"ids",b"ids",u"namespace",b"namespace"]) -> None: ... + ids: typing___Optional[typing___Iterable[typing___Text]] = None, + namespace: typing___Optional[typing___Text] = None, + ) -> None: ... + def ClearField(self, field_name: typing_extensions___Literal["ids", b"ids", "namespace", b"namespace"]) -> None: ... + type___FetchRequest = FetchRequest class FetchResponse(google___protobuf___message___Message): DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... + class VectorsEntry(google___protobuf___message___Message): DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... key: typing___Text = ... @property def value(self) -> type___Vector: ... - - def __init__(self, + def __init__( + self, *, - key : typing___Optional[typing___Text] = None, - value : typing___Optional[type___Vector] = None, - ) -> None: ... - def HasField(self, field_name: typing_extensions___Literal[u"value",b"value"]) -> builtin___bool: ... - def ClearField(self, field_name: typing_extensions___Literal[u"key",b"key",u"value",b"value"]) -> None: ... + key: typing___Optional[typing___Text] = None, + value: typing___Optional[type___Vector] = None, + ) -> None: ... + def HasField(self, field_name: typing_extensions___Literal["value", b"value"]) -> builtin___bool: ... + def ClearField(self, field_name: typing_extensions___Literal["key", b"key", "value", b"value"]) -> None: ... type___VectorsEntry = VectorsEntry namespace: typing___Text = ... @property def vectors(self) -> typing___MutableMapping[typing___Text, type___Vector]: ... - - def __init__(self, + def __init__( + self, *, - vectors : typing___Optional[typing___Mapping[typing___Text, type___Vector]] = None, - namespace : typing___Optional[typing___Text] = None, - ) -> None: ... - def ClearField(self, field_name: typing_extensions___Literal[u"namespace",b"namespace",u"vectors",b"vectors"]) -> None: ... + vectors: typing___Optional[typing___Mapping[typing___Text, type___Vector]] = None, + namespace: typing___Optional[typing___Text] = None, + ) -> None: ... + def ClearField( + self, field_name: typing_extensions___Literal["namespace", b"namespace", "vectors", b"vectors"] + ) -> None: ... + type___FetchResponse = FetchResponse class QueryVector(google___protobuf___message___Message): @@ -203,20 +247,36 @@ class QueryVector(google___protobuf___message___Message): @property def sparse_values(self) -> type___SparseValues: ... - @property def filter(self) -> google___protobuf___struct_pb2___Struct: ... - - def __init__(self, + def __init__( + self, *, - values : typing___Optional[typing___Iterable[builtin___float]] = None, - sparse_values : typing___Optional[type___SparseValues] = None, - top_k : typing___Optional[builtin___int] = None, - namespace : typing___Optional[typing___Text] = None, - filter : typing___Optional[google___protobuf___struct_pb2___Struct] = None, - ) -> None: ... - def HasField(self, field_name: typing_extensions___Literal[u"filter",b"filter",u"sparse_values",b"sparse_values"]) -> builtin___bool: ... - def ClearField(self, field_name: typing_extensions___Literal[u"filter",b"filter",u"namespace",b"namespace",u"sparse_values",b"sparse_values",u"top_k",b"top_k",u"values",b"values"]) -> None: ... + values: typing___Optional[typing___Iterable[builtin___float]] = None, + sparse_values: typing___Optional[type___SparseValues] = None, + top_k: typing___Optional[builtin___int] = None, + namespace: typing___Optional[typing___Text] = None, + filter: typing___Optional[google___protobuf___struct_pb2___Struct] = None, + ) -> None: ... + def HasField( + self, field_name: typing_extensions___Literal["filter", b"filter", "sparse_values", b"sparse_values"] + ) -> builtin___bool: ... + def ClearField( + self, + field_name: typing_extensions___Literal[ + "filter", + b"filter", + "namespace", + b"namespace", + "sparse_values", + b"sparse_values", + "top_k", + b"top_k", + "values", + b"values", + ], + ) -> None: ... + type___QueryVector = QueryVector class QueryRequest(google___protobuf___message___Message): @@ -230,27 +290,52 @@ class QueryRequest(google___protobuf___message___Message): @property def filter(self) -> google___protobuf___struct_pb2___Struct: ... - @property - def queries(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___QueryVector]: ... - + def queries( + self, + ) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___QueryVector]: ... @property def sparse_vector(self) -> type___SparseValues: ... - - def __init__(self, + def __init__( + self, *, - namespace : typing___Optional[typing___Text] = None, - top_k : typing___Optional[builtin___int] = None, - filter : typing___Optional[google___protobuf___struct_pb2___Struct] = None, - include_values : typing___Optional[builtin___bool] = None, - include_metadata : typing___Optional[builtin___bool] = None, - queries : typing___Optional[typing___Iterable[type___QueryVector]] = None, - vector : typing___Optional[typing___Iterable[builtin___float]] = None, - sparse_vector : typing___Optional[type___SparseValues] = None, - id : typing___Optional[typing___Text] = None, - ) -> None: ... - def HasField(self, field_name: typing_extensions___Literal[u"filter",b"filter",u"sparse_vector",b"sparse_vector"]) -> builtin___bool: ... - def ClearField(self, field_name: typing_extensions___Literal[u"filter",b"filter",u"id",b"id",u"include_metadata",b"include_metadata",u"include_values",b"include_values",u"namespace",b"namespace",u"queries",b"queries",u"sparse_vector",b"sparse_vector",u"top_k",b"top_k",u"vector",b"vector"]) -> None: ... + namespace: typing___Optional[typing___Text] = None, + top_k: typing___Optional[builtin___int] = None, + filter: typing___Optional[google___protobuf___struct_pb2___Struct] = None, + include_values: typing___Optional[builtin___bool] = None, + include_metadata: typing___Optional[builtin___bool] = None, + queries: typing___Optional[typing___Iterable[type___QueryVector]] = None, + vector: typing___Optional[typing___Iterable[builtin___float]] = None, + sparse_vector: typing___Optional[type___SparseValues] = None, + id: typing___Optional[typing___Text] = None, + ) -> None: ... + def HasField( + self, field_name: typing_extensions___Literal["filter", b"filter", "sparse_vector", b"sparse_vector"] + ) -> builtin___bool: ... + def ClearField( + self, + field_name: typing_extensions___Literal[ + "filter", + b"filter", + "id", + b"id", + "include_metadata", + b"include_metadata", + "include_values", + b"include_values", + "namespace", + b"namespace", + "queries", + b"queries", + "sparse_vector", + b"sparse_vector", + "top_k", + b"top_k", + "vector", + b"vector", + ], + ) -> None: ... + type___QueryRequest = QueryRequest class SingleQueryResults(google___protobuf___message___Message): @@ -258,14 +343,19 @@ class SingleQueryResults(google___protobuf___message___Message): namespace: typing___Text = ... @property - def matches(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___ScoredVector]: ... - - def __init__(self, + def matches( + self, + ) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___ScoredVector]: ... + def __init__( + self, *, - matches : typing___Optional[typing___Iterable[type___ScoredVector]] = None, - namespace : typing___Optional[typing___Text] = None, - ) -> None: ... - def ClearField(self, field_name: typing_extensions___Literal[u"matches",b"matches",u"namespace",b"namespace"]) -> None: ... + matches: typing___Optional[typing___Iterable[type___ScoredVector]] = None, + namespace: typing___Optional[typing___Text] = None, + ) -> None: ... + def ClearField( + self, field_name: typing_extensions___Literal["matches", b"matches", "namespace", b"namespace"] + ) -> None: ... + type___SingleQueryResults = SingleQueryResults class QueryResponse(google___protobuf___message___Message): @@ -273,18 +363,27 @@ class QueryResponse(google___protobuf___message___Message): namespace: typing___Text = ... @property - def results(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___SingleQueryResults]: ... - + def results( + self, + ) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___SingleQueryResults]: ... @property - def matches(self) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___ScoredVector]: ... - - def __init__(self, + def matches( + self, + ) -> google___protobuf___internal___containers___RepeatedCompositeFieldContainer[type___ScoredVector]: ... + def __init__( + self, *, - results : typing___Optional[typing___Iterable[type___SingleQueryResults]] = None, - matches : typing___Optional[typing___Iterable[type___ScoredVector]] = None, - namespace : typing___Optional[typing___Text] = None, - ) -> None: ... - def ClearField(self, field_name: typing_extensions___Literal[u"matches",b"matches",u"namespace",b"namespace",u"results",b"results"]) -> None: ... + results: typing___Optional[typing___Iterable[type___SingleQueryResults]] = None, + matches: typing___Optional[typing___Iterable[type___ScoredVector]] = None, + namespace: typing___Optional[typing___Text] = None, + ) -> None: ... + def ClearField( + self, + field_name: typing_extensions___Literal[ + "matches", b"matches", "namespace", b"namespace", "results", b"results" + ], + ) -> None: ... + type___QueryResponse = QueryResponse class UpdateRequest(google___protobuf___message___Message): @@ -295,27 +394,46 @@ class UpdateRequest(google___protobuf___message___Message): @property def sparse_values(self) -> type___SparseValues: ... - @property def set_metadata(self) -> google___protobuf___struct_pb2___Struct: ... - - def __init__(self, + def __init__( + self, *, - id : typing___Optional[typing___Text] = None, - values : typing___Optional[typing___Iterable[builtin___float]] = None, - sparse_values : typing___Optional[type___SparseValues] = None, - set_metadata : typing___Optional[google___protobuf___struct_pb2___Struct] = None, - namespace : typing___Optional[typing___Text] = None, - ) -> None: ... - def HasField(self, field_name: typing_extensions___Literal[u"set_metadata",b"set_metadata",u"sparse_values",b"sparse_values"]) -> builtin___bool: ... - def ClearField(self, field_name: typing_extensions___Literal[u"id",b"id",u"namespace",b"namespace",u"set_metadata",b"set_metadata",u"sparse_values",b"sparse_values",u"values",b"values"]) -> None: ... + id: typing___Optional[typing___Text] = None, + values: typing___Optional[typing___Iterable[builtin___float]] = None, + sparse_values: typing___Optional[type___SparseValues] = None, + set_metadata: typing___Optional[google___protobuf___struct_pb2___Struct] = None, + namespace: typing___Optional[typing___Text] = None, + ) -> None: ... + def HasField( + self, + field_name: typing_extensions___Literal["set_metadata", b"set_metadata", "sparse_values", b"sparse_values"], + ) -> builtin___bool: ... + def ClearField( + self, + field_name: typing_extensions___Literal[ + "id", + b"id", + "namespace", + b"namespace", + "set_metadata", + b"set_metadata", + "sparse_values", + b"sparse_values", + "values", + b"values", + ], + ) -> None: ... + type___UpdateRequest = UpdateRequest class UpdateResponse(google___protobuf___message___Message): DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... - def __init__(self, - ) -> None: ... + def __init__( + self, + ) -> None: ... + type___UpdateResponse = UpdateResponse class DescribeIndexStatsRequest(google___protobuf___message___Message): @@ -323,42 +441,46 @@ class DescribeIndexStatsRequest(google___protobuf___message___Message): @property def filter(self) -> google___protobuf___struct_pb2___Struct: ... - - def __init__(self, + def __init__( + self, *, - filter : typing___Optional[google___protobuf___struct_pb2___Struct] = None, - ) -> None: ... - def HasField(self, field_name: typing_extensions___Literal[u"filter",b"filter"]) -> builtin___bool: ... - def ClearField(self, field_name: typing_extensions___Literal[u"filter",b"filter"]) -> None: ... + filter: typing___Optional[google___protobuf___struct_pb2___Struct] = None, + ) -> None: ... + def HasField(self, field_name: typing_extensions___Literal["filter", b"filter"]) -> builtin___bool: ... + def ClearField(self, field_name: typing_extensions___Literal["filter", b"filter"]) -> None: ... + type___DescribeIndexStatsRequest = DescribeIndexStatsRequest class NamespaceSummary(google___protobuf___message___Message): DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... vector_count: builtin___int = ... - def __init__(self, + def __init__( + self, *, - vector_count : typing___Optional[builtin___int] = None, - ) -> None: ... - def ClearField(self, field_name: typing_extensions___Literal[u"vector_count",b"vector_count"]) -> None: ... + vector_count: typing___Optional[builtin___int] = None, + ) -> None: ... + def ClearField(self, field_name: typing_extensions___Literal["vector_count", b"vector_count"]) -> None: ... + type___NamespaceSummary = NamespaceSummary class DescribeIndexStatsResponse(google___protobuf___message___Message): DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... + class NamespacesEntry(google___protobuf___message___Message): DESCRIPTOR: google___protobuf___descriptor___Descriptor = ... key: typing___Text = ... @property def value(self) -> type___NamespaceSummary: ... - - def __init__(self, + def __init__( + self, *, - key : typing___Optional[typing___Text] = None, - value : typing___Optional[type___NamespaceSummary] = None, - ) -> None: ... - def HasField(self, field_name: typing_extensions___Literal[u"value",b"value"]) -> builtin___bool: ... - def ClearField(self, field_name: typing_extensions___Literal[u"key",b"key",u"value",b"value"]) -> None: ... + key: typing___Optional[typing___Text] = None, + value: typing___Optional[type___NamespaceSummary] = None, + ) -> None: ... + def HasField(self, field_name: typing_extensions___Literal["value", b"value"]) -> builtin___bool: ... + def ClearField(self, field_name: typing_extensions___Literal["key", b"key", "value", b"value"]) -> None: ... type___NamespacesEntry = NamespacesEntry dimension: builtin___int = ... @@ -367,13 +489,26 @@ class DescribeIndexStatsResponse(google___protobuf___message___Message): @property def namespaces(self) -> typing___MutableMapping[typing___Text, type___NamespaceSummary]: ... - - def __init__(self, + def __init__( + self, *, - namespaces : typing___Optional[typing___Mapping[typing___Text, type___NamespaceSummary]] = None, - dimension : typing___Optional[builtin___int] = None, - index_fullness : typing___Optional[builtin___float] = None, - total_vector_count : typing___Optional[builtin___int] = None, - ) -> None: ... - def ClearField(self, field_name: typing_extensions___Literal[u"dimension",b"dimension",u"index_fullness",b"index_fullness",u"namespaces",b"namespaces",u"total_vector_count",b"total_vector_count"]) -> None: ... + namespaces: typing___Optional[typing___Mapping[typing___Text, type___NamespaceSummary]] = None, + dimension: typing___Optional[builtin___int] = None, + index_fullness: typing___Optional[builtin___float] = None, + total_vector_count: typing___Optional[builtin___int] = None, + ) -> None: ... + def ClearField( + self, + field_name: typing_extensions___Literal[ + "dimension", + b"dimension", + "index_fullness", + b"index_fullness", + "namespaces", + b"namespaces", + "total_vector_count", + b"total_vector_count", + ], + ) -> None: ... + type___DescribeIndexStatsResponse = DescribeIndexStatsResponse diff --git a/pinecone/core/grpc/protos/vector_service_pb2_grpc.py b/pinecone/core/grpc/protos/vector_service_pb2_grpc.py index 28102774..aa64ea7d 100644 --- a/pinecone/core/grpc/protos/vector_service_pb2_grpc.py +++ b/pinecone/core/grpc/protos/vector_service_pb2_grpc.py @@ -8,6 +8,7 @@ import pinecone.core.grpc.protos.vector_service_pb2 as vector__service__pb2 + class VectorServiceStub(object): """The `VectorService` interface is exposed by Pinecone's vector index services. This service could also be called a `gRPC` service or a `REST`-like api. @@ -20,35 +21,35 @@ def __init__(self, channel): channel: A grpc.Channel. """ self.Upsert = channel.unary_unary( - '/VectorService/Upsert', - request_serializer=vector__service__pb2.UpsertRequest.SerializeToString, - response_deserializer=vector__service__pb2.UpsertResponse.FromString, - ) + "/VectorService/Upsert", + request_serializer=vector__service__pb2.UpsertRequest.SerializeToString, + response_deserializer=vector__service__pb2.UpsertResponse.FromString, + ) self.Delete = channel.unary_unary( - '/VectorService/Delete', - request_serializer=vector__service__pb2.DeleteRequest.SerializeToString, - response_deserializer=vector__service__pb2.DeleteResponse.FromString, - ) + "/VectorService/Delete", + request_serializer=vector__service__pb2.DeleteRequest.SerializeToString, + response_deserializer=vector__service__pb2.DeleteResponse.FromString, + ) self.Fetch = channel.unary_unary( - '/VectorService/Fetch', - request_serializer=vector__service__pb2.FetchRequest.SerializeToString, - response_deserializer=vector__service__pb2.FetchResponse.FromString, - ) + "/VectorService/Fetch", + request_serializer=vector__service__pb2.FetchRequest.SerializeToString, + response_deserializer=vector__service__pb2.FetchResponse.FromString, + ) self.Query = channel.unary_unary( - '/VectorService/Query', - request_serializer=vector__service__pb2.QueryRequest.SerializeToString, - response_deserializer=vector__service__pb2.QueryResponse.FromString, - ) + "/VectorService/Query", + request_serializer=vector__service__pb2.QueryRequest.SerializeToString, + response_deserializer=vector__service__pb2.QueryResponse.FromString, + ) self.Update = channel.unary_unary( - '/VectorService/Update', - request_serializer=vector__service__pb2.UpdateRequest.SerializeToString, - response_deserializer=vector__service__pb2.UpdateResponse.FromString, - ) + "/VectorService/Update", + request_serializer=vector__service__pb2.UpdateRequest.SerializeToString, + response_deserializer=vector__service__pb2.UpdateResponse.FromString, + ) self.DescribeIndexStats = channel.unary_unary( - '/VectorService/DescribeIndexStats', - request_serializer=vector__service__pb2.DescribeIndexStatsRequest.SerializeToString, - response_deserializer=vector__service__pb2.DescribeIndexStatsResponse.FromString, - ) + "/VectorService/DescribeIndexStats", + request_serializer=vector__service__pb2.DescribeIndexStatsRequest.SerializeToString, + response_deserializer=vector__service__pb2.DescribeIndexStatsResponse.FromString, + ) class VectorServiceServicer(object): @@ -63,8 +64,8 @@ def Upsert(self, request, context): If a new value is upserted for an existing vector id, it will overwrite the previous value. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") def Delete(self, request, context): """Delete @@ -73,8 +74,8 @@ def Delete(self, request, context): You can delete items by their id, from a single namespace. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") def Fetch(self, request, context): """Fetch @@ -83,8 +84,8 @@ def Fetch(self, request, context): The returned vectors include the vector data and/or metadata. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") def Query(self, request, context): """Query @@ -93,8 +94,8 @@ def Query(self, request, context): It retrieves the ids of the most similar items in a namespace, along with their similarity scores. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") def Update(self, request, context): """Update @@ -104,8 +105,8 @@ def Update(self, request, context): If a set_metadata is included, the values of the fields specified in it will be added or overwrite the previous value. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") def DescribeIndexStats(self, request, context): """DescribeIndexStats @@ -118,152 +119,223 @@ def DescribeIndexStats(self, request, context): [`describe_index`](https://www.pinecone.io/docs/api/operation/describe_index/). """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") def add_VectorServiceServicer_to_server(servicer, server): rpc_method_handlers = { - 'Upsert': grpc.unary_unary_rpc_method_handler( - servicer.Upsert, - request_deserializer=vector__service__pb2.UpsertRequest.FromString, - response_serializer=vector__service__pb2.UpsertResponse.SerializeToString, - ), - 'Delete': grpc.unary_unary_rpc_method_handler( - servicer.Delete, - request_deserializer=vector__service__pb2.DeleteRequest.FromString, - response_serializer=vector__service__pb2.DeleteResponse.SerializeToString, - ), - 'Fetch': grpc.unary_unary_rpc_method_handler( - servicer.Fetch, - request_deserializer=vector__service__pb2.FetchRequest.FromString, - response_serializer=vector__service__pb2.FetchResponse.SerializeToString, - ), - 'Query': grpc.unary_unary_rpc_method_handler( - servicer.Query, - request_deserializer=vector__service__pb2.QueryRequest.FromString, - response_serializer=vector__service__pb2.QueryResponse.SerializeToString, - ), - 'Update': grpc.unary_unary_rpc_method_handler( - servicer.Update, - request_deserializer=vector__service__pb2.UpdateRequest.FromString, - response_serializer=vector__service__pb2.UpdateResponse.SerializeToString, - ), - 'DescribeIndexStats': grpc.unary_unary_rpc_method_handler( - servicer.DescribeIndexStats, - request_deserializer=vector__service__pb2.DescribeIndexStatsRequest.FromString, - response_serializer=vector__service__pb2.DescribeIndexStatsResponse.SerializeToString, - ), + "Upsert": grpc.unary_unary_rpc_method_handler( + servicer.Upsert, + request_deserializer=vector__service__pb2.UpsertRequest.FromString, + response_serializer=vector__service__pb2.UpsertResponse.SerializeToString, + ), + "Delete": grpc.unary_unary_rpc_method_handler( + servicer.Delete, + request_deserializer=vector__service__pb2.DeleteRequest.FromString, + response_serializer=vector__service__pb2.DeleteResponse.SerializeToString, + ), + "Fetch": grpc.unary_unary_rpc_method_handler( + servicer.Fetch, + request_deserializer=vector__service__pb2.FetchRequest.FromString, + response_serializer=vector__service__pb2.FetchResponse.SerializeToString, + ), + "Query": grpc.unary_unary_rpc_method_handler( + servicer.Query, + request_deserializer=vector__service__pb2.QueryRequest.FromString, + response_serializer=vector__service__pb2.QueryResponse.SerializeToString, + ), + "Update": grpc.unary_unary_rpc_method_handler( + servicer.Update, + request_deserializer=vector__service__pb2.UpdateRequest.FromString, + response_serializer=vector__service__pb2.UpdateResponse.SerializeToString, + ), + "DescribeIndexStats": grpc.unary_unary_rpc_method_handler( + servicer.DescribeIndexStats, + request_deserializer=vector__service__pb2.DescribeIndexStatsRequest.FromString, + response_serializer=vector__service__pb2.DescribeIndexStatsResponse.SerializeToString, + ), } - generic_handler = grpc.method_handlers_generic_handler( - 'VectorService', rpc_method_handlers) + generic_handler = grpc.method_handlers_generic_handler("VectorService", rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) - # This class is part of an EXPERIMENTAL API. +# This class is part of an EXPERIMENTAL API. class VectorService(object): """The `VectorService` interface is exposed by Pinecone's vector index services. This service could also be called a `gRPC` service or a `REST`-like api. """ @staticmethod - def Upsert(request, + def Upsert( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/VectorService/Upsert', + "/VectorService/Upsert", vector__service__pb2.UpsertRequest.SerializeToString, vector__service__pb2.UpsertResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) @staticmethod - def Delete(request, + def Delete( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/VectorService/Delete', + "/VectorService/Delete", vector__service__pb2.DeleteRequest.SerializeToString, vector__service__pb2.DeleteResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) @staticmethod - def Fetch(request, + def Fetch( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/VectorService/Fetch', + "/VectorService/Fetch", vector__service__pb2.FetchRequest.SerializeToString, vector__service__pb2.FetchResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) @staticmethod - def Query(request, + def Query( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/VectorService/Query', + "/VectorService/Query", vector__service__pb2.QueryRequest.SerializeToString, vector__service__pb2.QueryResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) @staticmethod - def Update(request, + def Update( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/VectorService/Update', + "/VectorService/Update", vector__service__pb2.UpdateRequest.SerializeToString, vector__service__pb2.UpdateResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) @staticmethod - def DescribeIndexStats(request, + def DescribeIndexStats( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/VectorService/DescribeIndexStats', + "/VectorService/DescribeIndexStats", vector__service__pb2.DescribeIndexStatsRequest.SerializeToString, vector__service__pb2.DescribeIndexStatsResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) diff --git a/pinecone/core/grpc/retry.py b/pinecone/core/grpc/retry.py index 8f1b3f7b..3d3f63a2 100644 --- a/pinecone/core/grpc/retry.py +++ b/pinecone/core/grpc/retry.py @@ -31,7 +31,7 @@ def __init__(self, *, init_backoff_ms: int, max_backoff_ms: int, multiplier: int self.multiplier = multiplier def sleep(self, try_i: int): - sleep_range = min(self.init_backoff * self.multiplier ** try_i, self.max_backoff) + sleep_range = min(self.init_backoff * self.multiplier**try_i, self.max_backoff) sleep_ms = random.randint(0, sleep_range) _logger.debug(f"gRPC retry. Sleeping for {sleep_ms}ms") time.sleep(sleep_ms / 1000) @@ -48,7 +48,7 @@ class RetryOnRpcErrorClientInterceptor( Referece: https://github.com/grpc/grpc/issues/19514#issuecomment-531700657 """ - def __init__(self, retry_config: 'RetryConfig'): + def __init__(self, retry_config: "RetryConfig"): self.max_attempts = retry_config.max_attempts self.sleep_policy = retry_config.sleep_policy self.retryable_status = retry_config.retryable_status @@ -56,9 +56,9 @@ def __init__(self, retry_config: 'RetryConfig'): def _is_retryable_error(self, response_or_error): """Determine if a response is a retryable error.""" return ( - isinstance(response_or_error, grpc.RpcError) - and "_MultiThreadedRendezvous" not in response_or_error.__class__.__name__ - and response_or_error.code() in self.retryable_status + isinstance(response_or_error, grpc.RpcError) + and "_MultiThreadedRendezvous" not in response_or_error.__class__.__name__ + and response_or_error.code() in self.retryable_status ) def _intercept_call(self, continuation, client_call_details, request_or_iterator): diff --git a/pinecone/core/utils/__init__.py b/pinecone/core/utils/__init__.py index cc944eb7..e3cda4ef 100644 --- a/pinecone/core/utils/__init__.py +++ b/pinecone/core/utils/__init__.py @@ -24,11 +24,15 @@ DNS_COMPATIBLE_REGEX = re.compile("^[a-z0-9]([a-z0-9]|[-])+[a-z0-9]$") -def dump_numpy_public(np_array: 'np.ndarray', compressed: bool = False) -> 'vector_column_service_pb2.NdArray': +def dump_numpy_public(np_array: "np.ndarray", compressed: bool = False) -> "vector_column_service_pb2.NdArray": """ Dump numpy array to vector_column_service_pb2.NdArray """ - warn_deprecated('dump_numpy_public and all numpy-related features will be removed in a future version', deprecated_in='2.2.1', removal_in='3.0.0') + warn_deprecated( + "dump_numpy_public and all numpy-related features will be removed in a future version", + deprecated_in="2.2.1", + removal_in="3.0.0", + ) protobuf_arr = vector_column_service_pb2.NdArray() protobuf_arr.dtype = str(np_array.dtype) protobuf_arr.shape.extend(np_array.shape) @@ -40,24 +44,30 @@ def dump_numpy_public(np_array: 'np.ndarray', compressed: bool = False) -> 'vect return protobuf_arr -def dump_strings_public(strs: List[str], compressed: bool = False) -> 'vector_column_service_pb2.NdArray': - warn_deprecated('dump_strings_public and all numpy-related features will be removed in a future version', deprecated_in='2.2.1', removal_in='3.0.0') - return dump_numpy_public(np.array(strs, dtype='S'), compressed=compressed) +def dump_strings_public(strs: List[str], compressed: bool = False) -> "vector_column_service_pb2.NdArray": + warn_deprecated( + "dump_strings_public and all numpy-related features will be removed in a future version", + deprecated_in="2.2.1", + removal_in="3.0.0", + ) + return dump_numpy_public(np.array(strs, dtype="S"), compressed=compressed) def get_version(): - return Path(__file__).parent.parent.parent.joinpath('__version__').read_text().strip() + return Path(__file__).parent.parent.parent.joinpath("__version__").read_text().strip() def get_environment(): - return Path(__file__).parent.parent.parent.joinpath('__environment__').read_text().strip() + return Path(__file__).parent.parent.parent.joinpath("__environment__").read_text().strip() def validate_dns_name(name): if not DNS_COMPATIBLE_REGEX.match(name): - raise ValueError("{} is invalid - service names and node names must consist of lower case " - "alphanumeric characters or '-', start with an alphabetic character, and end with an " - "alphanumeric character (e.g. 'my-name', or 'abc-123')".format(name)) + raise ValueError( + "{} is invalid - service names and node names must consist of lower case " + "alphanumeric characters or '-', start with an alphabetic character, and end with an " + "alphanumeric character (e.g. 'my-name', or 'abc-123')".format(name) + ) def _generate_request_id() -> str: @@ -70,13 +80,13 @@ def fix_tuple_length(t, n): def get_user_agent(): - client_id = f'python-client-{get_version()}' - user_agent_details = {'requests': requests.__version__, 'urllib3': urllib3.__version__} - user_agent = '{} ({})'.format(client_id, ', '.join([f'{k}:{v}' for k, v in user_agent_details.items()])) + client_id = f"python-client-{get_version()}" + user_agent_details = {"requests": requests.__version__, "urllib3": urllib3.__version__} + user_agent = "{} ({})".format(client_id, ", ".join([f"{k}:{v}" for k, v in user_agent_details.items()])) return user_agent -def dict_to_proto_struct(d: dict) -> 'Struct': +def dict_to_proto_struct(d: dict) -> "Struct": if not d: d = {} s = Struct() @@ -84,17 +94,21 @@ def dict_to_proto_struct(d: dict) -> 'Struct': return s -def proto_struct_to_dict(s: 'Struct') -> dict: +def proto_struct_to_dict(s: "Struct") -> dict: return json_format.MessageToDict(s) -def load_numpy_public(proto_arr: 'vector_column_service_pb2.NdArray') -> 'np.ndarray': +def load_numpy_public(proto_arr: "vector_column_service_pb2.NdArray") -> "np.ndarray": """ Load numpy array from protobuf :param proto_arr: :return: """ - warn_deprecated('load_numpy_public and all numpy-related features will be removed in a future version', deprecated_in='2.2.1', removal_in='3.0.0') + warn_deprecated( + "load_numpy_public and all numpy-related features will be removed in a future version", + deprecated_in="2.2.1", + removal_in="3.0.0", + ) if len(proto_arr.shape) == 0: return np.array([]) if proto_arr.compressed: @@ -104,16 +118,22 @@ def load_numpy_public(proto_arr: 'vector_column_service_pb2.NdArray') -> 'np.nda return numpy_arr.reshape(proto_arr.shape) -def load_strings_public(proto_arr: 'vector_column_service_pb2.NdArray') -> List[str]: - warn_deprecated('load_strings_public and all numpy-related features will be removed in a future version', deprecated_in='2.2.1', removal_in='3.0.0') - return [str(item, 'utf-8') for item in load_numpy_public(proto_arr)] +def load_strings_public(proto_arr: "vector_column_service_pb2.NdArray") -> List[str]: + warn_deprecated( + "load_strings_public and all numpy-related features will be removed in a future version", + deprecated_in="2.2.1", + removal_in="3.0.0", + ) + return [str(item, "utf-8") for item in load_numpy_public(proto_arr)] -def warn_deprecated(description: str = '', deprecated_in: str = None, removal_in: str = None): - message = f'DEPRECATED since v{deprecated_in} [Will be removed in v{removal_in}]: {description}' + +def warn_deprecated(description: str = "", deprecated_in: str = None, removal_in: str = None): + message = f"DEPRECATED since v{deprecated_in} [Will be removed in v{removal_in}]: {description}" warnings.warn(message, FutureWarning) + def check_kwargs(caller, given): argspec = inspect.getfullargspec(caller) diff = set(given).difference(argspec.args) if diff: - logging.exception(caller.__name__ + ' had unexpected keyword argument(s): ' + ', '.join(diff), exc_info=False) \ No newline at end of file + logging.exception(caller.__name__ + " had unexpected keyword argument(s): " + ", ".join(diff), exc_info=False) diff --git a/pinecone/core/utils/constants.py b/pinecone/core/utils/constants.py index 5d14696c..4dac7524 100644 --- a/pinecone/core/utils/constants.py +++ b/pinecone/core/utils/constants.py @@ -7,36 +7,36 @@ from pinecone.core.utils import get_environment, get_version -PARENT_LOGGER_NAME = 'pinecone' -DEFAULT_PARENT_LOGGER_LEVEL = 'ERROR' +PARENT_LOGGER_NAME = "pinecone" +DEFAULT_PARENT_LOGGER_LEVEL = "ERROR" MAX_MSG_SIZE = 128 * 1024 * 1024 MAX_ID_LENGTH = int(os.getenv("PINECONE_MAX_ID_LENGTH", default="64")) REQUEST_ID: str = "request_id" -CLIENT_VERSION_HEADER = 'X-Pinecone-Client-Version' +CLIENT_VERSION_HEADER = "X-Pinecone-Client-Version" class NodeType(str, enum.Enum): - STANDARD = 'STANDARD' - COMPUTE = 'COMPUTE' - MEMORY = 'MEMORY' - STANDARD2X = 'STANDARD2X' - COMPUTE2X = 'COMPUTE2X' - MEMORY2X = 'MEMORY2X' - STANDARD4X = 'STANDARD4X' - COMPUTE4X = 'COMPUTE4X' - MEMORY4X = 'MEMORY4X' + STANDARD = "STANDARD" + COMPUTE = "COMPUTE" + MEMORY = "MEMORY" + STANDARD2X = "STANDARD2X" + COMPUTE2X = "COMPUTE2X" + MEMORY2X = "MEMORY2X" + STANDARD4X = "STANDARD4X" + COMPUTE4X = "COMPUTE4X" + MEMORY4X = "MEMORY4X" PACKAGE_ENVIRONMENT = get_environment() or "development" CLIENT_VERSION = get_version() -CLIENT_ID = f'python-client-{CLIENT_VERSION}' +CLIENT_ID = f"python-client-{CLIENT_VERSION}" -TCP_KEEPINTVL = 60 # Sec -TCP_KEEPIDLE = 300 # Sec +TCP_KEEPINTVL = 60 # Sec +TCP_KEEPIDLE = 300 # Sec TCP_KEEPCNT = 4 -REQUIRED_VECTOR_FIELDS = {'id', 'values'} -OPTIONAL_VECTOR_FIELDS = {'sparse_values', 'metadata'} +REQUIRED_VECTOR_FIELDS = {"id", "values"} +OPTIONAL_VECTOR_FIELDS = {"sparse_values", "metadata"} diff --git a/pinecone/core/utils/error_handling.py b/pinecone/core/utils/error_handling.py index b3e3f1d2..34d7df42 100644 --- a/pinecone/core/utils/error_handling.py +++ b/pinecone/core/utils/error_handling.py @@ -18,11 +18,12 @@ def inner_func(*args, **kwargs): except MaxRetryError as e: if isinstance(e.reason, ProtocolError): raise PineconeProtocolError( - f'Failed to connect to {e.url}; did you specify the correct index name?') from e + f"Failed to connect to {e.url}; did you specify the correct index name?" + ) from e else: raise except ProtocolError as e: - raise PineconeProtocolError(f'Failed to connect; did you specify the correct index name?') from e + raise PineconeProtocolError(f"Failed to connect; did you specify the correct index name?") from e # Override signature sig = inspect.signature(func) diff --git a/pinecone/exceptions.py b/pinecone/exceptions.py index aafaba34..3f5e1cdf 100644 --- a/pinecone/exceptions.py +++ b/pinecone/exceptions.py @@ -3,8 +3,18 @@ # from .core.exceptions import PineconeException, PineconeProtocolError -from .core.client.exceptions import OpenApiException, ApiAttributeError, ApiTypeError, ApiValueError, \ - ApiKeyError, ApiException, NotFoundException, UnauthorizedException, ForbiddenException, ServiceException +from .core.client.exceptions import ( + OpenApiException, + ApiAttributeError, + ApiTypeError, + ApiValueError, + ApiKeyError, + ApiException, + NotFoundException, + UnauthorizedException, + ForbiddenException, + ServiceException, +) __all__ = [ "PineconeException", diff --git a/pinecone/index.py b/pinecone/index.py index d7b9b7fc..b4363f2a 100644 --- a/pinecone/index.py +++ b/pinecone/index.py @@ -12,39 +12,77 @@ from .core.client.model.sparse_values import SparseValues from pinecone import Config from pinecone.core.client import ApiClient -from .core.client.models import FetchResponse, ProtobufAny, QueryRequest, QueryResponse, QueryVector, RpcStatus, \ - ScoredVector, SingleQueryResults, DescribeIndexStatsResponse, UpsertRequest, UpsertResponse, UpdateRequest, \ - Vector, DeleteRequest, UpdateRequest, DescribeIndexStatsRequest +from .core.client.models import ( + FetchResponse, + ProtobufAny, + QueryRequest, + QueryResponse, + QueryVector, + RpcStatus, + ScoredVector, + SingleQueryResults, + DescribeIndexStatsResponse, + UpsertRequest, + UpsertResponse, + UpdateRequest, + Vector, + DeleteRequest, + UpdateRequest, + DescribeIndexStatsRequest, +) from pinecone.core.client.api.vector_operations_api import VectorOperationsApi from pinecone.core.utils import fix_tuple_length, get_user_agent, warn_deprecated import copy __all__ = [ - "Index", "FetchResponse", "ProtobufAny", "QueryRequest", "QueryResponse", "QueryVector", "RpcStatus", - "ScoredVector", "SingleQueryResults", "DescribeIndexStatsResponse", "UpsertRequest", "UpsertResponse", - "UpdateRequest", "Vector", "DeleteRequest", "UpdateRequest", "DescribeIndexStatsRequest", "SparseValues" + "Index", + "FetchResponse", + "ProtobufAny", + "QueryRequest", + "QueryResponse", + "QueryVector", + "RpcStatus", + "ScoredVector", + "SingleQueryResults", + "DescribeIndexStatsResponse", + "UpsertRequest", + "UpsertResponse", + "UpdateRequest", + "Vector", + "DeleteRequest", + "UpdateRequest", + "DescribeIndexStatsRequest", + "SparseValues", ] from .core.utils.constants import REQUIRED_VECTOR_FIELDS, OPTIONAL_VECTOR_FIELDS from .core.utils.error_handling import validate_and_convert_errors _OPENAPI_ENDPOINT_PARAMS = ( - '_return_http_data_only', '_preload_content', '_request_timeout', - '_check_input_type', '_check_return_type', '_host_index', 'async_req' + "_return_http_data_only", + "_preload_content", + "_request_timeout", + "_check_input_type", + "_check_return_type", + "_host_index", + "async_req", ) + def parse_query_response(response: QueryResponse, unary_query: bool): if unary_query: - response._data_store.pop('results', None) + response._data_store.pop("results", None) else: - response._data_store.pop('matches', None) - response._data_store.pop('namespace', None) + response._data_store.pop("matches", None) + response._data_store.pop("namespace", None) return response + def upsert_numpy_deprecation_notice(context): numpy_deprecataion_notice = "The ability to pass a numpy ndarray as part of a dictionary argument to upsert() will be removed in a future version of the pinecone client. To remove this warning, use the numpy.ndarray.tolist method to convert your ndarray into a python list before calling upsert()." message = " ".join([context, numpy_deprecataion_notice]) - warn_deprecated(message, deprecated_in='2.2.1', removal_in='3.0.0') + warn_deprecated(message, deprecated_in="2.2.1", removal_in="3.0.0") + class Index(ApiClient): @@ -52,30 +90,29 @@ class Index(ApiClient): A client for interacting with a Pinecone index via REST API. For improved performance, use the Pinecone GRPC index client. """ + def __init__(self, index_name: str, pool_threads=1): openapi_client_config = copy.deepcopy(Config.OPENAPI_CONFIG) openapi_client_config.api_key = openapi_client_config.api_key or {} - openapi_client_config.api_key['ApiKeyAuth'] = openapi_client_config.api_key.get('ApiKeyAuth', Config.API_KEY) + openapi_client_config.api_key["ApiKeyAuth"] = openapi_client_config.api_key.get("ApiKeyAuth", Config.API_KEY) openapi_client_config.server_variables = openapi_client_config.server_variables or {} openapi_client_config.server_variables = { - **{ - 'environment': Config.ENVIRONMENT, - 'index_name': index_name, - 'project_name': Config.PROJECT_NAME - }, - **openapi_client_config.server_variables + **{"environment": Config.ENVIRONMENT, "index_name": index_name, "project_name": Config.PROJECT_NAME}, + **openapi_client_config.server_variables, } super().__init__(configuration=openapi_client_config, pool_threads=pool_threads) self.user_agent = get_user_agent() self._vector_api = VectorOperationsApi(self) @validate_and_convert_errors - def upsert(self, - vectors: Union[List[Vector], List[tuple], List[dict]], - namespace: Optional[str] = None, - batch_size: Optional[int] = None, - show_progress: bool = True, - **kwargs) -> UpsertResponse: + def upsert( + self, + vectors: Union[List[Vector], List[tuple], List[dict]], + namespace: Optional[str] = None, + batch_size: Optional[int] = None, + show_progress: bool = True, + **kwargs + ) -> UpsertResponse: """ The upsert operation writes vectors into a namespace. If a new value is upserted for an existing vector id, it will overwrite the previous value. @@ -139,55 +176,58 @@ def upsert(self, Returns: UpsertResponse, includes the number of vectors upserted. """ - _check_type = kwargs.pop('_check_type', False) + _check_type = kwargs.pop("_check_type", False) - if kwargs.get('async_req', False) and batch_size is not None: - raise ValueError('async_req is not supported when batch_size is provided.' - 'To upsert in parallel, please follow: ' - 'https://docs.pinecone.io/docs/insert-data#sending-upserts-in-parallel') + if kwargs.get("async_req", False) and batch_size is not None: + raise ValueError( + "async_req is not supported when batch_size is provided." + "To upsert in parallel, please follow: " + "https://docs.pinecone.io/docs/insert-data#sending-upserts-in-parallel" + ) if batch_size is None: return self._upsert_batch(vectors, namespace, _check_type, **kwargs) if not isinstance(batch_size, int) or batch_size <= 0: - raise ValueError('batch_size must be a positive integer') + raise ValueError("batch_size must be a positive integer") - pbar = tqdm(total=len(vectors), disable=not show_progress, desc='Upserted vectors') + pbar = tqdm(total=len(vectors), disable=not show_progress, desc="Upserted vectors") total_upserted = 0 for i in range(0, len(vectors), batch_size): - batch_result = self._upsert_batch(vectors[i:i + batch_size], namespace, _check_type, **kwargs) + batch_result = self._upsert_batch(vectors[i : i + batch_size], namespace, _check_type, **kwargs) pbar.update(batch_result.upserted_count) # we can't use here pbar.n for the case show_progress=False total_upserted += batch_result.upserted_count return UpsertResponse(upserted_count=total_upserted) - def _upsert_batch(self, - vectors: List[Vector], - namespace: Optional[str], - _check_type: bool, - **kwargs) -> UpsertResponse: - - args_dict = self._parse_non_empty_args([('namespace', namespace)]) + def _upsert_batch( + self, vectors: List[Vector], namespace: Optional[str], _check_type: bool, **kwargs + ) -> UpsertResponse: + args_dict = self._parse_non_empty_args([("namespace", namespace)]) def _dict_to_vector(item): item_keys = set(item.keys()) if not item_keys.issuperset(REQUIRED_VECTOR_FIELDS): raise ValueError( - f"Vector dictionary is missing required fields: {list(REQUIRED_VECTOR_FIELDS - item_keys)}") + f"Vector dictionary is missing required fields: {list(REQUIRED_VECTOR_FIELDS - item_keys)}" + ) excessive_keys = item_keys - (REQUIRED_VECTOR_FIELDS | OPTIONAL_VECTOR_FIELDS) if len(excessive_keys) > 0: - raise ValueError(f"Found excess keys in the vector dictionary: {list(excessive_keys)}. " - f"The allowed keys are: {list(REQUIRED_VECTOR_FIELDS | OPTIONAL_VECTOR_FIELDS)}") + raise ValueError( + f"Found excess keys in the vector dictionary: {list(excessive_keys)}. " + f"The allowed keys are: {list(REQUIRED_VECTOR_FIELDS | OPTIONAL_VECTOR_FIELDS)}" + ) - if 'sparse_values' in item: - if not isinstance(item['sparse_values'], Mapping): + if "sparse_values" in item: + if not isinstance(item["sparse_values"], Mapping): raise ValueError( - f"Column `sparse_values` is expected to be a dictionary, found {type(item['sparse_values'])}") + f"Column `sparse_values` is expected to be a dictionary, found {type(item['sparse_values'])}" + ) - indices = item['sparse_values'].get('indices', None) - values = item['sparse_values'].get('values', None) + indices = item["sparse_values"].get("indices", None) + values = item["sparse_values"].get("values", None) if isinstance(values, np.ndarray): upsert_numpy_deprecation_notice("Deprecated type passed in sparse_values['values'].") @@ -196,27 +236,28 @@ def _dict_to_vector(item): upsert_numpy_deprecation_notice("Deprecated type passed in sparse_values['indices'].") indices = indices.tolist() try: - item['sparse_values'] = SparseValues(indices=indices, values=values) + item["sparse_values"] = SparseValues(indices=indices, values=values) except TypeError as e: - raise ValueError("Found unexpected data in column `sparse_values`. " - "Expected format is `'sparse_values': {'indices': List[int], 'values': List[float]}`." - ) from e + raise ValueError( + "Found unexpected data in column `sparse_values`. " + "Expected format is `'sparse_values': {'indices': List[int], 'values': List[float]}`." + ) from e - if 'metadata' in item: - metadata = item.get('metadata') + if "metadata" in item: + metadata = item.get("metadata") if not isinstance(metadata, Mapping): raise TypeError(f"Column `metadata` is expected to be a dictionary, found {type(metadata)}") - - if isinstance(item['values'], np.ndarray): + + if isinstance(item["values"], np.ndarray): upsert_numpy_deprecation_notice("Deprecated type passed in 'values'.") - item['values'] = item['values'].tolist() + item["values"] = item["values"].tolist() try: return Vector(**item) except TypeError as e: # if not isinstance(item['values'], Iterable) or not isinstance(item['values'][0], numbers.Real): # raise TypeError(f"Column `values` is expected to be a list of floats") - if not isinstance(item['values'], Iterable) or not isinstance(item['values'][0], numbers.Real): + if not isinstance(item["values"], Iterable) or not isinstance(item["values"][0], numbers.Real): raise TypeError(f"Column `values` is expected to be a list of floats") raise @@ -225,9 +266,11 @@ def _vector_transform(item: Union[Vector, Tuple]): return item elif isinstance(item, tuple): if len(item) > 3: - raise ValueError(f"Found a tuple of length {len(item)} which is not supported. " - f"Vectors can be represented as tuples either the form (id, values, metadata) or (id, values). " - f"To pass sparse values please use either dicts or a Vector objects as inputs.") + raise ValueError( + f"Found a tuple of length {len(item)} which is not supported. " + f"Vectors can be represented as tuples either the form (id, values, metadata) or (id, values). " + f"To pass sparse values please use either dicts or a Vector objects as inputs." + ) id, values, metadata = fix_tuple_length(item, 3) return Vector(id=id, values=values, metadata=metadata or {}, _check_type=_check_type) elif isinstance(item, Mapping): @@ -247,14 +290,12 @@ def _vector_transform(item: Union[Vector, Tuple]): @staticmethod def _iter_dataframe(df, batch_size): for i in range(0, len(df), batch_size): - batch = df.iloc[i:i + batch_size].to_dict(orient="records") + batch = df.iloc[i : i + batch_size].to_dict(orient="records") yield batch - def upsert_from_dataframe(self, - df, - namespace: str = None, - batch_size: int = 500, - show_progress: bool = True) -> UpsertResponse: + def upsert_from_dataframe( + self, df, namespace: str = None, batch_size: int = 500, show_progress: bool = True + ) -> UpsertResponse: """Upserts a dataframe into the index. Args: @@ -266,7 +307,9 @@ def upsert_from_dataframe(self, try: import pandas as pd except ImportError: - raise RuntimeError("The `pandas` package is not installed. Please install pandas to use `upsert_from_dataframe()`") + raise RuntimeError( + "The `pandas` package is not installed. Please install pandas to use `upsert_from_dataframe()`" + ) if not isinstance(df, pd.DataFrame): raise ValueError(f"Only pandas dataframes are supported. Found: {type(df)}") @@ -285,52 +328,53 @@ def upsert_from_dataframe(self, return UpsertResponse(upserted_count=upserted_count) @validate_and_convert_errors - def delete(self, - ids: Optional[List[str]] = None, - delete_all: Optional[bool] = None, - namespace: Optional[str] = None, - filter: Optional[Dict[str, Union[str, float, int, bool, List, dict]]] = None, - **kwargs) -> Dict[str, Any]: + def delete( + self, + ids: Optional[List[str]] = None, + delete_all: Optional[bool] = None, + namespace: Optional[str] = None, + filter: Optional[Dict[str, Union[str, float, int, bool, List, dict]]] = None, + **kwargs + ) -> Dict[str, Any]: """ - The Delete operation deletes vectors from the index, from a single namespace. - No error raised if the vector id does not exist. - Note: for any delete call, if namespace is not specified, the default namespace is used. - - Delete can occur in the following mutual exclusive ways: - 1. Delete by ids from a single namespace - 2. Delete all vectors from a single namespace by setting delete_all to True - 3. Delete all vectors from a single namespace by specifying a metadata filter - (note that for this option delete all must be set to False) - - API reference: https://docs.pinecone.io/reference/delete_post + The Delete operation deletes vectors from the index, from a single namespace. + No error raised if the vector id does not exist. + Note: for any delete call, if namespace is not specified, the default namespace is used. + + Delete can occur in the following mutual exclusive ways: + 1. Delete by ids from a single namespace + 2. Delete all vectors from a single namespace by setting delete_all to True + 3. Delete all vectors from a single namespace by specifying a metadata filter + (note that for this option delete all must be set to False) + + API reference: https://docs.pinecone.io/reference/delete_post + + Examples: + >>> index.delete(ids=['id1', 'id2'], namespace='my_namespace') + >>> index.delete(delete_all=True, namespace='my_namespace') + >>> index.delete(filter={'key': 'value'}, namespace='my_namespace') + + Args: + ids (List[str]): Vector ids to delete [optional] + delete_all (bool): This indicates that all vectors in the index namespace should be deleted.. [optional] + Default is False. + namespace (str): The namespace to delete vectors from [optional] + If not specified, the default namespace is used. + filter (Dict[str, Union[str, float, int, bool, List, dict]]): + If specified, the metadata filter here will be used to select the vectors to delete. + This is mutually exclusive with specifying ids to delete in the ids param or using delete_all=True. + See https://www.pinecone.io/docs/metadata-filtering/.. [optional] - Examples: - >>> index.delete(ids=['id1', 'id2'], namespace='my_namespace') - >>> index.delete(delete_all=True, namespace='my_namespace') - >>> index.delete(filter={'key': 'value'}, namespace='my_namespace') - - Args: - ids (List[str]): Vector ids to delete [optional] - delete_all (bool): This indicates that all vectors in the index namespace should be deleted.. [optional] - Default is False. - namespace (str): The namespace to delete vectors from [optional] - If not specified, the default namespace is used. - filter (Dict[str, Union[str, float, int, bool, List, dict]]): - If specified, the metadata filter here will be used to select the vectors to delete. - This is mutually exclusive with specifying ids to delete in the ids param or using delete_all=True. - See https://www.pinecone.io/docs/metadata-filtering/.. [optional] - - Keyword Args: - Supports OpenAPI client keyword arguments. See pinecone.core.client.models.DeleteRequest for more details. + Keyword Args: + Supports OpenAPI client keyword arguments. See pinecone.core.client.models.DeleteRequest for more details. - Returns: An empty dictionary if the delete operation was successful. + Returns: An empty dictionary if the delete operation was successful. """ - _check_type = kwargs.pop('_check_type', False) - args_dict = self._parse_non_empty_args([('ids', ids), - ('delete_all', delete_all), - ('namespace', namespace), - ('filter', filter)]) + _check_type = kwargs.pop("_check_type", False) + args_dict = self._parse_non_empty_args( + [("ids", ids), ("delete_all", delete_all), ("namespace", namespace), ("filter", filter)] + ) return self._vector_api.delete( DeleteRequest( @@ -342,10 +386,7 @@ def delete(self, ) @validate_and_convert_errors - def fetch(self, - ids: List[str], - namespace: Optional[str] = None, - **kwargs) -> FetchResponse: + def fetch(self, ids: List[str], namespace: Optional[str] = None, **kwargs) -> FetchResponse: """ The fetch operation looks up and returns vectors, by ID, from a single namespace. The returned vectors include the vector data and/or metadata. @@ -366,21 +407,23 @@ def fetch(self, Returns: FetchResponse object which contains the list of Vector objects, and namespace name. """ - args_dict = self._parse_non_empty_args([('namespace', namespace)]) + args_dict = self._parse_non_empty_args([("namespace", namespace)]) return self._vector_api.fetch(ids=ids, **args_dict, **kwargs) @validate_and_convert_errors - def query(self, - vector: Optional[List[float]] = None, - id: Optional[str] = None, - queries: Optional[Union[List[QueryVector], List[Tuple]]] = None, - top_k: Optional[int] = None, - namespace: Optional[str] = None, - filter: Optional[Dict[str, Union[str, float, int, bool, List, dict]]] = None, - include_values: Optional[bool] = None, - include_metadata: Optional[bool] = None, - sparse_vector: Optional[Union[SparseValues, Dict[str, Union[List[float], List[int]]]]] = None, - **kwargs) -> QueryResponse: + def query( + self, + vector: Optional[List[float]] = None, + id: Optional[str] = None, + queries: Optional[Union[List[QueryVector], List[Tuple]]] = None, + top_k: Optional[int] = None, + namespace: Optional[str] = None, + filter: Optional[Dict[str, Union[str, float, int, bool, List, dict]]] = None, + include_values: Optional[bool] = None, + include_metadata: Optional[bool] = None, + sparse_vector: Optional[Union[SparseValues, Dict[str, Union[List[float], List[int]]]]] = None, + **kwargs + ) -> QueryResponse: """ The Query operation searches a namespace, using a query vector. It retrieves the ids of the most similar items in a namespace, along with their similarity scores. @@ -426,6 +469,7 @@ def query(self, Returns: QueryResponse object which contains the list of the closest vectors as ScoredVector objects, and namespace name. """ + def _query_transform(item): if isinstance(item, QueryVector): return item @@ -439,19 +483,23 @@ def _query_transform(item): return QueryVector(values=item, _check_type=_check_type) raise ValueError(f"Invalid query vector value passed: cannot interpret type {type(item)}") - _check_type = kwargs.pop('_check_type', False) + _check_type = kwargs.pop("_check_type", False) queries = list(map(_query_transform, queries)) if queries is not None else None sparse_vector = self._parse_sparse_values_arg(sparse_vector) - args_dict = self._parse_non_empty_args([('vector', vector), - ('id', id), - ('queries', queries), - ('top_k', top_k), - ('namespace', namespace), - ('filter', filter), - ('include_values', include_values), - ('include_metadata', include_metadata), - ('sparse_vector', sparse_vector)]) + args_dict = self._parse_non_empty_args( + [ + ("vector", vector), + ("id", id), + ("queries", queries), + ("top_k", top_k), + ("namespace", namespace), + ("filter", filter), + ("include_values", include_values), + ("include_metadata", include_metadata), + ("sparse_vector", sparse_vector), + ] + ) response = self._vector_api.query( QueryRequest( **args_dict, @@ -463,14 +511,15 @@ def _query_transform(item): return parse_query_response(response, vector is not None or id) @validate_and_convert_errors - def update(self, - id: str, - values: Optional[List[float]] = None, - set_metadata: Optional[Dict[str, - Union[str, float, int, bool, List[int], List[float], List[str]]]] = None, - namespace: Optional[str] = None, - sparse_values: Optional[Union[SparseValues, Dict[str, Union[List[float], List[int]]]]] = None, - **kwargs) -> Dict[str, Any]: + def update( + self, + id: str, + values: Optional[List[float]] = None, + set_metadata: Optional[Dict[str, Union[str, float, int, bool, List[int], List[float], List[str]]]] = None, + namespace: Optional[str] = None, + sparse_values: Optional[Union[SparseValues, Dict[str, Union[List[float], List[int]]]]] = None, + **kwargs + ) -> Dict[str, Any]: """ The Update operation updates vector in a namespace. If a value is included, it will overwrite the previous value. @@ -502,24 +551,30 @@ def update(self, Returns: An empty dictionary if the update was successful. """ - _check_type = kwargs.pop('_check_type', False) + _check_type = kwargs.pop("_check_type", False) sparse_values = self._parse_sparse_values_arg(sparse_values) - args_dict = self._parse_non_empty_args([('values', values), - ('set_metadata', set_metadata), - ('namespace', namespace), - ('sparse_values', sparse_values)]) - return self._vector_api.update(UpdateRequest( + args_dict = self._parse_non_empty_args( + [ + ("values", values), + ("set_metadata", set_metadata), + ("namespace", namespace), + ("sparse_values", sparse_values), + ] + ) + return self._vector_api.update( + UpdateRequest( id=id, **args_dict, _check_type=_check_type, **{k: v for k, v in kwargs.items() if k not in _OPENAPI_ENDPOINT_PARAMS} ), - **{k: v for k, v in kwargs.items() if k in _OPENAPI_ENDPOINT_PARAMS}) + **{k: v for k, v in kwargs.items() if k in _OPENAPI_ENDPOINT_PARAMS} + ) @validate_and_convert_errors - def describe_index_stats(self, - filter: Optional[Dict[str, Union[str, float, int, bool, List, dict]]] = None, - **kwargs) -> DescribeIndexStatsResponse: + def describe_index_stats( + self, filter: Optional[Dict[str, Union[str, float, int, bool, List, dict]]] = None, **kwargs + ) -> DescribeIndexStatsResponse: """ The DescribeIndexStats operation returns statistics about the index's contents. For example: The vector count per namespace and the number of dimensions. @@ -537,8 +592,8 @@ def describe_index_stats(self, Returns: DescribeIndexStatsResponse object which contains stats about the index. """ - _check_type = kwargs.pop('_check_type', False) - args_dict = self._parse_non_empty_args([('filter', filter)]) + _check_type = kwargs.pop("_check_type", False) + args_dict = self._parse_non_empty_args([("filter", filter)]) return self._vector_api.describe_index_stats( DescribeIndexStatsRequest( @@ -555,8 +610,8 @@ def _parse_non_empty_args(args: List[Tuple[str, Any]]) -> Dict[str, Any]: @staticmethod def _parse_sparse_values_arg( - sparse_values: Optional[Union[SparseValues, - Dict[str, Union[List[float], List[int]]]]]) -> Optional[SparseValues]: + sparse_values: Optional[Union[SparseValues, Dict[str, Union[List[float], List[int]]]]] + ) -> Optional[SparseValues]: if sparse_values is None: return None @@ -566,6 +621,7 @@ def _parse_sparse_values_arg( if not isinstance(sparse_values, dict) or "indices" not in sparse_values or "values" not in sparse_values: raise ValueError( "Invalid sparse values argument. Expected a dict of: {'indices': List[int], 'values': List[float]}." - f"Received: {sparse_values}") + f"Received: {sparse_values}" + ) return SparseValues(indices=sparse_values["indices"], values=sparse_values["values"]) diff --git a/pinecone/info.py b/pinecone/info.py index be84dcf7..75ee7050 100644 --- a/pinecone/info.py +++ b/pinecone/info.py @@ -36,4 +36,4 @@ def wait_controller_ready(timeout: int = 30): time.sleep(3) connection = True except requests.exceptions.ConnectionError: - time.sleep(1) \ No newline at end of file + time.sleep(1) diff --git a/pinecone/manage.py b/pinecone/manage.py index b71b7ef9..84041682 100644 --- a/pinecone/manage.py +++ b/pinecone/manage.py @@ -15,9 +15,18 @@ from pinecone.core.utils import get_user_agent __all__ = [ - "create_index", "delete_index", "describe_index", "list_indexes", "scale_index", "IndexDescription", - "create_collection", "describe_collection", "list_collections", "delete_collection", "configure_index", - "CollectionDescription" + "create_index", + "delete_index", + "describe_index", + "list_indexes", + "scale_index", + "IndexDescription", + "create_collection", + "describe_collection", + "list_collections", + "delete_collection", + "configure_index", + "CollectionDescription", ] @@ -46,13 +55,8 @@ def __str__(self): def _get_api_instance(): client_config = Config.OPENAPI_CONFIG client_config.api_key = client_config.api_key or {} - client_config.api_key['ApiKeyAuth'] = client_config.api_key.get('ApiKeyAuth', Config.API_KEY) - client_config.server_variables = { - **{ - 'environment': Config.ENVIRONMENT - }, - **client_config.server_variables - } + client_config.api_key["ApiKeyAuth"] = client_config.api_key.get("ApiKeyAuth", Config.API_KEY) + client_config.server_variables = {**{"environment": Config.ENVIRONMENT}, **client_config.server_variables} api_client = ApiClient(configuration=client_config) api_client.user_agent = get_user_agent() api_instance = IndexOperationsApi(api_client) @@ -62,22 +66,22 @@ def _get_api_instance(): def _get_status(name: str): api_instance = _get_api_instance() response = api_instance.describe_index(name) - return response['status'] + return response["status"] def create_index( - name: str, - dimension: int, - timeout: int = None, - index_type: str = "approximated", - metric: str = "cosine", - replicas: int = 1, - shards: int = 1, - pods: int = 1, - pod_type: str = 'p1', - index_config: dict = None, - metadata_config: dict = None, - source_collection: str = '', + name: str, + dimension: int, + timeout: int = None, + index_type: str = "approximated", + metric: str = "cosine", + replicas: int = 1, + shards: int = 1, + pods: int = 1, + pod_type: str = "p1", + index_config: dict = None, + metadata_config: dict = None, + source_collection: str = "", ): """Creates a Pinecone index. @@ -115,23 +119,25 @@ def create_index( """ api_instance = _get_api_instance() - api_instance.create_index(create_request=CreateRequest( - name=name, - dimension=dimension, - index_type=index_type, - metric=metric, - replicas=replicas, - shards=shards, - pods=pods, - pod_type=pod_type, - index_config=index_config or {}, - metadata_config=metadata_config, - source_collection=source_collection - )) + api_instance.create_index( + create_request=CreateRequest( + name=name, + dimension=dimension, + index_type=index_type, + metric=metric, + replicas=replicas, + shards=shards, + pods=pods, + pod_type=pod_type, + index_config=index_config or {}, + metadata_config=metadata_config, + source_collection=source_collection, + ) + ) def is_ready(): status = _get_status(name) - ready = status['ready'] + ready = status["ready"] return ready if timeout == -1: @@ -144,9 +150,13 @@ def is_ready(): time.sleep(5) timeout -= 5 if timeout and timeout < 0: - raise (TimeoutError( - 'Please call the describe_index API ({}) to confirm index status.'.format( - 'https://www.pinecone.io/docs/api/operation/describe_index/'))) + raise ( + TimeoutError( + "Please call the describe_index API ({}) to confirm index status.".format( + "https://www.pinecone.io/docs/api/operation/describe_index/" + ) + ) + ) def delete_index(name: str, timeout: int = None): @@ -174,9 +184,13 @@ def get_remaining(): time.sleep(5) timeout -= 5 if timeout and timeout < 0: - raise (TimeoutError( - 'Please call the list_indexes API ({}) to confirm if index is deleted'.format( - 'https://www.pinecone.io/docs/api/operation/list_indexes/'))) + raise ( + TimeoutError( + "Please call the list_indexes API ({}) to confirm if index is deleted".format( + "https://www.pinecone.io/docs/api/operation/list_indexes/" + ) + ) + ) def list_indexes(): @@ -194,14 +208,21 @@ def describe_index(name: str): """ api_instance = _get_api_instance() response = api_instance.describe_index(name) - db = response['database'] - ready = response['status']['ready'] - state = response['status']['state'] - return IndexDescription(name=db['name'], metric=db['metric'], - replicas=db['replicas'], dimension=db['dimension'], shards=db['shards'], - pods=db.get('pods', db['shards'] * db['replicas']), pod_type=db.get('pod_type', 'p1'), - status={'ready': ready, 'state': state}, metadata_config=db.get('metadata_config'), - source_collection=db.get('source_collection', '')) + db = response["database"] + ready = response["status"]["ready"] + state = response["status"]["state"] + return IndexDescription( + name=db["name"], + metric=db["metric"], + replicas=db["replicas"], + dimension=db["dimension"], + shards=db["shards"], + pods=db.get("pods", db["shards"] * db["replicas"]), + pod_type=db.get("pod_type", "p1"), + status={"ready": ready, "state": state}, + metadata_config=db.get("metadata_config"), + source_collection=db.get("source_collection", ""), + ) def scale_index(name: str, replicas: int): @@ -216,10 +237,7 @@ def scale_index(name: str, replicas: int): api_instance.configure_index(name, patch_request=PatchRequest(replicas=replicas, pod_type="")) -def create_collection( - name: str, - source: str -): +def create_collection(name: str, source: str): """Create a collection :param: name: Name of the collection :param: source: Name of the source index @@ -256,10 +274,10 @@ def describe_collection(name: str): def configure_index(name: str, replicas: Optional[int] = None, pod_type: Optional[str] = ""): """Changes current configuration of the index. - :param: name: the name of the Index - :param: replicas: the desired number of replicas, lowest value is 0. - :param: pod_type: the new pod_type for the index. - """ + :param: name: the name of the Index + :param: replicas: the desired number of replicas, lowest value is 0. + :param: pod_type: the new pod_type for the index. + """ api_instance = _get_api_instance() config_args = {} if pod_type != "":