diff --git a/pinecone/core/client/api/index_operations_api.py b/pinecone/core/client/api/index_operations_api.py index 2ee2c2546..0b2f9a9fe 100644 --- a/pinecone/core/client/api/index_operations_api.py +++ b/pinecone/core/client/api/index_operations_api.py @@ -52,7 +52,7 @@ def __configure_index( ): """configure_index # noqa: E501 - Configure index to change pod type and number of replicas. # noqa: E501 + This operation specifies the pod type and number of replicas for an index. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -63,7 +63,7 @@ def __configure_index( index_name (str): The name of the index Keyword Args: - patch_request (PatchRequest): The desired configuration changes for the index.. [optional] + patch_request (PatchRequest): The desired pod type and replica configuration for the index.. [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. _preload_content (bool): if False, the urllib3.HTTPResponse object diff --git a/pinecone/core/client/model/create_request.py b/pinecone/core/client/model/create_request.py index 58b388d38..d3790ea63 100644 --- a/pinecone/core/client/model/create_request.py +++ b/pinecone/core/client/model/create_request.py @@ -125,12 +125,11 @@ def discriminator(): @classmethod @convert_js_args_to_python_args - def _from_openapi_data(cls, name, dimension, *args, **kwargs): # noqa: E501 + def _from_openapi_data(cls, name, *args, **kwargs): # noqa: E501 """CreateRequest - a model defined in OpenAPI Args: name (str): The name of the index to be created. The maximum length is 45 characters. - dimension (int): The dimensions of the vectors to be inserted in the index Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -163,12 +162,13 @@ def _from_openapi_data(cls, name, dimension, *args, **kwargs): # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) + dimension (int): The dimensions of the vectors to be inserted in the index. [optional] # noqa: E501 index_type (str): The type of vector index. Pinecone supports 'approximated'.. [optional] if omitted the server will use the default value of "approximated" # noqa: E501 metric (str): The distance metric to be used for similarity search. You can use 'euclidean', 'cosine', or 'dotproduct'.. [optional] if omitted the server will use the default value of "cosine" # noqa: E501 pods (int): The number of pods for the index to use,including replicas.. [optional] if omitted the server will use the default value of 1 # noqa: E501 replicas (int): The number of replicas. Replicas duplicate your index. They provide higher availability and throughput.. [optional] if omitted the server will use the default value of 1 # noqa: E501 shards (int): The number of shards to be used in the index.. [optional] if omitted the server will use the default value of 1 # noqa: E501 - pod_type (str): The type of pod to use. One of 's1' or 'p1'.. [optional] if omitted the server will use the default value of "p1" # noqa: E501 + pod_type (str): The type of pod to use. One of `s1`, `p1`, or `p2` appended with `.` and one of `x1`, `x2`, `x4`, or `x8`.. [optional] if omitted the server will use the default value of "p1.x1" # noqa: E501 index_config (dict): [optional] # noqa: E501 metadata_config ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): Configuration for the behavior of Pinecone's internal metadata index. By default, all metadata is indexed; when `metadata_config` is present, only specified metadata fields are indexed. To specify metadata fields to index, provide a JSON object of the following form: ``` {\"indexed\": [\"example_metadata_field\"]} ``` . [optional] # noqa: E501 source_collection (str): The name of the collection to create an index from. [optional] # noqa: E501 @@ -200,7 +200,6 @@ def _from_openapi_data(cls, name, dimension, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 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 \ @@ -221,12 +220,11 @@ def _from_openapi_data(cls, name, dimension, *args, **kwargs): # noqa: E501 ]) @convert_js_args_to_python_args - def __init__(self, name, dimension, *args, **kwargs): # noqa: E501 + def __init__(self, name, *args, **kwargs): # noqa: E501 """CreateRequest - a model defined in OpenAPI Args: name (str): The name of the index to be created. The maximum length is 45 characters. - dimension (int): The dimensions of the vectors to be inserted in the index Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -259,12 +257,13 @@ def __init__(self, name, dimension, *args, **kwargs): # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) + dimension (int): The dimensions of the vectors to be inserted in the index. [optional] # noqa: E501 index_type (str): The type of vector index. Pinecone supports 'approximated'.. [optional] if omitted the server will use the default value of "approximated" # noqa: E501 metric (str): The distance metric to be used for similarity search. You can use 'euclidean', 'cosine', or 'dotproduct'.. [optional] if omitted the server will use the default value of "cosine" # noqa: E501 pods (int): The number of pods for the index to use,including replicas.. [optional] if omitted the server will use the default value of 1 # noqa: E501 replicas (int): The number of replicas. Replicas duplicate your index. They provide higher availability and throughput.. [optional] if omitted the server will use the default value of 1 # noqa: E501 shards (int): The number of shards to be used in the index.. [optional] if omitted the server will use the default value of 1 # noqa: E501 - pod_type (str): The type of pod to use. One of 's1' or 'p1'.. [optional] if omitted the server will use the default value of "p1" # noqa: E501 + pod_type (str): The type of pod to use. One of `s1`, `p1`, or `p2` appended with `.` and one of `x1`, `x2`, `x4`, or `x8`.. [optional] if omitted the server will use the default value of "p1.x1" # noqa: E501 index_config (dict): [optional] # noqa: E501 metadata_config ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): Configuration for the behavior of Pinecone's internal metadata index. By default, all metadata is indexed; when `metadata_config` is present, only specified metadata fields are indexed. To specify metadata fields to index, provide a JSON object of the following form: ``` {\"indexed\": [\"example_metadata_field\"]} ``` . [optional] # noqa: E501 source_collection (str): The name of the collection to create an index from. [optional] # noqa: E501 @@ -294,7 +293,6 @@ def __init__(self, name, dimension, *args, **kwargs): # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) 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 \ diff --git a/pinecone/core/client/model/index_meta_database.py b/pinecone/core/client/model/index_meta_database.py index 4baf55557..728e2ba63 100644 --- a/pinecone/core/client/model/index_meta_database.py +++ b/pinecone/core/client/model/index_meta_database.py @@ -93,7 +93,7 @@ def openapi_types(): lazy_import() return { 'name': (str,), # noqa: E501 - 'dimensions': (str,), # noqa: E501 + 'dimension': (str,), # noqa: E501 'index_type': (str,), # noqa: E501 'metric': (str,), # noqa: E501 'pods': (int,), # noqa: E501 @@ -111,7 +111,7 @@ def discriminator(): attribute_map = { 'name': 'name', # noqa: E501 - 'dimensions': 'dimensions', # noqa: E501 + 'dimension': 'dimension', # noqa: E501 'index_type': 'index_type', # noqa: E501 'metric': 'metric', # noqa: E501 'pods': 'pods', # noqa: E501 @@ -164,7 +164,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 through its discriminator because we passed in _visited_composed_classes = (Animal,) name (str): [optional] # noqa: E501 - dimensions (str): [optional] # noqa: E501 + dimension (str): [optional] # noqa: E501 index_type (str): [optional] # noqa: E501 metric (str): [optional] # noqa: E501 pods (int): [optional] # noqa: E501 @@ -255,7 +255,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 through its discriminator because we passed in _visited_composed_classes = (Animal,) name (str): [optional] # noqa: E501 - dimensions (str): [optional] # noqa: E501 + dimension (str): [optional] # noqa: E501 index_type (str): [optional] # noqa: E501 metric (str): [optional] # noqa: E501 pods (int): [optional] # noqa: E501 diff --git a/pinecone/core/client/model/patch_request.py b/pinecone/core/client/model/patch_request.py index 45a5135b0..85b66d121 100644 --- a/pinecone/core/client/model/patch_request.py +++ b/pinecone/core/client/model/patch_request.py @@ -142,7 +142,7 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501 through its discriminator because we passed in _visited_composed_classes = (Animal,) replicas (int): The desired number of replicas for the index.. [optional] # noqa: E501 - pod_type (str): The new pod type for the index.. [optional] # 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) @@ -225,7 +225,7 @@ def __init__(self, *args, **kwargs): # noqa: E501 through its discriminator because we passed in _visited_composed_classes = (Animal,) replicas (int): The desired number of replicas for the index.. [optional] # noqa: E501 - pod_type (str): The new pod type for the index.. [optional] # 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) diff --git a/pinecone/manage.py b/pinecone/manage.py index b71b7ef96..443f1c051 100644 --- a/pinecone/manage.py +++ b/pinecone/manage.py @@ -67,7 +67,7 @@ def _get_status(name: str): def create_index( name: str, - dimension: int, + dimension: int = None, timeout: int = None, index_type: str = "approximated", metric: str = "cosine", @@ -126,7 +126,8 @@ def create_index( pod_type=pod_type, index_config=index_config or {}, metadata_config=metadata_config, - source_collection=source_collection + source_collection=source_collection, + _check_type=False )) def is_ready():