From 7eb6192b6bc73f6e14eb2eef5bd35062d2ca3e43 Mon Sep 17 00:00:00 2001 From: Jen Hamon Date: Mon, 3 Mar 2025 10:28:36 -0500 Subject: [PATCH 1/3] Regenerate code for 2025-04 --- codegen/build-oas.sh | 22 ++++------ pinecone/core/openapi/db_control/__init__.py | 4 +- .../db_control/api/manage_indexes_api.py | 42 +++++++++---------- .../db_control/model/collection_list.py | 2 +- .../db_control/model/collection_model.py | 2 +- .../model/configure_index_request.py | 2 +- .../model/configure_index_request_embed.py | 2 +- .../model/configure_index_request_spec.py | 2 +- .../model/configure_index_request_spec_pod.py | 2 +- .../model/create_collection_request.py | 2 +- .../model/create_index_for_model_request.py | 2 +- .../create_index_for_model_request_embed.py | 6 ++- .../db_control/model/create_index_request.py | 2 +- .../db_control/model/deletion_protection.py | 2 +- .../db_control/model/error_response.py | 2 +- .../db_control/model/error_response_error.py | 2 +- .../openapi/db_control/model/index_list.py | 2 +- .../openapi/db_control/model/index_model.py | 2 +- .../db_control/model/index_model_spec.py | 2 +- .../db_control/model/index_model_status.py | 3 +- .../openapi/db_control/model/index_spec.py | 2 +- .../openapi/db_control/model/index_tags.py | 2 +- .../db_control/model/model_index_embed.py | 2 +- .../core/openapi/db_control/model/pod_spec.py | 2 +- .../model/pod_spec_metadata_config.py | 2 +- .../db_control/model/serverless_spec.py | 2 +- pinecone/core/openapi/db_data/__init__.py | 4 +- .../db_data/api/bulk_operations_api.py | 6 +-- .../db_data/api/vector_operations_api.py | 42 +++++++++---------- .../openapi/db_data/model/delete_request.py | 2 +- .../model/describe_index_stats_request.py | 2 +- .../openapi/db_data/model/fetch_response.py | 2 +- pinecone/core/openapi/db_data/model/hit.py | 2 +- .../db_data/model/import_error_mode.py | 2 +- .../openapi/db_data/model/import_model.py | 2 +- .../db_data/model/index_description.py | 2 +- .../db_data/model/list_imports_response.py | 2 +- .../core/openapi/db_data/model/list_item.py | 2 +- .../openapi/db_data/model/list_response.py | 2 +- .../db_data/model/namespace_summary.py | 2 +- .../core/openapi/db_data/model/pagination.py | 2 +- .../openapi/db_data/model/protobuf_any.py | 2 +- .../db_data/model/protobuf_null_value.py | 2 +- .../openapi/db_data/model/query_request.py | 14 +++---- .../openapi/db_data/model/query_response.py | 2 +- .../openapi/db_data/model/query_vector.py | 2 +- .../core/openapi/db_data/model/rpc_status.py | 2 +- .../openapi/db_data/model/scored_vector.py | 2 +- .../db_data/model/search_records_request.py | 6 +-- .../model/search_records_request_query.py | 10 ++--- .../model/search_records_request_rerank.py | 2 +- .../db_data/model/search_records_response.py | 2 +- .../model/search_records_response_result.py | 2 +- .../db_data/model/search_records_vector.py | 2 +- .../openapi/db_data/model/search_usage.py | 2 +- .../openapi/db_data/model/search_vector.py | 2 +- .../db_data/model/single_query_results.py | 2 +- .../openapi/db_data/model/sparse_values.py | 2 +- .../db_data/model/start_import_request.py | 2 +- .../db_data/model/start_import_response.py | 2 +- .../openapi/db_data/model/update_request.py | 2 +- .../openapi/db_data/model/upsert_record.py | 2 +- .../openapi/db_data/model/upsert_request.py | 2 +- .../openapi/db_data/model/upsert_response.py | 2 +- pinecone/core/openapi/db_data/model/usage.py | 2 +- pinecone/core/openapi/db_data/model/vector.py | 2 +- .../openapi/db_data/model/vector_values.py | 2 +- pinecone/core/openapi/inference/__init__.py | 4 +- .../openapi/inference/api/inference_api.py | 10 ++--- .../inference/model/dense_embedding.py | 2 +- .../core/openapi/inference/model/document.py | 2 +- .../openapi/inference/model/embed_request.py | 2 +- .../inference/model/embed_request_inputs.py | 2 +- .../core/openapi/inference/model/embedding.py | 2 +- .../inference/model/embeddings_list.py | 2 +- .../inference/model/embeddings_list_usage.py | 2 +- .../openapi/inference/model/error_response.py | 2 +- .../inference/model/error_response_error.py | 2 +- .../inference/model/ranked_document.py | 2 +- .../openapi/inference/model/rerank_request.py | 2 +- .../openapi/inference/model/rerank_result.py | 2 +- .../inference/model/rerank_result_usage.py | 2 +- .../inference/model/sparse_embedding.py | 2 +- .../openapi/inference/model/vector_type.py | 2 +- pinecone/openapi_support/api_version.py | 4 +- 85 files changed, 158 insertions(+), 161 deletions(-) diff --git a/codegen/build-oas.sh b/codegen/build-oas.sh index 04bc83b7a..d4f837846 100755 --- a/codegen/build-oas.sh +++ b/codegen/build-oas.sh @@ -2,21 +2,13 @@ set -eux -o pipefail -version=$1 # e.g. 2024-07 -is_early_access=$2 # e.g. true - -# if is_early_access is true, add the "ea" module -if [ "$is_early_access" = "true" ]; then - destination="pinecone/core_ea/openapi" - modules=("db_control" "db_data" "inference") - py_module_name="core_ea" - template_dir="codegen/python-oas-templates/templates5.2.0" -else - destination="pinecone/core/openapi" - modules=("db_control" "db_data" "inference") - py_module_name="core" - template_dir="codegen/python-oas-templates/templates5.2.0" -fi +version=$1 # e.g. 2025-01 + + +destination="pinecone/core/openapi" +modules=("db_control" "db_data" "inference") +py_module_name="core" +template_dir="codegen/python-oas-templates/templates5.2.0" build_dir="build" diff --git a/pinecone/core/openapi/db_control/__init__.py b/pinecone/core/openapi/db_control/__init__.py index e8106fac9..1a6949bb2 100644 --- a/pinecone/core/openapi/db_control/__init__.py +++ b/pinecone/core/openapi/db_control/__init__.py @@ -7,7 +7,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ @@ -27,4 +27,4 @@ from pinecone.openapi_support.exceptions import PineconeApiKeyError from pinecone.openapi_support.exceptions import PineconeApiException -API_VERSION = "2025-01" +API_VERSION = "2025-04" diff --git a/pinecone/core/openapi/db_control/api/manage_indexes_api.py b/pinecone/core/openapi/db_control/api/manage_indexes_api.py index 2d2f464d0..b347be5d6 100644 --- a/pinecone/core/openapi/db_control/api/manage_indexes_api.py +++ b/pinecone/core/openapi/db_control/api/manage_indexes_api.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ @@ -52,7 +52,7 @@ def __configure_index( ): """Configure an index # noqa: E501 - This operation configures an existing index. For serverless indexes, you can configure index deletion protection, tags, and integrated inference embedding settings for the index. For pod-based indexes, you can configure the pod size, number of replicas, tags, and index deletion protection. It is not possible to change the pod type of a pod-based index. However, you can create a collection from a pod-based index and then [create a new pod-based index with a different pod type](http://docs.pinecone.io/guides/indexes/pods/create-a-pod-based-index#create-a-pod-index-from-a-collection) from the collection. For guidance and examples, see [Configure an index](http://docs.pinecone.io/guides/indexes/pods/manage-pod-based-indexes). # noqa: E501 + Configure an existing index. For serverless indexes, you can configure index deletion protection, tags, and integrated inference embedding settings for the index. For pod-based indexes, you can configure the pod size, number of replicas, tags, and index deletion protection. It is not possible to change the pod type of a pod-based index. However, you can create a collection from a pod-based index and then [create a new pod-based index with a different pod type](http://docs.pinecone.io/guides/indexes/pods/create-a-pod-based-index#create-a-pod-index-from-a-collection) from the collection. For guidance and examples, see [Configure an index](http://docs.pinecone.io/guides/indexes/pods/manage-pod-based-indexes). # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -128,7 +128,7 @@ def __create_collection( ): """Create a collection # noqa: E501 - This operation creates a Pinecone collection. Serverless indexes do not support collections. # noqa: E501 + Create a Pinecone collection. Serverless indexes do not support collections. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -197,7 +197,7 @@ def __create_collection( def __create_index(self, create_index_request, **kwargs: ExtraOpenApiKwargsTypedDict): """Create an index # noqa: E501 - This operation deploys a Pinecone index. This is where you specify the measure of similarity, the dimension of vectors to be stored in the index, which cloud provider you would like to deploy with, and more. For guidance and examples, see [Create an index](https://docs.pinecone.io/guides/indexes/create-an-index#create-a-serverless-index). # noqa: E501 + Create a Pinecone index. This is where you specify the measure of similarity, the dimension of vectors to be stored in the index, which cloud provider you would like to deploy with, and more. For guidance and examples, see [Create an index](https://docs.pinecone.io/guides/indexes/create-an-index#create-a-serverless-index). # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -266,9 +266,9 @@ def __create_index(self, create_index_request, **kwargs: ExtraOpenApiKwargsTyped def __create_index_for_model( self, create_index_for_model_request, **kwargs: ExtraOpenApiKwargsTypedDict ): - """Create an index for an embedding model # noqa: E501 + """Create an index with integrated embedding # noqa: E501 - This operation creates a serverless integrated inference index for a specific embedding model. Refer to the [model guide](https://docs.pinecone.io/guides/inference/understanding-inference#embedding-models) for available models and model details. # noqa: E501 + Create an index with integrated embedding. With this type of index, you provide source text, and Pinecone uses a [hosted embedding model](https://docs.pinecone.io/guides/inference/understanding-inference#embedding-models) to convert the text automatically during [upsert](https://docs.pinecone.io/reference/api/2025-01/data-plane/upsert_records) and [search](https://docs.pinecone.io/reference/api/2025-01/data-plane/search_records). For guidance and examples, see [Create an index](https://docs.pinecone.io/guides/indexes/create-an-index#integrated-embedding). # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -337,7 +337,7 @@ def __create_index_for_model( def __delete_collection(self, collection_name, **kwargs: ExtraOpenApiKwargsTypedDict): """Delete a collection # noqa: E501 - This operation deletes an existing collection. Serverless indexes do not support collections. # noqa: E501 + Delete an existing collection. Serverless indexes do not support collections. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -406,7 +406,7 @@ def __delete_collection(self, collection_name, **kwargs: ExtraOpenApiKwargsTyped def __delete_index(self, index_name, **kwargs: ExtraOpenApiKwargsTypedDict): """Delete an index # noqa: E501 - This operation deletes an existing index. # noqa: E501 + Delete an existing index. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -475,7 +475,7 @@ def __delete_index(self, index_name, **kwargs: ExtraOpenApiKwargsTypedDict): def __describe_collection(self, collection_name, **kwargs: ExtraOpenApiKwargsTypedDict): """Describe a collection # noqa: E501 - This operation gets a description of a collection. Serverless indexes do not support collections. # noqa: E501 + Get a description of a collection. Serverless indexes do not support collections. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -613,7 +613,7 @@ def __describe_index(self, index_name, **kwargs: ExtraOpenApiKwargsTypedDict): def __list_collections(self, **kwargs: ExtraOpenApiKwargsTypedDict): """List collections # noqa: E501 - This operation returns a list of all collections in a project. Serverless indexes do not support collections. # noqa: E501 + List all collections in a project. Serverless indexes do not support collections. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -673,7 +673,7 @@ def __list_collections(self, **kwargs: ExtraOpenApiKwargsTypedDict): def __list_indexes(self, **kwargs: ExtraOpenApiKwargsTypedDict): """List indexes # noqa: E501 - This operation returns a list of all indexes in a project. # noqa: E501 + List all indexes in a project. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -745,7 +745,7 @@ def __init__(self, api_client=None) -> None: async def __configure_index(self, index_name, configure_index_request, **kwargs): """Configure an index # noqa: E501 - This operation configures an existing index. For serverless indexes, you can configure index deletion protection, tags, and integrated inference embedding settings for the index. For pod-based indexes, you can configure the pod size, number of replicas, tags, and index deletion protection. It is not possible to change the pod type of a pod-based index. However, you can create a collection from a pod-based index and then [create a new pod-based index with a different pod type](http://docs.pinecone.io/guides/indexes/pods/create-a-pod-based-index#create-a-pod-index-from-a-collection) from the collection. For guidance and examples, see [Configure an index](http://docs.pinecone.io/guides/indexes/pods/manage-pod-based-indexes). # noqa: E501 + Configure an existing index. For serverless indexes, you can configure index deletion protection, tags, and integrated inference embedding settings for the index. For pod-based indexes, you can configure the pod size, number of replicas, tags, and index deletion protection. It is not possible to change the pod type of a pod-based index. However, you can create a collection from a pod-based index and then [create a new pod-based index with a different pod type](http://docs.pinecone.io/guides/indexes/pods/create-a-pod-based-index#create-a-pod-index-from-a-collection) from the collection. For guidance and examples, see [Configure an index](http://docs.pinecone.io/guides/indexes/pods/manage-pod-based-indexes). # noqa: E501 Args: @@ -812,7 +812,7 @@ async def __configure_index(self, index_name, configure_index_request, **kwargs) async def __create_collection(self, create_collection_request, **kwargs): """Create a collection # noqa: E501 - This operation creates a Pinecone collection. Serverless indexes do not support collections. # noqa: E501 + Create a Pinecone collection. Serverless indexes do not support collections. # noqa: E501 Args: @@ -874,7 +874,7 @@ async def __create_collection(self, create_collection_request, **kwargs): async def __create_index(self, create_index_request, **kwargs): """Create an index # noqa: E501 - This operation deploys a Pinecone index. This is where you specify the measure of similarity, the dimension of vectors to be stored in the index, which cloud provider you would like to deploy with, and more. For guidance and examples, see [Create an index](https://docs.pinecone.io/guides/indexes/create-an-index#create-a-serverless-index). # noqa: E501 + Create a Pinecone index. This is where you specify the measure of similarity, the dimension of vectors to be stored in the index, which cloud provider you would like to deploy with, and more. For guidance and examples, see [Create an index](https://docs.pinecone.io/guides/indexes/create-an-index#create-a-serverless-index). # noqa: E501 Args: @@ -934,9 +934,9 @@ async def __create_index(self, create_index_request, **kwargs): ) async def __create_index_for_model(self, create_index_for_model_request, **kwargs): - """Create an index for an embedding model # noqa: E501 + """Create an index with integrated embedding # noqa: E501 - This operation creates a serverless integrated inference index for a specific embedding model. Refer to the [model guide](https://docs.pinecone.io/guides/inference/understanding-inference#embedding-models) for available models and model details. # noqa: E501 + Create an index with integrated embedding. With this type of index, you provide source text, and Pinecone uses a [hosted embedding model](https://docs.pinecone.io/guides/inference/understanding-inference#embedding-models) to convert the text automatically during [upsert](https://docs.pinecone.io/reference/api/2025-01/data-plane/upsert_records) and [search](https://docs.pinecone.io/reference/api/2025-01/data-plane/search_records). For guidance and examples, see [Create an index](https://docs.pinecone.io/guides/indexes/create-an-index#integrated-embedding). # noqa: E501 Args: @@ -998,7 +998,7 @@ async def __create_index_for_model(self, create_index_for_model_request, **kwarg async def __delete_collection(self, collection_name, **kwargs): """Delete a collection # noqa: E501 - This operation deletes an existing collection. Serverless indexes do not support collections. # noqa: E501 + Delete an existing collection. Serverless indexes do not support collections. # noqa: E501 Args: @@ -1060,7 +1060,7 @@ async def __delete_collection(self, collection_name, **kwargs): async def __delete_index(self, index_name, **kwargs): """Delete an index # noqa: E501 - This operation deletes an existing index. # noqa: E501 + Delete an existing index. # noqa: E501 Args: @@ -1122,7 +1122,7 @@ async def __delete_index(self, index_name, **kwargs): async def __describe_collection(self, collection_name, **kwargs): """Describe a collection # noqa: E501 - This operation gets a description of a collection. Serverless indexes do not support collections. # noqa: E501 + Get a description of a collection. Serverless indexes do not support collections. # noqa: E501 Args: @@ -1246,7 +1246,7 @@ async def __describe_index(self, index_name, **kwargs): async def __list_collections(self, **kwargs): """List collections # noqa: E501 - This operation returns a list of all collections in a project. Serverless indexes do not support collections. # noqa: E501 + List all collections in a project. Serverless indexes do not support collections. # noqa: E501 @@ -1299,7 +1299,7 @@ async def __list_collections(self, **kwargs): async def __list_indexes(self, **kwargs): """List indexes # noqa: E501 - This operation returns a list of all indexes in a project. # noqa: E501 + List all indexes in a project. # noqa: E501 diff --git a/pinecone/core/openapi/db_control/model/collection_list.py b/pinecone/core/openapi/db_control/model/collection_list.py index e36d3d9d1..96e1632a8 100644 --- a/pinecone/core/openapi/db_control/model/collection_list.py +++ b/pinecone/core/openapi/db_control/model/collection_list.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_control/model/collection_model.py b/pinecone/core/openapi/db_control/model/collection_model.py index 88d2334d2..bafe08abc 100644 --- a/pinecone/core/openapi/db_control/model/collection_model.py +++ b/pinecone/core/openapi/db_control/model/collection_model.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_control/model/configure_index_request.py b/pinecone/core/openapi/db_control/model/configure_index_request.py index 7f4a5cf35..aa2d7704a 100644 --- a/pinecone/core/openapi/db_control/model/configure_index_request.py +++ b/pinecone/core/openapi/db_control/model/configure_index_request.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_control/model/configure_index_request_embed.py b/pinecone/core/openapi/db_control/model/configure_index_request_embed.py index 55f12ebfa..ce980b884 100644 --- a/pinecone/core/openapi/db_control/model/configure_index_request_embed.py +++ b/pinecone/core/openapi/db_control/model/configure_index_request_embed.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_control/model/configure_index_request_spec.py b/pinecone/core/openapi/db_control/model/configure_index_request_spec.py index 484ad71dc..ae9a76fa9 100644 --- a/pinecone/core/openapi/db_control/model/configure_index_request_spec.py +++ b/pinecone/core/openapi/db_control/model/configure_index_request_spec.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_control/model/configure_index_request_spec_pod.py b/pinecone/core/openapi/db_control/model/configure_index_request_spec_pod.py index 3a3ea96e0..67721ce42 100644 --- a/pinecone/core/openapi/db_control/model/configure_index_request_spec_pod.py +++ b/pinecone/core/openapi/db_control/model/configure_index_request_spec_pod.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_control/model/create_collection_request.py b/pinecone/core/openapi/db_control/model/create_collection_request.py index 0e14dc226..fe2807e23 100644 --- a/pinecone/core/openapi/db_control/model/create_collection_request.py +++ b/pinecone/core/openapi/db_control/model/create_collection_request.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_control/model/create_index_for_model_request.py b/pinecone/core/openapi/db_control/model/create_index_for_model_request.py index c7d889a2c..d4331ba46 100644 --- a/pinecone/core/openapi/db_control/model/create_index_for_model_request.py +++ b/pinecone/core/openapi/db_control/model/create_index_for_model_request.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_control/model/create_index_for_model_request_embed.py b/pinecone/core/openapi/db_control/model/create_index_for_model_request_embed.py index 88de090a4..7d3f4f082 100644 --- a/pinecone/core/openapi/db_control/model/create_index_for_model_request_embed.py +++ b/pinecone/core/openapi/db_control/model/create_index_for_model_request_embed.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ @@ -89,6 +89,7 @@ def openapi_types(cls): "model": (str,), # noqa: E501 "field_map": ({str: (bool, dict, float, int, list, str, none_type)},), # noqa: E501 "metric": (str,), # noqa: E501 + "dimension": (int,), # noqa: E501 "read_parameters": ({str: (bool, dict, float, int, list, str, none_type)},), # noqa: E501 "write_parameters": ({str: (bool, dict, float, int, list, str, none_type)},), # noqa: E501 } @@ -101,6 +102,7 @@ def discriminator(cls): "model": "model", # noqa: E501 "field_map": "field_map", # noqa: E501 "metric": "metric", # noqa: E501 + "dimension": "dimension", # noqa: E501 "read_parameters": "read_parameters", # noqa: E501 "write_parameters": "write_parameters", # noqa: E501 } @@ -150,6 +152,7 @@ def _from_openapi_data(cls: Type[T], model, field_map, *args, **kwargs) -> T: # through its discriminator because we passed in _visited_composed_classes = (Animal,) metric (str): The distance metric to be used for similarity search. You can use 'euclidean', 'cosine', or 'dotproduct'. If not specified, the metric will be defaulted according to the model. Cannot be updated once set. [optional] # noqa: E501 + dimension (int): The dimension of embedding vectors produced for the index. [optional] # noqa: E501 read_parameters ({str: (bool, dict, float, int, list, str, none_type)}): The read parameters for the embedding model. [optional] # noqa: E501 write_parameters ({str: (bool, dict, float, int, list, str, none_type)}): The write parameters for the embedding model. [optional] # noqa: E501 """ @@ -242,6 +245,7 @@ def __init__(self, model, field_map, *args, **kwargs) -> None: # noqa: E501 through its discriminator because we passed in _visited_composed_classes = (Animal,) metric (str): The distance metric to be used for similarity search. You can use 'euclidean', 'cosine', or 'dotproduct'. If not specified, the metric will be defaulted according to the model. Cannot be updated once set. [optional] # noqa: E501 + dimension (int): The dimension of embedding vectors produced for the index. [optional] # noqa: E501 read_parameters ({str: (bool, dict, float, int, list, str, none_type)}): The read parameters for the embedding model. [optional] # noqa: E501 write_parameters ({str: (bool, dict, float, int, list, str, none_type)}): The write parameters for the embedding model. [optional] # noqa: E501 """ diff --git a/pinecone/core/openapi/db_control/model/create_index_request.py b/pinecone/core/openapi/db_control/model/create_index_request.py index ae61e95a4..ff9548b75 100644 --- a/pinecone/core/openapi/db_control/model/create_index_request.py +++ b/pinecone/core/openapi/db_control/model/create_index_request.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_control/model/deletion_protection.py b/pinecone/core/openapi/db_control/model/deletion_protection.py index 24fc26f31..776826268 100644 --- a/pinecone/core/openapi/db_control/model/deletion_protection.py +++ b/pinecone/core/openapi/db_control/model/deletion_protection.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_control/model/error_response.py b/pinecone/core/openapi/db_control/model/error_response.py index b37c2e97c..a64ae9e21 100644 --- a/pinecone/core/openapi/db_control/model/error_response.py +++ b/pinecone/core/openapi/db_control/model/error_response.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_control/model/error_response_error.py b/pinecone/core/openapi/db_control/model/error_response_error.py index 613ccc4f5..488c99b55 100644 --- a/pinecone/core/openapi/db_control/model/error_response_error.py +++ b/pinecone/core/openapi/db_control/model/error_response_error.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_control/model/index_list.py b/pinecone/core/openapi/db_control/model/index_list.py index ed6c08dfe..99a4d6dfc 100644 --- a/pinecone/core/openapi/db_control/model/index_list.py +++ b/pinecone/core/openapi/db_control/model/index_list.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_control/model/index_model.py b/pinecone/core/openapi/db_control/model/index_model.py index 3fe45763f..2e5c62241 100644 --- a/pinecone/core/openapi/db_control/model/index_model.py +++ b/pinecone/core/openapi/db_control/model/index_model.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_control/model/index_model_spec.py b/pinecone/core/openapi/db_control/model/index_model_spec.py index b27ec0f8e..b75b803f1 100644 --- a/pinecone/core/openapi/db_control/model/index_model_spec.py +++ b/pinecone/core/openapi/db_control/model/index_model_spec.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_control/model/index_model_status.py b/pinecone/core/openapi/db_control/model/index_model_status.py index 0128f22eb..2379c7640 100644 --- a/pinecone/core/openapi/db_control/model/index_model_status.py +++ b/pinecone/core/openapi/db_control/model/index_model_status.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ @@ -69,6 +69,7 @@ class IndexModelStatus(ModelNormal): "SCALINGDOWNPODSIZE": "ScalingDownPodSize", "TERMINATING": "Terminating", "READY": "Ready", + "DISABLED": "Disabled", } } diff --git a/pinecone/core/openapi/db_control/model/index_spec.py b/pinecone/core/openapi/db_control/model/index_spec.py index 6a8c4db55..add2979ee 100644 --- a/pinecone/core/openapi/db_control/model/index_spec.py +++ b/pinecone/core/openapi/db_control/model/index_spec.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_control/model/index_tags.py b/pinecone/core/openapi/db_control/model/index_tags.py index 6111f7b57..bee527a54 100644 --- a/pinecone/core/openapi/db_control/model/index_tags.py +++ b/pinecone/core/openapi/db_control/model/index_tags.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_control/model/model_index_embed.py b/pinecone/core/openapi/db_control/model/model_index_embed.py index 624462a8b..1e3580591 100644 --- a/pinecone/core/openapi/db_control/model/model_index_embed.py +++ b/pinecone/core/openapi/db_control/model/model_index_embed.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_control/model/pod_spec.py b/pinecone/core/openapi/db_control/model/pod_spec.py index c430c6a39..a0171c8cb 100644 --- a/pinecone/core/openapi/db_control/model/pod_spec.py +++ b/pinecone/core/openapi/db_control/model/pod_spec.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_control/model/pod_spec_metadata_config.py b/pinecone/core/openapi/db_control/model/pod_spec_metadata_config.py index 969471e6c..d8df2bc9a 100644 --- a/pinecone/core/openapi/db_control/model/pod_spec_metadata_config.py +++ b/pinecone/core/openapi/db_control/model/pod_spec_metadata_config.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_control/model/serverless_spec.py b/pinecone/core/openapi/db_control/model/serverless_spec.py index 58e39e487..20ac901ff 100644 --- a/pinecone/core/openapi/db_control/model/serverless_spec.py +++ b/pinecone/core/openapi/db_control/model/serverless_spec.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_data/__init__.py b/pinecone/core/openapi/db_data/__init__.py index c878a5486..e8cbbfe12 100644 --- a/pinecone/core/openapi/db_data/__init__.py +++ b/pinecone/core/openapi/db_data/__init__.py @@ -7,7 +7,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ @@ -27,4 +27,4 @@ from pinecone.openapi_support.exceptions import PineconeApiKeyError from pinecone.openapi_support.exceptions import PineconeApiException -API_VERSION = "2025-01" +API_VERSION = "2025-04" diff --git a/pinecone/core/openapi/db_data/api/bulk_operations_api.py b/pinecone/core/openapi/db_data/api/bulk_operations_api.py index fcfbac8aa..c0be95433 100644 --- a/pinecone/core/openapi/db_data/api/bulk_operations_api.py +++ b/pinecone/core/openapi/db_data/api/bulk_operations_api.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ @@ -182,7 +182,7 @@ def __describe_bulk_import(self, id, **kwargs: ExtraOpenApiKwargsTypedDict): def __list_bulk_imports(self, **kwargs: ExtraOpenApiKwargsTypedDict): """List imports # noqa: E501 - List all recent and ongoing import operations. By default, this returns up to 100 imports per page. If the `limit` parameter is set, `list` returns up to that number of imports instead. Whenever there are additional IDs to return, the response also includes a `pagination_token` that you can use to get the next batch of imports. When the response does not include a `pagination_token`, there are no more imports to return. For guidance and examples, see [Import data](https://docs.pinecone.io/guides/data/import-data). # noqa: E501 + List all recent and ongoing import operations. By default, `list_imports` returns up to 100 imports per page. If the `limit` parameter is set, `list` returns up to that number of imports instead. Whenever there are additional IDs to return, the response also includes a `pagination_token` that you can use to get the next batch of imports. When the response does not include a `pagination_token`, there are no more imports to return. For guidance and examples, see [Import data](https://docs.pinecone.io/guides/data/import-data). # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -455,7 +455,7 @@ async def __describe_bulk_import(self, id, **kwargs): async def __list_bulk_imports(self, **kwargs): """List imports # noqa: E501 - List all recent and ongoing import operations. By default, this returns up to 100 imports per page. If the `limit` parameter is set, `list` returns up to that number of imports instead. Whenever there are additional IDs to return, the response also includes a `pagination_token` that you can use to get the next batch of imports. When the response does not include a `pagination_token`, there are no more imports to return. For guidance and examples, see [Import data](https://docs.pinecone.io/guides/data/import-data). # noqa: E501 + List all recent and ongoing import operations. By default, `list_imports` returns up to 100 imports per page. If the `limit` parameter is set, `list` returns up to that number of imports instead. Whenever there are additional IDs to return, the response also includes a `pagination_token` that you can use to get the next batch of imports. When the response does not include a `pagination_token`, there are no more imports to return. For guidance and examples, see [Import data](https://docs.pinecone.io/guides/data/import-data). # noqa: E501 diff --git a/pinecone/core/openapi/db_data/api/vector_operations_api.py b/pinecone/core/openapi/db_data/api/vector_operations_api.py index 22bb47c3f..a5a3c70e5 100644 --- a/pinecone/core/openapi/db_data/api/vector_operations_api.py +++ b/pinecone/core/openapi/db_data/api/vector_operations_api.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ @@ -55,7 +55,7 @@ def __init__(self, api_client=None) -> None: def __delete_vectors(self, delete_request, **kwargs: ExtraOpenApiKwargsTypedDict): """Delete vectors # noqa: E501 - Delete vectors, by id, from a single namespace. For guidance and examples, see [Delete data](https://docs.pinecone.io/guides/data/delete-data). # noqa: E501 + Delete vectors by id from a single namespace. For guidance and examples, see [Delete data](https://docs.pinecone.io/guides/data/delete-data). # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -195,7 +195,7 @@ def __describe_index_stats( def __fetch_vectors(self, ids, **kwargs: ExtraOpenApiKwargsTypedDict): """Fetch vectors # noqa: E501 - Look up and return vectors, by ID, from a single namespace. The returned vectors include the vector data and/or metadata. For guidance and examples, see [Fetch data](https://docs.pinecone.io/guides/data/fetch-data). # noqa: E501 + Look up and return vectors by ID from a single namespace. The returned vectors include the vector data and/or metadata. For guidance and examples, see [Fetch data](https://docs.pinecone.io/guides/data/fetch-data). # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -265,7 +265,7 @@ def __fetch_vectors(self, ids, **kwargs: ExtraOpenApiKwargsTypedDict): def __list_vectors(self, **kwargs: ExtraOpenApiKwargsTypedDict): """List vector IDs # noqa: E501 - List the IDs of vectors in a single namespace of a serverless index. An optional prefix can be passed to limit the results to IDs with a common prefix. This returns up to 100 IDs at a time by default in sorted order (bitwise \"C\" collation). If the `limit` parameter is set, `list` returns up to that number of IDs instead. Whenever there are additional IDs to return, the response also includes a `pagination_token` that you can use to get the next batch of IDs. When the response does not include a `pagination_token`, there are no more IDs to return. For guidance and examples, see [List record IDs](https://docs.pinecone.io/guides/data/list-record-ids). **Note:** `list` is supported only for serverless indexes. # noqa: E501 + List the IDs of vectors in a single namespace of a serverless index. An optional prefix can be passed to limit the results to IDs with a common prefix. Returns up to 100 IDs at a time by default in sorted order (bitwise \"C\" collation). If the `limit` parameter is set, `list` returns up to that number of IDs instead. Whenever there are additional IDs to return, the response also includes a `pagination_token` that you can use to get the next batch of IDs. When the response does not include a `pagination_token`, there are no more IDs to return. For guidance and examples, see [List record IDs](https://docs.pinecone.io/guides/data/list-record-ids). **Note:** `list` is supported only for serverless indexes. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -348,9 +348,9 @@ def __list_vectors(self, **kwargs: ExtraOpenApiKwargsTypedDict): ) def __query_vectors(self, query_request, **kwargs: ExtraOpenApiKwargsTypedDict): - """Query vectors # noqa: E501 + """Search with a vector # noqa: E501 - Search a namespace, using a query vector. It retrieves the ids of the most similar items in a namespace, along with their similarity scores. For guidance and examples, see [Query data](https://docs.pinecone.io/guides/data/query-data). # noqa: E501 + Search a namespace using a query vector. It retrieves the ids of the most similar items in a namespace, along with their similarity scores. For guidance and examples, see [Query data](https://docs.pinecone.io/guides/data/query-data). # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -419,9 +419,9 @@ def __query_vectors(self, query_request, **kwargs: ExtraOpenApiKwargsTypedDict): def __search_records_namespace( self, namespace, search_records_request, **kwargs: ExtraOpenApiKwargsTypedDict ): - """Search a namespace # noqa: E501 + """Search with text # noqa: E501 - This operation converts a query to a vector embedding and then searches a namespace using the embedding. It returns the most similar records in the namespace, along with their similarity scores. # noqa: E501 + Search a namespace with a query text, query vector, or record ID and return the most similar records, along with their similarity scores. Optionally, rerank the initial results based on their relevance to the query. Searching with text is supported only for [indexes with integrated embedding](https://docs.pinecone.io/guides/indexes/create-an-index#integrated-embedding). Searching with a query vector or record ID is supported for all indexes. For guidance and examples, see [Query data](https://docs.pinecone.io/guides/data/query-data). # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -564,9 +564,9 @@ def __update_vector(self, update_request, **kwargs: ExtraOpenApiKwargsTypedDict) def __upsert_records_namespace( self, namespace, upsert_record, **kwargs: ExtraOpenApiKwargsTypedDict ): - """Upsert records into a namespace # noqa: E501 + """Upsert text # noqa: E501 - This operation converts input data to vector embeddings and then upserts the embeddings into a namespace. # noqa: E501 + Upsert text into a namespace. Pinecone converts the text to vectors automatically using the hosted embedding model associated with the index. Upserting text is supported only for [indexes with integrated embedding](https://docs.pinecone.io/reference/api/2025-01/control-plane/create_for_model). For guidance and examples, see [Upsert data](https://docs.pinecone.io/guides/data/upsert-data#upsert-text). # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -637,7 +637,7 @@ def __upsert_records_namespace( def __upsert_vectors(self, upsert_request, **kwargs: ExtraOpenApiKwargsTypedDict): """Upsert vectors # noqa: E501 - Write vectors into a namespace. If a new value is upserted for an existing vector ID, it will overwrite the previous value. For guidance and examples, see [Upsert data](https://docs.pinecone.io/guides/data/upsert-data). # noqa: E501 + Upsert vectors into a namespace. If a new value is upserted for an existing vector ID, it will overwrite the previous value. For guidance and examples, see [Upsert data](https://docs.pinecone.io/guides/data/upsert-data#upsert-vectors). # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -718,7 +718,7 @@ def __init__(self, api_client=None) -> None: async def __delete_vectors(self, delete_request, **kwargs): """Delete vectors # noqa: E501 - Delete vectors, by id, from a single namespace. For guidance and examples, see [Delete data](https://docs.pinecone.io/guides/data/delete-data). # noqa: E501 + Delete vectors by id from a single namespace. For guidance and examples, see [Delete data](https://docs.pinecone.io/guides/data/delete-data). # noqa: E501 Args: @@ -842,7 +842,7 @@ async def __describe_index_stats(self, describe_index_stats_request, **kwargs): async def __fetch_vectors(self, ids, **kwargs): """Fetch vectors # noqa: E501 - Look up and return vectors, by ID, from a single namespace. The returned vectors include the vector data and/or metadata. For guidance and examples, see [Fetch data](https://docs.pinecone.io/guides/data/fetch-data). # noqa: E501 + Look up and return vectors by ID from a single namespace. The returned vectors include the vector data and/or metadata. For guidance and examples, see [Fetch data](https://docs.pinecone.io/guides/data/fetch-data). # noqa: E501 Args: @@ -905,7 +905,7 @@ async def __fetch_vectors(self, ids, **kwargs): async def __list_vectors(self, **kwargs): """List vector IDs # noqa: E501 - List the IDs of vectors in a single namespace of a serverless index. An optional prefix can be passed to limit the results to IDs with a common prefix. This returns up to 100 IDs at a time by default in sorted order (bitwise \"C\" collation). If the `limit` parameter is set, `list` returns up to that number of IDs instead. Whenever there are additional IDs to return, the response also includes a `pagination_token` that you can use to get the next batch of IDs. When the response does not include a `pagination_token`, there are no more IDs to return. For guidance and examples, see [List record IDs](https://docs.pinecone.io/guides/data/list-record-ids). **Note:** `list` is supported only for serverless indexes. # noqa: E501 + List the IDs of vectors in a single namespace of a serverless index. An optional prefix can be passed to limit the results to IDs with a common prefix. Returns up to 100 IDs at a time by default in sorted order (bitwise \"C\" collation). If the `limit` parameter is set, `list` returns up to that number of IDs instead. Whenever there are additional IDs to return, the response also includes a `pagination_token` that you can use to get the next batch of IDs. When the response does not include a `pagination_token`, there are no more IDs to return. For guidance and examples, see [List record IDs](https://docs.pinecone.io/guides/data/list-record-ids). **Note:** `list` is supported only for serverless indexes. # noqa: E501 @@ -981,9 +981,9 @@ async def __list_vectors(self, **kwargs): ) async def __query_vectors(self, query_request, **kwargs): - """Query vectors # noqa: E501 + """Search with a vector # noqa: E501 - Search a namespace, using a query vector. It retrieves the ids of the most similar items in a namespace, along with their similarity scores. For guidance and examples, see [Query data](https://docs.pinecone.io/guides/data/query-data). # noqa: E501 + Search a namespace using a query vector. It retrieves the ids of the most similar items in a namespace, along with their similarity scores. For guidance and examples, see [Query data](https://docs.pinecone.io/guides/data/query-data). # noqa: E501 Args: @@ -1043,9 +1043,9 @@ async def __query_vectors(self, query_request, **kwargs): ) async def __search_records_namespace(self, namespace, search_records_request, **kwargs): - """Search a namespace # noqa: E501 + """Search with text # noqa: E501 - This operation converts a query to a vector embedding and then searches a namespace using the embedding. It returns the most similar records in the namespace, along with their similarity scores. # noqa: E501 + Search a namespace with a query text, query vector, or record ID and return the most similar records, along with their similarity scores. Optionally, rerank the initial results based on their relevance to the query. Searching with text is supported only for [indexes with integrated embedding](https://docs.pinecone.io/guides/indexes/create-an-index#integrated-embedding). Searching with a query vector or record ID is supported for all indexes. For guidance and examples, see [Query data](https://docs.pinecone.io/guides/data/query-data). # noqa: E501 Args: @@ -1172,9 +1172,9 @@ async def __update_vector(self, update_request, **kwargs): ) async def __upsert_records_namespace(self, namespace, upsert_record, **kwargs): - """Upsert records into a namespace # noqa: E501 + """Upsert text # noqa: E501 - This operation converts input data to vector embeddings and then upserts the embeddings into a namespace. # noqa: E501 + Upsert text into a namespace. Pinecone converts the text to vectors automatically using the hosted embedding model associated with the index. Upserting text is supported only for [indexes with integrated embedding](https://docs.pinecone.io/reference/api/2025-01/control-plane/create_for_model). For guidance and examples, see [Upsert data](https://docs.pinecone.io/guides/data/upsert-data#upsert-text). # noqa: E501 Args: @@ -1238,7 +1238,7 @@ async def __upsert_records_namespace(self, namespace, upsert_record, **kwargs): async def __upsert_vectors(self, upsert_request, **kwargs): """Upsert vectors # noqa: E501 - Write vectors into a namespace. If a new value is upserted for an existing vector ID, it will overwrite the previous value. For guidance and examples, see [Upsert data](https://docs.pinecone.io/guides/data/upsert-data). # noqa: E501 + Upsert vectors into a namespace. If a new value is upserted for an existing vector ID, it will overwrite the previous value. For guidance and examples, see [Upsert data](https://docs.pinecone.io/guides/data/upsert-data#upsert-vectors). # noqa: E501 Args: diff --git a/pinecone/core/openapi/db_data/model/delete_request.py b/pinecone/core/openapi/db_data/model/delete_request.py index 79e399051..bfb15b874 100644 --- a/pinecone/core/openapi/db_data/model/delete_request.py +++ b/pinecone/core/openapi/db_data/model/delete_request.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_data/model/describe_index_stats_request.py b/pinecone/core/openapi/db_data/model/describe_index_stats_request.py index 769f8dcbd..e024d5f33 100644 --- a/pinecone/core/openapi/db_data/model/describe_index_stats_request.py +++ b/pinecone/core/openapi/db_data/model/describe_index_stats_request.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_data/model/fetch_response.py b/pinecone/core/openapi/db_data/model/fetch_response.py index 6a918dbc4..f662b596f 100644 --- a/pinecone/core/openapi/db_data/model/fetch_response.py +++ b/pinecone/core/openapi/db_data/model/fetch_response.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_data/model/hit.py b/pinecone/core/openapi/db_data/model/hit.py index 8af69b372..b8e16de9a 100644 --- a/pinecone/core/openapi/db_data/model/hit.py +++ b/pinecone/core/openapi/db_data/model/hit.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_data/model/import_error_mode.py b/pinecone/core/openapi/db_data/model/import_error_mode.py index dd8a0e71b..7bda43b0a 100644 --- a/pinecone/core/openapi/db_data/model/import_error_mode.py +++ b/pinecone/core/openapi/db_data/model/import_error_mode.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_data/model/import_model.py b/pinecone/core/openapi/db_data/model/import_model.py index d1d4589f3..4d9908863 100644 --- a/pinecone/core/openapi/db_data/model/import_model.py +++ b/pinecone/core/openapi/db_data/model/import_model.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_data/model/index_description.py b/pinecone/core/openapi/db_data/model/index_description.py index 1bbc7198d..8fa8aa1ff 100644 --- a/pinecone/core/openapi/db_data/model/index_description.py +++ b/pinecone/core/openapi/db_data/model/index_description.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_data/model/list_imports_response.py b/pinecone/core/openapi/db_data/model/list_imports_response.py index 1b485e8b4..254de5809 100644 --- a/pinecone/core/openapi/db_data/model/list_imports_response.py +++ b/pinecone/core/openapi/db_data/model/list_imports_response.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_data/model/list_item.py b/pinecone/core/openapi/db_data/model/list_item.py index ad58c600f..14d778692 100644 --- a/pinecone/core/openapi/db_data/model/list_item.py +++ b/pinecone/core/openapi/db_data/model/list_item.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_data/model/list_response.py b/pinecone/core/openapi/db_data/model/list_response.py index 4a8d0c5e3..c4e447467 100644 --- a/pinecone/core/openapi/db_data/model/list_response.py +++ b/pinecone/core/openapi/db_data/model/list_response.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_data/model/namespace_summary.py b/pinecone/core/openapi/db_data/model/namespace_summary.py index a2ba425a5..e9f8080c2 100644 --- a/pinecone/core/openapi/db_data/model/namespace_summary.py +++ b/pinecone/core/openapi/db_data/model/namespace_summary.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_data/model/pagination.py b/pinecone/core/openapi/db_data/model/pagination.py index f93898c88..14cb23011 100644 --- a/pinecone/core/openapi/db_data/model/pagination.py +++ b/pinecone/core/openapi/db_data/model/pagination.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_data/model/protobuf_any.py b/pinecone/core/openapi/db_data/model/protobuf_any.py index 6e2c3c54e..aebbe3616 100644 --- a/pinecone/core/openapi/db_data/model/protobuf_any.py +++ b/pinecone/core/openapi/db_data/model/protobuf_any.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_data/model/protobuf_null_value.py b/pinecone/core/openapi/db_data/model/protobuf_null_value.py index 02ac25b85..b46f14d22 100644 --- a/pinecone/core/openapi/db_data/model/protobuf_null_value.py +++ b/pinecone/core/openapi/db_data/model/protobuf_null_value.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_data/model/query_request.py b/pinecone/core/openapi/db_data/model/query_request.py index 23763e6d4..7aa460c03 100644 --- a/pinecone/core/openapi/db_data/model/query_request.py +++ b/pinecone/core/openapi/db_data/model/query_request.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ @@ -170,13 +170,13 @@ def _from_openapi_data(cls: Type[T], top_k, *args, **kwargs) -> T: # noqa: E501 through its discriminator because we passed in _visited_composed_classes = (Animal,) namespace (str): The namespace to query. [optional] # noqa: E501 - filter ({str: (bool, dict, float, int, list, str, none_type)}): The filter to apply. You can use vector metadata to limit your search. See [Understanding metadata](https://docs.pinecone.io/guides/data/understanding-metadata). [optional] # noqa: E501 + filter ({str: (bool, dict, float, int, list, str, none_type)}): The filter to apply. You can use vector metadata to limit your search. See [Understanding metadata](https://docs.pinecone.io/guides/data/understanding-metadata). You can use vector metadata to limit your search. See [Understanding metadata](https://docs.pinecone.io/guides/data/understanding-metadata). [optional] # noqa: E501 include_values (bool): Indicates whether vector values are included in the response. [optional] if omitted the server will use the default value of False. # noqa: E501 include_metadata (bool): Indicates whether metadata is included in the response as well as the ids. [optional] if omitted the server will use the default value of False. # noqa: E501 - queries ([QueryVector]): DEPRECATED. The query vectors. Each `query()` request can contain only one of the parameters `queries`, `vector`, or `id`. [optional] # noqa: E501 + queries ([QueryVector]): DEPRECATED. Use `vector` or `id` instead. [optional] # noqa: E501 vector ([float]): The query vector. This should be the same length as the dimension of the index being queried. Each `query` request can contain only one of the parameters `id` or `vector`. [optional] # noqa: E501 sparse_vector (SparseValues): [optional] # 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 + id (str): The unique ID of the vector to be used as a query vector. Each request can contain either the `vector` or `id` parameter. [optional] # noqa: E501 """ _check_type = kwargs.pop("_check_type", True) @@ -265,13 +265,13 @@ def __init__(self, top_k, *args, **kwargs) -> None: # noqa: E501 through its discriminator because we passed in _visited_composed_classes = (Animal,) namespace (str): The namespace to query. [optional] # noqa: E501 - filter ({str: (bool, dict, float, int, list, str, none_type)}): The filter to apply. You can use vector metadata to limit your search. See [Understanding metadata](https://docs.pinecone.io/guides/data/understanding-metadata). [optional] # noqa: E501 + filter ({str: (bool, dict, float, int, list, str, none_type)}): The filter to apply. You can use vector metadata to limit your search. See [Understanding metadata](https://docs.pinecone.io/guides/data/understanding-metadata). You can use vector metadata to limit your search. See [Understanding metadata](https://docs.pinecone.io/guides/data/understanding-metadata). [optional] # noqa: E501 include_values (bool): Indicates whether vector values are included in the response. [optional] if omitted the server will use the default value of False. # noqa: E501 include_metadata (bool): Indicates whether metadata is included in the response as well as the ids. [optional] if omitted the server will use the default value of False. # noqa: E501 - queries ([QueryVector]): DEPRECATED. The query vectors. Each `query()` request can contain only one of the parameters `queries`, `vector`, or `id`. [optional] # noqa: E501 + queries ([QueryVector]): DEPRECATED. Use `vector` or `id` instead. [optional] # noqa: E501 vector ([float]): The query vector. This should be the same length as the dimension of the index being queried. Each `query` request can contain only one of the parameters `id` or `vector`. [optional] # noqa: E501 sparse_vector (SparseValues): [optional] # 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 + id (str): The unique ID of the vector to be used as a query vector. Each request can contain either the `vector` or `id` parameter. [optional] # noqa: E501 """ _check_type = kwargs.pop("_check_type", True) diff --git a/pinecone/core/openapi/db_data/model/query_response.py b/pinecone/core/openapi/db_data/model/query_response.py index fde3a55d3..937de2363 100644 --- a/pinecone/core/openapi/db_data/model/query_response.py +++ b/pinecone/core/openapi/db_data/model/query_response.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_data/model/query_vector.py b/pinecone/core/openapi/db_data/model/query_vector.py index 30f4c8de8..12caef5d7 100644 --- a/pinecone/core/openapi/db_data/model/query_vector.py +++ b/pinecone/core/openapi/db_data/model/query_vector.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_data/model/rpc_status.py b/pinecone/core/openapi/db_data/model/rpc_status.py index fa824641f..30196b58d 100644 --- a/pinecone/core/openapi/db_data/model/rpc_status.py +++ b/pinecone/core/openapi/db_data/model/rpc_status.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_data/model/scored_vector.py b/pinecone/core/openapi/db_data/model/scored_vector.py index 87d51d94d..949f4e2a4 100644 --- a/pinecone/core/openapi/db_data/model/scored_vector.py +++ b/pinecone/core/openapi/db_data/model/scored_vector.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_data/model/search_records_request.py b/pinecone/core/openapi/db_data/model/search_records_request.py index 9393c415f..df5fcd233 100644 --- a/pinecone/core/openapi/db_data/model/search_records_request.py +++ b/pinecone/core/openapi/db_data/model/search_records_request.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ @@ -156,7 +156,7 @@ def _from_openapi_data(cls: Type[T], query, *args, **kwargs) -> T: # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - fields ([str]): The fields to return in the search results. [optional] # noqa: E501 + fields ([str]): The fields to return in the search results. If not specified, the response will include all fields. [optional] # noqa: E501 rerank (SearchRecordsRequestRerank): [optional] # noqa: E501 """ @@ -245,7 +245,7 @@ def __init__(self, query, *args, **kwargs) -> None: # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - fields ([str]): The fields to return in the search results. [optional] # noqa: E501 + fields ([str]): The fields to return in the search results. If not specified, the response will include all fields. [optional] # noqa: E501 rerank (SearchRecordsRequestRerank): [optional] # noqa: E501 """ diff --git a/pinecone/core/openapi/db_data/model/search_records_request_query.py b/pinecone/core/openapi/db_data/model/search_records_request_query.py index 5cedde38e..6898e2006 100644 --- a/pinecone/core/openapi/db_data/model/search_records_request_query.py +++ b/pinecone/core/openapi/db_data/model/search_records_request_query.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ @@ -121,7 +121,7 @@ def _from_openapi_data(cls: Type[T], top_k, *args, **kwargs) -> T: # noqa: E501 """SearchRecordsRequestQuery - a model defined in OpenAPI Args: - top_k (int): The number of results to return for each search. + top_k (int): The number of similar records to return. Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -154,7 +154,7 @@ def _from_openapi_data(cls: Type[T], top_k, *args, **kwargs) -> T: # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - filter ({str: (bool, dict, float, int, list, str, none_type)}): The filter to apply. [optional] # noqa: E501 + filter ({str: (bool, dict, float, int, list, str, none_type)}): The filter to apply. You can use vector metadata to limit your search. See [Understanding metadata](https://docs.pinecone.io/guides/data/understanding-metadata). [optional] # noqa: E501 inputs ({str: (bool, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 vector (SearchRecordsVector): [optional] # noqa: E501 id (str): The unique ID of the vector to be used as a query vector. [optional] # noqa: E501 @@ -212,7 +212,7 @@ def __init__(self, top_k, *args, **kwargs) -> None: # noqa: E501 """SearchRecordsRequestQuery - a model defined in OpenAPI Args: - top_k (int): The number of results to return for each search. + top_k (int): The number of similar records to return. Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -245,7 +245,7 @@ def __init__(self, top_k, *args, **kwargs) -> None: # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - filter ({str: (bool, dict, float, int, list, str, none_type)}): The filter to apply. [optional] # noqa: E501 + filter ({str: (bool, dict, float, int, list, str, none_type)}): The filter to apply. You can use vector metadata to limit your search. See [Understanding metadata](https://docs.pinecone.io/guides/data/understanding-metadata). [optional] # noqa: E501 inputs ({str: (bool, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 vector (SearchRecordsVector): [optional] # noqa: E501 id (str): The unique ID of the vector to be used as a query vector. [optional] # noqa: E501 diff --git a/pinecone/core/openapi/db_data/model/search_records_request_rerank.py b/pinecone/core/openapi/db_data/model/search_records_request_rerank.py index 6b6515bb5..3138c6014 100644 --- a/pinecone/core/openapi/db_data/model/search_records_request_rerank.py +++ b/pinecone/core/openapi/db_data/model/search_records_request_rerank.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_data/model/search_records_response.py b/pinecone/core/openapi/db_data/model/search_records_response.py index 440fa71b4..95958624c 100644 --- a/pinecone/core/openapi/db_data/model/search_records_response.py +++ b/pinecone/core/openapi/db_data/model/search_records_response.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_data/model/search_records_response_result.py b/pinecone/core/openapi/db_data/model/search_records_response_result.py index 87ecf0177..87b0a5c61 100644 --- a/pinecone/core/openapi/db_data/model/search_records_response_result.py +++ b/pinecone/core/openapi/db_data/model/search_records_response_result.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_data/model/search_records_vector.py b/pinecone/core/openapi/db_data/model/search_records_vector.py index d2466cd7b..e5d551a56 100644 --- a/pinecone/core/openapi/db_data/model/search_records_vector.py +++ b/pinecone/core/openapi/db_data/model/search_records_vector.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_data/model/search_usage.py b/pinecone/core/openapi/db_data/model/search_usage.py index 565efc9f0..dc9217a8d 100644 --- a/pinecone/core/openapi/db_data/model/search_usage.py +++ b/pinecone/core/openapi/db_data/model/search_usage.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_data/model/search_vector.py b/pinecone/core/openapi/db_data/model/search_vector.py index 417bde501..88f181515 100644 --- a/pinecone/core/openapi/db_data/model/search_vector.py +++ b/pinecone/core/openapi/db_data/model/search_vector.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_data/model/single_query_results.py b/pinecone/core/openapi/db_data/model/single_query_results.py index b10e442d3..bfc1bb2fc 100644 --- a/pinecone/core/openapi/db_data/model/single_query_results.py +++ b/pinecone/core/openapi/db_data/model/single_query_results.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_data/model/sparse_values.py b/pinecone/core/openapi/db_data/model/sparse_values.py index 0883d17e9..c7f48e74e 100644 --- a/pinecone/core/openapi/db_data/model/sparse_values.py +++ b/pinecone/core/openapi/db_data/model/sparse_values.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_data/model/start_import_request.py b/pinecone/core/openapi/db_data/model/start_import_request.py index 891de0b26..1a4a96298 100644 --- a/pinecone/core/openapi/db_data/model/start_import_request.py +++ b/pinecone/core/openapi/db_data/model/start_import_request.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_data/model/start_import_response.py b/pinecone/core/openapi/db_data/model/start_import_response.py index ede992711..37da3ba6e 100644 --- a/pinecone/core/openapi/db_data/model/start_import_response.py +++ b/pinecone/core/openapi/db_data/model/start_import_response.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_data/model/update_request.py b/pinecone/core/openapi/db_data/model/update_request.py index cfa9f3442..bd937ebdd 100644 --- a/pinecone/core/openapi/db_data/model/update_request.py +++ b/pinecone/core/openapi/db_data/model/update_request.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_data/model/upsert_record.py b/pinecone/core/openapi/db_data/model/upsert_record.py index b95940ebe..8ae7a048b 100644 --- a/pinecone/core/openapi/db_data/model/upsert_record.py +++ b/pinecone/core/openapi/db_data/model/upsert_record.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_data/model/upsert_request.py b/pinecone/core/openapi/db_data/model/upsert_request.py index c842647a0..19058a3bb 100644 --- a/pinecone/core/openapi/db_data/model/upsert_request.py +++ b/pinecone/core/openapi/db_data/model/upsert_request.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_data/model/upsert_response.py b/pinecone/core/openapi/db_data/model/upsert_response.py index 2ba3056de..e4da7d30f 100644 --- a/pinecone/core/openapi/db_data/model/upsert_response.py +++ b/pinecone/core/openapi/db_data/model/upsert_response.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_data/model/usage.py b/pinecone/core/openapi/db_data/model/usage.py index 7ddc0c28d..a8ab222f1 100644 --- a/pinecone/core/openapi/db_data/model/usage.py +++ b/pinecone/core/openapi/db_data/model/usage.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_data/model/vector.py b/pinecone/core/openapi/db_data/model/vector.py index 167806f90..de061b7d6 100644 --- a/pinecone/core/openapi/db_data/model/vector.py +++ b/pinecone/core/openapi/db_data/model/vector.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_data/model/vector_values.py b/pinecone/core/openapi/db_data/model/vector_values.py index 7777cdc54..acaade886 100644 --- a/pinecone/core/openapi/db_data/model/vector_values.py +++ b/pinecone/core/openapi/db_data/model/vector_values.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/inference/__init__.py b/pinecone/core/openapi/inference/__init__.py index 3e258e4fe..d878080c6 100644 --- a/pinecone/core/openapi/inference/__init__.py +++ b/pinecone/core/openapi/inference/__init__.py @@ -7,7 +7,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ @@ -27,4 +27,4 @@ from pinecone.openapi_support.exceptions import PineconeApiKeyError from pinecone.openapi_support.exceptions import PineconeApiException -API_VERSION = "2025-01" +API_VERSION = "2025-04" diff --git a/pinecone/core/openapi/inference/api/inference_api.py b/pinecone/core/openapi/inference/api/inference_api.py index 1dc0e266d..6a425a03e 100644 --- a/pinecone/core/openapi/inference/api/inference_api.py +++ b/pinecone/core/openapi/inference/api/inference_api.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ @@ -42,9 +42,9 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client def __embed(self, **kwargs: ExtraOpenApiKwargsTypedDict): - """Embed data # noqa: E501 + """Generate vectors # noqa: E501 - Generate embeddings for input data. For guidance and examples, see [Generate embeddings](https://docs.pinecone.io/guides/inference/generate-embeddings). # noqa: E501 + Generate vector embeddings for input data. This endpoint uses [Pinecone Inference](https://docs.pinecone.io/guides/inference/understanding-inference). For guidance and examples, see [Embed data](https://docs.pinecone.io/guides/inference/generate-embeddings). # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True @@ -188,9 +188,9 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client async def __embed(self, **kwargs): - """Embed data # noqa: E501 + """Generate vectors # noqa: E501 - Generate embeddings for input data. For guidance and examples, see [Generate embeddings](https://docs.pinecone.io/guides/inference/generate-embeddings). # noqa: E501 + Generate vector embeddings for input data. This endpoint uses [Pinecone Inference](https://docs.pinecone.io/guides/inference/understanding-inference). For guidance and examples, see [Embed data](https://docs.pinecone.io/guides/inference/generate-embeddings). # noqa: E501 diff --git a/pinecone/core/openapi/inference/model/dense_embedding.py b/pinecone/core/openapi/inference/model/dense_embedding.py index fe841f99c..ec45c7bd3 100644 --- a/pinecone/core/openapi/inference/model/dense_embedding.py +++ b/pinecone/core/openapi/inference/model/dense_embedding.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/inference/model/document.py b/pinecone/core/openapi/inference/model/document.py index 159969aa3..99b881616 100644 --- a/pinecone/core/openapi/inference/model/document.py +++ b/pinecone/core/openapi/inference/model/document.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/inference/model/embed_request.py b/pinecone/core/openapi/inference/model/embed_request.py index 6f91a05a6..58e312908 100644 --- a/pinecone/core/openapi/inference/model/embed_request.py +++ b/pinecone/core/openapi/inference/model/embed_request.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/inference/model/embed_request_inputs.py b/pinecone/core/openapi/inference/model/embed_request_inputs.py index 44832a2e0..1eda05b06 100644 --- a/pinecone/core/openapi/inference/model/embed_request_inputs.py +++ b/pinecone/core/openapi/inference/model/embed_request_inputs.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/inference/model/embedding.py b/pinecone/core/openapi/inference/model/embedding.py index a7150a27c..72fd9b2d0 100644 --- a/pinecone/core/openapi/inference/model/embedding.py +++ b/pinecone/core/openapi/inference/model/embedding.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/inference/model/embeddings_list.py b/pinecone/core/openapi/inference/model/embeddings_list.py index 0b7de1ef5..2c4a4edb4 100644 --- a/pinecone/core/openapi/inference/model/embeddings_list.py +++ b/pinecone/core/openapi/inference/model/embeddings_list.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/inference/model/embeddings_list_usage.py b/pinecone/core/openapi/inference/model/embeddings_list_usage.py index 95e3263e6..ebfb2ce68 100644 --- a/pinecone/core/openapi/inference/model/embeddings_list_usage.py +++ b/pinecone/core/openapi/inference/model/embeddings_list_usage.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/inference/model/error_response.py b/pinecone/core/openapi/inference/model/error_response.py index ce18d3628..e08f84495 100644 --- a/pinecone/core/openapi/inference/model/error_response.py +++ b/pinecone/core/openapi/inference/model/error_response.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/inference/model/error_response_error.py b/pinecone/core/openapi/inference/model/error_response_error.py index e68848256..b864fab67 100644 --- a/pinecone/core/openapi/inference/model/error_response_error.py +++ b/pinecone/core/openapi/inference/model/error_response_error.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/inference/model/ranked_document.py b/pinecone/core/openapi/inference/model/ranked_document.py index 6223c752b..be8699dcf 100644 --- a/pinecone/core/openapi/inference/model/ranked_document.py +++ b/pinecone/core/openapi/inference/model/ranked_document.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/inference/model/rerank_request.py b/pinecone/core/openapi/inference/model/rerank_request.py index dea9ee3c9..5727a4f7c 100644 --- a/pinecone/core/openapi/inference/model/rerank_request.py +++ b/pinecone/core/openapi/inference/model/rerank_request.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/inference/model/rerank_result.py b/pinecone/core/openapi/inference/model/rerank_result.py index 2abeb4825..ee9e6fa6a 100644 --- a/pinecone/core/openapi/inference/model/rerank_result.py +++ b/pinecone/core/openapi/inference/model/rerank_result.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/inference/model/rerank_result_usage.py b/pinecone/core/openapi/inference/model/rerank_result_usage.py index 44f45c33f..ad24c7a76 100644 --- a/pinecone/core/openapi/inference/model/rerank_result_usage.py +++ b/pinecone/core/openapi/inference/model/rerank_result_usage.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/inference/model/sparse_embedding.py b/pinecone/core/openapi/inference/model/sparse_embedding.py index f4f974150..f3b34b533 100644 --- a/pinecone/core/openapi/inference/model/sparse_embedding.py +++ b/pinecone/core/openapi/inference/model/sparse_embedding.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/inference/model/vector_type.py b/pinecone/core/openapi/inference/model/vector_type.py index ffeb8706d..3985d0434 100644 --- a/pinecone/core/openapi/inference/model/vector_type.py +++ b/pinecone/core/openapi/inference/model/vector_type.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-01 +The version of the OpenAPI document: 2025-04 Contact: support@pinecone.io """ diff --git a/pinecone/openapi_support/api_version.py b/pinecone/openapi_support/api_version.py index fef29cbbd..8d89024c1 100644 --- a/pinecone/openapi_support/api_version.py +++ b/pinecone/openapi_support/api_version.py @@ -1,5 +1,5 @@ # This file is generated by codegen/build-oas.sh # Do not edit this file manually. -API_VERSION = "2025-01" -APIS_REPO_SHA = "eb79d8ea0c146aebe36c3769e19cbe9618db2d54" +API_VERSION = "2025-04" +APIS_REPO_SHA = "bec62979f009fe5dd3761943896a094dc7fffc4f" From 231f8c4f47563fdae6183ad09febb3980999f5bc Mon Sep 17 00:00:00 2001 From: Jen Hamon Date: Fri, 7 Mar 2025 10:09:47 -0500 Subject: [PATCH 2/3] Regen --- pinecone/openapi_support/api_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pinecone/openapi_support/api_version.py b/pinecone/openapi_support/api_version.py index 8d89024c1..4879ae90a 100644 --- a/pinecone/openapi_support/api_version.py +++ b/pinecone/openapi_support/api_version.py @@ -2,4 +2,4 @@ # Do not edit this file manually. API_VERSION = "2025-04" -APIS_REPO_SHA = "bec62979f009fe5dd3761943896a094dc7fffc4f" +APIS_REPO_SHA = "483b3885439a51ef831b820bfa621e2c9515834f" From 87020c9760f1160c5f3a5e0a82b1fc4613229a20 Mon Sep 17 00:00:00 2001 From: Jen Hamon Date: Fri, 14 Mar 2025 10:13:51 -0400 Subject: [PATCH 3/3] Regen --- codegen/apis | 2 +- .../db_control/api/manage_indexes_api.py | 1362 +++++++++++++++-- .../openapi/db_control/model/backup_list.py | 274 ++++ .../openapi/db_control/model/backup_model.py | 356 +++++ .../db_control/model/create_backup_request.py | 266 ++++ .../model/create_index_from_backup_request.py | 286 ++++ .../db_control/model/dedicated_spec.py | 266 ++++ .../db_control/model/index_model_spec.py | 6 + .../openapi/db_control/model/index_spec.py | 6 + .../db_control/model/pagination_response.py | 266 ++++ .../db_control/model/restore_job_list.py | 280 ++++ .../db_control/model/restore_job_model.py | 326 ++++ .../openapi/db_control/models/__init__.py | 10 + .../openapi/inference/api/inference_api.py | 268 ++++ .../openapi/inference/model/model_info.py | 333 ++++ .../inference/model/model_info_list.py | 268 ++++ .../inference/model/model_info_metric.py | 284 ++++ .../model/model_info_supported_metrics.py | 290 ++++ .../model/model_info_supported_parameter.py | 302 ++++ .../core/openapi/inference/models/__init__.py | 9 + 20 files changed, 5323 insertions(+), 137 deletions(-) create mode 100644 pinecone/core/openapi/db_control/model/backup_list.py create mode 100644 pinecone/core/openapi/db_control/model/backup_model.py create mode 100644 pinecone/core/openapi/db_control/model/create_backup_request.py create mode 100644 pinecone/core/openapi/db_control/model/create_index_from_backup_request.py create mode 100644 pinecone/core/openapi/db_control/model/dedicated_spec.py create mode 100644 pinecone/core/openapi/db_control/model/pagination_response.py create mode 100644 pinecone/core/openapi/db_control/model/restore_job_list.py create mode 100644 pinecone/core/openapi/db_control/model/restore_job_model.py create mode 100644 pinecone/core/openapi/inference/model/model_info.py create mode 100644 pinecone/core/openapi/inference/model/model_info_list.py create mode 100644 pinecone/core/openapi/inference/model/model_info_metric.py create mode 100644 pinecone/core/openapi/inference/model/model_info_supported_metrics.py create mode 100644 pinecone/core/openapi/inference/model/model_info_supported_parameter.py diff --git a/codegen/apis b/codegen/apis index 483b38854..ba143abc7 160000 --- a/codegen/apis +++ b/codegen/apis @@ -1 +1 @@ -Subproject commit 483b3885439a51ef831b820bfa621e2c9515834f +Subproject commit ba143abc7449abfcf0b6635f1aabff2400dac762 diff --git a/pinecone/core/openapi/db_control/api/manage_indexes_api.py b/pinecone/core/openapi/db_control/api/manage_indexes_api.py index b347be5d6..3796fd264 100644 --- a/pinecone/core/openapi/db_control/api/manage_indexes_api.py +++ b/pinecone/core/openapi/db_control/api/manage_indexes_api.py @@ -23,17 +23,25 @@ none_type, validate_and_convert_types, ) +from pinecone.core.openapi.db_control.model.backup_list import BackupList +from pinecone.core.openapi.db_control.model.backup_model import BackupModel from pinecone.core.openapi.db_control.model.collection_list import CollectionList from pinecone.core.openapi.db_control.model.collection_model import CollectionModel from pinecone.core.openapi.db_control.model.configure_index_request import ConfigureIndexRequest +from pinecone.core.openapi.db_control.model.create_backup_request import CreateBackupRequest from pinecone.core.openapi.db_control.model.create_collection_request import CreateCollectionRequest from pinecone.core.openapi.db_control.model.create_index_for_model_request import ( CreateIndexForModelRequest, ) +from pinecone.core.openapi.db_control.model.create_index_from_backup_request import ( + CreateIndexFromBackupRequest, +) from pinecone.core.openapi.db_control.model.create_index_request import CreateIndexRequest from pinecone.core.openapi.db_control.model.error_response import ErrorResponse from pinecone.core.openapi.db_control.model.index_list import IndexList from pinecone.core.openapi.db_control.model.index_model import IndexModel +from pinecone.core.openapi.db_control.model.restore_job_list import RestoreJobList +from pinecone.core.openapi.db_control.model.restore_job_model import RestoreJobModel class ManageIndexesApi: @@ -123,6 +131,82 @@ def __configure_index( callable=__configure_index, ) + def __create_backup( + self, index_name, create_backup_request, **kwargs: ExtraOpenApiKwargsTypedDict + ): + """Create a backup of an index # noqa: E501 + + Create a backup of an index. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.create_backup(index_name, create_backup_request, async_req=True) + >>> result = thread.get() + + Args: + index_name (str): Name of the index to backup + create_backup_request (CreateBackupRequest): The desired configuration for the backup. + + Keyword Args: + _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 + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + async_req (bool): execute request asynchronously + + Returns: + BackupModel + If the method is called asynchronously, returns the request + thread. + """ + kwargs = self._process_openapi_kwargs(kwargs) + kwargs["index_name"] = index_name + kwargs["create_backup_request"] = create_backup_request + return self.call_with_http_info(**kwargs) + + self.create_backup = _Endpoint( + settings={ + "response_type": (BackupModel,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/indexes/{index_name}/backups", + "operation_id": "create_backup", + "http_method": "POST", + "servers": None, + }, + params_map={ + "all": ["index_name", "create_backup_request"], + "required": ["index_name", "create_backup_request"], + "nullable": [], + "enum": [], + "validation": [], + }, + root_map={ + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "index_name": (str,), + "create_backup_request": (CreateBackupRequest,), + }, + "attribute_map": {"index_name": "index_name"}, + "location_map": {"index_name": "path", "create_backup_request": "body"}, + "collection_format_map": {}, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + callable=__create_backup, + ) + def __create_collection( self, create_collection_request, **kwargs: ExtraOpenApiKwargsTypedDict ): @@ -334,18 +418,21 @@ def __create_index_for_model( callable=__create_index_for_model, ) - def __delete_collection(self, collection_name, **kwargs: ExtraOpenApiKwargsTypedDict): - """Delete a collection # noqa: E501 + def __create_index_from_backup( + self, backup_id, create_index_from_backup_request, **kwargs: ExtraOpenApiKwargsTypedDict + ): + """Create an index from a backup # noqa: E501 - Delete an existing collection. Serverless indexes do not support collections. # noqa: E501 + Create an index from a backup. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_collection(collection_name, async_req=True) + >>> thread = api.create_index_from_backup(backup_id, create_index_from_backup_request, async_req=True) >>> result = thread.get() Args: - collection_name (str): The name of the collection. + backup_id (str): The ID of the backup to create an index from. + create_index_from_backup_request (CreateIndexFromBackupRequest): The desired configuration for the index created from a backup. Keyword Args: _return_http_data_only (bool): response data without head status @@ -371,21 +458,22 @@ def __delete_collection(self, collection_name, **kwargs: ExtraOpenApiKwargsTyped thread. """ kwargs = self._process_openapi_kwargs(kwargs) - kwargs["collection_name"] = collection_name + kwargs["backup_id"] = backup_id + kwargs["create_index_from_backup_request"] = create_index_from_backup_request return self.call_with_http_info(**kwargs) - self.delete_collection = _Endpoint( + self.create_index_from_backup = _Endpoint( settings={ "response_type": None, "auth": ["ApiKeyAuth"], - "endpoint_path": "/collections/{collection_name}", - "operation_id": "delete_collection", - "http_method": "DELETE", + "endpoint_path": "/backups/{backup_id}/create-index", + "operation_id": "create_index_from_backup", + "http_method": "POST", "servers": None, }, params_map={ - "all": ["collection_name"], - "required": ["collection_name"], + "all": ["backup_id", "create_index_from_backup_request"], + "required": ["backup_id", "create_index_from_backup_request"], "nullable": [], "enum": [], "validation": [], @@ -393,28 +481,31 @@ def __delete_collection(self, collection_name, **kwargs: ExtraOpenApiKwargsTyped root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"collection_name": (str,)}, - "attribute_map": {"collection_name": "collection_name"}, - "location_map": {"collection_name": "path"}, + "openapi_types": { + "backup_id": (str,), + "create_index_from_backup_request": (CreateIndexFromBackupRequest,), + }, + "attribute_map": {"backup_id": "backup_id"}, + "location_map": {"backup_id": "path", "create_index_from_backup_request": "body"}, "collection_format_map": {}, }, - headers_map={"accept": ["application/json"], "content_type": []}, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__delete_collection, + callable=__create_index_from_backup, ) - def __delete_index(self, index_name, **kwargs: ExtraOpenApiKwargsTypedDict): - """Delete an index # noqa: E501 + def __delete_backup(self, backup_id, **kwargs: ExtraOpenApiKwargsTypedDict): + """Delete a backup # noqa: E501 - Delete an existing index. # noqa: E501 + Delete a backup. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_index(index_name, async_req=True) + >>> thread = api.delete_backup(backup_id, async_req=True) >>> result = thread.get() Args: - index_name (str): The name of the index to delete. + backup_id (str): The ID of the backup to delete. Keyword Args: _return_http_data_only (bool): response data without head status @@ -440,21 +531,21 @@ def __delete_index(self, index_name, **kwargs: ExtraOpenApiKwargsTypedDict): thread. """ kwargs = self._process_openapi_kwargs(kwargs) - kwargs["index_name"] = index_name + kwargs["backup_id"] = backup_id return self.call_with_http_info(**kwargs) - self.delete_index = _Endpoint( + self.delete_backup = _Endpoint( settings={ "response_type": None, "auth": ["ApiKeyAuth"], - "endpoint_path": "/indexes/{index_name}", - "operation_id": "delete_index", + "endpoint_path": "/backups/{backup_id}", + "operation_id": "delete_backup", "http_method": "DELETE", "servers": None, }, params_map={ - "all": ["index_name"], - "required": ["index_name"], + "all": ["backup_id"], + "required": ["backup_id"], "nullable": [], "enum": [], "validation": [], @@ -462,28 +553,28 @@ def __delete_index(self, index_name, **kwargs: ExtraOpenApiKwargsTypedDict): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"index_name": (str,)}, - "attribute_map": {"index_name": "index_name"}, - "location_map": {"index_name": "path"}, + "openapi_types": {"backup_id": (str,)}, + "attribute_map": {"backup_id": "backup_id"}, + "location_map": {"backup_id": "path"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__delete_index, + callable=__delete_backup, ) - def __describe_collection(self, collection_name, **kwargs: ExtraOpenApiKwargsTypedDict): - """Describe a collection # noqa: E501 + def __delete_collection(self, collection_name, **kwargs: ExtraOpenApiKwargsTypedDict): + """Delete a collection # noqa: E501 - Get a description of a collection. Serverless indexes do not support collections. # noqa: E501 + Delete an existing collection. Serverless indexes do not support collections. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.describe_collection(collection_name, async_req=True) + >>> thread = api.delete_collection(collection_name, async_req=True) >>> result = thread.get() Args: - collection_name (str): The name of the collection to be described. + collection_name (str): The name of the collection. Keyword Args: _return_http_data_only (bool): response data without head status @@ -504,7 +595,7 @@ def __describe_collection(self, collection_name, **kwargs: ExtraOpenApiKwargsTyp async_req (bool): execute request asynchronously Returns: - CollectionModel + None If the method is called asynchronously, returns the request thread. """ @@ -512,13 +603,13 @@ def __describe_collection(self, collection_name, **kwargs: ExtraOpenApiKwargsTyp kwargs["collection_name"] = collection_name return self.call_with_http_info(**kwargs) - self.describe_collection = _Endpoint( + self.delete_collection = _Endpoint( settings={ - "response_type": (CollectionModel,), + "response_type": None, "auth": ["ApiKeyAuth"], "endpoint_path": "/collections/{collection_name}", - "operation_id": "describe_collection", - "http_method": "GET", + "operation_id": "delete_collection", + "http_method": "DELETE", "servers": None, }, params_map={ @@ -538,21 +629,21 @@ def __describe_collection(self, collection_name, **kwargs: ExtraOpenApiKwargsTyp }, headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__describe_collection, + callable=__delete_collection, ) - def __describe_index(self, index_name, **kwargs: ExtraOpenApiKwargsTypedDict): - """Describe an index # noqa: E501 + def __delete_index(self, index_name, **kwargs: ExtraOpenApiKwargsTypedDict): + """Delete an index # noqa: E501 - Get a description of an index. # noqa: E501 + Delete an existing index. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.describe_index(index_name, async_req=True) + >>> thread = api.delete_index(index_name, async_req=True) >>> result = thread.get() Args: - index_name (str): The name of the index to be described. + index_name (str): The name of the index to delete. Keyword Args: _return_http_data_only (bool): response data without head status @@ -573,7 +664,7 @@ def __describe_index(self, index_name, **kwargs: ExtraOpenApiKwargsTypedDict): async_req (bool): execute request asynchronously Returns: - IndexModel + None If the method is called asynchronously, returns the request thread. """ @@ -581,13 +672,13 @@ def __describe_index(self, index_name, **kwargs: ExtraOpenApiKwargsTypedDict): kwargs["index_name"] = index_name return self.call_with_http_info(**kwargs) - self.describe_index = _Endpoint( + self.delete_index = _Endpoint( settings={ - "response_type": (IndexModel,), + "response_type": None, "auth": ["ApiKeyAuth"], "endpoint_path": "/indexes/{index_name}", - "operation_id": "describe_index", - "http_method": "GET", + "operation_id": "delete_index", + "http_method": "DELETE", "servers": None, }, params_map={ @@ -607,19 +698,21 @@ def __describe_index(self, index_name, **kwargs: ExtraOpenApiKwargsTypedDict): }, headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__describe_index, + callable=__delete_index, ) - def __list_collections(self, **kwargs: ExtraOpenApiKwargsTypedDict): - """List collections # noqa: E501 + def __describe_backup(self, backup_id, **kwargs: ExtraOpenApiKwargsTypedDict): + """Describe a backup # noqa: E501 - List all collections in a project. Serverless indexes do not support collections. # noqa: E501 + Get a description of a backup. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_collections(async_req=True) + >>> thread = api.describe_backup(backup_id, async_req=True) >>> result = thread.get() + Args: + backup_id (str): The ID of the backup to describe. Keyword Args: _return_http_data_only (bool): response data without head status @@ -640,46 +733,55 @@ def __list_collections(self, **kwargs: ExtraOpenApiKwargsTypedDict): async_req (bool): execute request asynchronously Returns: - CollectionList + BackupModel If the method is called asynchronously, returns the request thread. """ kwargs = self._process_openapi_kwargs(kwargs) + kwargs["backup_id"] = backup_id return self.call_with_http_info(**kwargs) - self.list_collections = _Endpoint( + self.describe_backup = _Endpoint( settings={ - "response_type": (CollectionList,), + "response_type": (BackupModel,), "auth": ["ApiKeyAuth"], - "endpoint_path": "/collections", - "operation_id": "list_collections", + "endpoint_path": "/backups/{backup_id}", + "operation_id": "describe_backup", "http_method": "GET", "servers": None, }, - params_map={"all": [], "required": [], "nullable": [], "enum": [], "validation": []}, + params_map={ + "all": ["backup_id"], + "required": ["backup_id"], + "nullable": [], + "enum": [], + "validation": [], + }, root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {}, - "attribute_map": {}, - "location_map": {}, + "openapi_types": {"backup_id": (str,)}, + "attribute_map": {"backup_id": "backup_id"}, + "location_map": {"backup_id": "path"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__list_collections, + callable=__describe_backup, ) - def __list_indexes(self, **kwargs: ExtraOpenApiKwargsTypedDict): - """List indexes # noqa: E501 + def __describe_collection(self, collection_name, **kwargs: ExtraOpenApiKwargsTypedDict): + """Describe a collection # noqa: E501 - List all indexes in a project. # noqa: E501 + Get a description of a collection. Serverless indexes do not support collections. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_indexes(async_req=True) + >>> thread = api.describe_collection(collection_name, async_req=True) >>> result = thread.get() + Args: + collection_name (str): The name of the collection to be described. Keyword Args: _return_http_data_only (bool): response data without head status @@ -700,57 +802,55 @@ def __list_indexes(self, **kwargs: ExtraOpenApiKwargsTypedDict): async_req (bool): execute request asynchronously Returns: - IndexList + CollectionModel If the method is called asynchronously, returns the request thread. """ kwargs = self._process_openapi_kwargs(kwargs) + kwargs["collection_name"] = collection_name return self.call_with_http_info(**kwargs) - self.list_indexes = _Endpoint( + self.describe_collection = _Endpoint( settings={ - "response_type": (IndexList,), + "response_type": (CollectionModel,), "auth": ["ApiKeyAuth"], - "endpoint_path": "/indexes", - "operation_id": "list_indexes", + "endpoint_path": "/collections/{collection_name}", + "operation_id": "describe_collection", "http_method": "GET", "servers": None, }, - params_map={"all": [], "required": [], "nullable": [], "enum": [], "validation": []}, + params_map={ + "all": ["collection_name"], + "required": ["collection_name"], + "nullable": [], + "enum": [], + "validation": [], + }, root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {}, - "attribute_map": {}, - "location_map": {}, + "openapi_types": {"collection_name": (str,)}, + "attribute_map": {"collection_name": "collection_name"}, + "location_map": {"collection_name": "path"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__list_indexes, + callable=__describe_collection, ) + def __describe_index(self, index_name, **kwargs: ExtraOpenApiKwargsTypedDict): + """Describe an index # noqa: E501 -class AsyncioManageIndexesApi: - """NOTE: This class is @generated using OpenAPI - - Do not edit the class manually. - """ - - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = AsyncioApiClient() - self.api_client = api_client - - async def __configure_index(self, index_name, configure_index_request, **kwargs): - """Configure an index # noqa: E501 - - Configure an existing index. For serverless indexes, you can configure index deletion protection, tags, and integrated inference embedding settings for the index. For pod-based indexes, you can configure the pod size, number of replicas, tags, and index deletion protection. It is not possible to change the pod type of a pod-based index. However, you can create a collection from a pod-based index and then [create a new pod-based index with a different pod type](http://docs.pinecone.io/guides/indexes/pods/create-a-pod-based-index#create-a-pod-index-from-a-collection) from the collection. For guidance and examples, see [Configure an index](http://docs.pinecone.io/guides/indexes/pods/manage-pod-based-indexes). # noqa: E501 + Get a description of an index. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.describe_index(index_name, async_req=True) + >>> result = thread.get() Args: - index_name (str): The name of the index to configure. - configure_index_request (ConfigureIndexRequest): The desired pod size and replica configuration for the index. + index_name (str): The name of the index to be described. Keyword Args: _return_http_data_only (bool): response data without head status @@ -768,27 +868,29 @@ async def __configure_index(self, index_name, configure_index_request, **kwargs) _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + async_req (bool): execute request asynchronously Returns: IndexModel + If the method is called asynchronously, returns the request + thread. """ - self._process_openapi_kwargs(kwargs) + kwargs = self._process_openapi_kwargs(kwargs) kwargs["index_name"] = index_name - kwargs["configure_index_request"] = configure_index_request - return await self.call_with_http_info(**kwargs) + return self.call_with_http_info(**kwargs) - self.configure_index = _AsyncioEndpoint( + self.describe_index = _Endpoint( settings={ "response_type": (IndexModel,), "auth": ["ApiKeyAuth"], "endpoint_path": "/indexes/{index_name}", - "operation_id": "configure_index", - "http_method": "PATCH", + "operation_id": "describe_index", + "http_method": "GET", "servers": None, }, params_map={ - "all": ["index_name", "configure_index_request"], - "required": ["index_name", "configure_index_request"], + "all": ["index_name"], + "required": ["index_name"], "nullable": [], "enum": [], "validation": [], @@ -796,23 +898,566 @@ async def __configure_index(self, index_name, configure_index_request, **kwargs) root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": { - "index_name": (str,), - "configure_index_request": (ConfigureIndexRequest,), - }, + "openapi_types": {"index_name": (str,)}, "attribute_map": {"index_name": "index_name"}, - "location_map": {"index_name": "path", "configure_index_request": "body"}, + "location_map": {"index_name": "path"}, "collection_format_map": {}, }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__configure_index, + callable=__describe_index, ) - async def __create_collection(self, create_collection_request, **kwargs): - """Create a collection # noqa: E501 + def __describe_restore_job(self, job_id, **kwargs: ExtraOpenApiKwargsTypedDict): + """Describe a restore job # noqa: E501 - Create a Pinecone collection. Serverless indexes do not support collections. # noqa: E501 + Get a description of a restore job. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.describe_restore_job(job_id, async_req=True) + >>> result = thread.get() + + Args: + job_id (str): The ID of the restore job to describe. + + Keyword Args: + _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 + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + async_req (bool): execute request asynchronously + + Returns: + RestoreJobModel + If the method is called asynchronously, returns the request + thread. + """ + kwargs = self._process_openapi_kwargs(kwargs) + kwargs["job_id"] = job_id + return self.call_with_http_info(**kwargs) + + self.describe_restore_job = _Endpoint( + settings={ + "response_type": (RestoreJobModel,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/restore-jobs/{job_id}", + "operation_id": "describe_restore_job", + "http_method": "GET", + "servers": None, + }, + params_map={ + "all": ["job_id"], + "required": ["job_id"], + "nullable": [], + "enum": [], + "validation": [], + }, + root_map={ + "validations": {}, + "allowed_values": {}, + "openapi_types": {"job_id": (str,)}, + "attribute_map": {"job_id": "job_id"}, + "location_map": {"job_id": "path"}, + "collection_format_map": {}, + }, + headers_map={"accept": ["application/json"], "content_type": []}, + api_client=api_client, + callable=__describe_restore_job, + ) + + def __list_collections(self, **kwargs: ExtraOpenApiKwargsTypedDict): + """List collections # noqa: E501 + + List all collections in a project. Serverless indexes do not support collections. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_collections(async_req=True) + >>> result = thread.get() + + + Keyword Args: + _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 + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + async_req (bool): execute request asynchronously + + Returns: + CollectionList + If the method is called asynchronously, returns the request + thread. + """ + kwargs = self._process_openapi_kwargs(kwargs) + return self.call_with_http_info(**kwargs) + + self.list_collections = _Endpoint( + settings={ + "response_type": (CollectionList,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/collections", + "operation_id": "list_collections", + "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": {}, + }, + headers_map={"accept": ["application/json"], "content_type": []}, + api_client=api_client, + callable=__list_collections, + ) + + def __list_index_backups(self, index_name, **kwargs: ExtraOpenApiKwargsTypedDict): + """List backups for an index # noqa: E501 + + List all backups 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 + + >>> thread = api.list_index_backups(index_name, async_req=True) + >>> result = thread.get() + + Args: + index_name (str): Name of the backed up index + + Keyword Args: + limit (int): The number of results to return per page. [optional] if omitted the server will use the default value of 10. + pagination_token (str): The token to use to retrieve the next page of results. [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 + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + async_req (bool): execute request asynchronously + + Returns: + BackupList + If the method is called asynchronously, returns the request + thread. + """ + kwargs = self._process_openapi_kwargs(kwargs) + kwargs["index_name"] = index_name + return self.call_with_http_info(**kwargs) + + self.list_index_backups = _Endpoint( + settings={ + "response_type": (BackupList,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/indexes/{index_name}/backups", + "operation_id": "list_index_backups", + "http_method": "GET", + "servers": None, + }, + params_map={ + "all": ["index_name", "limit", "pagination_token"], + "required": ["index_name"], + "nullable": [], + "enum": [], + "validation": ["limit"], + }, + root_map={ + "validations": {("limit",): {"inclusive_maximum": 100, "inclusive_minimum": 1}}, + "allowed_values": {}, + "openapi_types": { + "index_name": (str,), + "limit": (int,), + "pagination_token": (str,), + }, + "attribute_map": { + "index_name": "index_name", + "limit": "limit", + "pagination_token": "paginationToken", + }, + "location_map": { + "index_name": "path", + "limit": "query", + "pagination_token": "query", + }, + "collection_format_map": {}, + }, + headers_map={"accept": ["application/json"], "content_type": []}, + api_client=api_client, + callable=__list_index_backups, + ) + + def __list_indexes(self, **kwargs: ExtraOpenApiKwargsTypedDict): + """List indexes # noqa: E501 + + List all indexes in a project. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_indexes(async_req=True) + >>> result = thread.get() + + + Keyword Args: + _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 + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + async_req (bool): execute request asynchronously + + Returns: + IndexList + If the method is called asynchronously, returns the request + thread. + """ + kwargs = self._process_openapi_kwargs(kwargs) + return self.call_with_http_info(**kwargs) + + self.list_indexes = _Endpoint( + settings={ + "response_type": (IndexList,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/indexes", + "operation_id": "list_indexes", + "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": {}, + }, + headers_map={"accept": ["application/json"], "content_type": []}, + api_client=api_client, + callable=__list_indexes, + ) + + def __list_project_backups(self, **kwargs: ExtraOpenApiKwargsTypedDict): + """List backups for all indexes in a project # noqa: E501 + + List all backups for a project. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_project_backups(async_req=True) + >>> result = thread.get() + + + Keyword Args: + _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 + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + async_req (bool): execute request asynchronously + + Returns: + BackupList + If the method is called asynchronously, returns the request + thread. + """ + kwargs = self._process_openapi_kwargs(kwargs) + return self.call_with_http_info(**kwargs) + + self.list_project_backups = _Endpoint( + settings={ + "response_type": (BackupList,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/backups", + "operation_id": "list_project_backups", + "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": {}, + }, + headers_map={"accept": ["application/json"], "content_type": []}, + api_client=api_client, + callable=__list_project_backups, + ) + + def __list_restore_jobs(self, **kwargs: ExtraOpenApiKwargsTypedDict): + """List restore jobs # noqa: E501 + + List all restore jobs for a project. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_restore_jobs(async_req=True) + >>> result = thread.get() + + + Keyword Args: + limit (int): The number of results to return per page. [optional] if omitted the server will use the default value of 10. + pagination_token (str): The token to use to retrieve the next page of results. [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 + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + async_req (bool): execute request asynchronously + + Returns: + RestoreJobList + If the method is called asynchronously, returns the request + thread. + """ + kwargs = self._process_openapi_kwargs(kwargs) + return self.call_with_http_info(**kwargs) + + self.list_restore_jobs = _Endpoint( + settings={ + "response_type": (RestoreJobList,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/restore-jobs", + "operation_id": "list_restore_jobs", + "http_method": "GET", + "servers": None, + }, + params_map={ + "all": ["limit", "pagination_token"], + "required": [], + "nullable": [], + "enum": [], + "validation": ["limit"], + }, + root_map={ + "validations": {("limit",): {"inclusive_maximum": 100, "inclusive_minimum": 1}}, + "allowed_values": {}, + "openapi_types": {"limit": (int,), "pagination_token": (str,)}, + "attribute_map": {"limit": "limit", "pagination_token": "paginationToken"}, + "location_map": {"limit": "query", "pagination_token": "query"}, + "collection_format_map": {}, + }, + headers_map={"accept": ["application/json"], "content_type": []}, + api_client=api_client, + callable=__list_restore_jobs, + ) + + +class AsyncioManageIndexesApi: + """NOTE: This class is @generated using OpenAPI + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = AsyncioApiClient() + self.api_client = api_client + + async def __configure_index(self, index_name, configure_index_request, **kwargs): + """Configure an index # noqa: E501 + + Configure an existing index. For serverless indexes, you can configure index deletion protection, tags, and integrated inference embedding settings for the index. For pod-based indexes, you can configure the pod size, number of replicas, tags, and index deletion protection. It is not possible to change the pod type of a pod-based index. However, you can create a collection from a pod-based index and then [create a new pod-based index with a different pod type](http://docs.pinecone.io/guides/indexes/pods/create-a-pod-based-index#create-a-pod-index-from-a-collection) from the collection. For guidance and examples, see [Configure an index](http://docs.pinecone.io/guides/indexes/pods/manage-pod-based-indexes). # noqa: E501 + + + Args: + index_name (str): The name of the index to configure. + configure_index_request (ConfigureIndexRequest): The desired pod size and replica configuration for the index. + + Keyword Args: + _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 + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + + Returns: + IndexModel + """ + self._process_openapi_kwargs(kwargs) + kwargs["index_name"] = index_name + kwargs["configure_index_request"] = configure_index_request + return await self.call_with_http_info(**kwargs) + + self.configure_index = _AsyncioEndpoint( + settings={ + "response_type": (IndexModel,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/indexes/{index_name}", + "operation_id": "configure_index", + "http_method": "PATCH", + "servers": None, + }, + params_map={ + "all": ["index_name", "configure_index_request"], + "required": ["index_name", "configure_index_request"], + "nullable": [], + "enum": [], + "validation": [], + }, + root_map={ + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "index_name": (str,), + "configure_index_request": (ConfigureIndexRequest,), + }, + "attribute_map": {"index_name": "index_name"}, + "location_map": {"index_name": "path", "configure_index_request": "body"}, + "collection_format_map": {}, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + callable=__configure_index, + ) + + async def __create_backup(self, index_name, create_backup_request, **kwargs): + """Create a backup of an index # noqa: E501 + + Create a backup of an index. # noqa: E501 + + + Args: + index_name (str): Name of the index to backup + create_backup_request (CreateBackupRequest): The desired configuration for the backup. + + Keyword Args: + _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 + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + + Returns: + BackupModel + """ + self._process_openapi_kwargs(kwargs) + kwargs["index_name"] = index_name + kwargs["create_backup_request"] = create_backup_request + return await self.call_with_http_info(**kwargs) + + self.create_backup = _AsyncioEndpoint( + settings={ + "response_type": (BackupModel,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/indexes/{index_name}/backups", + "operation_id": "create_backup", + "http_method": "POST", + "servers": None, + }, + params_map={ + "all": ["index_name", "create_backup_request"], + "required": ["index_name", "create_backup_request"], + "nullable": [], + "enum": [], + "validation": [], + }, + root_map={ + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "index_name": (str,), + "create_backup_request": (CreateBackupRequest,), + }, + "attribute_map": {"index_name": "index_name"}, + "location_map": {"index_name": "path", "create_backup_request": "body"}, + "collection_format_map": {}, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + callable=__create_backup, + ) + + async def __create_collection(self, create_collection_request, **kwargs): + """Create a collection # noqa: E501 + + Create a Pinecone collection. Serverless indexes do not support collections. # noqa: E501 Args: @@ -930,17 +1575,148 @@ async def __create_index(self, create_index_request, **kwargs): }, headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__create_index, + callable=__create_index, + ) + + async def __create_index_for_model(self, create_index_for_model_request, **kwargs): + """Create an index with integrated embedding # noqa: E501 + + Create an index with integrated embedding. With this type of index, you provide source text, and Pinecone uses a [hosted embedding model](https://docs.pinecone.io/guides/inference/understanding-inference#embedding-models) to convert the text automatically during [upsert](https://docs.pinecone.io/reference/api/2025-01/data-plane/upsert_records) and [search](https://docs.pinecone.io/reference/api/2025-01/data-plane/search_records). For guidance and examples, see [Create an index](https://docs.pinecone.io/guides/indexes/create-an-index#integrated-embedding). # noqa: E501 + + + Args: + create_index_for_model_request (CreateIndexForModelRequest): The desired configuration for the index and associated embedding model. + + Keyword Args: + _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 + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + + Returns: + IndexModel + """ + self._process_openapi_kwargs(kwargs) + kwargs["create_index_for_model_request"] = create_index_for_model_request + return await self.call_with_http_info(**kwargs) + + self.create_index_for_model = _AsyncioEndpoint( + settings={ + "response_type": (IndexModel,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/indexes/create-for-model", + "operation_id": "create_index_for_model", + "http_method": "POST", + "servers": None, + }, + params_map={ + "all": ["create_index_for_model_request"], + "required": ["create_index_for_model_request"], + "nullable": [], + "enum": [], + "validation": [], + }, + root_map={ + "validations": {}, + "allowed_values": {}, + "openapi_types": {"create_index_for_model_request": (CreateIndexForModelRequest,)}, + "attribute_map": {}, + "location_map": {"create_index_for_model_request": "body"}, + "collection_format_map": {}, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + callable=__create_index_for_model, + ) + + async def __create_index_from_backup( + self, backup_id, create_index_from_backup_request, **kwargs + ): + """Create an index from a backup # noqa: E501 + + Create an index from a backup. # noqa: E501 + + + Args: + backup_id (str): The ID of the backup to create an index from. + create_index_from_backup_request (CreateIndexFromBackupRequest): The desired configuration for the index created from a backup. + + Keyword Args: + _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 + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + + Returns: + None + """ + self._process_openapi_kwargs(kwargs) + kwargs["backup_id"] = backup_id + kwargs["create_index_from_backup_request"] = create_index_from_backup_request + return await self.call_with_http_info(**kwargs) + + self.create_index_from_backup = _AsyncioEndpoint( + settings={ + "response_type": None, + "auth": ["ApiKeyAuth"], + "endpoint_path": "/backups/{backup_id}/create-index", + "operation_id": "create_index_from_backup", + "http_method": "POST", + "servers": None, + }, + params_map={ + "all": ["backup_id", "create_index_from_backup_request"], + "required": ["backup_id", "create_index_from_backup_request"], + "nullable": [], + "enum": [], + "validation": [], + }, + root_map={ + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "backup_id": (str,), + "create_index_from_backup_request": (CreateIndexFromBackupRequest,), + }, + "attribute_map": {"backup_id": "backup_id"}, + "location_map": {"backup_id": "path", "create_index_from_backup_request": "body"}, + "collection_format_map": {}, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + callable=__create_index_from_backup, ) - async def __create_index_for_model(self, create_index_for_model_request, **kwargs): - """Create an index with integrated embedding # noqa: E501 + async def __delete_backup(self, backup_id, **kwargs): + """Delete a backup # noqa: E501 - Create an index with integrated embedding. With this type of index, you provide source text, and Pinecone uses a [hosted embedding model](https://docs.pinecone.io/guides/inference/understanding-inference#embedding-models) to convert the text automatically during [upsert](https://docs.pinecone.io/reference/api/2025-01/data-plane/upsert_records) and [search](https://docs.pinecone.io/reference/api/2025-01/data-plane/search_records). For guidance and examples, see [Create an index](https://docs.pinecone.io/guides/indexes/create-an-index#integrated-embedding). # noqa: E501 + Delete a backup. # noqa: E501 Args: - create_index_for_model_request (CreateIndexForModelRequest): The desired configuration for the index and associated embedding model. + backup_id (str): The ID of the backup to delete. Keyword Args: _return_http_data_only (bool): response data without head status @@ -960,24 +1736,24 @@ async def __create_index_for_model(self, create_index_for_model_request, **kwarg Default is True. Returns: - IndexModel + None """ self._process_openapi_kwargs(kwargs) - kwargs["create_index_for_model_request"] = create_index_for_model_request + kwargs["backup_id"] = backup_id return await self.call_with_http_info(**kwargs) - self.create_index_for_model = _AsyncioEndpoint( + self.delete_backup = _AsyncioEndpoint( settings={ - "response_type": (IndexModel,), + "response_type": None, "auth": ["ApiKeyAuth"], - "endpoint_path": "/indexes/create-for-model", - "operation_id": "create_index_for_model", - "http_method": "POST", + "endpoint_path": "/backups/{backup_id}", + "operation_id": "delete_backup", + "http_method": "DELETE", "servers": None, }, params_map={ - "all": ["create_index_for_model_request"], - "required": ["create_index_for_model_request"], + "all": ["backup_id"], + "required": ["backup_id"], "nullable": [], "enum": [], "validation": [], @@ -985,14 +1761,14 @@ async def __create_index_for_model(self, create_index_for_model_request, **kwarg root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"create_index_for_model_request": (CreateIndexForModelRequest,)}, - "attribute_map": {}, - "location_map": {"create_index_for_model_request": "body"}, + "openapi_types": {"backup_id": (str,)}, + "attribute_map": {"backup_id": "backup_id"}, + "location_map": {"backup_id": "path"}, "collection_format_map": {}, }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__create_index_for_model, + callable=__delete_backup, ) async def __delete_collection(self, collection_name, **kwargs): @@ -1119,6 +1895,68 @@ async def __delete_index(self, index_name, **kwargs): callable=__delete_index, ) + async def __describe_backup(self, backup_id, **kwargs): + """Describe a backup # noqa: E501 + + Get a description of a backup. # noqa: E501 + + + Args: + backup_id (str): The ID of the backup to describe. + + Keyword Args: + _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 + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + + Returns: + BackupModel + """ + self._process_openapi_kwargs(kwargs) + kwargs["backup_id"] = backup_id + return await self.call_with_http_info(**kwargs) + + self.describe_backup = _AsyncioEndpoint( + settings={ + "response_type": (BackupModel,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/backups/{backup_id}", + "operation_id": "describe_backup", + "http_method": "GET", + "servers": None, + }, + params_map={ + "all": ["backup_id"], + "required": ["backup_id"], + "nullable": [], + "enum": [], + "validation": [], + }, + root_map={ + "validations": {}, + "allowed_values": {}, + "openapi_types": {"backup_id": (str,)}, + "attribute_map": {"backup_id": "backup_id"}, + "location_map": {"backup_id": "path"}, + "collection_format_map": {}, + }, + headers_map={"accept": ["application/json"], "content_type": []}, + api_client=api_client, + callable=__describe_backup, + ) + async def __describe_collection(self, collection_name, **kwargs): """Describe a collection # noqa: E501 @@ -1243,6 +2081,68 @@ async def __describe_index(self, index_name, **kwargs): callable=__describe_index, ) + async def __describe_restore_job(self, job_id, **kwargs): + """Describe a restore job # noqa: E501 + + Get a description of a restore job. # noqa: E501 + + + Args: + job_id (str): The ID of the restore job to describe. + + Keyword Args: + _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 + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + + Returns: + RestoreJobModel + """ + self._process_openapi_kwargs(kwargs) + kwargs["job_id"] = job_id + return await self.call_with_http_info(**kwargs) + + self.describe_restore_job = _AsyncioEndpoint( + settings={ + "response_type": (RestoreJobModel,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/restore-jobs/{job_id}", + "operation_id": "describe_restore_job", + "http_method": "GET", + "servers": None, + }, + params_map={ + "all": ["job_id"], + "required": ["job_id"], + "nullable": [], + "enum": [], + "validation": [], + }, + root_map={ + "validations": {}, + "allowed_values": {}, + "openapi_types": {"job_id": (str,)}, + "attribute_map": {"job_id": "job_id"}, + "location_map": {"job_id": "path"}, + "collection_format_map": {}, + }, + headers_map={"accept": ["application/json"], "content_type": []}, + api_client=api_client, + callable=__describe_restore_job, + ) + async def __list_collections(self, **kwargs): """List collections # noqa: E501 @@ -1296,6 +2196,82 @@ async def __list_collections(self, **kwargs): callable=__list_collections, ) + async def __list_index_backups(self, index_name, **kwargs): + """List backups for an index # noqa: E501 + + List all backups for an index. # noqa: E501 + + + Args: + index_name (str): Name of the backed up index + + Keyword Args: + limit (int): The number of results to return per page. [optional] if omitted the server will use the default value of 10. + pagination_token (str): The token to use to retrieve the next page of results. [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 + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + + Returns: + BackupList + """ + self._process_openapi_kwargs(kwargs) + kwargs["index_name"] = index_name + return await self.call_with_http_info(**kwargs) + + self.list_index_backups = _AsyncioEndpoint( + settings={ + "response_type": (BackupList,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/indexes/{index_name}/backups", + "operation_id": "list_index_backups", + "http_method": "GET", + "servers": None, + }, + params_map={ + "all": ["index_name", "limit", "pagination_token"], + "required": ["index_name"], + "nullable": [], + "enum": [], + "validation": ["limit"], + }, + root_map={ + "validations": {("limit",): {"inclusive_maximum": 100, "inclusive_minimum": 1}}, + "allowed_values": {}, + "openapi_types": { + "index_name": (str,), + "limit": (int,), + "pagination_token": (str,), + }, + "attribute_map": { + "index_name": "index_name", + "limit": "limit", + "pagination_token": "paginationToken", + }, + "location_map": { + "index_name": "path", + "limit": "query", + "pagination_token": "query", + }, + "collection_format_map": {}, + }, + headers_map={"accept": ["application/json"], "content_type": []}, + api_client=api_client, + callable=__list_index_backups, + ) + async def __list_indexes(self, **kwargs): """List indexes # noqa: E501 @@ -1348,3 +2324,117 @@ async def __list_indexes(self, **kwargs): api_client=api_client, callable=__list_indexes, ) + + async def __list_project_backups(self, **kwargs): + """List backups for all indexes in a project # noqa: E501 + + List all backups for a project. # noqa: E501 + + + + Keyword Args: + _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 + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + + Returns: + BackupList + """ + self._process_openapi_kwargs(kwargs) + return await self.call_with_http_info(**kwargs) + + self.list_project_backups = _AsyncioEndpoint( + settings={ + "response_type": (BackupList,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/backups", + "operation_id": "list_project_backups", + "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": {}, + }, + headers_map={"accept": ["application/json"], "content_type": []}, + api_client=api_client, + callable=__list_project_backups, + ) + + async def __list_restore_jobs(self, **kwargs): + """List restore jobs # noqa: E501 + + List all restore jobs for a project. # noqa: E501 + + + + Keyword Args: + limit (int): The number of results to return per page. [optional] if omitted the server will use the default value of 10. + pagination_token (str): The token to use to retrieve the next page of results. [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 + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + + Returns: + RestoreJobList + """ + self._process_openapi_kwargs(kwargs) + return await self.call_with_http_info(**kwargs) + + self.list_restore_jobs = _AsyncioEndpoint( + settings={ + "response_type": (RestoreJobList,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/restore-jobs", + "operation_id": "list_restore_jobs", + "http_method": "GET", + "servers": None, + }, + params_map={ + "all": ["limit", "pagination_token"], + "required": [], + "nullable": [], + "enum": [], + "validation": ["limit"], + }, + root_map={ + "validations": {("limit",): {"inclusive_maximum": 100, "inclusive_minimum": 1}}, + "allowed_values": {}, + "openapi_types": {"limit": (int,), "pagination_token": (str,)}, + "attribute_map": {"limit": "limit", "pagination_token": "paginationToken"}, + "location_map": {"limit": "query", "pagination_token": "query"}, + "collection_format_map": {}, + }, + headers_map={"accept": ["application/json"], "content_type": []}, + api_client=api_client, + callable=__list_restore_jobs, + ) diff --git a/pinecone/core/openapi/db_control/model/backup_list.py b/pinecone/core/openapi/db_control/model/backup_list.py new file mode 100644 index 000000000..89777f755 --- /dev/null +++ b/pinecone/core/openapi/db_control/model/backup_list.py @@ -0,0 +1,274 @@ +""" +Pinecone Control Plane API + +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + +This file is @generated using OpenAPI. + +The version of the OpenAPI document: 2025-04 +Contact: support@pinecone.io +""" + +from pinecone.openapi_support.model_utils import ( # noqa: F401 + PineconeApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + OpenApiModel, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) +from pinecone.openapi_support.exceptions import PineconeApiAttributeError + + +def lazy_import(): + from pinecone.core.openapi.db_control.model.backup_model import BackupModel + from pinecone.core.openapi.db_control.model.pagination_response import PaginationResponse + + globals()["BackupModel"] = BackupModel + globals()["PaginationResponse"] = PaginationResponse + + +from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar +from pinecone.openapi_support import PropertyValidationTypedDict, cached_class_property + +T = TypeVar("T", bound="BackupList") + + +class BackupList(ModelNormal): + """NOTE: This class is @generated using OpenAPI. + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + _data_store: Dict[str, Any] + _check_type: bool + + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + + @cached_class_property + def additional_properties_type(cls): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, dict, float, int, list, str, none_type) # noqa: E501 + + _nullable = False + + @cached_class_property + def openapi_types(cls): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + "data": ([BackupModel],), # noqa: E501 + "pagination": (PaginationResponse,), # noqa: E501 + } + + @cached_class_property + def discriminator(cls): + return None + + attribute_map: Dict[str, str] = { + "data": "data", # noqa: E501 + "pagination": "pagination", # noqa: E501 + } + + read_only_vars: Set[str] = set([]) + + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 + """BackupList - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data ([BackupModel]): [optional] # noqa: E501 + pagination (PaginationResponse): [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", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise PineconeApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % (args, self.__class__.__name__), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + 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 + ): + # 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", + ] + ) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs) -> None: # noqa: E501 + """BackupList - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + data ([BackupModel]): [optional] # noqa: E501 + pagination (PaginationResponse): [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", ()) + + if args: + raise PineconeApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % (args, self.__class__.__name__), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + 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 + ): + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise PineconeApiAttributeError( + 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/openapi/db_control/model/backup_model.py b/pinecone/core/openapi/db_control/model/backup_model.py new file mode 100644 index 000000000..fd7da209c --- /dev/null +++ b/pinecone/core/openapi/db_control/model/backup_model.py @@ -0,0 +1,356 @@ +""" +Pinecone Control Plane API + +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + +This file is @generated using OpenAPI. + +The version of the OpenAPI document: 2025-04 +Contact: support@pinecone.io +""" + +from pinecone.openapi_support.model_utils import ( # noqa: F401 + PineconeApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + OpenApiModel, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) +from pinecone.openapi_support.exceptions import PineconeApiAttributeError + + +def lazy_import(): + from pinecone.core.openapi.db_control.model.index_tags import IndexTags + + globals()["IndexTags"] = IndexTags + + +from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar +from pinecone.openapi_support import PropertyValidationTypedDict, cached_class_property + +T = TypeVar("T", bound="BackupModel") + + +class BackupModel(ModelNormal): + """NOTE: This class is @generated using OpenAPI. + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + _data_store: Dict[str, Any] + _check_type: bool + + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + ("metric",): {"COSINE": "cosine", "EUCLIDEAN": "euclidean", "DOTPRODUCT": "dotproduct"} + } + + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + ("dimension",): {"inclusive_maximum": 20000, "inclusive_minimum": 1} + } + + @cached_class_property + def additional_properties_type(cls): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, dict, float, int, list, str, none_type) # noqa: E501 + + _nullable = False + + @cached_class_property + def openapi_types(cls): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + "backup_id": (str,), # noqa: E501 + "source_index_name": (str,), # noqa: E501 + "source_index_id": (str,), # noqa: E501 + "status": (str,), # noqa: E501 + "cloud": (str,), # noqa: E501 + "region": (str,), # noqa: E501 + "name": (str,), # noqa: E501 + "description": (str,), # noqa: E501 + "dimension": (int,), # noqa: E501 + "metric": (str,), # noqa: E501 + "record_count": (int,), # noqa: E501 + "namespace_count": (int,), # noqa: E501 + "size_bytes": (int,), # noqa: E501 + "tags": (IndexTags,), # noqa: E501 + "created_at": (str,), # noqa: E501 + } + + @cached_class_property + def discriminator(cls): + return None + + attribute_map: Dict[str, str] = { + "backup_id": "backup_id", # noqa: E501 + "source_index_name": "source_index_name", # noqa: E501 + "source_index_id": "source_index_id", # noqa: E501 + "status": "status", # noqa: E501 + "cloud": "cloud", # noqa: E501 + "region": "region", # noqa: E501 + "name": "name", # noqa: E501 + "description": "description", # noqa: E501 + "dimension": "dimension", # noqa: E501 + "metric": "metric", # noqa: E501 + "record_count": "record_count", # noqa: E501 + "namespace_count": "namespace_count", # noqa: E501 + "size_bytes": "size_bytes", # noqa: E501 + "tags": "tags", # noqa: E501 + "created_at": "created_at", # noqa: E501 + } + + read_only_vars: Set[str] = set([]) + + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data( + cls: Type[T], + backup_id, + source_index_name, + source_index_id, + status, + cloud, + region, + *args, + **kwargs, + ) -> T: # noqa: E501 + """BackupModel - a model defined in OpenAPI + + Args: + backup_id (str): Unique identifier for the backup. + source_index_name (str): Name of the index from which the backup was taken. + source_index_id (str): ID of the index. + status (str): Current status of the backup (e.g., Initializing, Ready, Failed). + cloud (str): Cloud provider where the backup is stored. + region (str): Cloud region where the backup is stored. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + name (str): Optional user-defined name for the backup. [optional] # noqa: E501 + description (str): Optional description providing context for the backup. [optional] # noqa: E501 + dimension (int): The dimensions of the vectors to be inserted in the index. [optional] # noqa: E501 + metric (str): The distance metric to be used for similarity search. You can use 'euclidean', 'cosine', or 'dotproduct'. If the 'vector_type' is 'sparse', the metric must be 'dotproduct'. If the `vector_type` is `dense`, the metric defaults to 'cosine'. [optional] # noqa: E501 + record_count (int): Total number of records in the backup. [optional] # noqa: E501 + namespace_count (int): Number of namespaces in the backup. [optional] # noqa: E501 + size_bytes (int): Size of the backup in bytes. [optional] # noqa: E501 + tags (IndexTags): [optional] # noqa: E501 + created_at (str): Timestamp when the backup was created. [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", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise PineconeApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % (args, self.__class__.__name__), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.backup_id = backup_id + self.source_index_name = source_index_name + self.source_index_id = source_index_id + self.status = status + self.cloud = cloud + self.region = region + 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 + ): + # 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", + ] + ) + + @convert_js_args_to_python_args + def __init__( + self, backup_id, source_index_name, source_index_id, status, cloud, region, *args, **kwargs + ) -> None: # noqa: E501 + """BackupModel - a model defined in OpenAPI + + Args: + backup_id (str): Unique identifier for the backup. + source_index_name (str): Name of the index from which the backup was taken. + source_index_id (str): ID of the index. + status (str): Current status of the backup (e.g., Initializing, Ready, Failed). + cloud (str): Cloud provider where the backup is stored. + region (str): Cloud region where the backup is stored. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + name (str): Optional user-defined name for the backup. [optional] # noqa: E501 + description (str): Optional description providing context for the backup. [optional] # noqa: E501 + dimension (int): The dimensions of the vectors to be inserted in the index. [optional] # noqa: E501 + metric (str): The distance metric to be used for similarity search. You can use 'euclidean', 'cosine', or 'dotproduct'. If the 'vector_type' is 'sparse', the metric must be 'dotproduct'. If the `vector_type` is `dense`, the metric defaults to 'cosine'. [optional] # noqa: E501 + record_count (int): Total number of records in the backup. [optional] # noqa: E501 + namespace_count (int): Number of namespaces in the backup. [optional] # noqa: E501 + size_bytes (int): Size of the backup in bytes. [optional] # noqa: E501 + tags (IndexTags): [optional] # noqa: E501 + created_at (str): Timestamp when the backup was created. [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", ()) + + if args: + raise PineconeApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % (args, self.__class__.__name__), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.backup_id = backup_id + self.source_index_name = source_index_name + self.source_index_id = source_index_id + self.status = status + self.cloud = cloud + self.region = region + 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 + ): + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise PineconeApiAttributeError( + 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/openapi/db_control/model/create_backup_request.py b/pinecone/core/openapi/db_control/model/create_backup_request.py new file mode 100644 index 000000000..106e9ab88 --- /dev/null +++ b/pinecone/core/openapi/db_control/model/create_backup_request.py @@ -0,0 +1,266 @@ +""" +Pinecone Control Plane API + +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + +This file is @generated using OpenAPI. + +The version of the OpenAPI document: 2025-04 +Contact: support@pinecone.io +""" + +from pinecone.openapi_support.model_utils import ( # noqa: F401 + PineconeApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + OpenApiModel, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) +from pinecone.openapi_support.exceptions import PineconeApiAttributeError + + +from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar +from pinecone.openapi_support import PropertyValidationTypedDict, cached_class_property + +T = TypeVar("T", bound="CreateBackupRequest") + + +class CreateBackupRequest(ModelNormal): + """NOTE: This class is @generated using OpenAPI. + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + _data_store: Dict[str, Any] + _check_type: bool + + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + ("name",): {"max_length": 45, "min_length": 1} + } + + @cached_class_property + def additional_properties_type(cls): + """ + 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, dict, float, int, list, str, none_type) # noqa: E501 + + _nullable = False + + @cached_class_property + def openapi_types(cls): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + "name": (str,), # noqa: E501 + "description": (str,), # noqa: E501 + } + + @cached_class_property + def discriminator(cls): + return None + + attribute_map: Dict[str, str] = { + "name": "name", # noqa: E501 + "description": "description", # noqa: E501 + } + + read_only_vars: Set[str] = set([]) + + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 + """CreateBackupRequest - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + name (str): The name of the index. Resource name must be 1-45 characters long, start and end with an alphanumeric character, and consist only of lower case alphanumeric characters or '-'. [optional] # noqa: E501 + description (str): A description of the backup. [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", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise PineconeApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % (args, self.__class__.__name__), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + 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 + ): + # 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", + ] + ) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs) -> None: # noqa: E501 + """CreateBackupRequest - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + name (str): The name of the index. Resource name must be 1-45 characters long, start and end with an alphanumeric character, and consist only of lower case alphanumeric characters or '-'. [optional] # noqa: E501 + description (str): A description of the backup. [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", ()) + + if args: + raise PineconeApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % (args, self.__class__.__name__), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + 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 + ): + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise PineconeApiAttributeError( + 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/openapi/db_control/model/create_index_from_backup_request.py b/pinecone/core/openapi/db_control/model/create_index_from_backup_request.py new file mode 100644 index 000000000..99f713b2d --- /dev/null +++ b/pinecone/core/openapi/db_control/model/create_index_from_backup_request.py @@ -0,0 +1,286 @@ +""" +Pinecone Control Plane API + +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + +This file is @generated using OpenAPI. + +The version of the OpenAPI document: 2025-04 +Contact: support@pinecone.io +""" + +from pinecone.openapi_support.model_utils import ( # noqa: F401 + PineconeApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + OpenApiModel, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) +from pinecone.openapi_support.exceptions import PineconeApiAttributeError + + +def lazy_import(): + from pinecone.core.openapi.db_control.model.deletion_protection import DeletionProtection + from pinecone.core.openapi.db_control.model.index_tags import IndexTags + + globals()["DeletionProtection"] = DeletionProtection + globals()["IndexTags"] = IndexTags + + +from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar +from pinecone.openapi_support import PropertyValidationTypedDict, cached_class_property + +T = TypeVar("T", bound="CreateIndexFromBackupRequest") + + +class CreateIndexFromBackupRequest(ModelNormal): + """NOTE: This class is @generated using OpenAPI. + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + _data_store: Dict[str, Any] + _check_type: bool + + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + ("name",): {"max_length": 45, "min_length": 1} + } + + @cached_class_property + def additional_properties_type(cls): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, dict, float, int, list, str, none_type) # noqa: E501 + + _nullable = False + + @cached_class_property + def openapi_types(cls): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + "name": (str,), # noqa: E501 + "tags": (IndexTags,), # noqa: E501 + "deletion_protection": (DeletionProtection,), # noqa: E501 + } + + @cached_class_property + def discriminator(cls): + return None + + attribute_map: Dict[str, str] = { + "name": "name", # noqa: E501 + "tags": "tags", # noqa: E501 + "deletion_protection": "deletion_protection", # noqa: E501 + } + + read_only_vars: Set[str] = set([]) + + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls: Type[T], name, *args, **kwargs) -> T: # noqa: E501 + """CreateIndexFromBackupRequest - a model defined in OpenAPI + + Args: + name (str): The name of the index. Resource name must be 1-45 characters long, start and end with an alphanumeric character, and consist only of lower case alphanumeric characters or '-'. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + tags (IndexTags): [optional] # noqa: E501 + deletion_protection (DeletionProtection): [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", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise PineconeApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % (args, self.__class__.__name__), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.name = name + 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 + ): + # 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", + ] + ) + + @convert_js_args_to_python_args + def __init__(self, name, *args, **kwargs) -> None: # noqa: E501 + """CreateIndexFromBackupRequest - a model defined in OpenAPI + + Args: + name (str): The name of the index. Resource name must be 1-45 characters long, start and end with an alphanumeric character, and consist only of lower case alphanumeric characters or '-'. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + tags (IndexTags): [optional] # noqa: E501 + deletion_protection (DeletionProtection): [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", ()) + + if args: + raise PineconeApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % (args, self.__class__.__name__), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.name = name + 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 + ): + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise PineconeApiAttributeError( + 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/openapi/db_control/model/dedicated_spec.py b/pinecone/core/openapi/db_control/model/dedicated_spec.py new file mode 100644 index 000000000..cb2c5d207 --- /dev/null +++ b/pinecone/core/openapi/db_control/model/dedicated_spec.py @@ -0,0 +1,266 @@ +""" +Pinecone Control Plane API + +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + +This file is @generated using OpenAPI. + +The version of the OpenAPI document: 2025-04 +Contact: support@pinecone.io +""" + +from pinecone.openapi_support.model_utils import ( # noqa: F401 + PineconeApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + OpenApiModel, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) +from pinecone.openapi_support.exceptions import PineconeApiAttributeError + + +from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar +from pinecone.openapi_support import PropertyValidationTypedDict, cached_class_property + +T = TypeVar("T", bound="DedicatedSpec") + + +class DedicatedSpec(ModelNormal): + """NOTE: This class is @generated using OpenAPI. + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + _data_store: Dict[str, Any] + _check_type: bool + + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + + @cached_class_property + def additional_properties_type(cls): + """ + 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, dict, float, int, list, str, none_type) # noqa: E501 + + _nullable = False + + @cached_class_property + def openapi_types(cls): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + "environment": (str,) # noqa: E501 + } + + @cached_class_property + def discriminator(cls): + return None + + attribute_map: Dict[str, str] = { + "environment": "environment" # noqa: E501 + } + + read_only_vars: Set[str] = set([]) + + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls: Type[T], environment, *args, **kwargs) -> T: # noqa: E501 + """DedicatedSpec - a model defined in OpenAPI + + Args: + environment (str): The environment where the index is hosted. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _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", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise PineconeApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % (args, self.__class__.__name__), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.environment = environment + 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 + ): + # 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", + ] + ) + + @convert_js_args_to_python_args + def __init__(self, environment, *args, **kwargs) -> None: # noqa: E501 + """DedicatedSpec - a model defined in OpenAPI + + Args: + environment (str): The environment where the index is hosted. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _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", ()) + + if args: + raise PineconeApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % (args, self.__class__.__name__), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.environment = environment + 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 + ): + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise PineconeApiAttributeError( + 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/openapi/db_control/model/index_model_spec.py b/pinecone/core/openapi/db_control/model/index_model_spec.py index b75b803f1..6bfa0a752 100644 --- a/pinecone/core/openapi/db_control/model/index_model_spec.py +++ b/pinecone/core/openapi/db_control/model/index_model_spec.py @@ -28,9 +28,11 @@ def lazy_import(): + from pinecone.core.openapi.db_control.model.dedicated_spec import DedicatedSpec from pinecone.core.openapi.db_control.model.pod_spec import PodSpec from pinecone.core.openapi.db_control.model.serverless_spec import ServerlessSpec + globals()["DedicatedSpec"] = DedicatedSpec globals()["PodSpec"] = PodSpec globals()["ServerlessSpec"] = ServerlessSpec @@ -94,6 +96,7 @@ def openapi_types(cls): """ lazy_import() return { + "dedicated": (DedicatedSpec,), # noqa: E501 "pod": (PodSpec,), # noqa: E501 "serverless": (ServerlessSpec,), # noqa: E501 } @@ -103,6 +106,7 @@ def discriminator(cls): return None attribute_map: Dict[str, str] = { + "dedicated": "dedicated", # noqa: E501 "pod": "pod", # noqa: E501 "serverless": "serverless", # noqa: E501 } @@ -147,6 +151,7 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) + dedicated (DedicatedSpec): [optional] # noqa: E501 pod (PodSpec): [optional] # noqa: E501 serverless (ServerlessSpec): [optional] # noqa: E501 """ @@ -232,6 +237,7 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) + dedicated (DedicatedSpec): [optional] # noqa: E501 pod (PodSpec): [optional] # noqa: E501 serverless (ServerlessSpec): [optional] # noqa: E501 """ diff --git a/pinecone/core/openapi/db_control/model/index_spec.py b/pinecone/core/openapi/db_control/model/index_spec.py index add2979ee..cee103f2c 100644 --- a/pinecone/core/openapi/db_control/model/index_spec.py +++ b/pinecone/core/openapi/db_control/model/index_spec.py @@ -28,9 +28,11 @@ def lazy_import(): + from pinecone.core.openapi.db_control.model.dedicated_spec import DedicatedSpec from pinecone.core.openapi.db_control.model.pod_spec import PodSpec from pinecone.core.openapi.db_control.model.serverless_spec import ServerlessSpec + globals()["DedicatedSpec"] = DedicatedSpec globals()["PodSpec"] = PodSpec globals()["ServerlessSpec"] = ServerlessSpec @@ -89,6 +91,7 @@ def openapi_types(cls): return { "serverless": (ServerlessSpec,), # noqa: E501 "pod": (PodSpec,), # noqa: E501 + "dedicated": (DedicatedSpec,), # noqa: E501 } @cached_class_property @@ -98,6 +101,7 @@ def discriminator(cls): attribute_map: Dict[str, str] = { "serverless": "serverless", # noqa: E501 "pod": "pod", # noqa: E501 + "dedicated": "dedicated", # noqa: E501 } read_only_vars: Set[str] = set([]) @@ -142,6 +146,7 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 _visited_composed_classes = (Animal,) serverless (ServerlessSpec): [optional] # noqa: E501 pod (PodSpec): [optional] # noqa: E501 + dedicated (DedicatedSpec): [optional] # noqa: E501 """ _check_type = kwargs.pop("_check_type", True) @@ -227,6 +232,7 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 _visited_composed_classes = (Animal,) serverless (ServerlessSpec): [optional] # noqa: E501 pod (PodSpec): [optional] # noqa: E501 + dedicated (DedicatedSpec): [optional] # noqa: E501 """ _check_type = kwargs.pop("_check_type", True) diff --git a/pinecone/core/openapi/db_control/model/pagination_response.py b/pinecone/core/openapi/db_control/model/pagination_response.py new file mode 100644 index 000000000..3a0182a5c --- /dev/null +++ b/pinecone/core/openapi/db_control/model/pagination_response.py @@ -0,0 +1,266 @@ +""" +Pinecone Control Plane API + +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + +This file is @generated using OpenAPI. + +The version of the OpenAPI document: 2025-04 +Contact: support@pinecone.io +""" + +from pinecone.openapi_support.model_utils import ( # noqa: F401 + PineconeApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + OpenApiModel, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) +from pinecone.openapi_support.exceptions import PineconeApiAttributeError + + +from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar +from pinecone.openapi_support import PropertyValidationTypedDict, cached_class_property + +T = TypeVar("T", bound="PaginationResponse") + + +class PaginationResponse(ModelNormal): + """NOTE: This class is @generated using OpenAPI. + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + _data_store: Dict[str, Any] + _check_type: bool + + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + + @cached_class_property + def additional_properties_type(cls): + """ + 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, dict, float, int, list, str, none_type) # noqa: E501 + + _nullable = False + + @cached_class_property + def openapi_types(cls): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + "next": (str,) # noqa: E501 + } + + @cached_class_property + def discriminator(cls): + return None + + attribute_map: Dict[str, str] = { + "next": "next" # noqa: E501 + } + + read_only_vars: Set[str] = set([]) + + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls: Type[T], next, *args, **kwargs) -> T: # noqa: E501 + """PaginationResponse - a model defined in OpenAPI + + Args: + next (str): The token to use to retrieve the next page of results. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _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", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise PineconeApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % (args, self.__class__.__name__), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.next = next + 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 + ): + # 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", + ] + ) + + @convert_js_args_to_python_args + def __init__(self, next, *args, **kwargs) -> None: # noqa: E501 + """PaginationResponse - a model defined in OpenAPI + + Args: + next (str): The token to use to retrieve the next page of results. + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _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", ()) + + if args: + raise PineconeApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % (args, self.__class__.__name__), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.next = next + 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 + ): + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise PineconeApiAttributeError( + 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/openapi/db_control/model/restore_job_list.py b/pinecone/core/openapi/db_control/model/restore_job_list.py new file mode 100644 index 000000000..fb66e233d --- /dev/null +++ b/pinecone/core/openapi/db_control/model/restore_job_list.py @@ -0,0 +1,280 @@ +""" +Pinecone Control Plane API + +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + +This file is @generated using OpenAPI. + +The version of the OpenAPI document: 2025-04 +Contact: support@pinecone.io +""" + +from pinecone.openapi_support.model_utils import ( # noqa: F401 + PineconeApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + OpenApiModel, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) +from pinecone.openapi_support.exceptions import PineconeApiAttributeError + + +def lazy_import(): + from pinecone.core.openapi.db_control.model.pagination_response import PaginationResponse + from pinecone.core.openapi.db_control.model.restore_job_model import RestoreJobModel + + globals()["PaginationResponse"] = PaginationResponse + globals()["RestoreJobModel"] = RestoreJobModel + + +from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar +from pinecone.openapi_support import PropertyValidationTypedDict, cached_class_property + +T = TypeVar("T", bound="RestoreJobList") + + +class RestoreJobList(ModelNormal): + """NOTE: This class is @generated using OpenAPI. + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + _data_store: Dict[str, Any] + _check_type: bool + + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + + @cached_class_property + def additional_properties_type(cls): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, dict, float, int, list, str, none_type) # noqa: E501 + + _nullable = False + + @cached_class_property + def openapi_types(cls): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + "data": ([RestoreJobModel],), # noqa: E501 + "pagination": (PaginationResponse,), # noqa: E501 + } + + @cached_class_property + def discriminator(cls): + return None + + attribute_map: Dict[str, str] = { + "data": "data", # noqa: E501 + "pagination": "pagination", # noqa: E501 + } + + read_only_vars: Set[str] = set([]) + + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls: Type[T], data, *args, **kwargs) -> T: # noqa: E501 + """RestoreJobList - a model defined in OpenAPI + + Args: + data ([RestoreJobModel]): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + pagination (PaginationResponse): [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", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise PineconeApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % (args, self.__class__.__name__), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.data = data + 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 + ): + # 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", + ] + ) + + @convert_js_args_to_python_args + def __init__(self, data, *args, **kwargs) -> None: # noqa: E501 + """RestoreJobList - a model defined in OpenAPI + + Args: + data ([RestoreJobModel]): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + pagination (PaginationResponse): [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", ()) + + if args: + raise PineconeApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % (args, self.__class__.__name__), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.data = data + 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 + ): + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise PineconeApiAttributeError( + 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/openapi/db_control/model/restore_job_model.py b/pinecone/core/openapi/db_control/model/restore_job_model.py new file mode 100644 index 000000000..8f541188b --- /dev/null +++ b/pinecone/core/openapi/db_control/model/restore_job_model.py @@ -0,0 +1,326 @@ +""" +Pinecone Control Plane API + +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + +This file is @generated using OpenAPI. + +The version of the OpenAPI document: 2025-04 +Contact: support@pinecone.io +""" + +from pinecone.openapi_support.model_utils import ( # noqa: F401 + PineconeApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + OpenApiModel, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) +from pinecone.openapi_support.exceptions import PineconeApiAttributeError + + +from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar +from pinecone.openapi_support import PropertyValidationTypedDict, cached_class_property + +T = TypeVar("T", bound="RestoreJobModel") + + +class RestoreJobModel(ModelNormal): + """NOTE: This class is @generated using OpenAPI. + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + _data_store: Dict[str, Any] + _check_type: bool + + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + ("percent_complete",): {"inclusive_maximum": 100.0, "inclusive_minimum": 0.0} + } + + @cached_class_property + def additional_properties_type(cls): + """ + 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, dict, float, int, list, str, none_type) # noqa: E501 + + _nullable = False + + @cached_class_property + def openapi_types(cls): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + "restore_job_id": (str,), # noqa: E501 + "backup_id": (str,), # noqa: E501 + "target_index_name": (str,), # noqa: E501 + "target_index_id": (str,), # noqa: E501 + "status": (str,), # noqa: E501 + "created_at": (datetime,), # noqa: E501 + "completed_at": (datetime,), # noqa: E501 + "percent_complete": (float,), # noqa: E501 + } + + @cached_class_property + def discriminator(cls): + return None + + attribute_map: Dict[str, str] = { + "restore_job_id": "restore_job_id", # noqa: E501 + "backup_id": "backup_id", # noqa: E501 + "target_index_name": "target_index_name", # noqa: E501 + "target_index_id": "target_index_id", # noqa: E501 + "status": "status", # noqa: E501 + "created_at": "created_at", # noqa: E501 + "completed_at": "completed_at", # noqa: E501 + "percent_complete": "percent_complete", # noqa: E501 + } + + read_only_vars: Set[str] = set([]) + + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data( + cls: Type[T], + restore_job_id, + backup_id, + target_index_name, + target_index_id, + status, + created_at, + *args, + **kwargs, + ) -> T: # noqa: E501 + """RestoreJobModel - a model defined in OpenAPI + + Args: + restore_job_id (str): Unique identifier for the restore job + backup_id (str): Backup used for the restore + target_index_name (str): Name of the index into which data is being restored + target_index_id (str): ID of the index + status (str): Status of the restore job + created_at (datetime): Timestamp when the restore job started + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + completed_at (datetime): Timestamp when the restore job finished [optional] # noqa: E501 + percent_complete (float): The progress made by the restore job out of 100 [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", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise PineconeApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % (args, self.__class__.__name__), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.restore_job_id = restore_job_id + self.backup_id = backup_id + self.target_index_name = target_index_name + self.target_index_id = target_index_id + self.status = status + self.created_at = created_at + 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 + ): + # 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", + ] + ) + + @convert_js_args_to_python_args + def __init__( + self, + restore_job_id, + backup_id, + target_index_name, + target_index_id, + status, + created_at, + *args, + **kwargs, + ) -> None: # noqa: E501 + """RestoreJobModel - a model defined in OpenAPI + + Args: + restore_job_id (str): Unique identifier for the restore job + backup_id (str): Backup used for the restore + target_index_name (str): Name of the index into which data is being restored + target_index_id (str): ID of the index + status (str): Status of the restore job + created_at (datetime): Timestamp when the restore job started + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + completed_at (datetime): Timestamp when the restore job finished [optional] # noqa: E501 + percent_complete (float): The progress made by the restore job out of 100 [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", ()) + + if args: + raise PineconeApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % (args, self.__class__.__name__), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.restore_job_id = restore_job_id + self.backup_id = backup_id + self.target_index_name = target_index_name + self.target_index_id = target_index_id + self.status = status + self.created_at = created_at + 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 + ): + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise PineconeApiAttributeError( + 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/openapi/db_control/models/__init__.py b/pinecone/core/openapi/db_control/models/__init__.py index fd82f1214..59b93661c 100644 --- a/pinecone/core/openapi/db_control/models/__init__.py +++ b/pinecone/core/openapi/db_control/models/__init__.py @@ -9,6 +9,8 @@ # import sys # sys.setrecursionlimit(n) +from pinecone.core.openapi.db_control.model.backup_list import BackupList +from pinecone.core.openapi.db_control.model.backup_model import BackupModel from pinecone.core.openapi.db_control.model.collection_list import CollectionList from pinecone.core.openapi.db_control.model.collection_model import CollectionModel from pinecone.core.openapi.db_control.model.configure_index_request import ConfigureIndexRequest @@ -21,6 +23,7 @@ from pinecone.core.openapi.db_control.model.configure_index_request_spec_pod import ( ConfigureIndexRequestSpecPod, ) +from pinecone.core.openapi.db_control.model.create_backup_request import CreateBackupRequest from pinecone.core.openapi.db_control.model.create_collection_request import CreateCollectionRequest from pinecone.core.openapi.db_control.model.create_index_for_model_request import ( CreateIndexForModelRequest, @@ -28,7 +31,11 @@ from pinecone.core.openapi.db_control.model.create_index_for_model_request_embed import ( CreateIndexForModelRequestEmbed, ) +from pinecone.core.openapi.db_control.model.create_index_from_backup_request import ( + CreateIndexFromBackupRequest, +) from pinecone.core.openapi.db_control.model.create_index_request import CreateIndexRequest +from pinecone.core.openapi.db_control.model.dedicated_spec import DedicatedSpec from pinecone.core.openapi.db_control.model.deletion_protection import DeletionProtection from pinecone.core.openapi.db_control.model.error_response import ErrorResponse from pinecone.core.openapi.db_control.model.error_response_error import ErrorResponseError @@ -39,6 +46,9 @@ from pinecone.core.openapi.db_control.model.index_spec import IndexSpec from pinecone.core.openapi.db_control.model.index_tags import IndexTags from pinecone.core.openapi.db_control.model.model_index_embed import ModelIndexEmbed +from pinecone.core.openapi.db_control.model.pagination_response import PaginationResponse from pinecone.core.openapi.db_control.model.pod_spec import PodSpec from pinecone.core.openapi.db_control.model.pod_spec_metadata_config import PodSpecMetadataConfig +from pinecone.core.openapi.db_control.model.restore_job_list import RestoreJobList +from pinecone.core.openapi.db_control.model.restore_job_model import RestoreJobModel from pinecone.core.openapi.db_control.model.serverless_spec import ServerlessSpec diff --git a/pinecone/core/openapi/inference/api/inference_api.py b/pinecone/core/openapi/inference/api/inference_api.py index 6a425a03e..3c9ec25be 100644 --- a/pinecone/core/openapi/inference/api/inference_api.py +++ b/pinecone/core/openapi/inference/api/inference_api.py @@ -26,6 +26,8 @@ from pinecone.core.openapi.inference.model.embed_request import EmbedRequest from pinecone.core.openapi.inference.model.embeddings_list import EmbeddingsList from pinecone.core.openapi.inference.model.error_response import ErrorResponse +from pinecone.core.openapi.inference.model.model_info import ModelInfo +from pinecone.core.openapi.inference.model.model_info_list import ModelInfoList from pinecone.core.openapi.inference.model.rerank_request import RerankRequest from pinecone.core.openapi.inference.model.rerank_result import RerankResult @@ -108,6 +110,146 @@ def __embed(self, **kwargs: ExtraOpenApiKwargsTypedDict): callable=__embed, ) + def __get_model(self, model_name, **kwargs: ExtraOpenApiKwargsTypedDict): + """Get available model details. # noqa: E501 + + Get model details. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.get_model(model_name, async_req=True) + >>> result = thread.get() + + Args: + model_name (str): The name of the model to look up. + + Keyword Args: + _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 + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + async_req (bool): execute request asynchronously + + Returns: + ModelInfo + If the method is called asynchronously, returns the request + thread. + """ + kwargs = self._process_openapi_kwargs(kwargs) + kwargs["model_name"] = model_name + return self.call_with_http_info(**kwargs) + + self.get_model = _Endpoint( + settings={ + "response_type": (ModelInfo,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/models/{model_name}", + "operation_id": "get_model", + "http_method": "GET", + "servers": None, + }, + params_map={ + "all": ["model_name"], + "required": ["model_name"], + "nullable": [], + "enum": [], + "validation": [], + }, + root_map={ + "validations": {}, + "allowed_values": {}, + "openapi_types": {"model_name": (str,)}, + "attribute_map": {"model_name": "model_name"}, + "location_map": {"model_name": "path"}, + "collection_format_map": {}, + }, + headers_map={"accept": ["application/json"], "content_type": []}, + api_client=api_client, + callable=__get_model, + ) + + def __list_models(self, **kwargs: ExtraOpenApiKwargsTypedDict): + """Get available models. # noqa: E501 + + Get available models. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.list_models(async_req=True) + >>> result = thread.get() + + + Keyword Args: + type (str): Filter models by type ('embed' or 'rerank'). [optional] + vector_type (str): Filter embedding models by vector type ('dense' or 'sparse'). Only relevant when `type=embed`. [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 + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + async_req (bool): execute request asynchronously + + Returns: + ModelInfoList + If the method is called asynchronously, returns the request + thread. + """ + kwargs = self._process_openapi_kwargs(kwargs) + return self.call_with_http_info(**kwargs) + + self.list_models = _Endpoint( + settings={ + "response_type": (ModelInfoList,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/models", + "operation_id": "list_models", + "http_method": "GET", + "servers": None, + }, + params_map={ + "all": ["type", "vector_type"], + "required": [], + "nullable": [], + "enum": ["type", "vector_type"], + "validation": [], + }, + root_map={ + "validations": {}, + "allowed_values": { + ("type",): {"EMBED": "embed", "RERANK": "rerank"}, + ("vector_type",): {"DENSE": "dense", "SPARSE": "sparse"}, + }, + "openapi_types": {"type": (str,), "vector_type": (str,)}, + "attribute_map": {"type": "type", "vector_type": "vector_type"}, + "location_map": {"type": "query", "vector_type": "query"}, + "collection_format_map": {}, + }, + headers_map={"accept": ["application/json"], "content_type": []}, + api_client=api_client, + callable=__list_models, + ) + def __rerank(self, **kwargs: ExtraOpenApiKwargsTypedDict): """Rerank documents # noqa: E501 @@ -247,6 +389,132 @@ async def __embed(self, **kwargs): callable=__embed, ) + async def __get_model(self, model_name, **kwargs): + """Get available model details. # noqa: E501 + + Get model details. # noqa: E501 + + + Args: + model_name (str): The name of the model to look up. + + Keyword Args: + _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 + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + + Returns: + ModelInfo + """ + self._process_openapi_kwargs(kwargs) + kwargs["model_name"] = model_name + return await self.call_with_http_info(**kwargs) + + self.get_model = _AsyncioEndpoint( + settings={ + "response_type": (ModelInfo,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/models/{model_name}", + "operation_id": "get_model", + "http_method": "GET", + "servers": None, + }, + params_map={ + "all": ["model_name"], + "required": ["model_name"], + "nullable": [], + "enum": [], + "validation": [], + }, + root_map={ + "validations": {}, + "allowed_values": {}, + "openapi_types": {"model_name": (str,)}, + "attribute_map": {"model_name": "model_name"}, + "location_map": {"model_name": "path"}, + "collection_format_map": {}, + }, + headers_map={"accept": ["application/json"], "content_type": []}, + api_client=api_client, + callable=__get_model, + ) + + async def __list_models(self, **kwargs): + """Get available models. # noqa: E501 + + Get available models. # noqa: E501 + + + + Keyword Args: + type (str): Filter models by type ('embed' or 'rerank'). [optional] + vector_type (str): Filter embedding models by vector type ('dense' or 'sparse'). Only relevant when `type=embed`. [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 + will be returned without reading/decoding response data. + Default is True. + _request_timeout (int/float/tuple): timeout setting for this request. If + one number provided, it will be total request timeout. It can also + be a pair (tuple) of (connection, read) timeouts. + Default is None. + _check_input_type (bool): specifies if type checking + should be done one the data sent to the server. + Default is True. + _check_return_type (bool): specifies if type checking + should be done one the data received from the server. + Default is True. + + Returns: + ModelInfoList + """ + self._process_openapi_kwargs(kwargs) + return await self.call_with_http_info(**kwargs) + + self.list_models = _AsyncioEndpoint( + settings={ + "response_type": (ModelInfoList,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/models", + "operation_id": "list_models", + "http_method": "GET", + "servers": None, + }, + params_map={ + "all": ["type", "vector_type"], + "required": [], + "nullable": [], + "enum": ["type", "vector_type"], + "validation": [], + }, + root_map={ + "validations": {}, + "allowed_values": { + ("type",): {"EMBED": "embed", "RERANK": "rerank"}, + ("vector_type",): {"DENSE": "dense", "SPARSE": "sparse"}, + }, + "openapi_types": {"type": (str,), "vector_type": (str,)}, + "attribute_map": {"type": "type", "vector_type": "vector_type"}, + "location_map": {"type": "query", "vector_type": "query"}, + "collection_format_map": {}, + }, + headers_map={"accept": ["application/json"], "content_type": []}, + api_client=api_client, + callable=__list_models, + ) + async def __rerank(self, **kwargs): """Rerank documents # noqa: E501 diff --git a/pinecone/core/openapi/inference/model/model_info.py b/pinecone/core/openapi/inference/model/model_info.py new file mode 100644 index 000000000..2ce733cc0 --- /dev/null +++ b/pinecone/core/openapi/inference/model/model_info.py @@ -0,0 +1,333 @@ +""" +Pinecone Inference API + +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + +This file is @generated using OpenAPI. + +The version of the OpenAPI document: 2025-04 +Contact: support@pinecone.io +""" + +from pinecone.openapi_support.model_utils import ( # noqa: F401 + PineconeApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + OpenApiModel, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) +from pinecone.openapi_support.exceptions import PineconeApiAttributeError + + +def lazy_import(): + from pinecone.core.openapi.inference.model.model_info_supported_metrics import ( + ModelInfoSupportedMetrics, + ) + from pinecone.core.openapi.inference.model.model_info_supported_parameter import ( + ModelInfoSupportedParameter, + ) + + globals()["ModelInfoSupportedMetrics"] = ModelInfoSupportedMetrics + globals()["ModelInfoSupportedParameter"] = ModelInfoSupportedParameter + + +from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar +from pinecone.openapi_support import PropertyValidationTypedDict, cached_class_property + +T = TypeVar("T", bound="ModelInfo") + + +class ModelInfo(ModelNormal): + """NOTE: This class is @generated using OpenAPI. + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + _data_store: Dict[str, Any] + _check_type: bool + + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + ("type",): {"EMBED": "embed", "RERANK": "rerank"}, + ("vector_type",): {"DENSE": "dense", "SPARSE": "sparse"}, + } + + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + ("dimension",): {"inclusive_maximum": 20000, "inclusive_minimum": 1}, + ("sequence_length",): {"inclusive_minimum": 1}, + ("batch_size",): {"inclusive_minimum": 1}, + } + + @cached_class_property + def additional_properties_type(cls): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, dict, float, int, list, str, none_type) # noqa: E501 + + _nullable = False + + @cached_class_property + def openapi_types(cls): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + "name": (str,), # noqa: E501 + "short_description": (str,), # noqa: E501 + "type": (str,), # noqa: E501 + "supported_parameters": ([ModelInfoSupportedParameter],), # noqa: E501 + "vector_type": (str,), # noqa: E501 + "dimension": (int,), # noqa: E501 + "modality": (str,), # noqa: E501 + "sequence_length": (int,), # noqa: E501 + "batch_size": (int,), # noqa: E501 + "supported_metrics": (ModelInfoSupportedMetrics,), # noqa: E501 + } + + @cached_class_property + def discriminator(cls): + return None + + attribute_map: Dict[str, str] = { + "name": "name", # noqa: E501 + "short_description": "short_description", # noqa: E501 + "type": "type", # noqa: E501 + "supported_parameters": "supported_parameters", # noqa: E501 + "vector_type": "vector_type", # noqa: E501 + "dimension": "dimension", # noqa: E501 + "modality": "modality", # noqa: E501 + "sequence_length": "sequence_length", # noqa: E501 + "batch_size": "batch_size", # noqa: E501 + "supported_metrics": "supported_metrics", # noqa: E501 + } + + read_only_vars: Set[str] = set([]) + + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data( + cls: Type[T], name, short_description, type, supported_parameters, *args, **kwargs + ) -> T: # noqa: E501 + """ModelInfo - a model defined in OpenAPI + + Args: + name (str): The name of the model. + short_description (str): A summary of the model. + type (str): The type of model (e.g. 'embed' or 'rerank'). + supported_parameters ([ModelInfoSupportedParameter]): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + vector_type (str): Whether the embedding model produces 'dense' or 'sparse' embeddings. [optional] # noqa: E501 + dimension (int): The embedding model dimension (applies to dense embedding models only). [optional] # noqa: E501 + modality (str): The modality of the model (e.g. 'text'). [optional] # noqa: E501 + sequence_length (int): The maximum tokens per sequence supported by the model. [optional] # noqa: E501 + batch_size (int): The maximum batch size (number of sequences) supported by the model. [optional] # noqa: E501 + supported_metrics (ModelInfoSupportedMetrics): [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", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise PineconeApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % (args, self.__class__.__name__), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.name = name + self.short_description = short_description + self.type = type + self.supported_parameters = supported_parameters + 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 + ): + # 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", + ] + ) + + @convert_js_args_to_python_args + def __init__( + self, name, short_description, type, supported_parameters, *args, **kwargs + ) -> None: # noqa: E501 + """ModelInfo - a model defined in OpenAPI + + Args: + name (str): The name of the model. + short_description (str): A summary of the model. + type (str): The type of model (e.g. 'embed' or 'rerank'). + supported_parameters ([ModelInfoSupportedParameter]): + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + vector_type (str): Whether the embedding model produces 'dense' or 'sparse' embeddings. [optional] # noqa: E501 + dimension (int): The embedding model dimension (applies to dense embedding models only). [optional] # noqa: E501 + modality (str): The modality of the model (e.g. 'text'). [optional] # noqa: E501 + sequence_length (int): The maximum tokens per sequence supported by the model. [optional] # noqa: E501 + batch_size (int): The maximum batch size (number of sequences) supported by the model. [optional] # noqa: E501 + supported_metrics (ModelInfoSupportedMetrics): [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", ()) + + if args: + raise PineconeApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % (args, self.__class__.__name__), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.name = name + self.short_description = short_description + self.type = type + self.supported_parameters = supported_parameters + 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 + ): + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise PineconeApiAttributeError( + 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/openapi/inference/model/model_info_list.py b/pinecone/core/openapi/inference/model/model_info_list.py new file mode 100644 index 000000000..9d176c0fb --- /dev/null +++ b/pinecone/core/openapi/inference/model/model_info_list.py @@ -0,0 +1,268 @@ +""" +Pinecone Inference API + +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + +This file is @generated using OpenAPI. + +The version of the OpenAPI document: 2025-04 +Contact: support@pinecone.io +""" + +from pinecone.openapi_support.model_utils import ( # noqa: F401 + PineconeApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + OpenApiModel, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) +from pinecone.openapi_support.exceptions import PineconeApiAttributeError + + +def lazy_import(): + from pinecone.core.openapi.inference.model.model_info import ModelInfo + + globals()["ModelInfo"] = ModelInfo + + +from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar +from pinecone.openapi_support import PropertyValidationTypedDict, cached_class_property + +T = TypeVar("T", bound="ModelInfoList") + + +class ModelInfoList(ModelNormal): + """NOTE: This class is @generated using OpenAPI. + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + _data_store: Dict[str, Any] + _check_type: bool + + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + + @cached_class_property + def additional_properties_type(cls): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, dict, float, int, list, str, none_type) # noqa: E501 + + _nullable = False + + @cached_class_property + def openapi_types(cls): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return { + "models": ([ModelInfo],) # noqa: E501 + } + + @cached_class_property + def discriminator(cls): + return None + + attribute_map: Dict[str, str] = { + "models": "models" # noqa: E501 + } + + read_only_vars: Set[str] = set([]) + + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 + """ModelInfoList - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + models ([ModelInfo]): [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", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise PineconeApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % (args, self.__class__.__name__), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + 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 + ): + # 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", + ] + ) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs) -> None: # noqa: E501 + """ModelInfoList - a model defined in OpenAPI + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + models ([ModelInfo]): [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", ()) + + if args: + raise PineconeApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % (args, self.__class__.__name__), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + 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 + ): + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise PineconeApiAttributeError( + 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/openapi/inference/model/model_info_metric.py b/pinecone/core/openapi/inference/model/model_info_metric.py new file mode 100644 index 000000000..85dd0457e --- /dev/null +++ b/pinecone/core/openapi/inference/model/model_info_metric.py @@ -0,0 +1,284 @@ +""" +Pinecone Inference API + +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + +This file is @generated using OpenAPI. + +The version of the OpenAPI document: 2025-04 +Contact: support@pinecone.io +""" + +from pinecone.openapi_support.model_utils import ( # noqa: F401 + PineconeApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + OpenApiModel, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) +from pinecone.openapi_support.exceptions import PineconeApiAttributeError + + +from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar +from pinecone.openapi_support import PropertyValidationTypedDict, cached_class_property + +T = TypeVar("T", bound="ModelInfoMetric") + + +class ModelInfoMetric(ModelSimple): + """NOTE: This class is @generated using OpenAPI. + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + _data_store: Dict[str, Any] + _check_type: bool + + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + ("value",): {"COSINE": "cosine", "EUCLIDEAN": "euclidean", "DOTPRODUCT": "dotproduct"} + } + + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + + @cached_class_property + def additional_properties_type(cls): + """ + 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, dict, float, int, list, str, none_type) # noqa: E501 + + _nullable = False + + @cached_class_property + def openapi_types(cls): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return {"value": (str,)} + + @cached_class_property + def discriminator(cls): + return None + + attribute_map: Dict[str, str] = {} + + read_only_vars: Set[str] = set() + + _composed_schemas = None + + 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) -> None: + """ModelInfoMetric - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): A distance metric that the embedding model supports for similarity searches.., must be one of ["cosine", "euclidean", "dotproduct", ] # noqa: E501 + + Keyword Args: + value (str): A distance metric that the embedding model supports for similarity searches.., must be one of ["cosine", "euclidean", "dotproduct", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + value = None + if "value" in kwargs: + value = kwargs.pop("value") + + if value is None and args: + if len(args) == 1: + value = args[0] + elif len(args) > 1: + raise PineconeApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % (args, self.__class__.__name__), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + if value is None: + raise PineconeApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _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", ()) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise PineconeApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % (kwargs, self.__class__.__name__), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: + """ModelInfoMetric - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] (str): A distance metric that the embedding model supports for similarity searches., must be one of ["cosine", "euclidean", "dotproduct", ] # noqa: E501 + + Keyword Args: + value (str): A distance metric that the embedding model supports for similarity searches., must be one of ["cosine", "euclidean", "dotproduct", ] # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + value = None + if "value" in kwargs: + value = kwargs.pop("value") + + if value is None and args: + if len(args) == 1: + value = args[0] + elif len(args) > 1: + raise PineconeApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % (args, self.__class__.__name__), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + if value is None: + raise PineconeApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _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", ()) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise PineconeApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % (kwargs, self.__class__.__name__), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/pinecone/core/openapi/inference/model/model_info_supported_metrics.py b/pinecone/core/openapi/inference/model/model_info_supported_metrics.py new file mode 100644 index 000000000..96b2bb412 --- /dev/null +++ b/pinecone/core/openapi/inference/model/model_info_supported_metrics.py @@ -0,0 +1,290 @@ +""" +Pinecone Inference API + +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + +This file is @generated using OpenAPI. + +The version of the OpenAPI document: 2025-04 +Contact: support@pinecone.io +""" + +from pinecone.openapi_support.model_utils import ( # noqa: F401 + PineconeApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + OpenApiModel, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) +from pinecone.openapi_support.exceptions import PineconeApiAttributeError + + +def lazy_import(): + from pinecone.core.openapi.inference.model.model_info_metric import ModelInfoMetric + + globals()["ModelInfoMetric"] = ModelInfoMetric + + +from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar +from pinecone.openapi_support import PropertyValidationTypedDict, cached_class_property + +T = TypeVar("T", bound="ModelInfoSupportedMetrics") + + +class ModelInfoSupportedMetrics(ModelSimple): + """NOTE: This class is @generated using OpenAPI. + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + _data_store: Dict[str, Any] + _check_type: bool + + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + + @cached_class_property + def additional_properties_type(cls): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + """ + lazy_import() + return (bool, dict, float, int, list, str, none_type) # noqa: E501 + + _nullable = False + + @cached_class_property + def openapi_types(cls): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + lazy_import() + return {"value": ([ModelInfoMetric],)} + + @cached_class_property + def discriminator(cls): + return None + + attribute_map: Dict[str, str] = {} + + read_only_vars: Set[str] = set() + + _composed_schemas = None + + 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) -> None: + """ModelInfoSupportedMetrics - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] ([ModelInfoMetric]): The distance metrics supported by the model for similarity search.. # noqa: E501 + + Keyword Args: + value ([ModelInfoMetric]): The distance metrics supported by the model for similarity search.. # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + value = None + if "value" in kwargs: + value = kwargs.pop("value") + + if value is None and args: + if len(args) == 1: + value = args[0] + elif len(args) > 1: + raise PineconeApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % (args, self.__class__.__name__), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + if value is None: + raise PineconeApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _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", ()) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise PineconeApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % (kwargs, self.__class__.__name__), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: + """ModelInfoSupportedMetrics - a model defined in OpenAPI + + Note that value can be passed either in args or in kwargs, but not in both. + + Args: + args[0] ([ModelInfoMetric]): The distance metrics supported by the model for similarity search. # noqa: E501 + + Keyword Args: + value ([ModelInfoMetric]): The distance metrics supported by the model for similarity search. # noqa: E501 + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + """ + # required up here when default value is not given + _path_to_item = kwargs.pop("_path_to_item", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + value = None + if "value" in kwargs: + value = kwargs.pop("value") + + if value is None and args: + if len(args) == 1: + value = args[0] + elif len(args) > 1: + raise PineconeApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % (args, self.__class__.__name__), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + if value is None: + raise PineconeApiTypeError( + "value is required, but not passed in args or kwargs and doesn't have default", + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + _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", ()) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.value = value + if kwargs: + raise PineconeApiTypeError( + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." + % (kwargs, self.__class__.__name__), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + return self diff --git a/pinecone/core/openapi/inference/model/model_info_supported_parameter.py b/pinecone/core/openapi/inference/model/model_info_supported_parameter.py new file mode 100644 index 000000000..56b17ac34 --- /dev/null +++ b/pinecone/core/openapi/inference/model/model_info_supported_parameter.py @@ -0,0 +1,302 @@ +""" +Pinecone Inference API + +Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + +This file is @generated using OpenAPI. + +The version of the OpenAPI document: 2025-04 +Contact: support@pinecone.io +""" + +from pinecone.openapi_support.model_utils import ( # noqa: F401 + PineconeApiTypeError, + ModelComposed, + ModelNormal, + ModelSimple, + OpenApiModel, + cached_property, + change_keys_js_to_python, + convert_js_args_to_python_args, + date, + datetime, + file_type, + none_type, + validate_get_composed_info, +) +from pinecone.openapi_support.exceptions import PineconeApiAttributeError + + +from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar +from pinecone.openapi_support import PropertyValidationTypedDict, cached_class_property + +T = TypeVar("T", bound="ModelInfoSupportedParameter") + + +class ModelInfoSupportedParameter(ModelNormal): + """NOTE: This class is @generated using OpenAPI. + + Do not edit the class manually. + + Attributes: + allowed_values (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + with a capitalized key describing the allowed value and an allowed + value. These dicts store the allowed enum values. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + discriminator_value_class_map (dict): A dict to go from the discriminator + variable value to the discriminator class name. + validations (dict): The key is the tuple path to the attribute + and the for var_name this is (var_name,). The value is a dict + that stores validations for max_length, min_length, max_items, + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, + inclusive_minimum, and regex. + additional_properties_type (tuple): A tuple of classes accepted + as additional properties values. + """ + + _data_store: Dict[str, Any] + _check_type: bool + + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + + @cached_class_property + def additional_properties_type(cls): + """ + 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, dict, float, int, list, str, none_type) # noqa: E501 + + _nullable = False + + @cached_class_property + def openapi_types(cls): + """ + This must be a method because a model may have properties that are + of type self, this must run after the class is loaded + + Returns + openapi_types (dict): The key is attribute name + and the value is attribute type. + """ + return { + "parameter": (str,), # noqa: E501 + "type": (str,), # noqa: E501 + "value_type": (str,), # noqa: E501 + "required": (bool,), # noqa: E501 + "allowed_values": ([dict],), # noqa: E501 + "min": (float,), # noqa: E501 + "max": (float,), # noqa: E501 + "default": (dict,), # noqa: E501 + } + + @cached_class_property + def discriminator(cls): + return None + + attribute_map: Dict[str, str] = { + "parameter": "parameter", # noqa: E501 + "type": "type", # noqa: E501 + "value_type": "value_type", # noqa: E501 + "required": "required", # noqa: E501 + "allowed_values": "allowed_values", # noqa: E501 + "min": "min", # noqa: E501 + "max": "max", # noqa: E501 + "default": "default", # noqa: E501 + } + + read_only_vars: Set[str] = set([]) + + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data( + cls: Type[T], parameter, type, value_type, required, *args, **kwargs + ) -> T: # noqa: E501 + """ModelInfoSupportedParameter - a model defined in OpenAPI + + Args: + parameter (str): The name of the parameter. + type (str): The parameter type e.g. 'one_of', 'numeric_range', or 'any'. If the type is 'one_of', then 'allowed_values' will be set, and the value specified must be one of the allowed values. 'one_of' is only compatible with value_type 'string' or 'integer'. If 'numeric_range', then 'min' and 'max' will be set, then the value specified must adhere to the value_type and must fall within the `[min, max]` range (inclusive). If 'any' then any value is allowed, as long as it adheres to the value_type. + value_type (str): The type of value the parameter accepts, e.g. 'string', 'integer', 'float', or 'boolean'. + required (bool): Whether the parameter is required (true) or optional (false). + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + allowed_values ([dict]): The allowed parameter values when the type is 'one_of'. [optional] # noqa: E501 + min (float): The minimum allowed value (inclusive) when the type is 'numeric_range'. [optional] # noqa: E501 + max (float): The maximum allowed value (inclusive) when the type is 'numeric_range'. [optional] # noqa: E501 + default (dict): The default value for the parameter when a parameter is optional. [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", ()) + + self = super(OpenApiModel, cls).__new__(cls) + + if args: + raise PineconeApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % (args, self.__class__.__name__), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.parameter = parameter + self.type = type + self.value_type = value_type + self.required = required + 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 + ): + # 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", + ] + ) + + @convert_js_args_to_python_args + def __init__(self, parameter, type, value_type, required, *args, **kwargs) -> None: # noqa: E501 + """ModelInfoSupportedParameter - a model defined in OpenAPI + + Args: + parameter (str): The name of the parameter. + type (str): The parameter type e.g. 'one_of', 'numeric_range', or 'any'. If the type is 'one_of', then 'allowed_values' will be set, and the value specified must be one of the allowed values. 'one_of' is only compatible with value_type 'string' or 'integer'. If 'numeric_range', then 'min' and 'max' will be set, then the value specified must adhere to the value_type and must fall within the `[min, max]` range (inclusive). If 'any' then any value is allowed, as long as it adheres to the value_type. + value_type (str): The type of value the parameter accepts, e.g. 'string', 'integer', 'float', or 'boolean'. + required (bool): Whether the parameter is required (true) or optional (false). + + Keyword Args: + _check_type (bool): if True, values for parameters in openapi_types + will be type checked and a TypeError will be + raised if the wrong type is input. + Defaults to True + _path_to_item (tuple/list): This is a list of keys or values to + drill down to the model in received_data + when deserializing a response + _spec_property_naming (bool): True if the variable names in the input data + are serialized names, as specified in the OpenAPI document. + False if the variable names in the input data + are pythonic names, e.g. snake case (default) + _configuration (Configuration): the instance to use when + deserializing a file_type parameter. + If passed, type conversion is attempted + If omitted no type conversion is done. + _visited_composed_classes (tuple): This stores a tuple of + classes that we have traveled through so that + if we see that class again we will not use its + discriminator again. + When traveling through a discriminator, the + composed schema that is + is traveled through is added to this set. + For example if Animal has a discriminator + petType and we pass in "Dog", and the class Dog + allOf includes Animal, we move through Animal + once using the discriminator, and pick Dog. + Then in Dog, we will make an instance of the + Animal class but this time we won't travel + through its discriminator because we passed in + _visited_composed_classes = (Animal,) + allowed_values ([dict]): The allowed parameter values when the type is 'one_of'. [optional] # noqa: E501 + min (float): The minimum allowed value (inclusive) when the type is 'numeric_range'. [optional] # noqa: E501 + max (float): The maximum allowed value (inclusive) when the type is 'numeric_range'. [optional] # noqa: E501 + default (dict): The default value for the parameter when a parameter is optional. [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", ()) + + if args: + raise PineconeApiTypeError( + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." + % (args, self.__class__.__name__), + path_to_item=_path_to_item, + valid_classes=(self.__class__,), + ) + + self._data_store = {} + self._check_type = _check_type + self._spec_property_naming = _spec_property_naming + self._path_to_item = _path_to_item + self._configuration = _configuration + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + + self.parameter = parameter + self.type = type + self.value_type = value_type + self.required = required + 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 + ): + # discard variable. + continue + setattr(self, var_name, var_value) + if var_name in self.read_only_vars: + raise PineconeApiAttributeError( + 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/openapi/inference/models/__init__.py b/pinecone/core/openapi/inference/models/__init__.py index bbb2cd34d..f338afe2a 100644 --- a/pinecone/core/openapi/inference/models/__init__.py +++ b/pinecone/core/openapi/inference/models/__init__.py @@ -18,6 +18,15 @@ from pinecone.core.openapi.inference.model.embeddings_list_usage import EmbeddingsListUsage from pinecone.core.openapi.inference.model.error_response import ErrorResponse from pinecone.core.openapi.inference.model.error_response_error import ErrorResponseError +from pinecone.core.openapi.inference.model.model_info import ModelInfo +from pinecone.core.openapi.inference.model.model_info_list import ModelInfoList +from pinecone.core.openapi.inference.model.model_info_metric import ModelInfoMetric +from pinecone.core.openapi.inference.model.model_info_supported_metrics import ( + ModelInfoSupportedMetrics, +) +from pinecone.core.openapi.inference.model.model_info_supported_parameter import ( + ModelInfoSupportedParameter, +) from pinecone.core.openapi.inference.model.ranked_document import RankedDocument from pinecone.core.openapi.inference.model.rerank_request import RerankRequest from pinecone.core.openapi.inference.model.rerank_result import RerankResult