Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pinecone/core/client/api/index_operations_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
14 changes: 6 additions & 8 deletions pinecone/core/client/model/create_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 \
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 \
Expand Down
8 changes: 4 additions & 4 deletions pinecone/core/client/model/index_meta_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Comment thread
mutayroei marked this conversation as resolved.
Resolved
index_type (str): [optional] # noqa: E501
metric (str): [optional] # noqa: E501
pods (int): [optional] # noqa: E501
Expand Down Expand Up @@ -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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

index_type (str): [optional] # noqa: E501
metric (str): [optional] # noqa: E501
pods (int): [optional] # noqa: E501
Expand Down
4 changes: 2 additions & 2 deletions pinecone/core/client/model/patch_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
5 changes: 3 additions & 2 deletions pinecone/manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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():
Expand Down