diff --git a/IMPORTABLE_OBJECTS.md b/IMPORTABLE_OBJECTS.md new file mode 100644 index 00000000..9dca2e58 --- /dev/null +++ b/IMPORTABLE_OBJECTS.md @@ -0,0 +1,232 @@ +# Complete List of Importable Objects from the Pinecone Python Client + +This document provides a comprehensive list of every object that can be imported from the `pinecone` package. This is useful for creating replacement packages or understanding the public API surface. + +## Import from Root Package (`import pinecone` or `from pinecone import ...`) + +### Version +- `__version__` (str) - Package version string + +### Primary Client Classes +- `Pinecone` - Main synchronous client class +- `PineconeAsyncio` - Async client class +- `Admin` - Admin API client class + +### Deprecated Top-Level Functions +These functions raise `AttributeError` with migration messages when called: +- `init` - Deprecated, use `Pinecone()` instead +- `create_index` - Deprecated, use `pc.create_index()` instead +- `delete_index` - Deprecated, use `pc.delete_index()` instead +- `list_indexes` - Deprecated, use `pc.list_indexes()` instead +- `describe_index` - Deprecated, use `pc.describe_index()` instead +- `configure_index` - Deprecated, use `pc.configure_index()` instead +- `scale_index` - Deprecated, use `pc.configure_index()` instead +- `create_collection` - Deprecated, use `pc.create_collection()` instead +- `delete_collection` - Deprecated, use `pc.delete_collection()` instead +- `describe_collection` - Deprecated, use `pc.describe_collection()` instead +- `list_collections` - Deprecated, use `pc.list_collections()` instead + +### Configuration Classes +- `Config` - Configuration class +- `ConfigBuilder` - Configuration builder class +- `PineconeConfig` - Main configuration class + +### Inference Classes and Models +- `Inference` - Synchronous inference client (accessible via lazy import) +- `AsyncioInference` - Async inference client (accessible via lazy import) +- `RerankModel` - Enum/class for rerank models +- `EmbedModel` - Enum/class for embedding models +- `ModelInfo` - Model information class +- `ModelInfoList` - List of model information +- `EmbeddingsList` - List of embeddings +- `RerankResult` - Rerank result class + +### Data Plane Classes (db_data) +#### Dataclasses +- `Vector` - Vector dataclass +- `SparseValues` - Sparse values dataclass +- `SearchQuery` - Search query dataclass +- `SearchQueryVector` - Search query vector dataclass +- `SearchRerank` - Search rerank dataclass +- `FetchResponse` - Fetch response dataclass + +#### Models (from OpenAPI generated code) +- `DeleteRequest` - Delete request model +- `DescribeIndexStatsRequest` - Describe index stats request model +- `DescribeIndexStatsResponse` - Describe index stats response (alias for `IndexDescription`) +- `RpcStatus` - RPC status model +- `ScoredVector` - Scored vector model +- `SingleQueryResults` - Single query results model +- `QueryRequest` - Query request model +- `QueryResponse` - Query response model +- `UpsertResponse` - Upsert response model +- `UpdateRequest` - Update request model +- `NamespaceDescription` - Namespace description model +- `ImportErrorMode` - Import error mode enum/class + +### Control Plane Classes (db_control) +#### Enums +- `CloudProvider` - Cloud provider enum +- `AwsRegion` - AWS region enum +- `GcpRegion` - GCP region enum +- `AzureRegion` - Azure region enum +- `PodIndexEnvironment` - Pod index environment enum +- `Metric` - Metric enum (cosine, euclidean, dotproduct) +- `VectorType` - Vector type enum +- `DeletionProtection` - Deletion protection enum +- `PodType` - Pod type enum + +#### Models +- `CollectionDescription` - Collection description model +- `CollectionList` - Collection list model +- `IndexList` - Index list model +- `IndexModel` - Index model +- `IndexEmbed` - Index embed configuration +- `ByocSpec` - Bring Your Own Cloud spec +- `ServerlessSpec` - Serverless index spec +- `ServerlessSpecDefinition` - Serverless spec definition +- `PodSpec` - Pod index spec +- `PodSpecDefinition` - Pod spec definition +- `BackupModel` - Backup model +- `BackupList` - Backup list model +- `RestoreJobModel` - Restore job model +- `RestoreJobList` - Restore job list model + +#### Types (TypedDict) +- `ConfigureIndexEmbed` - Configure index embed TypedDict +- `CreateIndexForModelEmbedTypedDict` - Create index for model embed TypedDict + +### Exception Classes +- `PineconeException` - Base exception class +- `PineconeApiException` - Base API exception +- `PineconeConfigurationError` - Configuration error +- `PineconeProtocolError` - Protocol error +- `PineconeApiAttributeError` - API attribute error +- `PineconeApiTypeError` - API type error +- `PineconeApiValueError` - API value error +- `PineconeApiKeyError` - API key error +- `NotFoundException` - Not found exception (404) +- `UnauthorizedException` - Unauthorized exception (401) +- `ForbiddenException` - Forbidden exception (403) +- `ServiceException` - Service exception (5xx) +- `ListConversionException` - List conversion exception + +#### Data Plane Error Classes +- `VectorDictionaryMissingKeysError` - Vector dictionary missing keys error +- `VectorDictionaryExcessKeysError` - Vector dictionary excess keys error +- `VectorTupleLengthError` - Vector tuple length error +- `SparseValuesTypeError` - Sparse values type error +- `SparseValuesMissingKeysError` - Sparse values missing keys error +- `SparseValuesDictionaryExpectedError` - Sparse values dictionary expected error + +## Additional Objects Importable via Submodules + +### From `pinecone.db_data` +These can be imported directly from the submodule: +- `Index` - Index client class (synchronous) +- `IndexAsyncio` - Index client class (async) +- `_Index` - Alias for `Index` (backwards compatibility) +- `_IndexAsyncio` - Alias for `IndexAsyncio` (backwards compatibility) +- `QueryResponse` - Query response class +- `MetadataDictionaryExpectedError` - Metadata dictionary expected error + +### From `pinecone.db_data.types` +These TypedDict classes are not exported from root but can be imported from submodule: +- `SparseVectorTypedDict` +- `VectorTypedDict` +- `VectorMetadataTypedDict` +- `VectorTuple` +- `VectorTupleWithMetadata` +- `FilterTypedDict` +- `SearchRerankTypedDict` +- `SearchQueryTypedDict` +- `SearchQueryVectorTypedDict` + +### From `pinecone.db_control` +These can be imported directly from the submodule: +- `DBControl` - Control plane client (synchronous) +- `DBControlAsyncio` - Control plane client (async) + +### From `pinecone.inference` +These can be imported directly from the submodule (and are also lazily loaded in root): +- `Inference` - Synchronous inference client +- `AsyncioInference` - Async inference client + +### From `pinecone.config` +- `OpenApiConfiguration` - OpenAPI configuration class (not in root __all__ but available) + +### From `pinecone.openapi_support` +These are internal support classes but may be importable: +- `ApiClient` +- `AsyncioApiClient` +- `Endpoint` +- `AsyncioEndpoint` +- `Configuration` +- `OpenApiModel` +- Various other OpenAPI support utilities + +### From `pinecone.grpc` +These GRPC-related classes can be imported from the submodule: +- `GRPCIndex` +- `PineconeGRPC` +- `GRPCDeleteResponse` +- `GRPCClientConfig` +- `GRPCVector` +- `GRPCSparseValues` +- `PineconeGrpcFuture` +- `ListNamespacesResponse` + +### From `pinecone.utils` +Various utility functions and classes (internal but importable): +- `PluginAware` +- `normalize_host` +- `docslinks` +- `require_kwargs` +- `get_user_agent` +- `warn_deprecated` +- `fix_tuple_length` +- `convert_to_list` +- `setup_openapi_client` +- `setup_async_openapi_client` +- `build_plugin_setup_client` +- `parse_non_empty_args` +- `install_json_repr_override` +- `validate_and_convert_errors` +- `convert_enum_to_string` +- `filter_dict` +- `tqdm` (from `pinecone.utils.tqdm`) + +## Summary Count + +### From Root Package (`from pinecone import ...`) +- **Total items in `__all__`**: ~85-90 items (including lazy imports) + +### Categories: +- **Primary clients**: 3 (Pinecone, PineconeAsyncio, Admin) +- **Config classes**: 3 (Config, ConfigBuilder, PineconeConfig) +- **Deprecated functions**: 11 (all raise errors) +- **Inference**: 8 (Inference, AsyncioInference, RerankModel, EmbedModel, ModelInfo, ModelInfoList, EmbeddingsList, RerankResult) +- **Data plane classes**: ~20 (dataclasses, models, errors) +- **Control plane classes**: ~20 (enums, models, types) +- **Exceptions**: 14 +- **Version**: 1 (__version__) + +### Additional via Submodules +- **Data types (TypedDict)**: 9 +- **GRPC classes**: 8 +- **Utility functions**: ~15 + +## Notes + +1. **Lazy Imports**: Many classes are loaded lazily via the `_setup_lazy_imports` mechanism in `__init__.py`. They appear in `__all__` but are only imported when first accessed. + +2. **Deprecated Functions**: The deprecated top-level functions (`init`, `create_index`, etc.) are in `__all__` but raise `AttributeError` with helpful migration messages when called. They exist to provide better error messages for users migrating from older versions. + +3. **Backwards Compatibility**: Some aliases exist for backwards compatibility (e.g., `_Index` for `Index`). + +4. **Type Stubs**: The `__init__.pyi` file provides type hints and should match the actual exports. + +5. **Submodule Imports**: While many objects can be imported directly from root, they can also be imported from their specific submodules (e.g., `from pinecone.db_data import Index`). + +6. **Internal vs Public**: Some objects in submodules like `pinecone.openapi_support` and `pinecone.utils` are technically importable but are considered internal implementation details. Only items in the root `__all__` or documented in the official docs should be considered part of the public API. + diff --git a/codegen/apis b/codegen/apis index 827d26f4..aa002fda 160000 --- a/codegen/apis +++ b/codegen/apis @@ -1 +1 @@ -Subproject commit 827d26f4825902994a099595d49779d16fea3a0a +Subproject commit aa002fdaa53b8ba10d49cbd105d1770e222b45a7 diff --git a/codegen/build-oas.sh b/codegen/build-oas.sh index 5976d7b9..06f39250 100755 --- a/codegen/build-oas.sh +++ b/codegen/build-oas.sh @@ -15,9 +15,10 @@ build_dir="build" update_apis_repo() { echo "Updating apis repo" pushd codegen/apis - git fetch - git checkout main - git pull + # git fetch + # git checkout main + # git pull + just clean just build popd } diff --git a/docs/db_control/serverless-indexes.md b/docs/db_control/serverless-indexes.md index 1c3944f3..066d2140 100644 --- a/docs/db_control/serverless-indexes.md +++ b/docs/db_control/serverless-indexes.md @@ -126,6 +126,80 @@ pc.create_index( ) ``` +## Read capacity configuration + +Serverless indexes support two read capacity modes: OnDemand (default) and Dedicated. By default, indexes are created with OnDemand read capacity, which automatically scales to handle your query load without pre-allocated resources. + +### OnDemand read capacity (default) + +OnDemand mode is the default and doesn't require any configuration. If you want to explicitly specify it, you can pass `read_capacity` to `ServerlessSpec`: + +```python +from pinecone import ( + Pinecone, + ServerlessSpec, + CloudProvider, + AwsRegion, + Metric +) + +pc = Pinecone(api_key='<>') + +pc.create_index( + name='my-index', + dimension=1536, + metric=Metric.COSINE, + spec=ServerlessSpec( + cloud=CloudProvider.AWS, + region=AwsRegion.US_WEST_2, + read_capacity={"mode": "OnDemand"} + ) +) +``` + +### Dedicated read capacity + +For workloads that require guaranteed capacity and lower latency, you can configure dedicated read nodes. This allows you to pre-allocate compute resources for query handling. When using Dedicated mode, you must specify: + +- `node_type`: The type of machines to use (`"b1"` or `"t1"`). `"t1"` includes increased processing power and memory. +- `scaling`: The scaling strategy. Currently only `"Manual"` is supported. +- `manual`: Manual scaling configuration with `shards` and `replicas`. + +```python +from pinecone import ( + Pinecone, + ServerlessSpec, + CloudProvider, + AwsRegion, + Metric +) + +pc = Pinecone(api_key='<>') + +pc.create_index( + name='my-index', + dimension=1536, + metric=Metric.COSINE, + spec=ServerlessSpec( + cloud=CloudProvider.AWS, + region=AwsRegion.US_WEST_2, + read_capacity={ + "mode": "Dedicated", + "dedicated": { + "node_type": "t1", + "scaling": "Manual", + "manual": { + "shards": 2, + "replicas": 2 + } + } + } + ) +) +``` + +For more details on dedicated read capacity, see the [dedicated read nodes guide](https://docs.pinecone.io/guides/index-data/dedicated-read-nodes). + ## Configuring, listing, describing, and deleting See [shared index actions](shared-index-actions.md) to learn about how to manage the lifecycle of your index after it is created. diff --git a/pinecone/__init__.pyi b/pinecone/__init__.pyi index e4af2ca1..ccca49ad 100644 --- a/pinecone/__init__.pyi +++ b/pinecone/__init__.pyi @@ -78,10 +78,7 @@ from pinecone.db_control.models import ( PodSpec, PodSpecDefinition, ) -from pinecone.db_control.types import ( - ConfigureIndexEmbed, - CreateIndexForModelEmbedTypedDict, -) +from pinecone.db_control.types import ConfigureIndexEmbed, CreateIndexForModelEmbedTypedDict from pinecone.pinecone import Pinecone from pinecone.pinecone_asyncio import PineconeAsyncio diff --git a/pinecone/config/__init__.py b/pinecone/config/__init__.py index a950300e..0430dc31 100644 --- a/pinecone/config/__init__.py +++ b/pinecone/config/__init__.py @@ -5,12 +5,7 @@ from .openapi_configuration import Configuration as OpenApiConfiguration from .pinecone_config import PineconeConfig -__all__ = [ - "ConfigBuilder", - "Config", - "OpenApiConfiguration", - "PineconeConfig", -] +__all__ = ["ConfigBuilder", "Config", "OpenApiConfiguration", "PineconeConfig"] if os.getenv("PINECONE_DEBUG") is not None: logging.getLogger("pinecone").setLevel(level=logging.DEBUG) diff --git a/pinecone/core/openapi/admin/__init__.py b/pinecone/core/openapi/admin/__init__.py index 18e8567a..72546a97 100644 --- a/pinecone/core/openapi/admin/__init__.py +++ b/pinecone/core/openapi/admin/__init__.py @@ -7,7 +7,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-04 +The version of the OpenAPI document: 2025-10 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-04" +API_VERSION = "2025-10" diff --git a/pinecone/core/openapi/admin/api/api_keys_api.py b/pinecone/core/openapi/admin/api/api_keys_api.py index 867b3db8..93e6cf44 100644 --- a/pinecone/core/openapi/admin/api/api_keys_api.py +++ b/pinecone/core/openapi/admin/api/api_keys_api.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ @@ -26,8 +26,9 @@ from pinecone.core.openapi.admin.model.api_key import APIKey from pinecone.core.openapi.admin.model.api_key_with_secret import APIKeyWithSecret from pinecone.core.openapi.admin.model.create_api_key_request import CreateAPIKeyRequest -from pinecone.core.openapi.admin.model.inline_response2001 import InlineResponse2001 -from pinecone.core.openapi.admin.model.inline_response401 import InlineResponse401 +from pinecone.core.openapi.admin.model.error_response import ErrorResponse +from pinecone.core.openapi.admin.model.list_api_keys_response import ListApiKeysResponse +from pinecone.core.openapi.admin.model.update_api_key_request import UpdateAPIKeyRequest class APIKeysApi: @@ -42,7 +43,11 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client def __create_api_key( - self, project_id, create_api_key_request, **kwargs: ExtraOpenApiKwargsTypedDict + self, + project_id, + create_api_key_request, + x_pinecone_api_version="2025-10", + **kwargs: ExtraOpenApiKwargsTypedDict, ): """Create an API key # noqa: E501 @@ -50,12 +55,13 @@ def __create_api_key( This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_api_key(project_id, create_api_key_request, async_req=True) + >>> thread = api.create_api_key(project_id, create_api_key_request, x_pinecone_api_version="2025-10", async_req=True) >>> result = thread.get() Args: project_id (str): Project ID create_api_key_request (CreateAPIKeyRequest): The details of the new API key. + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -81,6 +87,7 @@ def __create_api_key( thread. """ kwargs = self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["project_id"] = project_id kwargs["create_api_key_request"] = create_api_key_request return self.call_with_http_info(**kwargs) @@ -95,8 +102,8 @@ def __create_api_key( "servers": None, }, params_map={ - "all": ["project_id", "create_api_key_request"], - "required": ["project_id", "create_api_key_request"], + "all": ["x_pinecone_api_version", "project_id", "create_api_key_request"], + "required": ["x_pinecone_api_version", "project_id", "create_api_key_request"], "nullable": [], "enum": [], "validation": [], @@ -105,11 +112,19 @@ def __create_api_key( "validations": {}, "allowed_values": {}, "openapi_types": { + "x_pinecone_api_version": (str,), "project_id": (str,), "create_api_key_request": (CreateAPIKeyRequest,), }, - "attribute_map": {"project_id": "project_id"}, - "location_map": {"project_id": "path", "create_api_key_request": "body"}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "project_id": "project_id", + }, + "location_map": { + "x_pinecone_api_version": "header", + "project_id": "path", + "create_api_key_request": "body", + }, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, @@ -117,18 +132,24 @@ def __create_api_key( callable=__create_api_key, ) - def __delete_api_key(self, api_key_id, **kwargs: ExtraOpenApiKwargsTypedDict): + def __delete_api_key( + self, + api_key_id, + x_pinecone_api_version="2025-10", + **kwargs: ExtraOpenApiKwargsTypedDict, + ): """Delete an API key # noqa: E501 Delete an API key from 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.delete_api_key(api_key_id, async_req=True) + >>> thread = api.delete_api_key(api_key_id, x_pinecone_api_version="2025-10", async_req=True) >>> result = thread.get() Args: api_key_id (str): API key ID + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -154,6 +175,7 @@ def __delete_api_key(self, api_key_id, **kwargs: ExtraOpenApiKwargsTypedDict): thread. """ kwargs = self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["api_key_id"] = api_key_id return self.call_with_http_info(**kwargs) @@ -167,8 +189,8 @@ def __delete_api_key(self, api_key_id, **kwargs: ExtraOpenApiKwargsTypedDict): "servers": None, }, params_map={ - "all": ["api_key_id"], - "required": ["api_key_id"], + "all": ["x_pinecone_api_version", "api_key_id"], + "required": ["x_pinecone_api_version", "api_key_id"], "nullable": [], "enum": [], "validation": [], @@ -176,9 +198,12 @@ def __delete_api_key(self, api_key_id, **kwargs: ExtraOpenApiKwargsTypedDict): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"api_key_id": (str,)}, - "attribute_map": {"api_key_id": "api_key_id"}, - "location_map": {"api_key_id": "path"}, + "openapi_types": {"x_pinecone_api_version": (str,), "api_key_id": (str,)}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "api_key_id": "api_key_id", + }, + "location_map": {"x_pinecone_api_version": "header", "api_key_id": "path"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": []}, @@ -186,18 +211,24 @@ def __delete_api_key(self, api_key_id, **kwargs: ExtraOpenApiKwargsTypedDict): callable=__delete_api_key, ) - def __fetch_api_key(self, api_key_id, **kwargs: ExtraOpenApiKwargsTypedDict): + def __fetch_api_key( + self, + api_key_id, + x_pinecone_api_version="2025-10", + **kwargs: ExtraOpenApiKwargsTypedDict, + ): """Get API key details # noqa: E501 Get the details of an API key, excluding the API key secret. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.fetch_api_key(api_key_id, async_req=True) + >>> thread = api.fetch_api_key(api_key_id, x_pinecone_api_version="2025-10", async_req=True) >>> result = thread.get() Args: api_key_id (str): API key ID + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -223,6 +254,7 @@ def __fetch_api_key(self, api_key_id, **kwargs: ExtraOpenApiKwargsTypedDict): thread. """ kwargs = self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["api_key_id"] = api_key_id return self.call_with_http_info(**kwargs) @@ -236,8 +268,8 @@ def __fetch_api_key(self, api_key_id, **kwargs: ExtraOpenApiKwargsTypedDict): "servers": None, }, params_map={ - "all": ["api_key_id"], - "required": ["api_key_id"], + "all": ["x_pinecone_api_version", "api_key_id"], + "required": ["x_pinecone_api_version", "api_key_id"], "nullable": [], "enum": [], "validation": [], @@ -245,9 +277,12 @@ def __fetch_api_key(self, api_key_id, **kwargs: ExtraOpenApiKwargsTypedDict): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"api_key_id": (str,)}, - "attribute_map": {"api_key_id": "api_key_id"}, - "location_map": {"api_key_id": "path"}, + "openapi_types": {"x_pinecone_api_version": (str,), "api_key_id": (str,)}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "api_key_id": "api_key_id", + }, + "location_map": {"x_pinecone_api_version": "header", "api_key_id": "path"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": []}, @@ -255,18 +290,24 @@ def __fetch_api_key(self, api_key_id, **kwargs: ExtraOpenApiKwargsTypedDict): callable=__fetch_api_key, ) - def __list_api_keys(self, project_id, **kwargs: ExtraOpenApiKwargsTypedDict): + def __list_api_keys( + self, + project_id, + x_pinecone_api_version="2025-10", + **kwargs: ExtraOpenApiKwargsTypedDict, + ): """List API keys # noqa: E501 List all API keys 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_api_keys(project_id, async_req=True) + >>> thread = api.list_api_keys(project_id, x_pinecone_api_version="2025-10", async_req=True) >>> result = thread.get() Args: project_id (str): Project ID + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -287,17 +328,18 @@ def __list_api_keys(self, project_id, **kwargs: ExtraOpenApiKwargsTypedDict): async_req (bool): execute request asynchronously Returns: - InlineResponse2001 + ListApiKeysResponse If the method is called asynchronously, returns the request thread. """ kwargs = self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["project_id"] = project_id return self.call_with_http_info(**kwargs) self.list_api_keys = _Endpoint( settings={ - "response_type": (InlineResponse2001,), + "response_type": (ListApiKeysResponse,), "auth": ["BearerAuth"], "endpoint_path": "/admin/projects/{project_id}/api-keys", "operation_id": "list_api_keys", @@ -305,8 +347,8 @@ def __list_api_keys(self, project_id, **kwargs: ExtraOpenApiKwargsTypedDict): "servers": None, }, params_map={ - "all": ["project_id"], - "required": ["project_id"], + "all": ["x_pinecone_api_version", "project_id"], + "required": ["x_pinecone_api_version", "project_id"], "nullable": [], "enum": [], "validation": [], @@ -314,9 +356,12 @@ def __list_api_keys(self, project_id, **kwargs: ExtraOpenApiKwargsTypedDict): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"project_id": (str,)}, - "attribute_map": {"project_id": "project_id"}, - "location_map": {"project_id": "path"}, + "openapi_types": {"x_pinecone_api_version": (str,), "project_id": (str,)}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "project_id": "project_id", + }, + "location_map": {"x_pinecone_api_version": "header", "project_id": "path"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": []}, @@ -324,6 +369,96 @@ def __list_api_keys(self, project_id, **kwargs: ExtraOpenApiKwargsTypedDict): callable=__list_api_keys, ) + def __update_api_key( + self, + api_key_id, + update_api_key_request, + x_pinecone_api_version="2025-10", + **kwargs: ExtraOpenApiKwargsTypedDict, + ): + """Update an API key # noqa: E501 + + Update the name and roles of an API key. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.update_api_key(api_key_id, update_api_key_request, x_pinecone_api_version="2025-10", async_req=True) + >>> result = thread.get() + + Args: + api_key_id (str): API key ID + update_api_key_request (UpdateAPIKeyRequest): Updated name and roles for the API key. + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] + + 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: + APIKey + If the method is called asynchronously, returns the request + thread. + """ + kwargs = self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["api_key_id"] = api_key_id + kwargs["update_api_key_request"] = update_api_key_request + return self.call_with_http_info(**kwargs) + + self.update_api_key = _Endpoint( + settings={ + "response_type": (APIKey,), + "auth": ["BearerAuth"], + "endpoint_path": "/admin/api-keys/{api_key_id}", + "operation_id": "update_api_key", + "http_method": "PATCH", + "servers": None, + }, + params_map={ + "all": ["x_pinecone_api_version", "api_key_id", "update_api_key_request"], + "required": ["x_pinecone_api_version", "api_key_id", "update_api_key_request"], + "nullable": [], + "enum": [], + "validation": [], + }, + root_map={ + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "api_key_id": (str,), + "update_api_key_request": (UpdateAPIKeyRequest,), + }, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "api_key_id": "api_key_id", + }, + "location_map": { + "x_pinecone_api_version": "header", + "api_key_id": "path", + "update_api_key_request": "body", + }, + "collection_format_map": {}, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + callable=__update_api_key, + ) + class AsyncioAPIKeysApi: """NOTE: This class is @generated using OpenAPI @@ -336,7 +471,9 @@ def __init__(self, api_client=None) -> None: api_client = AsyncioApiClient() self.api_client = api_client - async def __create_api_key(self, project_id, create_api_key_request, **kwargs): + async def __create_api_key( + self, project_id, create_api_key_request, x_pinecone_api_version="2025-10", **kwargs + ): """Create an API key # noqa: E501 Create a new API key for a project. Developers can use the API key to authenticate requests to Pinecone's Data Plane and Control Plane APIs. # noqa: E501 @@ -345,6 +482,7 @@ async def __create_api_key(self, project_id, create_api_key_request, **kwargs): Args: project_id (str): Project ID create_api_key_request (CreateAPIKeyRequest): The details of the new API key. + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -367,6 +505,7 @@ async def __create_api_key(self, project_id, create_api_key_request, **kwargs): APIKeyWithSecret """ self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["project_id"] = project_id kwargs["create_api_key_request"] = create_api_key_request return await self.call_with_http_info(**kwargs) @@ -381,8 +520,8 @@ async def __create_api_key(self, project_id, create_api_key_request, **kwargs): "servers": None, }, params_map={ - "all": ["project_id", "create_api_key_request"], - "required": ["project_id", "create_api_key_request"], + "all": ["x_pinecone_api_version", "project_id", "create_api_key_request"], + "required": ["x_pinecone_api_version", "project_id", "create_api_key_request"], "nullable": [], "enum": [], "validation": [], @@ -391,11 +530,19 @@ async def __create_api_key(self, project_id, create_api_key_request, **kwargs): "validations": {}, "allowed_values": {}, "openapi_types": { + "x_pinecone_api_version": (str,), "project_id": (str,), "create_api_key_request": (CreateAPIKeyRequest,), }, - "attribute_map": {"project_id": "project_id"}, - "location_map": {"project_id": "path", "create_api_key_request": "body"}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "project_id": "project_id", + }, + "location_map": { + "x_pinecone_api_version": "header", + "project_id": "path", + "create_api_key_request": "body", + }, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, @@ -403,7 +550,7 @@ async def __create_api_key(self, project_id, create_api_key_request, **kwargs): callable=__create_api_key, ) - async def __delete_api_key(self, api_key_id, **kwargs): + async def __delete_api_key(self, api_key_id, x_pinecone_api_version="2025-10", **kwargs): """Delete an API key # noqa: E501 Delete an API key from a project. # noqa: E501 @@ -411,6 +558,7 @@ async def __delete_api_key(self, api_key_id, **kwargs): Args: api_key_id (str): API key ID + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -433,6 +581,7 @@ async def __delete_api_key(self, api_key_id, **kwargs): None """ self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["api_key_id"] = api_key_id return await self.call_with_http_info(**kwargs) @@ -446,8 +595,8 @@ async def __delete_api_key(self, api_key_id, **kwargs): "servers": None, }, params_map={ - "all": ["api_key_id"], - "required": ["api_key_id"], + "all": ["x_pinecone_api_version", "api_key_id"], + "required": ["x_pinecone_api_version", "api_key_id"], "nullable": [], "enum": [], "validation": [], @@ -455,9 +604,12 @@ async def __delete_api_key(self, api_key_id, **kwargs): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"api_key_id": (str,)}, - "attribute_map": {"api_key_id": "api_key_id"}, - "location_map": {"api_key_id": "path"}, + "openapi_types": {"x_pinecone_api_version": (str,), "api_key_id": (str,)}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "api_key_id": "api_key_id", + }, + "location_map": {"x_pinecone_api_version": "header", "api_key_id": "path"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": []}, @@ -465,7 +617,7 @@ async def __delete_api_key(self, api_key_id, **kwargs): callable=__delete_api_key, ) - async def __fetch_api_key(self, api_key_id, **kwargs): + async def __fetch_api_key(self, api_key_id, x_pinecone_api_version="2025-10", **kwargs): """Get API key details # noqa: E501 Get the details of an API key, excluding the API key secret. # noqa: E501 @@ -473,6 +625,7 @@ async def __fetch_api_key(self, api_key_id, **kwargs): Args: api_key_id (str): API key ID + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -495,6 +648,7 @@ async def __fetch_api_key(self, api_key_id, **kwargs): APIKey """ self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["api_key_id"] = api_key_id return await self.call_with_http_info(**kwargs) @@ -508,8 +662,8 @@ async def __fetch_api_key(self, api_key_id, **kwargs): "servers": None, }, params_map={ - "all": ["api_key_id"], - "required": ["api_key_id"], + "all": ["x_pinecone_api_version", "api_key_id"], + "required": ["x_pinecone_api_version", "api_key_id"], "nullable": [], "enum": [], "validation": [], @@ -517,9 +671,12 @@ async def __fetch_api_key(self, api_key_id, **kwargs): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"api_key_id": (str,)}, - "attribute_map": {"api_key_id": "api_key_id"}, - "location_map": {"api_key_id": "path"}, + "openapi_types": {"x_pinecone_api_version": (str,), "api_key_id": (str,)}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "api_key_id": "api_key_id", + }, + "location_map": {"x_pinecone_api_version": "header", "api_key_id": "path"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": []}, @@ -527,7 +684,7 @@ async def __fetch_api_key(self, api_key_id, **kwargs): callable=__fetch_api_key, ) - async def __list_api_keys(self, project_id, **kwargs): + async def __list_api_keys(self, project_id, x_pinecone_api_version="2025-10", **kwargs): """List API keys # noqa: E501 List all API keys in a project. # noqa: E501 @@ -535,6 +692,7 @@ async def __list_api_keys(self, project_id, **kwargs): Args: project_id (str): Project ID + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -554,15 +712,16 @@ async def __list_api_keys(self, project_id, **kwargs): Default is True. Returns: - InlineResponse2001 + ListApiKeysResponse """ self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["project_id"] = project_id return await self.call_with_http_info(**kwargs) self.list_api_keys = _AsyncioEndpoint( settings={ - "response_type": (InlineResponse2001,), + "response_type": (ListApiKeysResponse,), "auth": ["BearerAuth"], "endpoint_path": "/admin/projects/{project_id}/api-keys", "operation_id": "list_api_keys", @@ -570,8 +729,8 @@ async def __list_api_keys(self, project_id, **kwargs): "servers": None, }, params_map={ - "all": ["project_id"], - "required": ["project_id"], + "all": ["x_pinecone_api_version", "project_id"], + "required": ["x_pinecone_api_version", "project_id"], "nullable": [], "enum": [], "validation": [], @@ -579,12 +738,94 @@ async def __list_api_keys(self, project_id, **kwargs): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"project_id": (str,)}, - "attribute_map": {"project_id": "project_id"}, - "location_map": {"project_id": "path"}, + "openapi_types": {"x_pinecone_api_version": (str,), "project_id": (str,)}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "project_id": "project_id", + }, + "location_map": {"x_pinecone_api_version": "header", "project_id": "path"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, callable=__list_api_keys, ) + + async def __update_api_key( + self, api_key_id, update_api_key_request, x_pinecone_api_version="2025-10", **kwargs + ): + """Update an API key # noqa: E501 + + Update the name and roles of an API key. # noqa: E501 + + + Args: + api_key_id (str): API key ID + update_api_key_request (UpdateAPIKeyRequest): Updated name and roles for the API key. + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] + + 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: + APIKey + """ + self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["api_key_id"] = api_key_id + kwargs["update_api_key_request"] = update_api_key_request + return await self.call_with_http_info(**kwargs) + + self.update_api_key = _AsyncioEndpoint( + settings={ + "response_type": (APIKey,), + "auth": ["BearerAuth"], + "endpoint_path": "/admin/api-keys/{api_key_id}", + "operation_id": "update_api_key", + "http_method": "PATCH", + "servers": None, + }, + params_map={ + "all": ["x_pinecone_api_version", "api_key_id", "update_api_key_request"], + "required": ["x_pinecone_api_version", "api_key_id", "update_api_key_request"], + "nullable": [], + "enum": [], + "validation": [], + }, + root_map={ + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "api_key_id": (str,), + "update_api_key_request": (UpdateAPIKeyRequest,), + }, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "api_key_id": "api_key_id", + }, + "location_map": { + "x_pinecone_api_version": "header", + "api_key_id": "path", + "update_api_key_request": "body", + }, + "collection_format_map": {}, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + callable=__update_api_key, + ) diff --git a/pinecone/core/openapi/admin/api/organizations_api.py b/pinecone/core/openapi/admin/api/organizations_api.py new file mode 100644 index 00000000..c3cca33c --- /dev/null +++ b/pinecone/core/openapi/admin/api/organizations_api.py @@ -0,0 +1,663 @@ +""" +Pinecone Admin API + +Provides an API for managing a Pinecone organization and its resources. # noqa: E501 + +This file is @generated using OpenAPI. + +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io +""" + +from pinecone.openapi_support import ApiClient, AsyncioApiClient +from pinecone.openapi_support.endpoint_utils import ( + ExtraOpenApiKwargsTypedDict, + KwargsWithOpenApiKwargDefaultsTypedDict, +) +from pinecone.openapi_support.endpoint import Endpoint as _Endpoint, ExtraOpenApiKwargsTypedDict +from pinecone.openapi_support.asyncio_endpoint import AsyncioEndpoint as _AsyncioEndpoint +from pinecone.openapi_support.model_utils import ( # noqa: F401 + date, + datetime, + file_type, + none_type, + validate_and_convert_types, +) +from pinecone.core.openapi.admin.model.error_response import ErrorResponse +from pinecone.core.openapi.admin.model.organization import Organization +from pinecone.core.openapi.admin.model.organization_list import OrganizationList +from pinecone.core.openapi.admin.model.update_organization_request import UpdateOrganizationRequest + + +class OrganizationsApi: + """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 = ApiClient() + self.api_client = api_client + + def __delete_organization( + self, + organization_id, + x_pinecone_api_version="2025-10", + **kwargs: ExtraOpenApiKwargsTypedDict, + ): + """Delete an organization # noqa: E501 + + Delete an organization and all its associated configuration. Before deleting an organization, you must delete all projects (including indexes, assistants, backups, and collections) associated with the organization. # 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_organization(organization_id, x_pinecone_api_version="2025-10", async_req=True) + >>> result = thread.get() + + Args: + organization_id (str): Organization ID + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] + + 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: + None + If the method is called asynchronously, returns the request + thread. + """ + kwargs = self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["organization_id"] = organization_id + return self.call_with_http_info(**kwargs) + + self.delete_organization = _Endpoint( + settings={ + "response_type": None, + "auth": ["BearerAuth"], + "endpoint_path": "/admin/organizations/{organization_id}", + "operation_id": "delete_organization", + "http_method": "DELETE", + "servers": None, + }, + params_map={ + "all": ["x_pinecone_api_version", "organization_id"], + "required": ["x_pinecone_api_version", "organization_id"], + "nullable": [], + "enum": [], + "validation": [], + }, + root_map={ + "validations": {}, + "allowed_values": {}, + "openapi_types": {"x_pinecone_api_version": (str,), "organization_id": (str,)}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "organization_id": "organization_id", + }, + "location_map": {"x_pinecone_api_version": "header", "organization_id": "path"}, + "collection_format_map": {}, + }, + headers_map={"accept": ["application/json"], "content_type": []}, + api_client=api_client, + callable=__delete_organization, + ) + + def __fetch_organization( + self, + organization_id, + x_pinecone_api_version="2025-10", + **kwargs: ExtraOpenApiKwargsTypedDict, + ): + """Get organization details # noqa: E501 + + Get details about an organization. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.fetch_organization(organization_id, x_pinecone_api_version="2025-10", async_req=True) + >>> result = thread.get() + + Args: + organization_id (str): Organization ID + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] + + 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: + Organization + If the method is called asynchronously, returns the request + thread. + """ + kwargs = self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["organization_id"] = organization_id + return self.call_with_http_info(**kwargs) + + self.fetch_organization = _Endpoint( + settings={ + "response_type": (Organization,), + "auth": ["BearerAuth"], + "endpoint_path": "/admin/organizations/{organization_id}", + "operation_id": "fetch_organization", + "http_method": "GET", + "servers": None, + }, + params_map={ + "all": ["x_pinecone_api_version", "organization_id"], + "required": ["x_pinecone_api_version", "organization_id"], + "nullable": [], + "enum": [], + "validation": [], + }, + root_map={ + "validations": {}, + "allowed_values": {}, + "openapi_types": {"x_pinecone_api_version": (str,), "organization_id": (str,)}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "organization_id": "organization_id", + }, + "location_map": {"x_pinecone_api_version": "header", "organization_id": "path"}, + "collection_format_map": {}, + }, + headers_map={"accept": ["application/json"], "content_type": []}, + api_client=api_client, + callable=__fetch_organization, + ) + + def __list_organizations( + self, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict + ): + """List organizations # noqa: E501 + + List all organizations associated with an account. # 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_organizations(x_pinecone_api_version="2025-10", async_req=True) + >>> result = thread.get() + + Args: + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] + + 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: + OrganizationList + If the method is called asynchronously, returns the request + thread. + """ + kwargs = self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + return self.call_with_http_info(**kwargs) + + self.list_organizations = _Endpoint( + settings={ + "response_type": (OrganizationList,), + "auth": ["BearerAuth"], + "endpoint_path": "/admin/organizations", + "operation_id": "list_organizations", + "http_method": "GET", + "servers": None, + }, + params_map={ + "all": ["x_pinecone_api_version"], + "required": ["x_pinecone_api_version"], + "nullable": [], + "enum": [], + "validation": [], + }, + root_map={ + "validations": {}, + "allowed_values": {}, + "openapi_types": {"x_pinecone_api_version": (str,)}, + "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, + "location_map": {"x_pinecone_api_version": "header"}, + "collection_format_map": {}, + }, + headers_map={"accept": ["application/json"], "content_type": []}, + api_client=api_client, + callable=__list_organizations, + ) + + def __update_organization( + self, + organization_id, + update_organization_request, + x_pinecone_api_version="2025-10", + **kwargs: ExtraOpenApiKwargsTypedDict, + ): + """Update an organization # noqa: E501 + + Update an organization's name. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + + >>> thread = api.update_organization(organization_id, update_organization_request, x_pinecone_api_version="2025-10", async_req=True) + >>> result = thread.get() + + Args: + organization_id (str): Organization ID + update_organization_request (UpdateOrganizationRequest): Organization details to be updated. + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] + + 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: + Organization + If the method is called asynchronously, returns the request + thread. + """ + kwargs = self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["organization_id"] = organization_id + kwargs["update_organization_request"] = update_organization_request + return self.call_with_http_info(**kwargs) + + self.update_organization = _Endpoint( + settings={ + "response_type": (Organization,), + "auth": ["BearerAuth"], + "endpoint_path": "/admin/organizations/{organization_id}", + "operation_id": "update_organization", + "http_method": "PATCH", + "servers": None, + }, + params_map={ + "all": ["x_pinecone_api_version", "organization_id", "update_organization_request"], + "required": [ + "x_pinecone_api_version", + "organization_id", + "update_organization_request", + ], + "nullable": [], + "enum": [], + "validation": [], + }, + root_map={ + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "organization_id": (str,), + "update_organization_request": (UpdateOrganizationRequest,), + }, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "organization_id": "organization_id", + }, + "location_map": { + "x_pinecone_api_version": "header", + "organization_id": "path", + "update_organization_request": "body", + }, + "collection_format_map": {}, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + callable=__update_organization, + ) + + +class AsyncioOrganizationsApi: + """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 __delete_organization( + self, organization_id, x_pinecone_api_version="2025-10", **kwargs + ): + """Delete an organization # noqa: E501 + + Delete an organization and all its associated configuration. Before deleting an organization, you must delete all projects (including indexes, assistants, backups, and collections) associated with the organization. # noqa: E501 + + + Args: + organization_id (str): Organization ID + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] + + 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["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["organization_id"] = organization_id + return await self.call_with_http_info(**kwargs) + + self.delete_organization = _AsyncioEndpoint( + settings={ + "response_type": None, + "auth": ["BearerAuth"], + "endpoint_path": "/admin/organizations/{organization_id}", + "operation_id": "delete_organization", + "http_method": "DELETE", + "servers": None, + }, + params_map={ + "all": ["x_pinecone_api_version", "organization_id"], + "required": ["x_pinecone_api_version", "organization_id"], + "nullable": [], + "enum": [], + "validation": [], + }, + root_map={ + "validations": {}, + "allowed_values": {}, + "openapi_types": {"x_pinecone_api_version": (str,), "organization_id": (str,)}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "organization_id": "organization_id", + }, + "location_map": {"x_pinecone_api_version": "header", "organization_id": "path"}, + "collection_format_map": {}, + }, + headers_map={"accept": ["application/json"], "content_type": []}, + api_client=api_client, + callable=__delete_organization, + ) + + async def __fetch_organization( + self, organization_id, x_pinecone_api_version="2025-10", **kwargs + ): + """Get organization details # noqa: E501 + + Get details about an organization. # noqa: E501 + + + Args: + organization_id (str): Organization ID + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] + + 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: + Organization + """ + self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["organization_id"] = organization_id + return await self.call_with_http_info(**kwargs) + + self.fetch_organization = _AsyncioEndpoint( + settings={ + "response_type": (Organization,), + "auth": ["BearerAuth"], + "endpoint_path": "/admin/organizations/{organization_id}", + "operation_id": "fetch_organization", + "http_method": "GET", + "servers": None, + }, + params_map={ + "all": ["x_pinecone_api_version", "organization_id"], + "required": ["x_pinecone_api_version", "organization_id"], + "nullable": [], + "enum": [], + "validation": [], + }, + root_map={ + "validations": {}, + "allowed_values": {}, + "openapi_types": {"x_pinecone_api_version": (str,), "organization_id": (str,)}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "organization_id": "organization_id", + }, + "location_map": {"x_pinecone_api_version": "header", "organization_id": "path"}, + "collection_format_map": {}, + }, + headers_map={"accept": ["application/json"], "content_type": []}, + api_client=api_client, + callable=__fetch_organization, + ) + + async def __list_organizations(self, x_pinecone_api_version="2025-10", **kwargs): + """List organizations # noqa: E501 + + List all organizations associated with an account. # noqa: E501 + + + Args: + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] + + 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: + OrganizationList + """ + self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + return await self.call_with_http_info(**kwargs) + + self.list_organizations = _AsyncioEndpoint( + settings={ + "response_type": (OrganizationList,), + "auth": ["BearerAuth"], + "endpoint_path": "/admin/organizations", + "operation_id": "list_organizations", + "http_method": "GET", + "servers": None, + }, + params_map={ + "all": ["x_pinecone_api_version"], + "required": ["x_pinecone_api_version"], + "nullable": [], + "enum": [], + "validation": [], + }, + root_map={ + "validations": {}, + "allowed_values": {}, + "openapi_types": {"x_pinecone_api_version": (str,)}, + "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, + "location_map": {"x_pinecone_api_version": "header"}, + "collection_format_map": {}, + }, + headers_map={"accept": ["application/json"], "content_type": []}, + api_client=api_client, + callable=__list_organizations, + ) + + async def __update_organization( + self, + organization_id, + update_organization_request, + x_pinecone_api_version="2025-10", + **kwargs, + ): + """Update an organization # noqa: E501 + + Update an organization's name. # noqa: E501 + + + Args: + organization_id (str): Organization ID + update_organization_request (UpdateOrganizationRequest): Organization details to be updated. + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] + + 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: + Organization + """ + self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["organization_id"] = organization_id + kwargs["update_organization_request"] = update_organization_request + return await self.call_with_http_info(**kwargs) + + self.update_organization = _AsyncioEndpoint( + settings={ + "response_type": (Organization,), + "auth": ["BearerAuth"], + "endpoint_path": "/admin/organizations/{organization_id}", + "operation_id": "update_organization", + "http_method": "PATCH", + "servers": None, + }, + params_map={ + "all": ["x_pinecone_api_version", "organization_id", "update_organization_request"], + "required": [ + "x_pinecone_api_version", + "organization_id", + "update_organization_request", + ], + "nullable": [], + "enum": [], + "validation": [], + }, + root_map={ + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "organization_id": (str,), + "update_organization_request": (UpdateOrganizationRequest,), + }, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "organization_id": "organization_id", + }, + "location_map": { + "x_pinecone_api_version": "header", + "organization_id": "path", + "update_organization_request": "body", + }, + "collection_format_map": {}, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + callable=__update_organization, + ) diff --git a/pinecone/core/openapi/admin/api/projects_api.py b/pinecone/core/openapi/admin/api/projects_api.py index 0383d75f..ee2a9be6 100644 --- a/pinecone/core/openapi/admin/api/projects_api.py +++ b/pinecone/core/openapi/admin/api/projects_api.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ @@ -24,9 +24,9 @@ validate_and_convert_types, ) from pinecone.core.openapi.admin.model.create_project_request import CreateProjectRequest -from pinecone.core.openapi.admin.model.inline_response200 import InlineResponse200 -from pinecone.core.openapi.admin.model.inline_response401 import InlineResponse401 +from pinecone.core.openapi.admin.model.error_response import ErrorResponse from pinecone.core.openapi.admin.model.project import Project +from pinecone.core.openapi.admin.model.project_list import ProjectList from pinecone.core.openapi.admin.model.update_project_request import UpdateProjectRequest @@ -41,18 +41,24 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient() self.api_client = api_client - def __create_project(self, create_project_request, **kwargs: ExtraOpenApiKwargsTypedDict): + def __create_project( + self, + create_project_request, + x_pinecone_api_version="2025-10", + **kwargs: ExtraOpenApiKwargsTypedDict, + ): """Create a new project # noqa: E501 Creates a new 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.create_project(create_project_request, async_req=True) + >>> thread = api.create_project(create_project_request, x_pinecone_api_version="2025-10", async_req=True) >>> result = thread.get() Args: create_project_request (CreateProjectRequest): The details of the new project. + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -78,6 +84,7 @@ def __create_project(self, create_project_request, **kwargs: ExtraOpenApiKwargsT thread. """ kwargs = self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["create_project_request"] = create_project_request return self.call_with_http_info(**kwargs) @@ -91,8 +98,8 @@ def __create_project(self, create_project_request, **kwargs: ExtraOpenApiKwargsT "servers": None, }, params_map={ - "all": ["create_project_request"], - "required": ["create_project_request"], + "all": ["x_pinecone_api_version", "create_project_request"], + "required": ["x_pinecone_api_version", "create_project_request"], "nullable": [], "enum": [], "validation": [], @@ -100,9 +107,15 @@ def __create_project(self, create_project_request, **kwargs: ExtraOpenApiKwargsT root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"create_project_request": (CreateProjectRequest,)}, - "attribute_map": {}, - "location_map": {"create_project_request": "body"}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "create_project_request": (CreateProjectRequest,), + }, + "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, + "location_map": { + "x_pinecone_api_version": "header", + "create_project_request": "body", + }, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, @@ -110,18 +123,24 @@ def __create_project(self, create_project_request, **kwargs: ExtraOpenApiKwargsT callable=__create_project, ) - def __delete_project(self, project_id, **kwargs: ExtraOpenApiKwargsTypedDict): + def __delete_project( + self, + project_id, + x_pinecone_api_version="2025-10", + **kwargs: ExtraOpenApiKwargsTypedDict, + ): """Delete a project # noqa: E501 Delete a project and all its associated configuration. Before deleting a project, you must delete all indexes, assistants, backups, and collections associated with the project. Other project resources, such as API keys, are automatically deleted when the project is deleted. # 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_project(project_id, async_req=True) + >>> thread = api.delete_project(project_id, x_pinecone_api_version="2025-10", async_req=True) >>> result = thread.get() Args: project_id (str): Project ID + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -147,6 +166,7 @@ def __delete_project(self, project_id, **kwargs: ExtraOpenApiKwargsTypedDict): thread. """ kwargs = self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["project_id"] = project_id return self.call_with_http_info(**kwargs) @@ -160,8 +180,8 @@ def __delete_project(self, project_id, **kwargs: ExtraOpenApiKwargsTypedDict): "servers": None, }, params_map={ - "all": ["project_id"], - "required": ["project_id"], + "all": ["x_pinecone_api_version", "project_id"], + "required": ["x_pinecone_api_version", "project_id"], "nullable": [], "enum": [], "validation": [], @@ -169,9 +189,12 @@ def __delete_project(self, project_id, **kwargs: ExtraOpenApiKwargsTypedDict): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"project_id": (str,)}, - "attribute_map": {"project_id": "project_id"}, - "location_map": {"project_id": "path"}, + "openapi_types": {"x_pinecone_api_version": (str,), "project_id": (str,)}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "project_id": "project_id", + }, + "location_map": {"x_pinecone_api_version": "header", "project_id": "path"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": []}, @@ -179,18 +202,24 @@ def __delete_project(self, project_id, **kwargs: ExtraOpenApiKwargsTypedDict): callable=__delete_project, ) - def __fetch_project(self, project_id, **kwargs: ExtraOpenApiKwargsTypedDict): + def __fetch_project( + self, + project_id, + x_pinecone_api_version="2025-10", + **kwargs: ExtraOpenApiKwargsTypedDict, + ): """Get project details # noqa: E501 Get details about 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.fetch_project(project_id, async_req=True) + >>> thread = api.fetch_project(project_id, x_pinecone_api_version="2025-10", async_req=True) >>> result = thread.get() Args: project_id (str): Project ID + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -216,6 +245,7 @@ def __fetch_project(self, project_id, **kwargs: ExtraOpenApiKwargsTypedDict): thread. """ kwargs = self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["project_id"] = project_id return self.call_with_http_info(**kwargs) @@ -229,8 +259,8 @@ def __fetch_project(self, project_id, **kwargs: ExtraOpenApiKwargsTypedDict): "servers": None, }, params_map={ - "all": ["project_id"], - "required": ["project_id"], + "all": ["x_pinecone_api_version", "project_id"], + "required": ["x_pinecone_api_version", "project_id"], "nullable": [], "enum": [], "validation": [], @@ -238,9 +268,12 @@ def __fetch_project(self, project_id, **kwargs: ExtraOpenApiKwargsTypedDict): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"project_id": (str,)}, - "attribute_map": {"project_id": "project_id"}, - "location_map": {"project_id": "path"}, + "openapi_types": {"x_pinecone_api_version": (str,), "project_id": (str,)}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "project_id": "project_id", + }, + "location_map": {"x_pinecone_api_version": "header", "project_id": "path"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": []}, @@ -248,16 +281,20 @@ def __fetch_project(self, project_id, **kwargs: ExtraOpenApiKwargsTypedDict): callable=__fetch_project, ) - def __list_projects(self, **kwargs: ExtraOpenApiKwargsTypedDict): + def __list_projects( + self, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict + ): """List projects # noqa: E501 List all projects in an organization. # 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_projects(async_req=True) + >>> thread = api.list_projects(x_pinecone_api_version="2025-10", async_req=True) >>> result = thread.get() + Args: + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -278,29 +315,36 @@ def __list_projects(self, **kwargs: ExtraOpenApiKwargsTypedDict): async_req (bool): execute request asynchronously Returns: - InlineResponse200 + ProjectList If the method is called asynchronously, returns the request thread. """ kwargs = self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version return self.call_with_http_info(**kwargs) self.list_projects = _Endpoint( settings={ - "response_type": (InlineResponse200,), + "response_type": (ProjectList,), "auth": ["BearerAuth"], "endpoint_path": "/admin/projects", "operation_id": "list_projects", "http_method": "GET", "servers": None, }, - params_map={"all": [], "required": [], "nullable": [], "enum": [], "validation": []}, + params_map={ + "all": ["x_pinecone_api_version"], + "required": ["x_pinecone_api_version"], + "nullable": [], + "enum": [], + "validation": [], + }, root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {}, - "attribute_map": {}, - "location_map": {}, + "openapi_types": {"x_pinecone_api_version": (str,)}, + "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, + "location_map": {"x_pinecone_api_version": "header"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": []}, @@ -309,7 +353,11 @@ def __list_projects(self, **kwargs: ExtraOpenApiKwargsTypedDict): ) def __update_project( - self, project_id, update_project_request, **kwargs: ExtraOpenApiKwargsTypedDict + self, + project_id, + update_project_request, + x_pinecone_api_version="2025-10", + **kwargs: ExtraOpenApiKwargsTypedDict, ): """Update a project # noqa: E501 @@ -317,12 +365,13 @@ def __update_project( This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_project(project_id, update_project_request, async_req=True) + >>> thread = api.update_project(project_id, update_project_request, x_pinecone_api_version="2025-10", async_req=True) >>> result = thread.get() Args: project_id (str): Project ID update_project_request (UpdateProjectRequest): Project details to be updated. Fields that are omitted will not be updated. + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -348,6 +397,7 @@ def __update_project( thread. """ kwargs = self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["project_id"] = project_id kwargs["update_project_request"] = update_project_request return self.call_with_http_info(**kwargs) @@ -362,8 +412,8 @@ def __update_project( "servers": None, }, params_map={ - "all": ["project_id", "update_project_request"], - "required": ["project_id", "update_project_request"], + "all": ["x_pinecone_api_version", "project_id", "update_project_request"], + "required": ["x_pinecone_api_version", "project_id", "update_project_request"], "nullable": [], "enum": [], "validation": [], @@ -372,11 +422,19 @@ def __update_project( "validations": {}, "allowed_values": {}, "openapi_types": { + "x_pinecone_api_version": (str,), "project_id": (str,), "update_project_request": (UpdateProjectRequest,), }, - "attribute_map": {"project_id": "project_id"}, - "location_map": {"project_id": "path", "update_project_request": "body"}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "project_id": "project_id", + }, + "location_map": { + "x_pinecone_api_version": "header", + "project_id": "path", + "update_project_request": "body", + }, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, @@ -396,7 +454,9 @@ def __init__(self, api_client=None) -> None: api_client = AsyncioApiClient() self.api_client = api_client - async def __create_project(self, create_project_request, **kwargs): + async def __create_project( + self, create_project_request, x_pinecone_api_version="2025-10", **kwargs + ): """Create a new project # noqa: E501 Creates a new project. # noqa: E501 @@ -404,6 +464,7 @@ async def __create_project(self, create_project_request, **kwargs): Args: create_project_request (CreateProjectRequest): The details of the new project. + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -426,6 +487,7 @@ async def __create_project(self, create_project_request, **kwargs): Project """ self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["create_project_request"] = create_project_request return await self.call_with_http_info(**kwargs) @@ -439,8 +501,8 @@ async def __create_project(self, create_project_request, **kwargs): "servers": None, }, params_map={ - "all": ["create_project_request"], - "required": ["create_project_request"], + "all": ["x_pinecone_api_version", "create_project_request"], + "required": ["x_pinecone_api_version", "create_project_request"], "nullable": [], "enum": [], "validation": [], @@ -448,9 +510,15 @@ async def __create_project(self, create_project_request, **kwargs): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"create_project_request": (CreateProjectRequest,)}, - "attribute_map": {}, - "location_map": {"create_project_request": "body"}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "create_project_request": (CreateProjectRequest,), + }, + "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, + "location_map": { + "x_pinecone_api_version": "header", + "create_project_request": "body", + }, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, @@ -458,7 +526,7 @@ async def __create_project(self, create_project_request, **kwargs): callable=__create_project, ) - async def __delete_project(self, project_id, **kwargs): + async def __delete_project(self, project_id, x_pinecone_api_version="2025-10", **kwargs): """Delete a project # noqa: E501 Delete a project and all its associated configuration. Before deleting a project, you must delete all indexes, assistants, backups, and collections associated with the project. Other project resources, such as API keys, are automatically deleted when the project is deleted. # noqa: E501 @@ -466,6 +534,7 @@ async def __delete_project(self, project_id, **kwargs): Args: project_id (str): Project ID + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -488,6 +557,7 @@ async def __delete_project(self, project_id, **kwargs): None """ self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["project_id"] = project_id return await self.call_with_http_info(**kwargs) @@ -501,8 +571,8 @@ async def __delete_project(self, project_id, **kwargs): "servers": None, }, params_map={ - "all": ["project_id"], - "required": ["project_id"], + "all": ["x_pinecone_api_version", "project_id"], + "required": ["x_pinecone_api_version", "project_id"], "nullable": [], "enum": [], "validation": [], @@ -510,9 +580,12 @@ async def __delete_project(self, project_id, **kwargs): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"project_id": (str,)}, - "attribute_map": {"project_id": "project_id"}, - "location_map": {"project_id": "path"}, + "openapi_types": {"x_pinecone_api_version": (str,), "project_id": (str,)}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "project_id": "project_id", + }, + "location_map": {"x_pinecone_api_version": "header", "project_id": "path"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": []}, @@ -520,7 +593,7 @@ async def __delete_project(self, project_id, **kwargs): callable=__delete_project, ) - async def __fetch_project(self, project_id, **kwargs): + async def __fetch_project(self, project_id, x_pinecone_api_version="2025-10", **kwargs): """Get project details # noqa: E501 Get details about a project. # noqa: E501 @@ -528,6 +601,7 @@ async def __fetch_project(self, project_id, **kwargs): Args: project_id (str): Project ID + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -550,6 +624,7 @@ async def __fetch_project(self, project_id, **kwargs): Project """ self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["project_id"] = project_id return await self.call_with_http_info(**kwargs) @@ -563,8 +638,8 @@ async def __fetch_project(self, project_id, **kwargs): "servers": None, }, params_map={ - "all": ["project_id"], - "required": ["project_id"], + "all": ["x_pinecone_api_version", "project_id"], + "required": ["x_pinecone_api_version", "project_id"], "nullable": [], "enum": [], "validation": [], @@ -572,9 +647,12 @@ async def __fetch_project(self, project_id, **kwargs): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"project_id": (str,)}, - "attribute_map": {"project_id": "project_id"}, - "location_map": {"project_id": "path"}, + "openapi_types": {"x_pinecone_api_version": (str,), "project_id": (str,)}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "project_id": "project_id", + }, + "location_map": {"x_pinecone_api_version": "header", "project_id": "path"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": []}, @@ -582,12 +660,14 @@ async def __fetch_project(self, project_id, **kwargs): callable=__fetch_project, ) - async def __list_projects(self, **kwargs): + async def __list_projects(self, x_pinecone_api_version="2025-10", **kwargs): """List projects # noqa: E501 List all projects in an organization. # noqa: E501 + Args: + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -607,27 +687,34 @@ async def __list_projects(self, **kwargs): Default is True. Returns: - InlineResponse200 + ProjectList """ self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version return await self.call_with_http_info(**kwargs) self.list_projects = _AsyncioEndpoint( settings={ - "response_type": (InlineResponse200,), + "response_type": (ProjectList,), "auth": ["BearerAuth"], "endpoint_path": "/admin/projects", "operation_id": "list_projects", "http_method": "GET", "servers": None, }, - params_map={"all": [], "required": [], "nullable": [], "enum": [], "validation": []}, + params_map={ + "all": ["x_pinecone_api_version"], + "required": ["x_pinecone_api_version"], + "nullable": [], + "enum": [], + "validation": [], + }, root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {}, - "attribute_map": {}, - "location_map": {}, + "openapi_types": {"x_pinecone_api_version": (str,)}, + "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, + "location_map": {"x_pinecone_api_version": "header"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": []}, @@ -635,7 +722,9 @@ async def __list_projects(self, **kwargs): callable=__list_projects, ) - async def __update_project(self, project_id, update_project_request, **kwargs): + async def __update_project( + self, project_id, update_project_request, x_pinecone_api_version="2025-10", **kwargs + ): """Update a project # noqa: E501 Update a project's configuration details. You can update the project's name, maximum number of Pods, or enable encryption with a customer-managed encryption key (CMEK). # noqa: E501 @@ -644,6 +733,7 @@ async def __update_project(self, project_id, update_project_request, **kwargs): Args: project_id (str): Project ID update_project_request (UpdateProjectRequest): Project details to be updated. Fields that are omitted will not be updated. + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -666,6 +756,7 @@ async def __update_project(self, project_id, update_project_request, **kwargs): Project """ self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["project_id"] = project_id kwargs["update_project_request"] = update_project_request return await self.call_with_http_info(**kwargs) @@ -680,8 +771,8 @@ async def __update_project(self, project_id, update_project_request, **kwargs): "servers": None, }, params_map={ - "all": ["project_id", "update_project_request"], - "required": ["project_id", "update_project_request"], + "all": ["x_pinecone_api_version", "project_id", "update_project_request"], + "required": ["x_pinecone_api_version", "project_id", "update_project_request"], "nullable": [], "enum": [], "validation": [], @@ -690,11 +781,19 @@ async def __update_project(self, project_id, update_project_request, **kwargs): "validations": {}, "allowed_values": {}, "openapi_types": { + "x_pinecone_api_version": (str,), "project_id": (str,), "update_project_request": (UpdateProjectRequest,), }, - "attribute_map": {"project_id": "project_id"}, - "location_map": {"project_id": "path", "update_project_request": "body"}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "project_id": "project_id", + }, + "location_map": { + "x_pinecone_api_version": "header", + "project_id": "path", + "update_project_request": "body", + }, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, diff --git a/pinecone/core/openapi/admin/apis/__init__.py b/pinecone/core/openapi/admin/apis/__init__.py index ea3a34ba..2e2b8c23 100644 --- a/pinecone/core/openapi/admin/apis/__init__.py +++ b/pinecone/core/openapi/admin/apis/__init__.py @@ -14,4 +14,5 @@ # Import APIs into API package: from pinecone.core.openapi.admin.api.api_keys_api import APIKeysApi +from pinecone.core.openapi.admin.api.organizations_api import OrganizationsApi from pinecone.core.openapi.admin.api.projects_api import ProjectsApi diff --git a/pinecone/core/openapi/admin/model/api_key.py b/pinecone/core/openapi/admin/model/api_key.py index 6f48cdeb..33ad8554 100644 --- a/pinecone/core/openapi/admin/model/api_key.py +++ b/pinecone/core/openapi/admin/model/api_key.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ @@ -59,16 +59,7 @@ class APIKey(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - ("roles",): { - "PROJECTEDITOR": "ProjectEditor", - "PROJECTVIEWER": "ProjectViewer", - "CONTROLPLANEEDITOR": "ControlPlaneEditor", - "CONTROLPLANEVIEWER": "ControlPlaneViewer", - "DATAPLANEEDITOR": "DataPlaneEditor", - "DATAPLANEVIEWER": "DataPlaneViewer", - } - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} diff --git a/pinecone/core/openapi/admin/model/api_key_with_secret.py b/pinecone/core/openapi/admin/model/api_key_with_secret.py index f073ec22..e74471a3 100644 --- a/pinecone/core/openapi/admin/model/api_key_with_secret.py +++ b/pinecone/core/openapi/admin/model/api_key_with_secret.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/admin/model/create_api_key_request.py b/pinecone/core/openapi/admin/model/create_api_key_request.py index 57c7f60e..5a88a0bc 100644 --- a/pinecone/core/openapi/admin/model/create_api_key_request.py +++ b/pinecone/core/openapi/admin/model/create_api_key_request.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ @@ -59,16 +59,7 @@ class CreateAPIKeyRequest(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - ("roles",): { - "PROJECTEDITOR": "ProjectEditor", - "PROJECTVIEWER": "ProjectViewer", - "CONTROLPLANEEDITOR": "ControlPlaneEditor", - "CONTROLPLANEVIEWER": "ControlPlaneViewer", - "DATAPLANEEDITOR": "DataPlaneEditor", - "DATAPLANEVIEWER": "DataPlaneViewer", - } - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { ("name",): {"max_length": 80, "min_length": 1} diff --git a/pinecone/core/openapi/admin/model/create_project_request.py b/pinecone/core/openapi/admin/model/create_project_request.py index 5c280fe1..e6f710c3 100644 --- a/pinecone/core/openapi/admin/model/create_project_request.py +++ b/pinecone/core/openapi/admin/model/create_project_request.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/admin/model/inline_response401.py b/pinecone/core/openapi/admin/model/error_response.py similarity index 95% rename from pinecone/core/openapi/admin/model/inline_response401.py rename to pinecone/core/openapi/admin/model/error_response.py index f89c4f94..062b3e6b 100644 --- a/pinecone/core/openapi/admin/model/inline_response401.py +++ b/pinecone/core/openapi/admin/model/error_response.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ @@ -28,18 +28,18 @@ def lazy_import(): - from pinecone.core.openapi.admin.model.inline_response401_error import InlineResponse401Error + from pinecone.core.openapi.admin.model.error_response_error import ErrorResponseError - globals()["InlineResponse401Error"] = InlineResponse401Error + globals()["ErrorResponseError"] = ErrorResponseError from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar from pinecone.openapi_support import PropertyValidationTypedDict, cached_class_property -T = TypeVar("T", bound="InlineResponse401") +T = TypeVar("T", bound="ErrorResponse") -class InlineResponse401(ModelNormal): +class ErrorResponse(ModelNormal): """NOTE: This class is @generated using OpenAPI. Do not edit the class manually. @@ -93,7 +93,7 @@ def openapi_types(cls): lazy_import() return { "status": (int,), # noqa: E501 - "error": (InlineResponse401Error,), # noqa: E501 + "error": (ErrorResponseError,), # noqa: E501 } @cached_class_property @@ -112,11 +112,11 @@ def discriminator(cls): @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], status, error, *args, **kwargs) -> T: # noqa: E501 - """InlineResponse401 - a model defined in OpenAPI + """ErrorResponse - a model defined in OpenAPI Args: status (int): The HTTP status code of the error. - error (InlineResponse401Error): + error (ErrorResponseError): Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -207,11 +207,11 @@ def _from_openapi_data(cls: Type[T], status, error, *args, **kwargs) -> T: # no @convert_js_args_to_python_args def __init__(self, status, error, *args, **kwargs) -> None: # noqa: E501 - """InlineResponse401 - a model defined in OpenAPI + """ErrorResponse - a model defined in OpenAPI Args: status (int): The HTTP status code of the error. - error (InlineResponse401Error): + error (ErrorResponseError): Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/pinecone/core/openapi/admin/model/inline_response401_error.py b/pinecone/core/openapi/admin/model/error_response_error.py similarity index 90% rename from pinecone/core/openapi/admin/model/inline_response401_error.py rename to pinecone/core/openapi/admin/model/error_response_error.py index 1dbd766f..e83454ee 100644 --- a/pinecone/core/openapi/admin/model/inline_response401_error.py +++ b/pinecone/core/openapi/admin/model/error_response_error.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ @@ -30,10 +30,10 @@ from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar from pinecone.openapi_support import PropertyValidationTypedDict, cached_class_property -T = TypeVar("T", bound="InlineResponse401Error") +T = TypeVar("T", bound="ErrorResponseError") -class InlineResponse401Error(ModelNormal): +class ErrorResponseError(ModelNormal): """NOTE: This class is @generated using OpenAPI. Do not edit the class manually. @@ -59,29 +59,7 @@ class InlineResponse401Error(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - ("code",): { - "OK": "OK", - "UNKNOWN": "UNKNOWN", - "INVALID_ARGUMENT": "INVALID_ARGUMENT", - "DEADLINE_EXCEEDED": "DEADLINE_EXCEEDED", - "QUOTA_EXCEEDED": "QUOTA_EXCEEDED", - "NOT_FOUND": "NOT_FOUND", - "ALREADY_EXISTS": "ALREADY_EXISTS", - "PERMISSION_DENIED": "PERMISSION_DENIED", - "UNAUTHENTICATED": "UNAUTHENTICATED", - "RESOURCE_EXHAUSTED": "RESOURCE_EXHAUSTED", - "FAILED_PRECONDITION": "FAILED_PRECONDITION", - "ABORTED": "ABORTED", - "OUT_OF_RANGE": "OUT_OF_RANGE", - "UNIMPLEMENTED": "UNIMPLEMENTED", - "INTERNAL": "INTERNAL", - "UNAVAILABLE": "UNAVAILABLE", - "DATA_LOSS": "DATA_LOSS", - "FORBIDDEN": "FORBIDDEN", - "UNPROCESSABLE_ENTITY": "UNPROCESSABLE_ENTITY", - } - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @@ -128,10 +106,10 @@ def discriminator(cls): @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], code, message, *args, **kwargs) -> T: # noqa: E501 - """InlineResponse401Error - a model defined in OpenAPI + """ErrorResponseError - a model defined in OpenAPI Args: - code (str): + code (str): The error code. Possible values: `OK`, `UNKNOWN`, `INVALID_ARGUMENT`, `DEADLINE_EXCEEDED`, `QUOTA_EXCEEDED`, `NOT_FOUND`, `ALREADY_EXISTS`, `PERMISSION_DENIED`, `UNAUTHENTICATED`, `RESOURCE_EXHAUSTED`, `FAILED_PRECONDITION`, `ABORTED`, `OUT_OF_RANGE`, `UNIMPLEMENTED`, `INTERNAL`, `UNAVAILABLE`, `DATA_LOSS`, `FORBIDDEN`, or `UNPROCESSABLE_ENTITY`. message (str): Keyword Args: @@ -224,10 +202,10 @@ def _from_openapi_data(cls: Type[T], code, message, *args, **kwargs) -> T: # no @convert_js_args_to_python_args def __init__(self, code, message, *args, **kwargs) -> None: # noqa: E501 - """InlineResponse401Error - a model defined in OpenAPI + """ErrorResponseError - a model defined in OpenAPI Args: - code (str): + code (str): The error code. Possible values: `OK`, `UNKNOWN`, `INVALID_ARGUMENT`, `DEADLINE_EXCEEDED`, `QUOTA_EXCEEDED`, `NOT_FOUND`, `ALREADY_EXISTS`, `PERMISSION_DENIED`, `UNAUTHENTICATED`, `RESOURCE_EXHAUSTED`, `FAILED_PRECONDITION`, `ABORTED`, `OUT_OF_RANGE`, `UNIMPLEMENTED`, `INTERNAL`, `UNAVAILABLE`, `DATA_LOSS`, `FORBIDDEN`, or `UNPROCESSABLE_ENTITY`. message (str): Keyword Args: diff --git a/pinecone/core/openapi/admin/model/inline_response2001.py b/pinecone/core/openapi/admin/model/list_api_keys_response.py similarity index 95% rename from pinecone/core/openapi/admin/model/inline_response2001.py rename to pinecone/core/openapi/admin/model/list_api_keys_response.py index f7b4c6be..dcda7c01 100644 --- a/pinecone/core/openapi/admin/model/inline_response2001.py +++ b/pinecone/core/openapi/admin/model/list_api_keys_response.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ @@ -36,10 +36,10 @@ def lazy_import(): from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar from pinecone.openapi_support import PropertyValidationTypedDict, cached_class_property -T = TypeVar("T", bound="InlineResponse2001") +T = TypeVar("T", bound="ListApiKeysResponse") -class InlineResponse2001(ModelNormal): +class ListApiKeysResponse(ModelNormal): """NOTE: This class is @generated using OpenAPI. Do not edit the class manually. @@ -109,8 +109,11 @@ def discriminator(cls): @classmethod @convert_js_args_to_python_args - def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 - """InlineResponse2001 - a model defined in OpenAPI + def _from_openapi_data(cls: Type[T], data, *args, **kwargs) -> T: # noqa: E501 + """ListApiKeysResponse - a model defined in OpenAPI + + Args: + data ([APIKey]): Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -143,7 +146,6 @@ 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,) - data ([APIKey]): [optional] # noqa: E501 """ _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", False) @@ -173,6 +175,7 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 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 @@ -199,8 +202,11 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 ) @convert_js_args_to_python_args - def __init__(self, *args, **kwargs) -> None: # noqa: E501 - """InlineResponse2001 - a model defined in OpenAPI + def __init__(self, data, *args, **kwargs) -> None: # noqa: E501 + """ListApiKeysResponse - a model defined in OpenAPI + + Args: + data ([APIKey]): Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -233,7 +239,6 @@ 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,) - data ([APIKey]): [optional] # noqa: E501 """ _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", True) @@ -261,6 +266,7 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 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 diff --git a/pinecone/core/openapi/admin/model/organization.py b/pinecone/core/openapi/admin/model/organization.py new file mode 100644 index 00000000..63e3da5b --- /dev/null +++ b/pinecone/core/openapi/admin/model/organization.py @@ -0,0 +1,312 @@ +""" +Pinecone Admin API + +Provides an API for managing a Pinecone organization and its resources. # noqa: E501 + +This file is @generated using OpenAPI. + +The version of the OpenAPI document: 2025-10 +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="Organization") + + +class Organization(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": 512, "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 { + "id": (str,), # noqa: E501 + "name": (str,), # noqa: E501 + "plan": (str,), # noqa: E501 + "payment_status": (str,), # noqa: E501 + "created_at": (datetime,), # noqa: E501 + "support_tier": (str,), # noqa: E501 + } + + @cached_class_property + def discriminator(cls): + return None + + attribute_map: Dict[str, str] = { + "id": "id", # noqa: E501 + "name": "name", # noqa: E501 + "plan": "plan", # noqa: E501 + "payment_status": "payment_status", # noqa: E501 + "created_at": "created_at", # noqa: E501 + "support_tier": "support_tier", # 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], id, name, plan, payment_status, created_at, support_tier, *args, **kwargs + ) -> T: # noqa: E501 + """Organization - a model defined in OpenAPI + + Args: + id (str): The unique ID of the organization. + name (str): The name of the organization. + plan (str): The current plan the organization is on. + payment_status (str): The current payment status of the organization. + created_at (datetime): The date and time when the organization was created. + support_tier (str): The support tier of the organization. + + 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,) + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", False) + _enforce_validations = kwargs.pop("_enforce_validations", False) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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.id = id + self.name = name + self.plan = plan + self.payment_status = payment_status + self.created_at = created_at + self.support_tier = support_tier + 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( + [ + "_enforce_allowed_values", + "_enforce_validations", + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) + + @convert_js_args_to_python_args + def __init__( + self, id, name, plan, payment_status, created_at, support_tier, *args, **kwargs + ) -> None: # noqa: E501 + """Organization - a model defined in OpenAPI + + Args: + id (str): The unique ID of the organization. + name (str): The name of the organization. + plan (str): The current plan the organization is on. + payment_status (str): The current payment status of the organization. + created_at (datetime): The date and time when the organization was created. + support_tier (str): The support tier of the organization. + + 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,) + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", True) + _enforce_validations = kwargs.pop("_enforce_validations", True) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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.id = id + self.name = name + self.plan = plan + self.payment_status = payment_status + self.created_at = created_at + self.support_tier = support_tier + 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/admin/model/organization_list.py b/pinecone/core/openapi/admin/model/organization_list.py new file mode 100644 index 00000000..49a6846a --- /dev/null +++ b/pinecone/core/openapi/admin/model/organization_list.py @@ -0,0 +1,284 @@ +""" +Pinecone Admin API + +Provides an API for managing a Pinecone organization and its resources. # noqa: E501 + +This file is @generated using OpenAPI. + +The version of the OpenAPI document: 2025-10 +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.admin.model.organization import Organization + + globals()["Organization"] = Organization + + +from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar +from pinecone.openapi_support import PropertyValidationTypedDict, cached_class_property + +T = TypeVar("T", bound="OrganizationList") + + +class OrganizationList(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": ([Organization],) # noqa: E501 + } + + @cached_class_property + def discriminator(cls): + return None + + attribute_map: Dict[str, str] = { + "data": "data" # 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 + """OrganizationList - a model defined in OpenAPI + + Args: + data ([Organization]): + + 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,) + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", False) + _enforce_validations = kwargs.pop("_enforce_validations", False) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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( + [ + "_enforce_allowed_values", + "_enforce_validations", + "_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 + """OrganizationList - a model defined in OpenAPI + + Args: + data ([Organization]): + + 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,) + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", True) + _enforce_validations = kwargs.pop("_enforce_validations", True) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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/admin/model/project.py b/pinecone/core/openapi/admin/model/project.py index eea8b20b..2fc158e0 100644 --- a/pinecone/core/openapi/admin/model/project.py +++ b/pinecone/core/openapi/admin/model/project.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/admin/model/inline_response200.py b/pinecone/core/openapi/admin/model/project_list.py similarity index 95% rename from pinecone/core/openapi/admin/model/inline_response200.py rename to pinecone/core/openapi/admin/model/project_list.py index ab807cf0..2d06bc50 100644 --- a/pinecone/core/openapi/admin/model/inline_response200.py +++ b/pinecone/core/openapi/admin/model/project_list.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ @@ -36,10 +36,10 @@ def lazy_import(): from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar from pinecone.openapi_support import PropertyValidationTypedDict, cached_class_property -T = TypeVar("T", bound="InlineResponse200") +T = TypeVar("T", bound="ProjectList") -class InlineResponse200(ModelNormal): +class ProjectList(ModelNormal): """NOTE: This class is @generated using OpenAPI. Do not edit the class manually. @@ -109,8 +109,11 @@ def discriminator(cls): @classmethod @convert_js_args_to_python_args - def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 - """InlineResponse200 - a model defined in OpenAPI + def _from_openapi_data(cls: Type[T], data, *args, **kwargs) -> T: # noqa: E501 + """ProjectList - a model defined in OpenAPI + + Args: + data ([Project]): Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -143,7 +146,6 @@ 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,) - data ([Project]): [optional] # noqa: E501 """ _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", False) @@ -173,6 +175,7 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 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 @@ -199,8 +202,11 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 ) @convert_js_args_to_python_args - def __init__(self, *args, **kwargs) -> None: # noqa: E501 - """InlineResponse200 - a model defined in OpenAPI + def __init__(self, data, *args, **kwargs) -> None: # noqa: E501 + """ProjectList - a model defined in OpenAPI + + Args: + data ([Project]): Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -233,7 +239,6 @@ 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,) - data ([Project]): [optional] # noqa: E501 """ _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", True) @@ -261,6 +266,7 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 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 diff --git a/pinecone/core/openapi/admin/model/update_api_key_request.py b/pinecone/core/openapi/admin/model/update_api_key_request.py new file mode 100644 index 00000000..68d0cea8 --- /dev/null +++ b/pinecone/core/openapi/admin/model/update_api_key_request.py @@ -0,0 +1,276 @@ +""" +Pinecone Admin API + +Provides an API for managing a Pinecone organization and its resources. # noqa: E501 + +This file is @generated using OpenAPI. + +The version of the OpenAPI document: 2025-10 +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="UpdateAPIKeyRequest") + + +class UpdateAPIKeyRequest(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": 80, "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 + "roles": ([str],), # noqa: E501 + } + + @cached_class_property + def discriminator(cls): + return None + + attribute_map: Dict[str, str] = { + "name": "name", # noqa: E501 + "roles": "roles", # 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 + """UpdateAPIKeyRequest - 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): A new name for the API key. The name must be 1-80 characters long. If omitted, the name will not be updated. [optional] # noqa: E501 + roles ([str]): A new set of roles for the API key. Existing roles will be removed if not included. If this field is omitted, the roles will not be updated. [optional] # noqa: E501 + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", False) + _enforce_validations = kwargs.pop("_enforce_validations", False) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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( + [ + "_enforce_allowed_values", + "_enforce_validations", + "_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 + """UpdateAPIKeyRequest - 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): A new name for the API key. The name must be 1-80 characters long. If omitted, the name will not be updated. [optional] # noqa: E501 + roles ([str]): A new set of roles for the API key. Existing roles will be removed if not included. If this field is omitted, the roles will not be updated. [optional] # noqa: E501 + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", True) + _enforce_validations = kwargs.pop("_enforce_validations", True) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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/admin/model/update_organization_request.py b/pinecone/core/openapi/admin/model/update_organization_request.py new file mode 100644 index 00000000..ce0095cd --- /dev/null +++ b/pinecone/core/openapi/admin/model/update_organization_request.py @@ -0,0 +1,272 @@ +""" +Pinecone Admin API + +Provides an API for managing a Pinecone organization and its resources. # noqa: E501 + +This file is @generated using OpenAPI. + +The version of the OpenAPI document: 2025-10 +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="UpdateOrganizationRequest") + + +class UpdateOrganizationRequest(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": 512, "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 + } + + @cached_class_property + def discriminator(cls): + return None + + attribute_map: Dict[str, str] = { + "name": "name" # 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 + """UpdateOrganizationRequest - 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 new name for the organization. [optional] # noqa: E501 + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", False) + _enforce_validations = kwargs.pop("_enforce_validations", False) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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( + [ + "_enforce_allowed_values", + "_enforce_validations", + "_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 + """UpdateOrganizationRequest - 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 new name for the organization. [optional] # noqa: E501 + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", True) + _enforce_validations = kwargs.pop("_enforce_validations", True) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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/admin/model/update_project_request.py b/pinecone/core/openapi/admin/model/update_project_request.py index b061a9b2..20e8ae2a 100644 --- a/pinecone/core/openapi/admin/model/update_project_request.py +++ b/pinecone/core/openapi/admin/model/update_project_request.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/admin/models/__init__.py b/pinecone/core/openapi/admin/models/__init__.py index fd24744c..31401582 100644 --- a/pinecone/core/openapi/admin/models/__init__.py +++ b/pinecone/core/openapi/admin/models/__init__.py @@ -13,9 +13,13 @@ from pinecone.core.openapi.admin.model.api_key_with_secret import APIKeyWithSecret from pinecone.core.openapi.admin.model.create_api_key_request import CreateAPIKeyRequest from pinecone.core.openapi.admin.model.create_project_request import CreateProjectRequest -from pinecone.core.openapi.admin.model.inline_response200 import InlineResponse200 -from pinecone.core.openapi.admin.model.inline_response2001 import InlineResponse2001 -from pinecone.core.openapi.admin.model.inline_response401 import InlineResponse401 -from pinecone.core.openapi.admin.model.inline_response401_error import InlineResponse401Error +from pinecone.core.openapi.admin.model.error_response import ErrorResponse +from pinecone.core.openapi.admin.model.error_response_error import ErrorResponseError +from pinecone.core.openapi.admin.model.list_api_keys_response import ListApiKeysResponse +from pinecone.core.openapi.admin.model.organization import Organization +from pinecone.core.openapi.admin.model.organization_list import OrganizationList from pinecone.core.openapi.admin.model.project import Project +from pinecone.core.openapi.admin.model.project_list import ProjectList +from pinecone.core.openapi.admin.model.update_api_key_request import UpdateAPIKeyRequest +from pinecone.core.openapi.admin.model.update_organization_request import UpdateOrganizationRequest from pinecone.core.openapi.admin.model.update_project_request import UpdateProjectRequest diff --git a/pinecone/core/openapi/db_control/__init__.py b/pinecone/core/openapi/db_control/__init__.py index 31408552..52fc459d 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-04 +The version of the OpenAPI document: 2025-10 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-04" +API_VERSION = "2025-10" 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 ae478017..c4e75a45 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-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ @@ -59,7 +59,11 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client def __configure_index( - self, index_name, configure_index_request, **kwargs: ExtraOpenApiKwargsTypedDict + self, + index_name, + configure_index_request, + x_pinecone_api_version="2025-10", + **kwargs: ExtraOpenApiKwargsTypedDict, ): """Configure an index # noqa: E501 @@ -67,12 +71,13 @@ def __configure_index( This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.configure_index(index_name, configure_index_request, async_req=True) + >>> thread = api.configure_index(index_name, configure_index_request, x_pinecone_api_version="2025-10", 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. + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -98,6 +103,7 @@ def __configure_index( thread. """ kwargs = self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["index_name"] = index_name kwargs["configure_index_request"] = configure_index_request return self.call_with_http_info(**kwargs) @@ -112,8 +118,8 @@ def __configure_index( "servers": None, }, params_map={ - "all": ["index_name", "configure_index_request"], - "required": ["index_name", "configure_index_request"], + "all": ["x_pinecone_api_version", "index_name", "configure_index_request"], + "required": ["x_pinecone_api_version", "index_name", "configure_index_request"], "nullable": [], "enum": [], "validation": [], @@ -122,11 +128,19 @@ def __configure_index( "validations": {}, "allowed_values": {}, "openapi_types": { + "x_pinecone_api_version": (str,), "index_name": (str,), "configure_index_request": (ConfigureIndexRequest,), }, - "attribute_map": {"index_name": "index_name"}, - "location_map": {"index_name": "path", "configure_index_request": "body"}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "index_name": "index_name", + }, + "location_map": { + "x_pinecone_api_version": "header", + "index_name": "path", + "configure_index_request": "body", + }, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, @@ -135,7 +149,11 @@ def __configure_index( ) def __create_backup( - self, index_name, create_backup_request, **kwargs: ExtraOpenApiKwargsTypedDict + self, + index_name, + create_backup_request, + x_pinecone_api_version="2025-10", + **kwargs: ExtraOpenApiKwargsTypedDict, ): """Create a backup of an index # noqa: E501 @@ -143,12 +161,13 @@ def __create_backup( 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) + >>> thread = api.create_backup(index_name, create_backup_request, x_pinecone_api_version="2025-10", 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. + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -174,6 +193,7 @@ def __create_backup( thread. """ kwargs = self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["index_name"] = index_name kwargs["create_backup_request"] = create_backup_request return self.call_with_http_info(**kwargs) @@ -188,8 +208,8 @@ def __create_backup( "servers": None, }, params_map={ - "all": ["index_name", "create_backup_request"], - "required": ["index_name", "create_backup_request"], + "all": ["x_pinecone_api_version", "index_name", "create_backup_request"], + "required": ["x_pinecone_api_version", "index_name", "create_backup_request"], "nullable": [], "enum": [], "validation": [], @@ -198,11 +218,19 @@ def __create_backup( "validations": {}, "allowed_values": {}, "openapi_types": { + "x_pinecone_api_version": (str,), "index_name": (str,), "create_backup_request": (CreateBackupRequest,), }, - "attribute_map": {"index_name": "index_name"}, - "location_map": {"index_name": "path", "create_backup_request": "body"}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "index_name": "index_name", + }, + "location_map": { + "x_pinecone_api_version": "header", + "index_name": "path", + "create_backup_request": "body", + }, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, @@ -211,7 +239,10 @@ def __create_backup( ) def __create_collection( - self, create_collection_request, **kwargs: ExtraOpenApiKwargsTypedDict + self, + create_collection_request, + x_pinecone_api_version="2025-10", + **kwargs: ExtraOpenApiKwargsTypedDict, ): """Create a collection # noqa: E501 @@ -219,11 +250,12 @@ def __create_collection( This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_collection(create_collection_request, async_req=True) + >>> thread = api.create_collection(create_collection_request, x_pinecone_api_version="2025-10", async_req=True) >>> result = thread.get() Args: create_collection_request (CreateCollectionRequest): The desired configuration for the collection. + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -249,6 +281,7 @@ def __create_collection( thread. """ kwargs = self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["create_collection_request"] = create_collection_request return self.call_with_http_info(**kwargs) @@ -262,8 +295,8 @@ def __create_collection( "servers": None, }, params_map={ - "all": ["create_collection_request"], - "required": ["create_collection_request"], + "all": ["x_pinecone_api_version", "create_collection_request"], + "required": ["x_pinecone_api_version", "create_collection_request"], "nullable": [], "enum": [], "validation": [], @@ -271,9 +304,15 @@ def __create_collection( root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"create_collection_request": (CreateCollectionRequest,)}, - "attribute_map": {}, - "location_map": {"create_collection_request": "body"}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "create_collection_request": (CreateCollectionRequest,), + }, + "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, + "location_map": { + "x_pinecone_api_version": "header", + "create_collection_request": "body", + }, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, @@ -281,18 +320,24 @@ def __create_collection( callable=__create_collection, ) - def __create_index(self, create_index_request, **kwargs: ExtraOpenApiKwargsTypedDict): + def __create_index( + self, + create_index_request, + x_pinecone_api_version="2025-10", + **kwargs: ExtraOpenApiKwargsTypedDict, + ): """Create an 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/index-data/create-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_index(create_index_request, async_req=True) + >>> thread = api.create_index(create_index_request, x_pinecone_api_version="2025-10", async_req=True) >>> result = thread.get() Args: create_index_request (CreateIndexRequest): The desired configuration for the index. + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -318,6 +363,7 @@ def __create_index(self, create_index_request, **kwargs: ExtraOpenApiKwargsTyped thread. """ kwargs = self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["create_index_request"] = create_index_request return self.call_with_http_info(**kwargs) @@ -331,8 +377,8 @@ def __create_index(self, create_index_request, **kwargs: ExtraOpenApiKwargsTyped "servers": None, }, params_map={ - "all": ["create_index_request"], - "required": ["create_index_request"], + "all": ["x_pinecone_api_version", "create_index_request"], + "required": ["x_pinecone_api_version", "create_index_request"], "nullable": [], "enum": [], "validation": [], @@ -340,9 +386,15 @@ def __create_index(self, create_index_request, **kwargs: ExtraOpenApiKwargsTyped root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"create_index_request": (CreateIndexRequest,)}, - "attribute_map": {}, - "location_map": {"create_index_request": "body"}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "create_index_request": (CreateIndexRequest,), + }, + "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, + "location_map": { + "x_pinecone_api_version": "header", + "create_index_request": "body", + }, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, @@ -351,19 +403,23 @@ def __create_index(self, create_index_request, **kwargs: ExtraOpenApiKwargsTyped ) def __create_index_for_model( - self, create_index_for_model_request, **kwargs: ExtraOpenApiKwargsTypedDict + self, + create_index_for_model_request, + x_pinecone_api_version="2025-10", + **kwargs: ExtraOpenApiKwargsTypedDict, ): """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/index-data/create-an-index#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/index-data/create-an-index#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/index-data/create-an-index#embedding-models) to convert the text automatically during [upsert](https://docs.pinecone.io/reference/api/2025-10/data-plane/upsert_records) and [search](https://docs.pinecone.io/reference/api/2025-10/data-plane/search_records). For guidance and examples, see [Create an index](https://docs.pinecone.io/guides/index-data/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 - >>> thread = api.create_index_for_model(create_index_for_model_request, async_req=True) + >>> thread = api.create_index_for_model(create_index_for_model_request, x_pinecone_api_version="2025-10", async_req=True) >>> result = thread.get() Args: create_index_for_model_request (CreateIndexForModelRequest): The desired configuration for the index and associated embedding model. + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -389,6 +445,7 @@ def __create_index_for_model( thread. """ kwargs = self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["create_index_for_model_request"] = create_index_for_model_request return self.call_with_http_info(**kwargs) @@ -402,8 +459,8 @@ def __create_index_for_model( "servers": None, }, params_map={ - "all": ["create_index_for_model_request"], - "required": ["create_index_for_model_request"], + "all": ["x_pinecone_api_version", "create_index_for_model_request"], + "required": ["x_pinecone_api_version", "create_index_for_model_request"], "nullable": [], "enum": [], "validation": [], @@ -411,9 +468,15 @@ def __create_index_for_model( 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": { + "x_pinecone_api_version": (str,), + "create_index_for_model_request": (CreateIndexForModelRequest,), + }, + "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, + "location_map": { + "x_pinecone_api_version": "header", + "create_index_for_model_request": "body", + }, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, @@ -422,7 +485,11 @@ def __create_index_for_model( ) def __create_index_from_backup_operation( - self, backup_id, create_index_from_backup_request, **kwargs: ExtraOpenApiKwargsTypedDict + self, + backup_id, + create_index_from_backup_request, + x_pinecone_api_version="2025-10", + **kwargs: ExtraOpenApiKwargsTypedDict, ): """Create an index from a backup # noqa: E501 @@ -430,12 +497,13 @@ def __create_index_from_backup_operation( This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_index_from_backup_operation(backup_id, create_index_from_backup_request, async_req=True) + >>> thread = api.create_index_from_backup_operation(backup_id, create_index_from_backup_request, x_pinecone_api_version="2025-10", async_req=True) >>> result = thread.get() 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. + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -461,6 +529,7 @@ def __create_index_from_backup_operation( thread. """ kwargs = self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["backup_id"] = backup_id kwargs["create_index_from_backup_request"] = create_index_from_backup_request return self.call_with_http_info(**kwargs) @@ -475,8 +544,12 @@ def __create_index_from_backup_operation( "servers": None, }, params_map={ - "all": ["backup_id", "create_index_from_backup_request"], - "required": ["backup_id", "create_index_from_backup_request"], + "all": ["x_pinecone_api_version", "backup_id", "create_index_from_backup_request"], + "required": [ + "x_pinecone_api_version", + "backup_id", + "create_index_from_backup_request", + ], "nullable": [], "enum": [], "validation": [], @@ -485,11 +558,19 @@ def __create_index_from_backup_operation( "validations": {}, "allowed_values": {}, "openapi_types": { + "x_pinecone_api_version": (str,), "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"}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "backup_id": "backup_id", + }, + "location_map": { + "x_pinecone_api_version": "header", + "backup_id": "path", + "create_index_from_backup_request": "body", + }, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, @@ -497,18 +578,21 @@ def __create_index_from_backup_operation( callable=__create_index_from_backup_operation, ) - def __delete_backup(self, backup_id, **kwargs: ExtraOpenApiKwargsTypedDict): + def __delete_backup( + self, backup_id, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict + ): """Delete a backup # 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_backup(backup_id, async_req=True) + >>> thread = api.delete_backup(backup_id, x_pinecone_api_version="2025-10", async_req=True) >>> result = thread.get() Args: backup_id (str): The ID of the backup to delete. + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -534,6 +618,7 @@ def __delete_backup(self, backup_id, **kwargs: ExtraOpenApiKwargsTypedDict): thread. """ kwargs = self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["backup_id"] = backup_id return self.call_with_http_info(**kwargs) @@ -547,8 +632,8 @@ def __delete_backup(self, backup_id, **kwargs: ExtraOpenApiKwargsTypedDict): "servers": None, }, params_map={ - "all": ["backup_id"], - "required": ["backup_id"], + "all": ["x_pinecone_api_version", "backup_id"], + "required": ["x_pinecone_api_version", "backup_id"], "nullable": [], "enum": [], "validation": [], @@ -556,9 +641,12 @@ def __delete_backup(self, backup_id, **kwargs: ExtraOpenApiKwargsTypedDict): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"backup_id": (str,)}, - "attribute_map": {"backup_id": "backup_id"}, - "location_map": {"backup_id": "path"}, + "openapi_types": {"x_pinecone_api_version": (str,), "backup_id": (str,)}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "backup_id": "backup_id", + }, + "location_map": {"x_pinecone_api_version": "header", "backup_id": "path"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": []}, @@ -566,18 +654,24 @@ def __delete_backup(self, backup_id, **kwargs: ExtraOpenApiKwargsTypedDict): callable=__delete_backup, ) - def __delete_collection(self, collection_name, **kwargs: ExtraOpenApiKwargsTypedDict): + def __delete_collection( + self, + collection_name, + x_pinecone_api_version="2025-10", + **kwargs: ExtraOpenApiKwargsTypedDict, + ): """Delete a collection # 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.delete_collection(collection_name, async_req=True) + >>> thread = api.delete_collection(collection_name, x_pinecone_api_version="2025-10", async_req=True) >>> result = thread.get() Args: collection_name (str): The name of the collection. + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -603,6 +697,7 @@ def __delete_collection(self, collection_name, **kwargs: ExtraOpenApiKwargsTyped thread. """ kwargs = self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["collection_name"] = collection_name return self.call_with_http_info(**kwargs) @@ -616,8 +711,8 @@ def __delete_collection(self, collection_name, **kwargs: ExtraOpenApiKwargsTyped "servers": None, }, params_map={ - "all": ["collection_name"], - "required": ["collection_name"], + "all": ["x_pinecone_api_version", "collection_name"], + "required": ["x_pinecone_api_version", "collection_name"], "nullable": [], "enum": [], "validation": [], @@ -625,9 +720,12 @@ 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": {"x_pinecone_api_version": (str,), "collection_name": (str,)}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "collection_name": "collection_name", + }, + "location_map": {"x_pinecone_api_version": "header", "collection_name": "path"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": []}, @@ -635,18 +733,24 @@ def __delete_collection(self, collection_name, **kwargs: ExtraOpenApiKwargsTyped callable=__delete_collection, ) - def __delete_index(self, index_name, **kwargs: ExtraOpenApiKwargsTypedDict): + def __delete_index( + self, + index_name, + x_pinecone_api_version="2025-10", + **kwargs: ExtraOpenApiKwargsTypedDict, + ): """Delete 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.delete_index(index_name, async_req=True) + >>> thread = api.delete_index(index_name, x_pinecone_api_version="2025-10", async_req=True) >>> result = thread.get() Args: index_name (str): The name of the index to delete. + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -672,6 +776,7 @@ def __delete_index(self, index_name, **kwargs: ExtraOpenApiKwargsTypedDict): thread. """ kwargs = self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["index_name"] = index_name return self.call_with_http_info(**kwargs) @@ -685,8 +790,8 @@ def __delete_index(self, index_name, **kwargs: ExtraOpenApiKwargsTypedDict): "servers": None, }, params_map={ - "all": ["index_name"], - "required": ["index_name"], + "all": ["x_pinecone_api_version", "index_name"], + "required": ["x_pinecone_api_version", "index_name"], "nullable": [], "enum": [], "validation": [], @@ -694,9 +799,12 @@ 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": {"x_pinecone_api_version": (str,), "index_name": (str,)}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "index_name": "index_name", + }, + "location_map": {"x_pinecone_api_version": "header", "index_name": "path"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": []}, @@ -704,18 +812,21 @@ def __delete_index(self, index_name, **kwargs: ExtraOpenApiKwargsTypedDict): callable=__delete_index, ) - def __describe_backup(self, backup_id, **kwargs: ExtraOpenApiKwargsTypedDict): + def __describe_backup( + self, backup_id, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict + ): """Describe a backup # 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.describe_backup(backup_id, async_req=True) + >>> thread = api.describe_backup(backup_id, x_pinecone_api_version="2025-10", async_req=True) >>> result = thread.get() Args: backup_id (str): The ID of the backup to describe. + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -741,6 +852,7 @@ def __describe_backup(self, backup_id, **kwargs: ExtraOpenApiKwargsTypedDict): thread. """ kwargs = self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["backup_id"] = backup_id return self.call_with_http_info(**kwargs) @@ -754,8 +866,8 @@ def __describe_backup(self, backup_id, **kwargs: ExtraOpenApiKwargsTypedDict): "servers": None, }, params_map={ - "all": ["backup_id"], - "required": ["backup_id"], + "all": ["x_pinecone_api_version", "backup_id"], + "required": ["x_pinecone_api_version", "backup_id"], "nullable": [], "enum": [], "validation": [], @@ -763,9 +875,12 @@ def __describe_backup(self, backup_id, **kwargs: ExtraOpenApiKwargsTypedDict): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"backup_id": (str,)}, - "attribute_map": {"backup_id": "backup_id"}, - "location_map": {"backup_id": "path"}, + "openapi_types": {"x_pinecone_api_version": (str,), "backup_id": (str,)}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "backup_id": "backup_id", + }, + "location_map": {"x_pinecone_api_version": "header", "backup_id": "path"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": []}, @@ -773,18 +888,24 @@ def __describe_backup(self, backup_id, **kwargs: ExtraOpenApiKwargsTypedDict): callable=__describe_backup, ) - def __describe_collection(self, collection_name, **kwargs: ExtraOpenApiKwargsTypedDict): + def __describe_collection( + self, + collection_name, + x_pinecone_api_version="2025-10", + **kwargs: ExtraOpenApiKwargsTypedDict, + ): """Describe a collection # 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.describe_collection(collection_name, async_req=True) + >>> thread = api.describe_collection(collection_name, x_pinecone_api_version="2025-10", async_req=True) >>> result = thread.get() Args: collection_name (str): The name of the collection to be described. + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -810,6 +931,7 @@ def __describe_collection(self, collection_name, **kwargs: ExtraOpenApiKwargsTyp thread. """ kwargs = self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["collection_name"] = collection_name return self.call_with_http_info(**kwargs) @@ -823,8 +945,8 @@ def __describe_collection(self, collection_name, **kwargs: ExtraOpenApiKwargsTyp "servers": None, }, params_map={ - "all": ["collection_name"], - "required": ["collection_name"], + "all": ["x_pinecone_api_version", "collection_name"], + "required": ["x_pinecone_api_version", "collection_name"], "nullable": [], "enum": [], "validation": [], @@ -832,9 +954,12 @@ def __describe_collection(self, collection_name, **kwargs: ExtraOpenApiKwargsTyp root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"collection_name": (str,)}, - "attribute_map": {"collection_name": "collection_name"}, - "location_map": {"collection_name": "path"}, + "openapi_types": {"x_pinecone_api_version": (str,), "collection_name": (str,)}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "collection_name": "collection_name", + }, + "location_map": {"x_pinecone_api_version": "header", "collection_name": "path"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": []}, @@ -842,18 +967,24 @@ def __describe_collection(self, collection_name, **kwargs: ExtraOpenApiKwargsTyp callable=__describe_collection, ) - def __describe_index(self, index_name, **kwargs: ExtraOpenApiKwargsTypedDict): + def __describe_index( + self, + index_name, + x_pinecone_api_version="2025-10", + **kwargs: ExtraOpenApiKwargsTypedDict, + ): """Describe an index # 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) + >>> thread = api.describe_index(index_name, x_pinecone_api_version="2025-10", async_req=True) >>> result = thread.get() Args: index_name (str): The name of the index to be described. + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -879,6 +1010,7 @@ def __describe_index(self, index_name, **kwargs: ExtraOpenApiKwargsTypedDict): thread. """ kwargs = self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["index_name"] = index_name return self.call_with_http_info(**kwargs) @@ -892,8 +1024,8 @@ def __describe_index(self, index_name, **kwargs: ExtraOpenApiKwargsTypedDict): "servers": None, }, params_map={ - "all": ["index_name"], - "required": ["index_name"], + "all": ["x_pinecone_api_version", "index_name"], + "required": ["x_pinecone_api_version", "index_name"], "nullable": [], "enum": [], "validation": [], @@ -901,9 +1033,12 @@ def __describe_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": {"x_pinecone_api_version": (str,), "index_name": (str,)}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "index_name": "index_name", + }, + "location_map": {"x_pinecone_api_version": "header", "index_name": "path"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": []}, @@ -911,18 +1046,21 @@ def __describe_index(self, index_name, **kwargs: ExtraOpenApiKwargsTypedDict): callable=__describe_index, ) - def __describe_restore_job(self, job_id, **kwargs: ExtraOpenApiKwargsTypedDict): + def __describe_restore_job( + self, job_id, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict + ): """Describe a restore job # 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) + >>> thread = api.describe_restore_job(job_id, x_pinecone_api_version="2025-10", async_req=True) >>> result = thread.get() Args: job_id (str): The ID of the restore job to describe. + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -948,6 +1086,7 @@ def __describe_restore_job(self, job_id, **kwargs: ExtraOpenApiKwargsTypedDict): thread. """ kwargs = self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["job_id"] = job_id return self.call_with_http_info(**kwargs) @@ -961,8 +1100,8 @@ def __describe_restore_job(self, job_id, **kwargs: ExtraOpenApiKwargsTypedDict): "servers": None, }, params_map={ - "all": ["job_id"], - "required": ["job_id"], + "all": ["x_pinecone_api_version", "job_id"], + "required": ["x_pinecone_api_version", "job_id"], "nullable": [], "enum": [], "validation": [], @@ -970,9 +1109,12 @@ def __describe_restore_job(self, job_id, **kwargs: ExtraOpenApiKwargsTypedDict): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"job_id": (str,)}, - "attribute_map": {"job_id": "job_id"}, - "location_map": {"job_id": "path"}, + "openapi_types": {"x_pinecone_api_version": (str,), "job_id": (str,)}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "job_id": "job_id", + }, + "location_map": {"x_pinecone_api_version": "header", "job_id": "path"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": []}, @@ -980,16 +1122,20 @@ def __describe_restore_job(self, job_id, **kwargs: ExtraOpenApiKwargsTypedDict): callable=__describe_restore_job, ) - def __list_collections(self, **kwargs: ExtraOpenApiKwargsTypedDict): + def __list_collections( + self, x_pinecone_api_version="2025-10", **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) + >>> thread = api.list_collections(x_pinecone_api_version="2025-10", async_req=True) >>> result = thread.get() + Args: + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -1015,6 +1161,7 @@ def __list_collections(self, **kwargs: ExtraOpenApiKwargsTypedDict): thread. """ kwargs = self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version return self.call_with_http_info(**kwargs) self.list_collections = _Endpoint( @@ -1026,13 +1173,19 @@ def __list_collections(self, **kwargs: ExtraOpenApiKwargsTypedDict): "http_method": "GET", "servers": None, }, - params_map={"all": [], "required": [], "nullable": [], "enum": [], "validation": []}, + params_map={ + "all": ["x_pinecone_api_version"], + "required": ["x_pinecone_api_version"], + "nullable": [], + "enum": [], + "validation": [], + }, root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {}, - "attribute_map": {}, - "location_map": {}, + "openapi_types": {"x_pinecone_api_version": (str,)}, + "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, + "location_map": {"x_pinecone_api_version": "header"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": []}, @@ -1040,18 +1193,24 @@ def __list_collections(self, **kwargs: ExtraOpenApiKwargsTypedDict): callable=__list_collections, ) - def __list_index_backups(self, index_name, **kwargs: ExtraOpenApiKwargsTypedDict): + def __list_index_backups( + self, + index_name, + x_pinecone_api_version="2025-10", + **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) + >>> thread = api.list_index_backups(index_name, x_pinecone_api_version="2025-10", async_req=True) >>> result = thread.get() Args: index_name (str): Name of the backed up index + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: limit (int): The number of results to return per page. [optional] if omitted the server will use the default value of 10. @@ -1079,6 +1238,7 @@ def __list_index_backups(self, index_name, **kwargs: ExtraOpenApiKwargsTypedDict thread. """ kwargs = self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["index_name"] = index_name return self.call_with_http_info(**kwargs) @@ -1092,8 +1252,8 @@ def __list_index_backups(self, index_name, **kwargs: ExtraOpenApiKwargsTypedDict "servers": None, }, params_map={ - "all": ["index_name", "limit", "pagination_token"], - "required": ["index_name"], + "all": ["x_pinecone_api_version", "index_name", "limit", "pagination_token"], + "required": ["x_pinecone_api_version", "index_name"], "nullable": [], "enum": [], "validation": ["limit"], @@ -1102,16 +1262,19 @@ def __list_index_backups(self, index_name, **kwargs: ExtraOpenApiKwargsTypedDict "validations": {("limit",): {"inclusive_maximum": 100, "inclusive_minimum": 1}}, "allowed_values": {}, "openapi_types": { + "x_pinecone_api_version": (str,), "index_name": (str,), "limit": (int,), "pagination_token": (str,), }, "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", "index_name": "index_name", "limit": "limit", "pagination_token": "paginationToken", }, "location_map": { + "x_pinecone_api_version": "header", "index_name": "path", "limit": "query", "pagination_token": "query", @@ -1123,16 +1286,20 @@ def __list_index_backups(self, index_name, **kwargs: ExtraOpenApiKwargsTypedDict callable=__list_index_backups, ) - def __list_indexes(self, **kwargs: ExtraOpenApiKwargsTypedDict): + def __list_indexes( + self, x_pinecone_api_version="2025-10", **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) + >>> thread = api.list_indexes(x_pinecone_api_version="2025-10", async_req=True) >>> result = thread.get() + Args: + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -1158,6 +1325,7 @@ def __list_indexes(self, **kwargs: ExtraOpenApiKwargsTypedDict): thread. """ kwargs = self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version return self.call_with_http_info(**kwargs) self.list_indexes = _Endpoint( @@ -1169,13 +1337,19 @@ def __list_indexes(self, **kwargs: ExtraOpenApiKwargsTypedDict): "http_method": "GET", "servers": None, }, - params_map={"all": [], "required": [], "nullable": [], "enum": [], "validation": []}, + params_map={ + "all": ["x_pinecone_api_version"], + "required": ["x_pinecone_api_version"], + "nullable": [], + "enum": [], + "validation": [], + }, root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {}, - "attribute_map": {}, - "location_map": {}, + "openapi_types": {"x_pinecone_api_version": (str,)}, + "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, + "location_map": {"x_pinecone_api_version": "header"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": []}, @@ -1183,16 +1357,20 @@ def __list_indexes(self, **kwargs: ExtraOpenApiKwargsTypedDict): callable=__list_indexes, ) - def __list_project_backups(self, **kwargs: ExtraOpenApiKwargsTypedDict): + def __list_project_backups( + self, x_pinecone_api_version="2025-10", **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) + >>> thread = api.list_project_backups(x_pinecone_api_version="2025-10", async_req=True) >>> result = thread.get() + Args: + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: limit (int): The number of results to return per page. [optional] if omitted the server will use the default value of 10. @@ -1220,6 +1398,7 @@ def __list_project_backups(self, **kwargs: ExtraOpenApiKwargsTypedDict): thread. """ kwargs = self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version return self.call_with_http_info(**kwargs) self.list_project_backups = _Endpoint( @@ -1232,8 +1411,8 @@ def __list_project_backups(self, **kwargs: ExtraOpenApiKwargsTypedDict): "servers": None, }, params_map={ - "all": ["limit", "pagination_token"], - "required": [], + "all": ["x_pinecone_api_version", "limit", "pagination_token"], + "required": ["x_pinecone_api_version"], "nullable": [], "enum": [], "validation": ["limit"], @@ -1241,9 +1420,21 @@ def __list_project_backups(self, **kwargs: ExtraOpenApiKwargsTypedDict): 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"}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "limit": (int,), + "pagination_token": (str,), + }, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "limit": "limit", + "pagination_token": "paginationToken", + }, + "location_map": { + "x_pinecone_api_version": "header", + "limit": "query", + "pagination_token": "query", + }, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": []}, @@ -1251,16 +1442,20 @@ def __list_project_backups(self, **kwargs: ExtraOpenApiKwargsTypedDict): callable=__list_project_backups, ) - def __list_restore_jobs(self, **kwargs: ExtraOpenApiKwargsTypedDict): + def __list_restore_jobs( + self, x_pinecone_api_version="2025-10", **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) + >>> thread = api.list_restore_jobs(x_pinecone_api_version="2025-10", async_req=True) >>> result = thread.get() + Args: + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: limit (int): The number of results to return per page. [optional] if omitted the server will use the default value of 10. @@ -1288,6 +1483,7 @@ def __list_restore_jobs(self, **kwargs: ExtraOpenApiKwargsTypedDict): thread. """ kwargs = self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version return self.call_with_http_info(**kwargs) self.list_restore_jobs = _Endpoint( @@ -1300,8 +1496,8 @@ def __list_restore_jobs(self, **kwargs: ExtraOpenApiKwargsTypedDict): "servers": None, }, params_map={ - "all": ["limit", "pagination_token"], - "required": [], + "all": ["x_pinecone_api_version", "limit", "pagination_token"], + "required": ["x_pinecone_api_version"], "nullable": [], "enum": [], "validation": ["limit"], @@ -1309,9 +1505,21 @@ def __list_restore_jobs(self, **kwargs: ExtraOpenApiKwargsTypedDict): 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"}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "limit": (int,), + "pagination_token": (str,), + }, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "limit": "limit", + "pagination_token": "paginationToken", + }, + "location_map": { + "x_pinecone_api_version": "header", + "limit": "query", + "pagination_token": "query", + }, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": []}, @@ -1331,7 +1539,9 @@ def __init__(self, api_client=None) -> None: api_client = AsyncioApiClient() self.api_client = api_client - async def __configure_index(self, index_name, configure_index_request, **kwargs): + async def __configure_index( + self, index_name, configure_index_request, x_pinecone_api_version="2025-10", **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 @@ -1340,6 +1550,7 @@ async def __configure_index(self, index_name, configure_index_request, **kwargs) 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. + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -1362,6 +1573,7 @@ async def __configure_index(self, index_name, configure_index_request, **kwargs) IndexModel """ self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["index_name"] = index_name kwargs["configure_index_request"] = configure_index_request return await self.call_with_http_info(**kwargs) @@ -1376,8 +1588,8 @@ async def __configure_index(self, index_name, configure_index_request, **kwargs) "servers": None, }, params_map={ - "all": ["index_name", "configure_index_request"], - "required": ["index_name", "configure_index_request"], + "all": ["x_pinecone_api_version", "index_name", "configure_index_request"], + "required": ["x_pinecone_api_version", "index_name", "configure_index_request"], "nullable": [], "enum": [], "validation": [], @@ -1386,11 +1598,19 @@ async def __configure_index(self, index_name, configure_index_request, **kwargs) "validations": {}, "allowed_values": {}, "openapi_types": { + "x_pinecone_api_version": (str,), "index_name": (str,), "configure_index_request": (ConfigureIndexRequest,), }, - "attribute_map": {"index_name": "index_name"}, - "location_map": {"index_name": "path", "configure_index_request": "body"}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "index_name": "index_name", + }, + "location_map": { + "x_pinecone_api_version": "header", + "index_name": "path", + "configure_index_request": "body", + }, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, @@ -1398,7 +1618,9 @@ async def __configure_index(self, index_name, configure_index_request, **kwargs) callable=__configure_index, ) - async def __create_backup(self, index_name, create_backup_request, **kwargs): + async def __create_backup( + self, index_name, create_backup_request, x_pinecone_api_version="2025-10", **kwargs + ): """Create a backup of an index # noqa: E501 Create a backup of an index. # noqa: E501 @@ -1407,6 +1629,7 @@ async def __create_backup(self, index_name, create_backup_request, **kwargs): Args: index_name (str): Name of the index to backup create_backup_request (CreateBackupRequest): The desired configuration for the backup. + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -1429,6 +1652,7 @@ async def __create_backup(self, index_name, create_backup_request, **kwargs): BackupModel """ self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["index_name"] = index_name kwargs["create_backup_request"] = create_backup_request return await self.call_with_http_info(**kwargs) @@ -1443,8 +1667,8 @@ async def __create_backup(self, index_name, create_backup_request, **kwargs): "servers": None, }, params_map={ - "all": ["index_name", "create_backup_request"], - "required": ["index_name", "create_backup_request"], + "all": ["x_pinecone_api_version", "index_name", "create_backup_request"], + "required": ["x_pinecone_api_version", "index_name", "create_backup_request"], "nullable": [], "enum": [], "validation": [], @@ -1453,11 +1677,19 @@ async def __create_backup(self, index_name, create_backup_request, **kwargs): "validations": {}, "allowed_values": {}, "openapi_types": { + "x_pinecone_api_version": (str,), "index_name": (str,), "create_backup_request": (CreateBackupRequest,), }, - "attribute_map": {"index_name": "index_name"}, - "location_map": {"index_name": "path", "create_backup_request": "body"}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "index_name": "index_name", + }, + "location_map": { + "x_pinecone_api_version": "header", + "index_name": "path", + "create_backup_request": "body", + }, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, @@ -1465,7 +1697,9 @@ async def __create_backup(self, index_name, create_backup_request, **kwargs): callable=__create_backup, ) - async def __create_collection(self, create_collection_request, **kwargs): + async def __create_collection( + self, create_collection_request, x_pinecone_api_version="2025-10", **kwargs + ): """Create a collection # noqa: E501 Create a Pinecone collection. Serverless indexes do not support collections. # noqa: E501 @@ -1473,6 +1707,7 @@ async def __create_collection(self, create_collection_request, **kwargs): Args: create_collection_request (CreateCollectionRequest): The desired configuration for the collection. + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -1495,6 +1730,7 @@ async def __create_collection(self, create_collection_request, **kwargs): CollectionModel """ self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["create_collection_request"] = create_collection_request return await self.call_with_http_info(**kwargs) @@ -1508,8 +1744,8 @@ async def __create_collection(self, create_collection_request, **kwargs): "servers": None, }, params_map={ - "all": ["create_collection_request"], - "required": ["create_collection_request"], + "all": ["x_pinecone_api_version", "create_collection_request"], + "required": ["x_pinecone_api_version", "create_collection_request"], "nullable": [], "enum": [], "validation": [], @@ -1517,9 +1753,15 @@ async def __create_collection(self, create_collection_request, **kwargs): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"create_collection_request": (CreateCollectionRequest,)}, - "attribute_map": {}, - "location_map": {"create_collection_request": "body"}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "create_collection_request": (CreateCollectionRequest,), + }, + "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, + "location_map": { + "x_pinecone_api_version": "header", + "create_collection_request": "body", + }, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, @@ -1527,7 +1769,9 @@ async def __create_collection(self, create_collection_request, **kwargs): callable=__create_collection, ) - async def __create_index(self, create_index_request, **kwargs): + async def __create_index( + self, create_index_request, x_pinecone_api_version="2025-10", **kwargs + ): """Create an 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/index-data/create-an-index). # noqa: E501 @@ -1535,6 +1779,7 @@ async def __create_index(self, create_index_request, **kwargs): Args: create_index_request (CreateIndexRequest): The desired configuration for the index. + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -1557,6 +1802,7 @@ async def __create_index(self, create_index_request, **kwargs): IndexModel """ self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["create_index_request"] = create_index_request return await self.call_with_http_info(**kwargs) @@ -1570,8 +1816,8 @@ async def __create_index(self, create_index_request, **kwargs): "servers": None, }, params_map={ - "all": ["create_index_request"], - "required": ["create_index_request"], + "all": ["x_pinecone_api_version", "create_index_request"], + "required": ["x_pinecone_api_version", "create_index_request"], "nullable": [], "enum": [], "validation": [], @@ -1579,9 +1825,15 @@ async def __create_index(self, create_index_request, **kwargs): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"create_index_request": (CreateIndexRequest,)}, - "attribute_map": {}, - "location_map": {"create_index_request": "body"}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "create_index_request": (CreateIndexRequest,), + }, + "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, + "location_map": { + "x_pinecone_api_version": "header", + "create_index_request": "body", + }, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, @@ -1589,14 +1841,17 @@ async def __create_index(self, create_index_request, **kwargs): callable=__create_index, ) - async def __create_index_for_model(self, create_index_for_model_request, **kwargs): + async def __create_index_for_model( + self, create_index_for_model_request, x_pinecone_api_version="2025-10", **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/index-data/create-an-index#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/index-data/create-an-index#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/index-data/create-an-index#embedding-models) to convert the text automatically during [upsert](https://docs.pinecone.io/reference/api/2025-10/data-plane/upsert_records) and [search](https://docs.pinecone.io/reference/api/2025-10/data-plane/search_records). For guidance and examples, see [Create an index](https://docs.pinecone.io/guides/index-data/create-an-index#integrated-embedding). # noqa: E501 Args: create_index_for_model_request (CreateIndexForModelRequest): The desired configuration for the index and associated embedding model. + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -1619,6 +1874,7 @@ async def __create_index_for_model(self, create_index_for_model_request, **kwarg IndexModel """ self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["create_index_for_model_request"] = create_index_for_model_request return await self.call_with_http_info(**kwargs) @@ -1632,8 +1888,8 @@ async def __create_index_for_model(self, create_index_for_model_request, **kwarg "servers": None, }, params_map={ - "all": ["create_index_for_model_request"], - "required": ["create_index_for_model_request"], + "all": ["x_pinecone_api_version", "create_index_for_model_request"], + "required": ["x_pinecone_api_version", "create_index_for_model_request"], "nullable": [], "enum": [], "validation": [], @@ -1641,9 +1897,15 @@ 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": { + "x_pinecone_api_version": (str,), + "create_index_for_model_request": (CreateIndexForModelRequest,), + }, + "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, + "location_map": { + "x_pinecone_api_version": "header", + "create_index_for_model_request": "body", + }, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, @@ -1652,7 +1914,11 @@ async def __create_index_for_model(self, create_index_for_model_request, **kwarg ) async def __create_index_from_backup_operation( - self, backup_id, create_index_from_backup_request, **kwargs + self, + backup_id, + create_index_from_backup_request, + x_pinecone_api_version="2025-10", + **kwargs, ): """Create an index from a backup # noqa: E501 @@ -1662,6 +1928,7 @@ async def __create_index_from_backup_operation( 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. + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -1684,6 +1951,7 @@ async def __create_index_from_backup_operation( CreateIndexFromBackupResponse """ self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["backup_id"] = backup_id kwargs["create_index_from_backup_request"] = create_index_from_backup_request return await self.call_with_http_info(**kwargs) @@ -1698,8 +1966,12 @@ async def __create_index_from_backup_operation( "servers": None, }, params_map={ - "all": ["backup_id", "create_index_from_backup_request"], - "required": ["backup_id", "create_index_from_backup_request"], + "all": ["x_pinecone_api_version", "backup_id", "create_index_from_backup_request"], + "required": [ + "x_pinecone_api_version", + "backup_id", + "create_index_from_backup_request", + ], "nullable": [], "enum": [], "validation": [], @@ -1708,11 +1980,19 @@ async def __create_index_from_backup_operation( "validations": {}, "allowed_values": {}, "openapi_types": { + "x_pinecone_api_version": (str,), "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"}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "backup_id": "backup_id", + }, + "location_map": { + "x_pinecone_api_version": "header", + "backup_id": "path", + "create_index_from_backup_request": "body", + }, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, @@ -1720,7 +2000,7 @@ async def __create_index_from_backup_operation( callable=__create_index_from_backup_operation, ) - async def __delete_backup(self, backup_id, **kwargs): + async def __delete_backup(self, backup_id, x_pinecone_api_version="2025-10", **kwargs): """Delete a backup # noqa: E501 Delete a backup. # noqa: E501 @@ -1728,6 +2008,7 @@ async def __delete_backup(self, backup_id, **kwargs): Args: backup_id (str): The ID of the backup to delete. + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -1750,6 +2031,7 @@ async def __delete_backup(self, backup_id, **kwargs): None """ self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["backup_id"] = backup_id return await self.call_with_http_info(**kwargs) @@ -1763,8 +2045,8 @@ async def __delete_backup(self, backup_id, **kwargs): "servers": None, }, params_map={ - "all": ["backup_id"], - "required": ["backup_id"], + "all": ["x_pinecone_api_version", "backup_id"], + "required": ["x_pinecone_api_version", "backup_id"], "nullable": [], "enum": [], "validation": [], @@ -1772,9 +2054,12 @@ async def __delete_backup(self, backup_id, **kwargs): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"backup_id": (str,)}, - "attribute_map": {"backup_id": "backup_id"}, - "location_map": {"backup_id": "path"}, + "openapi_types": {"x_pinecone_api_version": (str,), "backup_id": (str,)}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "backup_id": "backup_id", + }, + "location_map": {"x_pinecone_api_version": "header", "backup_id": "path"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": []}, @@ -1782,7 +2067,9 @@ async def __delete_backup(self, backup_id, **kwargs): callable=__delete_backup, ) - async def __delete_collection(self, collection_name, **kwargs): + async def __delete_collection( + self, collection_name, x_pinecone_api_version="2025-10", **kwargs + ): """Delete a collection # noqa: E501 Delete an existing collection. Serverless indexes do not support collections. # noqa: E501 @@ -1790,6 +2077,7 @@ async def __delete_collection(self, collection_name, **kwargs): Args: collection_name (str): The name of the collection. + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -1812,6 +2100,7 @@ async def __delete_collection(self, collection_name, **kwargs): None """ self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["collection_name"] = collection_name return await self.call_with_http_info(**kwargs) @@ -1825,8 +2114,8 @@ async def __delete_collection(self, collection_name, **kwargs): "servers": None, }, params_map={ - "all": ["collection_name"], - "required": ["collection_name"], + "all": ["x_pinecone_api_version", "collection_name"], + "required": ["x_pinecone_api_version", "collection_name"], "nullable": [], "enum": [], "validation": [], @@ -1834,9 +2123,12 @@ async def __delete_collection(self, collection_name, **kwargs): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"collection_name": (str,)}, - "attribute_map": {"collection_name": "collection_name"}, - "location_map": {"collection_name": "path"}, + "openapi_types": {"x_pinecone_api_version": (str,), "collection_name": (str,)}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "collection_name": "collection_name", + }, + "location_map": {"x_pinecone_api_version": "header", "collection_name": "path"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": []}, @@ -1844,7 +2136,7 @@ async def __delete_collection(self, collection_name, **kwargs): callable=__delete_collection, ) - async def __delete_index(self, index_name, **kwargs): + async def __delete_index(self, index_name, x_pinecone_api_version="2025-10", **kwargs): """Delete an index # noqa: E501 Delete an existing index. # noqa: E501 @@ -1852,6 +2144,7 @@ async def __delete_index(self, index_name, **kwargs): Args: index_name (str): The name of the index to delete. + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -1874,6 +2167,7 @@ async def __delete_index(self, index_name, **kwargs): None """ self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["index_name"] = index_name return await self.call_with_http_info(**kwargs) @@ -1887,8 +2181,8 @@ async def __delete_index(self, index_name, **kwargs): "servers": None, }, params_map={ - "all": ["index_name"], - "required": ["index_name"], + "all": ["x_pinecone_api_version", "index_name"], + "required": ["x_pinecone_api_version", "index_name"], "nullable": [], "enum": [], "validation": [], @@ -1896,9 +2190,12 @@ async def __delete_index(self, index_name, **kwargs): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"index_name": (str,)}, - "attribute_map": {"index_name": "index_name"}, - "location_map": {"index_name": "path"}, + "openapi_types": {"x_pinecone_api_version": (str,), "index_name": (str,)}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "index_name": "index_name", + }, + "location_map": {"x_pinecone_api_version": "header", "index_name": "path"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": []}, @@ -1906,7 +2203,7 @@ async def __delete_index(self, index_name, **kwargs): callable=__delete_index, ) - async def __describe_backup(self, backup_id, **kwargs): + async def __describe_backup(self, backup_id, x_pinecone_api_version="2025-10", **kwargs): """Describe a backup # noqa: E501 Get a description of a backup. # noqa: E501 @@ -1914,6 +2211,7 @@ async def __describe_backup(self, backup_id, **kwargs): Args: backup_id (str): The ID of the backup to describe. + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -1936,6 +2234,7 @@ async def __describe_backup(self, backup_id, **kwargs): BackupModel """ self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["backup_id"] = backup_id return await self.call_with_http_info(**kwargs) @@ -1949,8 +2248,8 @@ async def __describe_backup(self, backup_id, **kwargs): "servers": None, }, params_map={ - "all": ["backup_id"], - "required": ["backup_id"], + "all": ["x_pinecone_api_version", "backup_id"], + "required": ["x_pinecone_api_version", "backup_id"], "nullable": [], "enum": [], "validation": [], @@ -1958,9 +2257,12 @@ async def __describe_backup(self, backup_id, **kwargs): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"backup_id": (str,)}, - "attribute_map": {"backup_id": "backup_id"}, - "location_map": {"backup_id": "path"}, + "openapi_types": {"x_pinecone_api_version": (str,), "backup_id": (str,)}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "backup_id": "backup_id", + }, + "location_map": {"x_pinecone_api_version": "header", "backup_id": "path"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": []}, @@ -1968,7 +2270,9 @@ async def __describe_backup(self, backup_id, **kwargs): callable=__describe_backup, ) - async def __describe_collection(self, collection_name, **kwargs): + async def __describe_collection( + self, collection_name, x_pinecone_api_version="2025-10", **kwargs + ): """Describe a collection # noqa: E501 Get a description of a collection. Serverless indexes do not support collections. # noqa: E501 @@ -1976,6 +2280,7 @@ async def __describe_collection(self, collection_name, **kwargs): Args: collection_name (str): The name of the collection to be described. + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -1998,6 +2303,7 @@ async def __describe_collection(self, collection_name, **kwargs): CollectionModel """ self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["collection_name"] = collection_name return await self.call_with_http_info(**kwargs) @@ -2011,8 +2317,8 @@ async def __describe_collection(self, collection_name, **kwargs): "servers": None, }, params_map={ - "all": ["collection_name"], - "required": ["collection_name"], + "all": ["x_pinecone_api_version", "collection_name"], + "required": ["x_pinecone_api_version", "collection_name"], "nullable": [], "enum": [], "validation": [], @@ -2020,9 +2326,12 @@ async def __describe_collection(self, collection_name, **kwargs): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"collection_name": (str,)}, - "attribute_map": {"collection_name": "collection_name"}, - "location_map": {"collection_name": "path"}, + "openapi_types": {"x_pinecone_api_version": (str,), "collection_name": (str,)}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "collection_name": "collection_name", + }, + "location_map": {"x_pinecone_api_version": "header", "collection_name": "path"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": []}, @@ -2030,7 +2339,7 @@ async def __describe_collection(self, collection_name, **kwargs): callable=__describe_collection, ) - async def __describe_index(self, index_name, **kwargs): + async def __describe_index(self, index_name, x_pinecone_api_version="2025-10", **kwargs): """Describe an index # noqa: E501 Get a description of an index. # noqa: E501 @@ -2038,6 +2347,7 @@ async def __describe_index(self, index_name, **kwargs): Args: index_name (str): The name of the index to be described. + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -2060,6 +2370,7 @@ async def __describe_index(self, index_name, **kwargs): IndexModel """ self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["index_name"] = index_name return await self.call_with_http_info(**kwargs) @@ -2073,8 +2384,8 @@ async def __describe_index(self, index_name, **kwargs): "servers": None, }, params_map={ - "all": ["index_name"], - "required": ["index_name"], + "all": ["x_pinecone_api_version", "index_name"], + "required": ["x_pinecone_api_version", "index_name"], "nullable": [], "enum": [], "validation": [], @@ -2082,9 +2393,12 @@ async def __describe_index(self, index_name, **kwargs): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"index_name": (str,)}, - "attribute_map": {"index_name": "index_name"}, - "location_map": {"index_name": "path"}, + "openapi_types": {"x_pinecone_api_version": (str,), "index_name": (str,)}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "index_name": "index_name", + }, + "location_map": {"x_pinecone_api_version": "header", "index_name": "path"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": []}, @@ -2092,7 +2406,7 @@ async def __describe_index(self, index_name, **kwargs): callable=__describe_index, ) - async def __describe_restore_job(self, job_id, **kwargs): + async def __describe_restore_job(self, job_id, x_pinecone_api_version="2025-10", **kwargs): """Describe a restore job # noqa: E501 Get a description of a restore job. # noqa: E501 @@ -2100,6 +2414,7 @@ async def __describe_restore_job(self, job_id, **kwargs): Args: job_id (str): The ID of the restore job to describe. + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -2122,6 +2437,7 @@ async def __describe_restore_job(self, job_id, **kwargs): RestoreJobModel """ self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["job_id"] = job_id return await self.call_with_http_info(**kwargs) @@ -2135,8 +2451,8 @@ async def __describe_restore_job(self, job_id, **kwargs): "servers": None, }, params_map={ - "all": ["job_id"], - "required": ["job_id"], + "all": ["x_pinecone_api_version", "job_id"], + "required": ["x_pinecone_api_version", "job_id"], "nullable": [], "enum": [], "validation": [], @@ -2144,9 +2460,12 @@ async def __describe_restore_job(self, job_id, **kwargs): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"job_id": (str,)}, - "attribute_map": {"job_id": "job_id"}, - "location_map": {"job_id": "path"}, + "openapi_types": {"x_pinecone_api_version": (str,), "job_id": (str,)}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "job_id": "job_id", + }, + "location_map": {"x_pinecone_api_version": "header", "job_id": "path"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": []}, @@ -2154,12 +2473,14 @@ async def __describe_restore_job(self, job_id, **kwargs): callable=__describe_restore_job, ) - async def __list_collections(self, **kwargs): + async def __list_collections(self, x_pinecone_api_version="2025-10", **kwargs): """List collections # noqa: E501 List all collections in a project. Serverless indexes do not support collections. # noqa: E501 + Args: + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -2182,6 +2503,7 @@ async def __list_collections(self, **kwargs): CollectionList """ self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version return await self.call_with_http_info(**kwargs) self.list_collections = _AsyncioEndpoint( @@ -2193,13 +2515,19 @@ async def __list_collections(self, **kwargs): "http_method": "GET", "servers": None, }, - params_map={"all": [], "required": [], "nullable": [], "enum": [], "validation": []}, + params_map={ + "all": ["x_pinecone_api_version"], + "required": ["x_pinecone_api_version"], + "nullable": [], + "enum": [], + "validation": [], + }, root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {}, - "attribute_map": {}, - "location_map": {}, + "openapi_types": {"x_pinecone_api_version": (str,)}, + "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, + "location_map": {"x_pinecone_api_version": "header"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": []}, @@ -2207,7 +2535,9 @@ async def __list_collections(self, **kwargs): callable=__list_collections, ) - async def __list_index_backups(self, index_name, **kwargs): + async def __list_index_backups( + self, index_name, x_pinecone_api_version="2025-10", **kwargs + ): """List backups for an index # noqa: E501 List all backups for an index. # noqa: E501 @@ -2215,6 +2545,7 @@ async def __list_index_backups(self, index_name, **kwargs): Args: index_name (str): Name of the backed up index + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: limit (int): The number of results to return per page. [optional] if omitted the server will use the default value of 10. @@ -2239,6 +2570,7 @@ async def __list_index_backups(self, index_name, **kwargs): BackupList """ self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["index_name"] = index_name return await self.call_with_http_info(**kwargs) @@ -2252,8 +2584,8 @@ async def __list_index_backups(self, index_name, **kwargs): "servers": None, }, params_map={ - "all": ["index_name", "limit", "pagination_token"], - "required": ["index_name"], + "all": ["x_pinecone_api_version", "index_name", "limit", "pagination_token"], + "required": ["x_pinecone_api_version", "index_name"], "nullable": [], "enum": [], "validation": ["limit"], @@ -2262,16 +2594,19 @@ async def __list_index_backups(self, index_name, **kwargs): "validations": {("limit",): {"inclusive_maximum": 100, "inclusive_minimum": 1}}, "allowed_values": {}, "openapi_types": { + "x_pinecone_api_version": (str,), "index_name": (str,), "limit": (int,), "pagination_token": (str,), }, "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", "index_name": "index_name", "limit": "limit", "pagination_token": "paginationToken", }, "location_map": { + "x_pinecone_api_version": "header", "index_name": "path", "limit": "query", "pagination_token": "query", @@ -2283,12 +2618,14 @@ async def __list_index_backups(self, index_name, **kwargs): callable=__list_index_backups, ) - async def __list_indexes(self, **kwargs): + async def __list_indexes(self, x_pinecone_api_version="2025-10", **kwargs): """List indexes # noqa: E501 List all indexes in a project. # noqa: E501 + Args: + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -2311,6 +2648,7 @@ async def __list_indexes(self, **kwargs): IndexList """ self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version return await self.call_with_http_info(**kwargs) self.list_indexes = _AsyncioEndpoint( @@ -2322,13 +2660,19 @@ async def __list_indexes(self, **kwargs): "http_method": "GET", "servers": None, }, - params_map={"all": [], "required": [], "nullable": [], "enum": [], "validation": []}, + params_map={ + "all": ["x_pinecone_api_version"], + "required": ["x_pinecone_api_version"], + "nullable": [], + "enum": [], + "validation": [], + }, root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {}, - "attribute_map": {}, - "location_map": {}, + "openapi_types": {"x_pinecone_api_version": (str,)}, + "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, + "location_map": {"x_pinecone_api_version": "header"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": []}, @@ -2336,12 +2680,14 @@ async def __list_indexes(self, **kwargs): callable=__list_indexes, ) - async def __list_project_backups(self, **kwargs): + async def __list_project_backups(self, x_pinecone_api_version="2025-10", **kwargs): """List backups for all indexes in a project # noqa: E501 List all backups for a project. # noqa: E501 + Args: + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: limit (int): The number of results to return per page. [optional] if omitted the server will use the default value of 10. @@ -2366,6 +2712,7 @@ async def __list_project_backups(self, **kwargs): BackupList """ self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version return await self.call_with_http_info(**kwargs) self.list_project_backups = _AsyncioEndpoint( @@ -2378,8 +2725,8 @@ async def __list_project_backups(self, **kwargs): "servers": None, }, params_map={ - "all": ["limit", "pagination_token"], - "required": [], + "all": ["x_pinecone_api_version", "limit", "pagination_token"], + "required": ["x_pinecone_api_version"], "nullable": [], "enum": [], "validation": ["limit"], @@ -2387,9 +2734,21 @@ async def __list_project_backups(self, **kwargs): 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"}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "limit": (int,), + "pagination_token": (str,), + }, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "limit": "limit", + "pagination_token": "paginationToken", + }, + "location_map": { + "x_pinecone_api_version": "header", + "limit": "query", + "pagination_token": "query", + }, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": []}, @@ -2397,12 +2756,14 @@ async def __list_project_backups(self, **kwargs): callable=__list_project_backups, ) - async def __list_restore_jobs(self, **kwargs): + async def __list_restore_jobs(self, x_pinecone_api_version="2025-10", **kwargs): """List restore jobs # noqa: E501 List all restore jobs for a project. # noqa: E501 + Args: + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: limit (int): The number of results to return per page. [optional] if omitted the server will use the default value of 10. @@ -2427,6 +2788,7 @@ async def __list_restore_jobs(self, **kwargs): RestoreJobList """ self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version return await self.call_with_http_info(**kwargs) self.list_restore_jobs = _AsyncioEndpoint( @@ -2439,8 +2801,8 @@ async def __list_restore_jobs(self, **kwargs): "servers": None, }, params_map={ - "all": ["limit", "pagination_token"], - "required": [], + "all": ["x_pinecone_api_version", "limit", "pagination_token"], + "required": ["x_pinecone_api_version"], "nullable": [], "enum": [], "validation": ["limit"], @@ -2448,9 +2810,21 @@ async def __list_restore_jobs(self, **kwargs): 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"}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "limit": (int,), + "pagination_token": (str,), + }, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "limit": "limit", + "pagination_token": "paginationToken", + }, + "location_map": { + "x_pinecone_api_version": "header", + "limit": "query", + "pagination_token": "query", + }, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": []}, diff --git a/pinecone/core/openapi/db_control/model/backup_list.py b/pinecone/core/openapi/db_control/model/backup_list.py index c485a03d..c45302c6 100644 --- a/pinecone/core/openapi/db_control/model/backup_list.py +++ b/pinecone/core/openapi/db_control/model/backup_list.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ @@ -147,7 +147,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,) - data ([BackupModel]): [optional] # noqa: E501 + data ([BackupModel]): List of backup objects [optional] # noqa: E501 pagination (PaginationResponse): [optional] # noqa: E501 """ @@ -238,7 +238,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,) - data ([BackupModel]): [optional] # noqa: E501 + data ([BackupModel]): List of backup objects [optional] # noqa: E501 pagination (PaginationResponse): [optional] # noqa: E501 """ diff --git a/pinecone/core/openapi/db_control/model/backup_model.py b/pinecone/core/openapi/db_control/model/backup_model.py index 5b50ba9d..96182174 100644 --- a/pinecone/core/openapi/db_control/model/backup_model.py +++ b/pinecone/core/openapi/db_control/model/backup_model.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ @@ -28,8 +28,10 @@ def lazy_import(): + from pinecone.core.openapi.db_control.model.backup_model_schema import BackupModelSchema from pinecone.core.openapi.db_control.model.index_tags import IndexTags + globals()["BackupModelSchema"] = BackupModelSchema globals()["IndexTags"] = IndexTags @@ -65,9 +67,7 @@ class BackupModel(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - ("metric",): {"COSINE": "cosine", "EUCLIDEAN": "euclidean", "DOTPRODUCT": "dotproduct"} - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { ("dimension",): {"inclusive_maximum": 20000, "inclusive_minimum": 1} @@ -106,6 +106,7 @@ def openapi_types(cls): "description": (str,), # noqa: E501 "dimension": (int,), # noqa: E501 "metric": (str,), # noqa: E501 + "schema": (BackupModelSchema,), # noqa: E501 "record_count": (int,), # noqa: E501 "namespace_count": (int,), # noqa: E501 "size_bytes": (int,), # noqa: E501 @@ -128,6 +129,7 @@ def discriminator(cls): "description": "description", # noqa: E501 "dimension": "dimension", # noqa: E501 "metric": "metric", # noqa: E501 + "schema": "schema", # noqa: E501 "record_count": "record_count", # noqa: E501 "namespace_count": "namespace_count", # noqa: E501 "size_bytes": "size_bytes", # noqa: E501 @@ -196,7 +198,8 @@ def _from_openapi_data( 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 + 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'. Possible values: `cosine`, `euclidean`, or `dotproduct`. [optional] # noqa: E501 + schema (BackupModelSchema): [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 @@ -310,7 +313,8 @@ def __init__( 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 + 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'. Possible values: `cosine`, `euclidean`, or `dotproduct`. [optional] # noqa: E501 + schema (BackupModelSchema): [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 diff --git a/pinecone/core/openapi/db_control/model/index_model_spec.py b/pinecone/core/openapi/db_control/model/backup_model_schema.py similarity index 89% rename from pinecone/core/openapi/db_control/model/index_model_spec.py rename to pinecone/core/openapi/db_control/model/backup_model_schema.py index 7fc5452b..0b9a02d3 100644 --- a/pinecone/core/openapi/db_control/model/index_model_spec.py +++ b/pinecone/core/openapi/db_control/model/backup_model_schema.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ @@ -28,22 +28,20 @@ def lazy_import(): - from pinecone.core.openapi.db_control.model.byoc_spec import ByocSpec - from pinecone.core.openapi.db_control.model.pod_spec import PodSpec - from pinecone.core.openapi.db_control.model.serverless_spec import ServerlessSpec + from pinecone.core.openapi.db_control.model.backup_model_schema_fields import ( + BackupModelSchemaFields, + ) - globals()["ByocSpec"] = ByocSpec - globals()["PodSpec"] = PodSpec - globals()["ServerlessSpec"] = ServerlessSpec + globals()["BackupModelSchemaFields"] = BackupModelSchemaFields from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar from pinecone.openapi_support import PropertyValidationTypedDict, cached_class_property -T = TypeVar("T", bound="IndexModelSpec") +T = TypeVar("T", bound="BackupModelSchema") -class IndexModelSpec(ModelNormal): +class BackupModelSchema(ModelNormal): """NOTE: This class is @generated using OpenAPI. Do not edit the class manually. @@ -96,9 +94,7 @@ def openapi_types(cls): """ lazy_import() return { - "byoc": (ByocSpec,), # noqa: E501 - "pod": (PodSpec,), # noqa: E501 - "serverless": (ServerlessSpec,), # noqa: E501 + "fields": ({str: (BackupModelSchemaFields,)},) # noqa: E501 } @cached_class_property @@ -106,9 +102,7 @@ def discriminator(cls): return None attribute_map: Dict[str, str] = { - "byoc": "byoc", # noqa: E501 - "pod": "pod", # noqa: E501 - "serverless": "serverless", # noqa: E501 + "fields": "fields" # noqa: E501 } read_only_vars: Set[str] = set([]) @@ -117,8 +111,11 @@ def discriminator(cls): @classmethod @convert_js_args_to_python_args - def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 - """IndexModelSpec - a model defined in OpenAPI + def _from_openapi_data(cls: Type[T], fields, *args, **kwargs) -> T: # noqa: E501 + """BackupModelSchema - a model defined in OpenAPI + + Args: + fields ({str: (BackupModelSchemaFields,)}): A map of metadata field names to their configuration. The field name must be a valid metadata field name. The field name must be unique. Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -151,9 +148,6 @@ 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,) - byoc (ByocSpec): [optional] # noqa: E501 - pod (PodSpec): [optional] # noqa: E501 - serverless (ServerlessSpec): [optional] # noqa: E501 """ _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", False) @@ -183,6 +177,7 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.fields = fields for var_name, var_value in kwargs.items(): if ( var_name not in self.attribute_map @@ -209,8 +204,11 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 ) @convert_js_args_to_python_args - def __init__(self, *args, **kwargs) -> None: # noqa: E501 - """IndexModelSpec - a model defined in OpenAPI + def __init__(self, fields, *args, **kwargs) -> None: # noqa: E501 + """BackupModelSchema - a model defined in OpenAPI + + Args: + fields ({str: (BackupModelSchemaFields,)}): A map of metadata field names to their configuration. The field name must be a valid metadata field name. The field name must be unique. Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -243,9 +241,6 @@ 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,) - byoc (ByocSpec): [optional] # noqa: E501 - pod (PodSpec): [optional] # noqa: E501 - serverless (ServerlessSpec): [optional] # noqa: E501 """ _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", True) @@ -273,6 +268,7 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.fields = fields for var_name, var_value in kwargs.items(): if ( var_name not in self.attribute_map diff --git a/pinecone/core/openapi/db_control/model/backup_model_schema_fields.py b/pinecone/core/openapi/db_control/model/backup_model_schema_fields.py new file mode 100644 index 00000000..51a95c0d --- /dev/null +++ b/pinecone/core/openapi/db_control/model/backup_model_schema_fields.py @@ -0,0 +1,270 @@ +""" +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-10 +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="BackupModelSchemaFields") + + +class BackupModelSchemaFields(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 { + "filterable": (bool,) # noqa: E501 + } + + @cached_class_property + def discriminator(cls): + return None + + attribute_map: Dict[str, str] = { + "filterable": "filterable" # 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 + """BackupModelSchemaFields - 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,) + filterable (bool): Whether the field is filterable. If true, the field is indexed and can be used in filters. Only true values are allowed. [optional] # noqa: E501 + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", False) + _enforce_validations = kwargs.pop("_enforce_validations", False) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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( + [ + "_enforce_allowed_values", + "_enforce_validations", + "_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 + """BackupModelSchemaFields - 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,) + filterable (bool): Whether the field is filterable. If true, the field is indexed and can be used in filters. Only true values are allowed. [optional] # noqa: E501 + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", True) + _enforce_validations = kwargs.pop("_enforce_validations", True) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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/byoc.py b/pinecone/core/openapi/db_control/model/byoc.py new file mode 100644 index 00000000..7d87e24b --- /dev/null +++ b/pinecone/core/openapi/db_control/model/byoc.py @@ -0,0 +1,284 @@ +""" +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-10 +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.byoc_spec import ByocSpec + + globals()["ByocSpec"] = ByocSpec + + +from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar +from pinecone.openapi_support import PropertyValidationTypedDict, cached_class_property + +T = TypeVar("T", bound="BYOC") + + +class BYOC(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 { + "byoc": (ByocSpec,) # noqa: E501 + } + + @cached_class_property + def discriminator(cls): + return None + + attribute_map: Dict[str, str] = { + "byoc": "byoc" # 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], byoc, *args, **kwargs) -> T: # noqa: E501 + """BYOC - a model defined in OpenAPI + + Args: + byoc (ByocSpec): + + 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,) + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", False) + _enforce_validations = kwargs.pop("_enforce_validations", False) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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.byoc = byoc + 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( + [ + "_enforce_allowed_values", + "_enforce_validations", + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) + + @convert_js_args_to_python_args + def __init__(self, byoc, *args, **kwargs) -> None: # noqa: E501 + """BYOC - a model defined in OpenAPI + + Args: + byoc (ByocSpec): + + 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,) + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", True) + _enforce_validations = kwargs.pop("_enforce_validations", True) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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.byoc = byoc + 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/byoc_spec.py b/pinecone/core/openapi/db_control/model/byoc_spec.py index 4d7a843d..ef30a46d 100644 --- a/pinecone/core/openapi/db_control/model/byoc_spec.py +++ b/pinecone/core/openapi/db_control/model/byoc_spec.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ @@ -27,6 +27,12 @@ from pinecone.openapi_support.exceptions import PineconeApiAttributeError +def lazy_import(): + from pinecone.core.openapi.db_control.model.backup_model_schema import BackupModelSchema + + globals()["BackupModelSchema"] = BackupModelSchema + + from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar from pinecone.openapi_support import PropertyValidationTypedDict, cached_class_property @@ -69,6 +75,7 @@ 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 @@ -83,8 +90,10 @@ def openapi_types(cls): openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { - "environment": (str,) # noqa: E501 + "environment": (str,), # noqa: E501 + "schema": (BackupModelSchema,), # noqa: E501 } @cached_class_property @@ -92,7 +101,8 @@ def discriminator(cls): return None attribute_map: Dict[str, str] = { - "environment": "environment" # noqa: E501 + "environment": "environment", # noqa: E501 + "schema": "schema", # noqa: E501 } read_only_vars: Set[str] = set([]) @@ -138,6 +148,7 @@ def _from_openapi_data(cls: Type[T], environment, *args, **kwargs) -> T: # noqa Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) + schema (BackupModelSchema): [optional] # noqa: E501 """ _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", False) @@ -231,6 +242,7 @@ def __init__(self, environment, *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,) + schema (BackupModelSchema): [optional] # noqa: E501 """ _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", True) diff --git a/pinecone/core/openapi/db_control/model/collection_list.py b/pinecone/core/openapi/db_control/model/collection_list.py index 8afb0b7e..5c1166e7 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-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ @@ -143,7 +143,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,) - collections ([CollectionModel]): [optional] # noqa: E501 + collections ([CollectionModel]): List of collections in the project [optional] # noqa: E501 """ _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", False) @@ -233,7 +233,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,) - collections ([CollectionModel]): [optional] # noqa: E501 + collections ([CollectionModel]): List of collections in the project [optional] # noqa: E501 """ _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", True) diff --git a/pinecone/core/openapi/db_control/model/collection_model.py b/pinecone/core/openapi/db_control/model/collection_model.py index bb8e6577..380be520 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-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ @@ -59,13 +59,7 @@ class CollectionModel(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - ("status",): { - "INITIALIZING": "Initializing", - "READY": "Ready", - "TERMINATING": "Terminating", - } - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { ("dimension",): {"inclusive_maximum": 20000, "inclusive_minimum": 1} @@ -124,7 +118,7 @@ def _from_openapi_data(cls: Type[T], name, status, environment, *args, **kwargs) Args: name (str): The name of the collection. - status (str): The status of the collection. + status (str): The status of the collection. Possible values: `Initializing`, `Ready`, or `Terminating`. environment (str): The environment where the collection is hosted. Keyword Args: @@ -224,7 +218,7 @@ def __init__(self, name, status, environment, *args, **kwargs) -> None: # noqa: Args: name (str): The name of the collection. - status (str): The status of the collection. + status (str): The status of the collection. Possible values: `Initializing`, `Ready`, or `Terminating`. environment (str): The environment where the collection is hosted. Keyword Args: 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 352166e0..7e8d5888 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-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ @@ -31,15 +31,9 @@ def lazy_import(): from pinecone.core.openapi.db_control.model.configure_index_request_embed import ( ConfigureIndexRequestEmbed, ) - from pinecone.core.openapi.db_control.model.configure_index_request_spec import ( - ConfigureIndexRequestSpec, - ) - from pinecone.core.openapi.db_control.model.deletion_protection import DeletionProtection from pinecone.core.openapi.db_control.model.index_tags import IndexTags globals()["ConfigureIndexRequestEmbed"] = ConfigureIndexRequestEmbed - globals()["ConfigureIndexRequestSpec"] = ConfigureIndexRequestSpec - globals()["DeletionProtection"] = DeletionProtection globals()["IndexTags"] = IndexTags @@ -102,8 +96,8 @@ def openapi_types(cls): """ lazy_import() return { - "spec": (ConfigureIndexRequestSpec,), # noqa: E501 - "deletion_protection": (DeletionProtection,), # noqa: E501 + "spec": (dict,), # noqa: E501 + "deletion_protection": (str,), # noqa: E501 "tags": (IndexTags,), # noqa: E501 "embed": (ConfigureIndexRequestEmbed,), # noqa: E501 } @@ -159,8 +153,8 @@ 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,) - spec (ConfigureIndexRequestSpec): [optional] # noqa: E501 - deletion_protection (DeletionProtection): [optional] # noqa: E501 + spec (dict): The spec object defines how the index should be deployed. Only some attributes of an index's spec may be updated. In general, you can modify settings related to scaling and configuration but you cannot change the cloud or region where the index is hosted. [optional] # noqa: E501 + deletion_protection (str): Whether [deletion protection](http://docs.pinecone.io/guides/manage-data/manage-indexes#configure-deletion-protection) is enabled/disabled for the index. Possible values: `disabled` or `enabled`. [optional] if omitted the server will use the default value of "disabled". # noqa: E501 tags (IndexTags): [optional] # noqa: E501 embed (ConfigureIndexRequestEmbed): [optional] # noqa: E501 """ @@ -252,8 +246,8 @@ 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,) - spec (ConfigureIndexRequestSpec): [optional] # noqa: E501 - deletion_protection (DeletionProtection): [optional] # noqa: E501 + spec (dict): The spec object defines how the index should be deployed. Only some attributes of an index's spec may be updated. In general, you can modify settings related to scaling and configuration but you cannot change the cloud or region where the index is hosted. [optional] # noqa: E501 + deletion_protection (str): Whether [deletion protection](http://docs.pinecone.io/guides/manage-data/manage-indexes#configure-deletion-protection) is enabled/disabled for the index. Possible values: `disabled` or `enabled`. [optional] if omitted the server will use the default value of "disabled". # noqa: E501 tags (IndexTags): [optional] # noqa: E501 embed (ConfigureIndexRequestEmbed): [optional] # noqa: E501 """ 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 c3b1fc2b..3491145a 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-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_control/model/create_backup_request.py b/pinecone/core/openapi/db_control/model/create_backup_request.py index 6375f18f..b6eeb1da 100644 --- a/pinecone/core/openapi/db_control/model/create_backup_request.py +++ b/pinecone/core/openapi/db_control/model/create_backup_request.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-04 +The version of the OpenAPI document: 2025-10 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 544d5f96..4d957bfd 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-04 +The version of the OpenAPI document: 2025-10 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 6fe5fe79..78207021 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-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ @@ -28,15 +28,17 @@ def lazy_import(): + from pinecone.core.openapi.db_control.model.backup_model_schema import BackupModelSchema from pinecone.core.openapi.db_control.model.create_index_for_model_request_embed import ( CreateIndexForModelRequestEmbed, ) - from pinecone.core.openapi.db_control.model.deletion_protection import DeletionProtection from pinecone.core.openapi.db_control.model.index_tags import IndexTags + from pinecone.core.openapi.db_control.model.read_capacity import ReadCapacity + globals()["BackupModelSchema"] = BackupModelSchema globals()["CreateIndexForModelRequestEmbed"] = CreateIndexForModelRequestEmbed - globals()["DeletionProtection"] = DeletionProtection globals()["IndexTags"] = IndexTags + globals()["ReadCapacity"] = ReadCapacity from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -71,9 +73,7 @@ class CreateIndexForModelRequest(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - ("cloud",): {"GCP": "gcp", "AWS": "aws", "AZURE": "azure"} - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { ("name",): {"max_length": 45, "min_length": 1} @@ -106,8 +106,10 @@ def openapi_types(cls): "cloud": (str,), # noqa: E501 "region": (str,), # noqa: E501 "embed": (CreateIndexForModelRequestEmbed,), # noqa: E501 - "deletion_protection": (DeletionProtection,), # noqa: E501 + "deletion_protection": (str,), # noqa: E501 "tags": (IndexTags,), # noqa: E501 + "schema": (BackupModelSchema,), # noqa: E501 + "read_capacity": (ReadCapacity,), # noqa: E501 } @cached_class_property @@ -121,6 +123,8 @@ def discriminator(cls): "embed": "embed", # noqa: E501 "deletion_protection": "deletion_protection", # noqa: E501 "tags": "tags", # noqa: E501 + "schema": "schema", # noqa: E501 + "read_capacity": "read_capacity", # noqa: E501 } read_only_vars: Set[str] = set([]) @@ -134,7 +138,7 @@ def _from_openapi_data(cls: Type[T], name, cloud, region, embed, *args, **kwargs 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 '-'. - cloud (str): The public cloud where you would like your index hosted. + cloud (str): The public cloud where you would like your index hosted. Possible values: `gcp`, `aws`, or `azure`. region (str): The region where you would like your index to be created. embed (CreateIndexForModelRequestEmbed): @@ -169,8 +173,10 @@ def _from_openapi_data(cls: Type[T], name, cloud, region, embed, *args, **kwargs Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - deletion_protection (DeletionProtection): [optional] # noqa: E501 + deletion_protection (str): Whether [deletion protection](http://docs.pinecone.io/guides/manage-data/manage-indexes#configure-deletion-protection) is enabled/disabled for the index. Possible values: `disabled` or `enabled`. [optional] if omitted the server will use the default value of "disabled". # noqa: E501 tags (IndexTags): [optional] # noqa: E501 + schema (BackupModelSchema): [optional] # noqa: E501 + read_capacity (ReadCapacity): [optional] # noqa: E501 """ _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", False) @@ -235,7 +241,7 @@ def __init__(self, name, cloud, region, embed, *args, **kwargs) -> None: # noqa 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 '-'. - cloud (str): The public cloud where you would like your index hosted. + cloud (str): The public cloud where you would like your index hosted. Possible values: `gcp`, `aws`, or `azure`. region (str): The region where you would like your index to be created. embed (CreateIndexForModelRequestEmbed): @@ -270,8 +276,10 @@ def __init__(self, name, cloud, region, embed, *args, **kwargs) -> None: # noqa Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - deletion_protection (DeletionProtection): [optional] # noqa: E501 + deletion_protection (str): Whether [deletion protection](http://docs.pinecone.io/guides/manage-data/manage-indexes#configure-deletion-protection) is enabled/disabled for the index. Possible values: `disabled` or `enabled`. [optional] if omitted the server will use the default value of "disabled". # noqa: E501 tags (IndexTags): [optional] # noqa: E501 + schema (BackupModelSchema): [optional] # noqa: E501 + read_capacity (ReadCapacity): [optional] # noqa: E501 """ _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", True) 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 63693c90..38027b94 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-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ @@ -59,9 +59,7 @@ class CreateIndexForModelRequestEmbed(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - ("metric",): {"COSINE": "cosine", "EUCLIDEAN": "euclidean", "DOTPRODUCT": "dotproduct"} - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @@ -151,7 +149,7 @@ def _from_openapi_data(cls: Type[T], model, field_map, *args, **kwargs) -> T: # Animal class but this time we won't travel 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 + 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. Possible values: `cosine`, `euclidean`, or `dotproduct`. [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 @@ -250,7 +248,7 @@ def __init__(self, model, field_map, *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,) - 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 + 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. Possible values: `cosine`, `euclidean`, or `dotproduct`. [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_from_backup_request.py b/pinecone/core/openapi/db_control/model/create_index_from_backup_request.py index 1070f4eb..08374994 100644 --- 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 @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ @@ -28,10 +28,8 @@ 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 @@ -98,7 +96,7 @@ def openapi_types(cls): return { "name": (str,), # noqa: E501 "tags": (IndexTags,), # noqa: E501 - "deletion_protection": (DeletionProtection,), # noqa: E501 + "deletion_protection": (str,), # noqa: E501 } @cached_class_property @@ -155,7 +153,7 @@ def _from_openapi_data(cls: Type[T], name, *args, **kwargs) -> T: # noqa: E501 through its discriminator because we passed in _visited_composed_classes = (Animal,) tags (IndexTags): [optional] # noqa: E501 - deletion_protection (DeletionProtection): [optional] # noqa: E501 + deletion_protection (str): Whether [deletion protection](http://docs.pinecone.io/guides/manage-data/manage-indexes#configure-deletion-protection) is enabled/disabled for the index. Possible values: `disabled` or `enabled`. [optional] if omitted the server will use the default value of "disabled". # noqa: E501 """ _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", False) @@ -250,7 +248,7 @@ def __init__(self, name, *args, **kwargs) -> None: # noqa: E501 through its discriminator because we passed in _visited_composed_classes = (Animal,) tags (IndexTags): [optional] # noqa: E501 - deletion_protection (DeletionProtection): [optional] # noqa: E501 + deletion_protection (str): Whether [deletion protection](http://docs.pinecone.io/guides/manage-data/manage-indexes#configure-deletion-protection) is enabled/disabled for the index. Possible values: `disabled` or `enabled`. [optional] if omitted the server will use the default value of "disabled". # noqa: E501 """ _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", True) diff --git a/pinecone/core/openapi/db_control/model/create_index_from_backup_response.py b/pinecone/core/openapi/db_control/model/create_index_from_backup_response.py index 360df0c2..88df3570 100644 --- a/pinecone/core/openapi/db_control/model/create_index_from_backup_response.py +++ b/pinecone/core/openapi/db_control/model/create_index_from_backup_response.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ 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 06c11c97..2106ab86 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-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ @@ -28,11 +28,9 @@ def lazy_import(): - from pinecone.core.openapi.db_control.model.deletion_protection import DeletionProtection from pinecone.core.openapi.db_control.model.index_spec import IndexSpec from pinecone.core.openapi.db_control.model.index_tags import IndexTags - globals()["DeletionProtection"] = DeletionProtection globals()["IndexSpec"] = IndexSpec globals()["IndexTags"] = IndexTags @@ -69,9 +67,7 @@ class CreateIndexRequest(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - ("metric",): {"COSINE": "cosine", "EUCLIDEAN": "euclidean", "DOTPRODUCT": "dotproduct"} - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { ("name",): {"max_length": 45, "min_length": 1}, @@ -105,7 +101,7 @@ def openapi_types(cls): "spec": (IndexSpec,), # noqa: E501 "dimension": (int,), # noqa: E501 "metric": (str,), # noqa: E501 - "deletion_protection": (DeletionProtection,), # noqa: E501 + "deletion_protection": (str,), # noqa: E501 "tags": (IndexTags,), # noqa: E501 "vector_type": (str,), # noqa: E501 } @@ -169,8 +165,8 @@ def _from_openapi_data(cls: Type[T], name, spec, *args, **kwargs) -> T: # noqa: through its discriminator because we passed in _visited_composed_classes = (Animal,) dimension (int): The dimensions of the vectors to be inserted in the index. [optional] # noqa: E501 - 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 - deletion_protection (DeletionProtection): [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'. Possible values: `cosine`, `euclidean`, or `dotproduct`. [optional] # noqa: E501 + deletion_protection (str): Whether [deletion protection](http://docs.pinecone.io/guides/manage-data/manage-indexes#configure-deletion-protection) is enabled/disabled for the index. Possible values: `disabled` or `enabled`. [optional] if omitted the server will use the default value of "disabled". # noqa: E501 tags (IndexTags): [optional] # noqa: E501 vector_type (str): The index vector type. You can use 'dense' or 'sparse'. If 'dense', the vector dimension must be specified. If 'sparse', the vector dimension should not be specified. [optional] if omitted the server will use the default value of "dense". # noqa: E501 """ @@ -269,8 +265,8 @@ def __init__(self, name, spec, *args, **kwargs) -> None: # noqa: E501 through its discriminator because we passed in _visited_composed_classes = (Animal,) dimension (int): The dimensions of the vectors to be inserted in the index. [optional] # noqa: E501 - 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 - deletion_protection (DeletionProtection): [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'. Possible values: `cosine`, `euclidean`, or `dotproduct`. [optional] # noqa: E501 + deletion_protection (str): Whether [deletion protection](http://docs.pinecone.io/guides/manage-data/manage-indexes#configure-deletion-protection) is enabled/disabled for the index. Possible values: `disabled` or `enabled`. [optional] if omitted the server will use the default value of "disabled". # noqa: E501 tags (IndexTags): [optional] # noqa: E501 vector_type (str): The index vector type. You can use 'dense' or 'sparse'. If 'dense', the vector dimension must be specified. If 'sparse', the vector dimension should not be specified. [optional] if omitted the server will use the default value of "dense". # noqa: E501 """ diff --git a/pinecone/core/openapi/db_control/model/deletion_protection.py b/pinecone/core/openapi/db_control/model/deletion_protection.py deleted file mode 100644 index c70945a2..00000000 --- a/pinecone/core/openapi/db_control/model/deletion_protection.py +++ /dev/null @@ -1,286 +0,0 @@ -""" -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="DeletionProtection") - - -class DeletionProtection(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",): {"DISABLED": "disabled", "ENABLED": "enabled"} - } - - 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( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_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: - """DeletionProtection - 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): Whether [deletion protection](http://docs.pinecone.io/guides/manage-data/manage-indexes#configure-deletion-protection) is enabled/disabled for the index. . if omitted defaults to "disabled", must be one of ["disabled", "enabled", ] # noqa: E501 - - Keyword Args: - value (str): Whether [deletion protection](http://docs.pinecone.io/guides/manage-data/manage-indexes#configure-deletion-protection) is enabled/disabled for the index. . if omitted defaults to "disabled", must be one of ["disabled", "enabled", ] # 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: - value = "disabled" - - _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", True) - _enforce_validations = kwargs.pop("_enforce_validations", True) - _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._enforce_allowed_values = _enforce_allowed_values - self._enforce_validations = _enforce_validations - 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: - """DeletionProtection - 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): Whether [deletion protection](http://docs.pinecone.io/guides/manage-data/manage-indexes#configure-deletion-protection) is enabled/disabled for the index. if omitted defaults to "disabled", must be one of ["disabled", "enabled", ] # noqa: E501 - - Keyword Args: - value (str): Whether [deletion protection](http://docs.pinecone.io/guides/manage-data/manage-indexes#configure-deletion-protection) is enabled/disabled for the index. if omitted defaults to "disabled", must be one of ["disabled", "enabled", ] # 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: - value = "disabled" - - _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", False) - _enforce_validations = kwargs.pop("_enforce_validations", False) - _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._enforce_allowed_values = _enforce_allowed_values - self._enforce_validations = _enforce_validations - 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/db_control/model/error_response.py b/pinecone/core/openapi/db_control/model/error_response.py index 23445308..56222a1f 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-04 +The version of the OpenAPI document: 2025-10 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 30cc62ac..ee7b0035 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-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ @@ -59,30 +59,7 @@ class ErrorResponseError(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - ("code",): { - "OK": "OK", - "UNKNOWN": "UNKNOWN", - "INVALID_ARGUMENT": "INVALID_ARGUMENT", - "DEADLINE_EXCEEDED": "DEADLINE_EXCEEDED", - "QUOTA_EXCEEDED": "QUOTA_EXCEEDED", - "NOT_FOUND": "NOT_FOUND", - "ALREADY_EXISTS": "ALREADY_EXISTS", - "PERMISSION_DENIED": "PERMISSION_DENIED", - "UNAUTHENTICATED": "UNAUTHENTICATED", - "RESOURCE_EXHAUSTED": "RESOURCE_EXHAUSTED", - "FAILED_PRECONDITION": "FAILED_PRECONDITION", - "ABORTED": "ABORTED", - "OUT_OF_RANGE": "OUT_OF_RANGE", - "UNIMPLEMENTED": "UNIMPLEMENTED", - "INTERNAL": "INTERNAL", - "UNAVAILABLE": "UNAVAILABLE", - "DATA_LOSS": "DATA_LOSS", - "FORBIDDEN": "FORBIDDEN", - "UNPROCESSABLE_ENTITY": "UNPROCESSABLE_ENTITY", - "PAYMENT_REQUIRED": "PAYMENT_REQUIRED", - } - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @@ -132,8 +109,8 @@ def _from_openapi_data(cls: Type[T], code, message, *args, **kwargs) -> T: # no """ErrorResponseError - a model defined in OpenAPI Args: - code (str): - message (str): + code (str): The error code. Possible values: `OK`, `UNKNOWN`, `INVALID_ARGUMENT`, `DEADLINE_EXCEEDED`, `QUOTA_EXCEEDED`, `NOT_FOUND`, `ALREADY_EXISTS`, `PERMISSION_DENIED`, `UNAUTHENTICATED`, `RESOURCE_EXHAUSTED`, `FAILED_PRECONDITION`, `ABORTED`, `OUT_OF_RANGE`, `UNIMPLEMENTED`, `INTERNAL`, `UNAVAILABLE`, `DATA_LOSS`, `FORBIDDEN`, `UNPROCESSABLE_ENTITY`, or `PAYMENT_REQUIRED`. + message (str): A human-readable description of the error Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -228,8 +205,8 @@ def __init__(self, code, message, *args, **kwargs) -> None: # noqa: E501 """ErrorResponseError - a model defined in OpenAPI Args: - code (str): - message (str): + code (str): The error code. Possible values: `OK`, `UNKNOWN`, `INVALID_ARGUMENT`, `DEADLINE_EXCEEDED`, `QUOTA_EXCEEDED`, `NOT_FOUND`, `ALREADY_EXISTS`, `PERMISSION_DENIED`, `UNAUTHENTICATED`, `RESOURCE_EXHAUSTED`, `FAILED_PRECONDITION`, `ABORTED`, `OUT_OF_RANGE`, `UNIMPLEMENTED`, `INTERNAL`, `UNAVAILABLE`, `DATA_LOSS`, `FORBIDDEN`, `UNPROCESSABLE_ENTITY`, or `PAYMENT_REQUIRED`. + message (str): A human-readable description of the error Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/pinecone/core/openapi/db_control/model/index_list.py b/pinecone/core/openapi/db_control/model/index_list.py index b2f7468e..046492c1 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-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ @@ -143,7 +143,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,) - indexes ([IndexModel]): [optional] # noqa: E501 + indexes ([IndexModel]): List of indexes in the project [optional] # noqa: E501 """ _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", False) @@ -233,7 +233,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,) - indexes ([IndexModel]): [optional] # noqa: E501 + indexes ([IndexModel]): List of indexes in the project [optional] # noqa: E501 """ _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", True) diff --git a/pinecone/core/openapi/db_control/model/index_model.py b/pinecone/core/openapi/db_control/model/index_model.py index 97ada3aa..b4af577f 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-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ @@ -28,14 +28,10 @@ def lazy_import(): - from pinecone.core.openapi.db_control.model.deletion_protection import DeletionProtection - from pinecone.core.openapi.db_control.model.index_model_spec import IndexModelSpec from pinecone.core.openapi.db_control.model.index_model_status import IndexModelStatus from pinecone.core.openapi.db_control.model.index_tags import IndexTags from pinecone.core.openapi.db_control.model.model_index_embed import ModelIndexEmbed - globals()["DeletionProtection"] = DeletionProtection - globals()["IndexModelSpec"] = IndexModelSpec globals()["IndexModelStatus"] = IndexModelStatus globals()["IndexTags"] = IndexTags globals()["ModelIndexEmbed"] = ModelIndexEmbed @@ -73,9 +69,7 @@ class IndexModel(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - ("metric",): {"COSINE": "cosine", "EUCLIDEAN": "euclidean", "DOTPRODUCT": "dotproduct"} - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { ("name",): {"max_length": 45, "min_length": 1}, @@ -108,11 +102,12 @@ def openapi_types(cls): "name": (str,), # noqa: E501 "metric": (str,), # noqa: E501 "host": (str,), # noqa: E501 - "spec": (IndexModelSpec,), # noqa: E501 + "spec": ({str: (bool, dict, float, int, list, str, none_type)},), # noqa: E501 "status": (IndexModelStatus,), # noqa: E501 "vector_type": (str,), # noqa: E501 "dimension": (int,), # noqa: E501 - "deletion_protection": (DeletionProtection,), # noqa: E501 + "private_host": (str,), # noqa: E501 + "deletion_protection": (str,), # noqa: E501 "tags": (IndexTags,), # noqa: E501 "embed": (ModelIndexEmbed,), # noqa: E501 } @@ -129,6 +124,7 @@ def discriminator(cls): "status": "status", # noqa: E501 "vector_type": "vector_type", # noqa: E501 "dimension": "dimension", # noqa: E501 + "private_host": "private_host", # noqa: E501 "deletion_protection": "deletion_protection", # noqa: E501 "tags": "tags", # noqa: E501 "embed": "embed", # noqa: E501 @@ -145,9 +141,9 @@ def _from_openapi_data(cls: Type[T], name, metric, host, spec, status, *args, ** 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 '-'. - 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'. + 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'. Possible values: `cosine`, `euclidean`, or `dotproduct`. host (str): The URL address where the index is hosted. - spec (IndexModelSpec): + spec ({str: (bool, dict, float, int, list, str, none_type)}): The spec object defines how the index should be deployed. status (IndexModelStatus): Keyword Args: @@ -183,7 +179,8 @@ def _from_openapi_data(cls: Type[T], name, metric, host, spec, status, *args, ** through its discriminator because we passed in _visited_composed_classes = (Animal,) dimension (int): The dimensions of the vectors to be inserted in the index. [optional] # noqa: E501 - deletion_protection (DeletionProtection): [optional] # noqa: E501 + private_host (str): The private endpoint URL of an index. [optional] # noqa: E501 + deletion_protection (str): Whether [deletion protection](http://docs.pinecone.io/guides/manage-data/manage-indexes#configure-deletion-protection) is enabled/disabled for the index. Possible values: `disabled` or `enabled`. [optional] if omitted the server will use the default value of "disabled". # noqa: E501 tags (IndexTags): [optional] # noqa: E501 embed (ModelIndexEmbed): [optional] # noqa: E501 """ @@ -253,9 +250,9 @@ def __init__(self, name, metric, host, spec, status, *args, **kwargs) -> None: 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 '-'. - 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'. + 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'. Possible values: `cosine`, `euclidean`, or `dotproduct`. host (str): The URL address where the index is hosted. - spec (IndexModelSpec): + spec ({str: (bool, dict, float, int, list, str, none_type)}): The spec object defines how the index should be deployed. status (IndexModelStatus): Keyword Args: @@ -291,7 +288,8 @@ def __init__(self, name, metric, host, spec, status, *args, **kwargs) -> None: through its discriminator because we passed in _visited_composed_classes = (Animal,) dimension (int): The dimensions of the vectors to be inserted in the index. [optional] # noqa: E501 - deletion_protection (DeletionProtection): [optional] # noqa: E501 + private_host (str): The private endpoint URL of an index. [optional] # noqa: E501 + deletion_protection (str): Whether [deletion protection](http://docs.pinecone.io/guides/manage-data/manage-indexes#configure-deletion-protection) is enabled/disabled for the index. Possible values: `disabled` or `enabled`. [optional] if omitted the server will use the default value of "disabled". # noqa: E501 tags (IndexTags): [optional] # noqa: E501 embed (ModelIndexEmbed): [optional] # noqa: E501 """ 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 52821c68..d020f8cb 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-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ @@ -59,19 +59,7 @@ class IndexModelStatus(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - ("state",): { - "INITIALIZING": "Initializing", - "INITIALIZATIONFAILED": "InitializationFailed", - "SCALINGUP": "ScalingUp", - "SCALINGDOWN": "ScalingDown", - "SCALINGUPPODSIZE": "ScalingUpPodSize", - "SCALINGDOWNPODSIZE": "ScalingDownPodSize", - "TERMINATING": "Terminating", - "READY": "Ready", - "DISABLED": "Disabled", - } - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @@ -119,8 +107,8 @@ def _from_openapi_data(cls: Type[T], ready, state, *args, **kwargs) -> T: # noq """IndexModelStatus - a model defined in OpenAPI Args: - ready (bool): - state (str): + ready (bool): Whether the index is ready for use + state (str): The state of the index. Possible values: `Initializing`, `InitializationFailed`, `ScalingUp`, `ScalingDown`, `ScalingUpPodSize`, `ScalingDownPodSize`, `Terminating`, `Ready`, or `Disabled`. Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -214,8 +202,8 @@ def __init__(self, ready, state, *args, **kwargs) -> None: # noqa: E501 """IndexModelStatus - a model defined in OpenAPI Args: - ready (bool): - state (str): + ready (bool): Whether the index is ready for use + state (str): The state of the index. Possible values: `Initializing`, `InitializationFailed`, `ScalingUp`, `ScalingDown`, `ScalingUpPodSize`, `ScalingDownPodSize`, `Terminating`, `Ready`, or `Disabled`. Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/pinecone/core/openapi/db_control/model/index_spec.py b/pinecone/core/openapi/db_control/model/index_spec.py index fe1ac44e..ac7cf2a4 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-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ @@ -28,12 +28,18 @@ def lazy_import(): + from pinecone.core.openapi.db_control.model.byoc import BYOC from pinecone.core.openapi.db_control.model.byoc_spec import ByocSpec + from pinecone.core.openapi.db_control.model.pod_based import PodBased from pinecone.core.openapi.db_control.model.pod_spec import PodSpec + from pinecone.core.openapi.db_control.model.serverless import Serverless from pinecone.core.openapi.db_control.model.serverless_spec import ServerlessSpec + globals()["BYOC"] = BYOC globals()["ByocSpec"] = ByocSpec + globals()["PodBased"] = PodBased globals()["PodSpec"] = PodSpec + globals()["Serverless"] = Serverless globals()["ServerlessSpec"] = ServerlessSpec @@ -43,7 +49,7 @@ def lazy_import(): T = TypeVar("T", bound="IndexSpec") -class IndexSpec(ModelNormal): +class IndexSpec(ModelComposed): """NOTE: This class is @generated using OpenAPI. Do not edit the class manually. @@ -73,7 +79,14 @@ class IndexSpec(ModelNormal): validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} - additional_properties_type = None + @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 @@ -106,8 +119,6 @@ def discriminator(cls): 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 @@ -149,8 +160,6 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 byoc (ByocSpec): [optional] # noqa: E501 """ - _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", False) - _enforce_validations = kwargs.pop("_enforce_validations", False) _check_type = kwargs.pop("_check_type", True) _spec_property_naming = kwargs.pop("_spec_property_naming", False) _path_to_item = kwargs.pop("_path_to_item", ()) @@ -168,24 +177,36 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 ) self._data_store = {} - self._enforce_allowed_values = _enforce_allowed_values - self._enforce_validations = _enforce_validations 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__,) + constant_args = { + "_check_type": _check_type, + "_path_to_item": _path_to_item, + "_spec_property_naming": _spec_property_naming, + "_configuration": _configuration, + "_visited_composed_classes": self._visited_composed_classes, + } + composed_info = validate_get_composed_info(constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + for var_name, var_value in kwargs.items(): if ( - var_name not in self.attribute_map + var_name in discarded_args and self._configuration is not None and self._configuration.discard_unknown_keys - and self.additional_properties_type is None + and self._additional_properties_model_instances ): # discard variable. continue setattr(self, var_name, var_value) + return self required_properties = set( @@ -198,6 +219,9 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 "_path_to_item", "_configuration", "_visited_composed_classes", + "_composed_instances", + "_var_name_to_model_instances", + "_additional_properties_model_instances", ] ) @@ -266,12 +290,25 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + constant_args = { + "_check_type": _check_type, + "_path_to_item": _path_to_item, + "_spec_property_naming": _spec_property_naming, + "_configuration": _configuration, + "_visited_composed_classes": self._visited_composed_classes, + } + composed_info = validate_get_composed_info(constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + for var_name, var_value in kwargs.items(): if ( - var_name not in self.attribute_map + var_name in discarded_args and self._configuration is not None and self._configuration.discard_unknown_keys - and self.additional_properties_type is None + and self._additional_properties_model_instances ): # discard variable. continue @@ -281,3 +318,15 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " f"class with read only attributes." ) + + @cached_property + def _composed_schemas(): # type: ignore + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error beause the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + lazy_import() + return {"anyOf": [], "allOf": [], "oneOf": [BYOC, PodBased, Serverless]} diff --git a/pinecone/core/openapi/db_control/model/index_tags.py b/pinecone/core/openapi/db_control/model/index_tags.py index 62f17fb0..b4df234b 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-04 +The version of the OpenAPI document: 2025-10 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 1a7f2010..c9439638 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-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ @@ -59,9 +59,7 @@ class ModelIndexEmbed(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - ("metric",): {"COSINE": "cosine", "EUCLIDEAN": "euclidean", "DOTPRODUCT": "dotproduct"} - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { ("dimension",): {"inclusive_maximum": 20000, "inclusive_minimum": 1} @@ -154,7 +152,7 @@ def _from_openapi_data(cls: Type[T], model, *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,) - 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 + 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. Possible values: `cosine`, `euclidean`, or `dotproduct`. [optional] # noqa: E501 dimension (int): The dimensions of the vectors to be inserted in the index. [optional] # noqa: E501 vector_type (str): The index vector type. You can use 'dense' or 'sparse'. If 'dense', the vector dimension must be specified. If 'sparse', the vector dimension should not be specified. [optional] if omitted the server will use the default value of "dense". # noqa: E501 field_map ({str: (bool, dict, float, int, list, str, none_type)}): Identifies the name of the text field from your document model that is embedded. [optional] # noqa: E501 @@ -253,7 +251,7 @@ def __init__(self, model, *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,) - 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 + 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. Possible values: `cosine`, `euclidean`, or `dotproduct`. [optional] # noqa: E501 dimension (int): The dimensions of the vectors to be inserted in the index. [optional] # noqa: E501 vector_type (str): The index vector type. You can use 'dense' or 'sparse'. If 'dense', the vector dimension must be specified. If 'sparse', the vector dimension should not be specified. [optional] if omitted the server will use the default value of "dense". # noqa: E501 field_map ({str: (bool, dict, float, int, list, str, none_type)}): Identifies the name of the text field from your document model that is embedded. [optional] # noqa: E501 diff --git a/pinecone/core/openapi/db_control/model/pagination_response.py b/pinecone/core/openapi/db_control/model/pagination_response.py index 8a954cc4..b357e522 100644 --- a/pinecone/core/openapi/db_control/model/pagination_response.py +++ b/pinecone/core/openapi/db_control/model/pagination_response.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-04 +The version of the OpenAPI document: 2025-10 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/pod_based.py similarity index 94% rename from pinecone/core/openapi/db_control/model/configure_index_request_spec.py rename to pinecone/core/openapi/db_control/model/pod_based.py index 5f2b0668..dddba5b1 100644 --- a/pinecone/core/openapi/db_control/model/configure_index_request_spec.py +++ b/pinecone/core/openapi/db_control/model/pod_based.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ @@ -28,20 +28,18 @@ def lazy_import(): - from pinecone.core.openapi.db_control.model.configure_index_request_spec_pod import ( - ConfigureIndexRequestSpecPod, - ) + from pinecone.core.openapi.db_control.model.pod_spec import PodSpec - globals()["ConfigureIndexRequestSpecPod"] = ConfigureIndexRequestSpecPod + globals()["PodSpec"] = PodSpec from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar from pinecone.openapi_support import PropertyValidationTypedDict, cached_class_property -T = TypeVar("T", bound="ConfigureIndexRequestSpec") +T = TypeVar("T", bound="PodBased") -class ConfigureIndexRequestSpec(ModelNormal): +class PodBased(ModelNormal): """NOTE: This class is @generated using OpenAPI. Do not edit the class manually. @@ -94,7 +92,7 @@ def openapi_types(cls): """ lazy_import() return { - "pod": (ConfigureIndexRequestSpecPod,) # noqa: E501 + "pod": (PodSpec,) # noqa: E501 } @cached_class_property @@ -112,10 +110,10 @@ def discriminator(cls): @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], pod, *args, **kwargs) -> T: # noqa: E501 - """ConfigureIndexRequestSpec - a model defined in OpenAPI + """PodBased - a model defined in OpenAPI Args: - pod (ConfigureIndexRequestSpecPod): + pod (PodSpec): Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -205,10 +203,10 @@ def _from_openapi_data(cls: Type[T], pod, *args, **kwargs) -> T: # noqa: E501 @convert_js_args_to_python_args def __init__(self, pod, *args, **kwargs) -> None: # noqa: E501 - """ConfigureIndexRequestSpec - a model defined in OpenAPI + """PodBased - a model defined in OpenAPI Args: - pod (ConfigureIndexRequestSpecPod): + pod (PodSpec): Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/pinecone/core/openapi/db_control/model/pod_spec.py b/pinecone/core/openapi/db_control/model/pod_spec.py index 64c0b2a7..1714212c 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-04 +The version of the OpenAPI document: 2025-10 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 e605a141..5508d931 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-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_control/model/read_capacity.py b/pinecone/core/openapi/db_control/model/read_capacity.py new file mode 100644 index 00000000..4b773a4f --- /dev/null +++ b/pinecone/core/openapi/db_control/model/read_capacity.py @@ -0,0 +1,341 @@ +""" +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-10 +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.read_capacity_dedicated_config import ( + ReadCapacityDedicatedConfig, + ) + from pinecone.core.openapi.db_control.model.read_capacity_dedicated_spec import ( + ReadCapacityDedicatedSpec, + ) + from pinecone.core.openapi.db_control.model.read_capacity_on_demand_spec import ( + ReadCapacityOnDemandSpec, + ) + + globals()["ReadCapacityDedicatedConfig"] = ReadCapacityDedicatedConfig + globals()["ReadCapacityDedicatedSpec"] = ReadCapacityDedicatedSpec + globals()["ReadCapacityOnDemandSpec"] = ReadCapacityOnDemandSpec + + +from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar +from pinecone.openapi_support import PropertyValidationTypedDict, cached_class_property + +T = TypeVar("T", bound="ReadCapacity") + + +class ReadCapacity(ModelComposed): + """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 { + "mode": (str,), # noqa: E501 + "dedicated": (ReadCapacityDedicatedConfig,), # noqa: E501 + } + + @cached_class_property + def discriminator(cls): + lazy_import() + val = { + "Dedicated": ReadCapacityDedicatedSpec, + "OnDemand": ReadCapacityOnDemandSpec, + "ReadCapacityDedicatedSpec": ReadCapacityDedicatedSpec, + "ReadCapacityOnDemandSpec": ReadCapacityOnDemandSpec, + } + if not val: + return None + return {"mode": val} + + attribute_map: Dict[str, str] = { + "mode": "mode", # noqa: E501 + "dedicated": "dedicated", # noqa: E501 + } + + read_only_vars: Set[str] = set([]) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 + """ReadCapacity - a model defined in OpenAPI + + Keyword Args: + mode (str): The mode of the index. Possible values: `OnDemand` or `Dedicated`. Defaults to `OnDemand`. If set to `Dedicated`, `dedicated.node_type`, and `dedicated.scaling` must be specified. + _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,) + dedicated (ReadCapacityDedicatedConfig): [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__,) + + constant_args = { + "_check_type": _check_type, + "_path_to_item": _path_to_item, + "_spec_property_naming": _spec_property_naming, + "_configuration": _configuration, + "_visited_composed_classes": self._visited_composed_classes, + } + composed_info = validate_get_composed_info(constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if ( + var_name in discarded_args + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self._additional_properties_model_instances + ): + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + + required_properties = set( + [ + "_enforce_allowed_values", + "_enforce_validations", + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + "_composed_instances", + "_var_name_to_model_instances", + "_additional_properties_model_instances", + ] + ) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs) -> None: # noqa: E501 + """ReadCapacity - a model defined in OpenAPI + + Keyword Args: + mode (str): The mode of the index. Possible values: `OnDemand` or `Dedicated`. Defaults to `OnDemand`. If set to `Dedicated`, `dedicated.node_type`, and `dedicated.scaling` must be specified. + _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,) + dedicated (ReadCapacityDedicatedConfig): [optional] # noqa: E501 + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", True) + _enforce_validations = kwargs.pop("_enforce_validations", True) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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__,) + + constant_args = { + "_check_type": _check_type, + "_path_to_item": _path_to_item, + "_spec_property_naming": _spec_property_naming, + "_configuration": _configuration, + "_visited_composed_classes": self._visited_composed_classes, + } + composed_info = validate_get_composed_info(constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if ( + var_name in discarded_args + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self._additional_properties_model_instances + ): + # 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." + ) + + @cached_property + def _composed_schemas(): # type: ignore + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error beause the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + lazy_import() + return { + "anyOf": [], + "allOf": [], + "oneOf": [ReadCapacityDedicatedSpec, ReadCapacityOnDemandSpec], + } diff --git a/pinecone/core/openapi/db_control/model/read_capacity_dedicated_config.py b/pinecone/core/openapi/db_control/model/read_capacity_dedicated_config.py new file mode 100644 index 00000000..e95c2fdf --- /dev/null +++ b/pinecone/core/openapi/db_control/model/read_capacity_dedicated_config.py @@ -0,0 +1,294 @@ +""" +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-10 +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.scaling_config_manual import ScalingConfigManual + + globals()["ScalingConfigManual"] = ScalingConfigManual + + +from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar +from pinecone.openapi_support import PropertyValidationTypedDict, cached_class_property + +T = TypeVar("T", bound="ReadCapacityDedicatedConfig") + + +class ReadCapacityDedicatedConfig(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 { + "node_type": (str,), # noqa: E501 + "scaling": (str,), # noqa: E501 + "manual": (ScalingConfigManual,), # noqa: E501 + } + + @cached_class_property + def discriminator(cls): + return None + + attribute_map: Dict[str, str] = { + "node_type": "node_type", # noqa: E501 + "scaling": "scaling", # noqa: E501 + "manual": "manual", # 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], node_type, scaling, *args, **kwargs) -> T: # noqa: E501 + """ReadCapacityDedicatedConfig - a model defined in OpenAPI + + Args: + node_type (str): The type of machines to use. Available options: `b1` and `t1`. `t1` includes increased processing power and memory. + scaling (str): The type of scaling strategy to use. + + 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,) + manual (ScalingConfigManual): [optional] # noqa: E501 + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", False) + _enforce_validations = kwargs.pop("_enforce_validations", False) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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.node_type = node_type + self.scaling = scaling + 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( + [ + "_enforce_allowed_values", + "_enforce_validations", + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) + + @convert_js_args_to_python_args + def __init__(self, node_type, scaling, *args, **kwargs) -> None: # noqa: E501 + """ReadCapacityDedicatedConfig - a model defined in OpenAPI + + Args: + node_type (str): The type of machines to use. Available options: `b1` and `t1`. `t1` includes increased processing power and memory. + scaling (str): The type of scaling strategy to use. + + 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,) + manual (ScalingConfigManual): [optional] # noqa: E501 + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", True) + _enforce_validations = kwargs.pop("_enforce_validations", True) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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.node_type = node_type + self.scaling = scaling + 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/read_capacity_dedicated_spec.py b/pinecone/core/openapi/db_control/model/read_capacity_dedicated_spec.py new file mode 100644 index 00000000..54bfafc6 --- /dev/null +++ b/pinecone/core/openapi/db_control/model/read_capacity_dedicated_spec.py @@ -0,0 +1,292 @@ +""" +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-10 +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.read_capacity_dedicated_config import ( + ReadCapacityDedicatedConfig, + ) + + globals()["ReadCapacityDedicatedConfig"] = ReadCapacityDedicatedConfig + + +from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar +from pinecone.openapi_support import PropertyValidationTypedDict, cached_class_property + +T = TypeVar("T", bound="ReadCapacityDedicatedSpec") + + +class ReadCapacityDedicatedSpec(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 { + "mode": (str,), # noqa: E501 + "dedicated": (ReadCapacityDedicatedConfig,), # noqa: E501 + } + + @cached_class_property + def discriminator(cls): + return None + + attribute_map: Dict[str, str] = { + "mode": "mode", # noqa: E501 + "dedicated": "dedicated", # 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], mode, dedicated, *args, **kwargs) -> T: # noqa: E501 + """ReadCapacityDedicatedSpec - a model defined in OpenAPI + + Args: + mode (str): The mode of the index. Possible values: `OnDemand` or `Dedicated`. Defaults to `OnDemand`. If set to `Dedicated`, `dedicated.node_type`, and `dedicated.scaling` must be specified. + dedicated (ReadCapacityDedicatedConfig): + + 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,) + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", False) + _enforce_validations = kwargs.pop("_enforce_validations", False) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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.mode = mode + self.dedicated = dedicated + 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( + [ + "_enforce_allowed_values", + "_enforce_validations", + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) + + @convert_js_args_to_python_args + def __init__(self, mode, dedicated, *args, **kwargs) -> None: # noqa: E501 + """ReadCapacityDedicatedSpec - a model defined in OpenAPI + + Args: + mode (str): The mode of the index. Possible values: `OnDemand` or `Dedicated`. Defaults to `OnDemand`. If set to `Dedicated`, `dedicated.node_type`, and `dedicated.scaling` must be specified. + dedicated (ReadCapacityDedicatedConfig): + + 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,) + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", True) + _enforce_validations = kwargs.pop("_enforce_validations", True) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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.mode = mode + self.dedicated = dedicated + 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/read_capacity_dedicated_spec_response.py b/pinecone/core/openapi/db_control/model/read_capacity_dedicated_spec_response.py new file mode 100644 index 00000000..c1eb3b18 --- /dev/null +++ b/pinecone/core/openapi/db_control/model/read_capacity_dedicated_spec_response.py @@ -0,0 +1,293 @@ +""" +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-10 +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.read_capacity_dedicated_config import ( + ReadCapacityDedicatedConfig, + ) + from pinecone.core.openapi.db_control.model.read_capacity_status import ReadCapacityStatus + + globals()["ReadCapacityDedicatedConfig"] = ReadCapacityDedicatedConfig + globals()["ReadCapacityStatus"] = ReadCapacityStatus + + +from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar +from pinecone.openapi_support import PropertyValidationTypedDict, cached_class_property + +T = TypeVar("T", bound="ReadCapacityDedicatedSpecResponse") + + +class ReadCapacityDedicatedSpecResponse(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] = {} + + additional_properties_type = None + + _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 { + "mode": (str,), # noqa: E501 + "dedicated": (ReadCapacityDedicatedConfig,), # noqa: E501 + "status": (ReadCapacityStatus,), # noqa: E501 + } + + @cached_class_property + def discriminator(cls): + return None + + attribute_map: Dict[str, str] = { + "mode": "mode", # noqa: E501 + "dedicated": "dedicated", # noqa: E501 + "status": "status", # 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], mode, dedicated, status, *args, **kwargs) -> T: # noqa: E501 + """ReadCapacityDedicatedSpecResponse - a model defined in OpenAPI + + Args: + mode (str): The mode of the index. Possible values: `OnDemand` or `Dedicated`. Defaults to `OnDemand`. If set to `Dedicated`, `dedicated.node_type`, and `dedicated.scaling` must be specified. + dedicated (ReadCapacityDedicatedConfig): + status (ReadCapacityStatus): + + 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,) + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", False) + _enforce_validations = kwargs.pop("_enforce_validations", False) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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.mode = mode + self.dedicated = dedicated + self.status = status + 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( + [ + "_enforce_allowed_values", + "_enforce_validations", + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) + + @convert_js_args_to_python_args + def __init__(self, mode, dedicated, status, *args, **kwargs) -> None: # noqa: E501 + """ReadCapacityDedicatedSpecResponse - a model defined in OpenAPI + + Args: + mode (str): The mode of the index. Possible values: `OnDemand` or `Dedicated`. Defaults to `OnDemand`. If set to `Dedicated`, `dedicated.node_type`, and `dedicated.scaling` must be specified. + dedicated (ReadCapacityDedicatedConfig): + status (ReadCapacityStatus): + + 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,) + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", True) + _enforce_validations = kwargs.pop("_enforce_validations", True) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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.mode = mode + self.dedicated = dedicated + self.status = status + 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/read_capacity_on_demand_spec.py b/pinecone/core/openapi/db_control/model/read_capacity_on_demand_spec.py new file mode 100644 index 00000000..9446c424 --- /dev/null +++ b/pinecone/core/openapi/db_control/model/read_capacity_on_demand_spec.py @@ -0,0 +1,270 @@ +""" +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-10 +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="ReadCapacityOnDemandSpec") + + +class ReadCapacityOnDemandSpec(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] = {} + + additional_properties_type = None + + _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 { + "mode": (str,) # noqa: E501 + } + + @cached_class_property + def discriminator(cls): + return None + + attribute_map: Dict[str, str] = { + "mode": "mode" # 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], mode, *args, **kwargs) -> T: # noqa: E501 + """ReadCapacityOnDemandSpec - a model defined in OpenAPI + + Args: + mode (str): The mode of the index. Possible values: `OnDemand` or `Dedicated`. Defaults to `OnDemand`. If set to `Dedicated`, `dedicated.node_type`, and `dedicated.scaling` must be specified. + + 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,) + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", False) + _enforce_validations = kwargs.pop("_enforce_validations", False) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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.mode = mode + 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( + [ + "_enforce_allowed_values", + "_enforce_validations", + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) + + @convert_js_args_to_python_args + def __init__(self, mode, *args, **kwargs) -> None: # noqa: E501 + """ReadCapacityOnDemandSpec - a model defined in OpenAPI + + Args: + mode (str): The mode of the index. Possible values: `OnDemand` or `Dedicated`. Defaults to `OnDemand`. If set to `Dedicated`, `dedicated.node_type`, and `dedicated.scaling` must be specified. + + 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,) + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", True) + _enforce_validations = kwargs.pop("_enforce_validations", True) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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.mode = mode + 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/read_capacity_on_demand_spec_response.py b/pinecone/core/openapi/db_control/model/read_capacity_on_demand_spec_response.py new file mode 100644 index 00000000..e01b47d5 --- /dev/null +++ b/pinecone/core/openapi/db_control/model/read_capacity_on_demand_spec_response.py @@ -0,0 +1,283 @@ +""" +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-10 +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.read_capacity_status import ReadCapacityStatus + + globals()["ReadCapacityStatus"] = ReadCapacityStatus + + +from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar +from pinecone.openapi_support import PropertyValidationTypedDict, cached_class_property + +T = TypeVar("T", bound="ReadCapacityOnDemandSpecResponse") + + +class ReadCapacityOnDemandSpecResponse(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] = {} + + additional_properties_type = None + + _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 { + "mode": (str,), # noqa: E501 + "status": (ReadCapacityStatus,), # noqa: E501 + } + + @cached_class_property + def discriminator(cls): + return None + + attribute_map: Dict[str, str] = { + "mode": "mode", # noqa: E501 + "status": "status", # 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], mode, status, *args, **kwargs) -> T: # noqa: E501 + """ReadCapacityOnDemandSpecResponse - a model defined in OpenAPI + + Args: + mode (str): The mode of the index. Possible values: `OnDemand` or `Dedicated`. Defaults to `OnDemand`. If set to `Dedicated`, `dedicated.node_type`, and `dedicated.scaling` must be specified. + status (ReadCapacityStatus): + + 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,) + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", False) + _enforce_validations = kwargs.pop("_enforce_validations", False) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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.mode = mode + self.status = status + 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( + [ + "_enforce_allowed_values", + "_enforce_validations", + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) + + @convert_js_args_to_python_args + def __init__(self, mode, status, *args, **kwargs) -> None: # noqa: E501 + """ReadCapacityOnDemandSpecResponse - a model defined in OpenAPI + + Args: + mode (str): The mode of the index. Possible values: `OnDemand` or `Dedicated`. Defaults to `OnDemand`. If set to `Dedicated`, `dedicated.node_type`, and `dedicated.scaling` must be specified. + status (ReadCapacityStatus): + + 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,) + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", True) + _enforce_validations = kwargs.pop("_enforce_validations", True) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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.mode = mode + self.status = status + 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/read_capacity_response.py b/pinecone/core/openapi/db_control/model/read_capacity_response.py new file mode 100644 index 00000000..6d5047e1 --- /dev/null +++ b/pinecone/core/openapi/db_control/model/read_capacity_response.py @@ -0,0 +1,347 @@ +""" +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-10 +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.read_capacity_dedicated_config import ( + ReadCapacityDedicatedConfig, + ) + from pinecone.core.openapi.db_control.model.read_capacity_dedicated_spec_response import ( + ReadCapacityDedicatedSpecResponse, + ) + from pinecone.core.openapi.db_control.model.read_capacity_on_demand_spec_response import ( + ReadCapacityOnDemandSpecResponse, + ) + from pinecone.core.openapi.db_control.model.read_capacity_status import ReadCapacityStatus + + globals()["ReadCapacityDedicatedConfig"] = ReadCapacityDedicatedConfig + globals()["ReadCapacityDedicatedSpecResponse"] = ReadCapacityDedicatedSpecResponse + globals()["ReadCapacityOnDemandSpecResponse"] = ReadCapacityOnDemandSpecResponse + globals()["ReadCapacityStatus"] = ReadCapacityStatus + + +from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar +from pinecone.openapi_support import PropertyValidationTypedDict, cached_class_property + +T = TypeVar("T", bound="ReadCapacityResponse") + + +class ReadCapacityResponse(ModelComposed): + """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 { + "mode": (str,), # noqa: E501 + "status": (ReadCapacityStatus,), # noqa: E501 + "dedicated": (ReadCapacityDedicatedConfig,), # noqa: E501 + } + + @cached_class_property + def discriminator(cls): + lazy_import() + val = { + "Dedicated": ReadCapacityDedicatedSpecResponse, + "OnDemand": ReadCapacityOnDemandSpecResponse, + "ReadCapacityDedicatedSpecResponse": ReadCapacityDedicatedSpecResponse, + "ReadCapacityOnDemandSpecResponse": ReadCapacityOnDemandSpecResponse, + } + if not val: + return None + return {"mode": val} + + attribute_map: Dict[str, str] = { + "mode": "mode", # noqa: E501 + "status": "status", # noqa: E501 + "dedicated": "dedicated", # noqa: E501 + } + + read_only_vars: Set[str] = set([]) + + @classmethod + @convert_js_args_to_python_args + def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 + """ReadCapacityResponse - a model defined in OpenAPI + + Keyword Args: + mode (str): The mode of the index. Possible values: `OnDemand` or `Dedicated`. Defaults to `OnDemand`. If set to `Dedicated`, `dedicated.node_type`, and `dedicated.scaling` must be specified. + _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,) + status (ReadCapacityStatus): [optional] # noqa: E501 + dedicated (ReadCapacityDedicatedConfig): [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__,) + + constant_args = { + "_check_type": _check_type, + "_path_to_item": _path_to_item, + "_spec_property_naming": _spec_property_naming, + "_configuration": _configuration, + "_visited_composed_classes": self._visited_composed_classes, + } + composed_info = validate_get_composed_info(constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if ( + var_name in discarded_args + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self._additional_properties_model_instances + ): + # discard variable. + continue + setattr(self, var_name, var_value) + + return self + + required_properties = set( + [ + "_enforce_allowed_values", + "_enforce_validations", + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + "_composed_instances", + "_var_name_to_model_instances", + "_additional_properties_model_instances", + ] + ) + + @convert_js_args_to_python_args + def __init__(self, *args, **kwargs) -> None: # noqa: E501 + """ReadCapacityResponse - a model defined in OpenAPI + + Keyword Args: + mode (str): The mode of the index. Possible values: `OnDemand` or `Dedicated`. Defaults to `OnDemand`. If set to `Dedicated`, `dedicated.node_type`, and `dedicated.scaling` must be specified. + _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,) + status (ReadCapacityStatus): [optional] # noqa: E501 + dedicated (ReadCapacityDedicatedConfig): [optional] # noqa: E501 + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", True) + _enforce_validations = kwargs.pop("_enforce_validations", True) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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__,) + + constant_args = { + "_check_type": _check_type, + "_path_to_item": _path_to_item, + "_spec_property_naming": _spec_property_naming, + "_configuration": _configuration, + "_visited_composed_classes": self._visited_composed_classes, + } + composed_info = validate_get_composed_info(constant_args, kwargs, self) + self._composed_instances = composed_info[0] + self._var_name_to_model_instances = composed_info[1] + self._additional_properties_model_instances = composed_info[2] + discarded_args = composed_info[3] + + for var_name, var_value in kwargs.items(): + if ( + var_name in discarded_args + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self._additional_properties_model_instances + ): + # 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." + ) + + @cached_property + def _composed_schemas(): # type: ignore + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error beause the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + lazy_import() + return { + "anyOf": [], + "allOf": [], + "oneOf": [ReadCapacityDedicatedSpecResponse, ReadCapacityOnDemandSpecResponse], + } diff --git a/pinecone/core/openapi/db_control/model/read_capacity_status.py b/pinecone/core/openapi/db_control/model/read_capacity_status.py new file mode 100644 index 00000000..107e4031 --- /dev/null +++ b/pinecone/core/openapi/db_control/model/read_capacity_status.py @@ -0,0 +1,288 @@ +""" +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-10 +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="ReadCapacityStatus") + + +class ReadCapacityStatus(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 { + "state": (str,), # noqa: E501 + "current_replicas": (int,), # noqa: E501 + "current_shards": (int,), # noqa: E501 + "error_message": (str,), # noqa: E501 + } + + @cached_class_property + def discriminator(cls): + return None + + attribute_map: Dict[str, str] = { + "state": "state", # noqa: E501 + "current_replicas": "current_replicas", # noqa: E501 + "current_shards": "current_shards", # noqa: E501 + "error_message": "error_message", # 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], state, *args, **kwargs) -> T: # noqa: E501 + """ReadCapacityStatus - a model defined in OpenAPI + + Args: + state (str): The `state` describes the overall status of factors relating to the read capacity of an index. Available values: - `Ready` is the state most of the time - `Scaling` if the number of replicas or shards has been recently updated by calling the [configure index endpoint](https://docs.pinecone.io/reference/api/2025-10/control-plane/configure_index) - `Migrating` if the index is being migrated to a new `node_type` - `Error` if there is an error with the read capacity configuration. In that case, see `error_message` for more details. + + 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,) + current_replicas (int): The number of replicas. Each replica has dedicated compute resources and data storage. Increasing this number will increase the total throughput of the index. [optional] # noqa: E501 + current_shards (int): The number of shards. Each shard has dedicated storage. Increasing shards alleiviates index fullness. [optional] # noqa: E501 + error_message (str): An optional error message indicating any issues with your read capacity configuration [optional] # noqa: E501 + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", False) + _enforce_validations = kwargs.pop("_enforce_validations", False) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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.state = state + 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( + [ + "_enforce_allowed_values", + "_enforce_validations", + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) + + @convert_js_args_to_python_args + def __init__(self, state, *args, **kwargs) -> None: # noqa: E501 + """ReadCapacityStatus - a model defined in OpenAPI + + Args: + state (str): The `state` describes the overall status of factors relating to the read capacity of an index. Available values: - `Ready` is the state most of the time - `Scaling` if the number of replicas or shards has been recently updated by calling the [configure index endpoint](https://docs.pinecone.io/reference/api/2025-10/control-plane/configure_index) - `Migrating` if the index is being migrated to a new `node_type` - `Error` if there is an error with the read capacity configuration. In that case, see `error_message` for more details. + + 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,) + current_replicas (int): The number of replicas. Each replica has dedicated compute resources and data storage. Increasing this number will increase the total throughput of the index. [optional] # noqa: E501 + current_shards (int): The number of shards. Each shard has dedicated storage. Increasing shards alleiviates index fullness. [optional] # noqa: E501 + error_message (str): An optional error message indicating any issues with your read capacity configuration [optional] # noqa: E501 + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", True) + _enforce_validations = kwargs.pop("_enforce_validations", True) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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.state = state + 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 index 2f39d91c..a01d8b6b 100644 --- a/pinecone/core/openapi/db_control/model/restore_job_list.py +++ b/pinecone/core/openapi/db_control/model/restore_job_list.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ @@ -117,7 +117,7 @@ def _from_openapi_data(cls: Type[T], data, *args, **kwargs) -> T: # noqa: E501 """RestoreJobList - a model defined in OpenAPI Args: - data ([RestoreJobModel]): + data ([RestoreJobModel]): List of restore job objects Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -211,7 +211,7 @@ def __init__(self, data, *args, **kwargs) -> None: # noqa: E501 """RestoreJobList - a model defined in OpenAPI Args: - data ([RestoreJobModel]): + data ([RestoreJobModel]): List of restore job objects Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/pinecone/core/openapi/db_control/model/restore_job_model.py b/pinecone/core/openapi/db_control/model/restore_job_model.py index 951200d1..5f68f3c5 100644 --- a/pinecone/core/openapi/db_control/model/restore_job_model.py +++ b/pinecone/core/openapi/db_control/model/restore_job_model.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-04 +The version of the OpenAPI document: 2025-10 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/scaling_config_manual.py similarity index 87% rename from pinecone/core/openapi/db_control/model/configure_index_request_spec_pod.py rename to pinecone/core/openapi/db_control/model/scaling_config_manual.py index 91909c75..0639533f 100644 --- a/pinecone/core/openapi/db_control/model/configure_index_request_spec_pod.py +++ b/pinecone/core/openapi/db_control/model/scaling_config_manual.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ @@ -30,10 +30,10 @@ from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar from pinecone.openapi_support import PropertyValidationTypedDict, cached_class_property -T = TypeVar("T", bound="ConfigureIndexRequestSpecPod") +T = TypeVar("T", bound="ScalingConfigManual") -class ConfigureIndexRequestSpecPod(ModelNormal): +class ScalingConfigManual(ModelNormal): """NOTE: This class is @generated using OpenAPI. Do not edit the class manually. @@ -62,7 +62,8 @@ class ConfigureIndexRequestSpecPod(ModelNormal): allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ("replicas",): {"inclusive_minimum": 1} + ("replicas",): {"inclusive_minimum": 0}, + ("shards",): {"inclusive_minimum": 1}, } @cached_class_property @@ -87,7 +88,7 @@ def openapi_types(cls): """ return { "replicas": (int,), # noqa: E501 - "pod_type": (str,), # noqa: E501 + "shards": (int,), # noqa: E501 } @cached_class_property @@ -96,7 +97,7 @@ def discriminator(cls): attribute_map: Dict[str, str] = { "replicas": "replicas", # noqa: E501 - "pod_type": "pod_type", # noqa: E501 + "shards": "shards", # noqa: E501 } read_only_vars: Set[str] = set([]) @@ -105,8 +106,12 @@ def discriminator(cls): @classmethod @convert_js_args_to_python_args - def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 - """ConfigureIndexRequestSpecPod - a model defined in OpenAPI + def _from_openapi_data(cls: Type[T], replicas, shards, *args, **kwargs) -> T: # noqa: E501 + """ScalingConfigManual - a model defined in OpenAPI + + Args: + replicas (int): The number of replicas to use. Replicas duplicate the compute resources and data of an index, allowing higher query throughput and availability. Setting replicas to 0 disables the index but can be used to reduce costs while usage is paused. + shards (int): The number of shards to use. Shards determine the storage capacity of an index, with each shard providing 250 GB of storage. Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -139,8 +144,6 @@ 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,) - replicas (int): The number of replicas. Replicas duplicate your index. They provide higher availability and throughput. Replicas can be scaled up or down as your needs change. [optional] if omitted the server will use the default value of 1. # noqa: E501 - pod_type (str): The type of pod to use. One of `s1`, `p1`, or `p2` appended with `.` and one of `x1`, `x2`, `x4`, or `x8`. [optional] if omitted the server will use the default value of "p1.x1". # noqa: E501 """ _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", False) @@ -170,6 +173,8 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.replicas = replicas + self.shards = shards for var_name, var_value in kwargs.items(): if ( var_name not in self.attribute_map @@ -196,8 +201,12 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 ) @convert_js_args_to_python_args - def __init__(self, *args, **kwargs) -> None: # noqa: E501 - """ConfigureIndexRequestSpecPod - a model defined in OpenAPI + def __init__(self, replicas, shards, *args, **kwargs) -> None: # noqa: E501 + """ScalingConfigManual - a model defined in OpenAPI + + Args: + replicas (int): The number of replicas to use. Replicas duplicate the compute resources and data of an index, allowing higher query throughput and availability. Setting replicas to 0 disables the index but can be used to reduce costs while usage is paused. + shards (int): The number of shards to use. Shards determine the storage capacity of an index, with each shard providing 250 GB of storage. Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -230,8 +239,6 @@ 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,) - replicas (int): The number of replicas. Replicas duplicate your index. They provide higher availability and throughput. Replicas can be scaled up or down as your needs change. [optional] if omitted the server will use the default value of 1. # noqa: E501 - pod_type (str): The type of pod to use. One of `s1`, `p1`, or `p2` appended with `.` and one of `x1`, `x2`, `x4`, or `x8`. [optional] if omitted the server will use the default value of "p1.x1". # noqa: E501 """ _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", True) @@ -259,6 +266,8 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) + self.replicas = replicas + self.shards = shards for var_name, var_value in kwargs.items(): if ( var_name not in self.attribute_map diff --git a/pinecone/core/openapi/db_control/model/serverless.py b/pinecone/core/openapi/db_control/model/serverless.py new file mode 100644 index 00000000..d36a79a5 --- /dev/null +++ b/pinecone/core/openapi/db_control/model/serverless.py @@ -0,0 +1,284 @@ +""" +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-10 +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.serverless_spec import ServerlessSpec + + globals()["ServerlessSpec"] = ServerlessSpec + + +from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar +from pinecone.openapi_support import PropertyValidationTypedDict, cached_class_property + +T = TypeVar("T", bound="Serverless") + + +class Serverless(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 { + "serverless": (ServerlessSpec,) # noqa: E501 + } + + @cached_class_property + def discriminator(cls): + return None + + attribute_map: Dict[str, str] = { + "serverless": "serverless" # 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], serverless, *args, **kwargs) -> T: # noqa: E501 + """Serverless - a model defined in OpenAPI + + Args: + serverless (ServerlessSpec): + + 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,) + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", False) + _enforce_validations = kwargs.pop("_enforce_validations", False) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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.serverless = serverless + 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( + [ + "_enforce_allowed_values", + "_enforce_validations", + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) + + @convert_js_args_to_python_args + def __init__(self, serverless, *args, **kwargs) -> None: # noqa: E501 + """Serverless - a model defined in OpenAPI + + Args: + serverless (ServerlessSpec): + + 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,) + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", True) + _enforce_validations = kwargs.pop("_enforce_validations", True) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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.serverless = serverless + 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/serverless_spec.py b/pinecone/core/openapi/db_control/model/serverless_spec.py index efa9157e..0f1800f1 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-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ @@ -27,6 +27,14 @@ from pinecone.openapi_support.exceptions import PineconeApiAttributeError +def lazy_import(): + from pinecone.core.openapi.db_control.model.backup_model_schema import BackupModelSchema + from pinecone.core.openapi.db_control.model.read_capacity import ReadCapacity + + globals()["BackupModelSchema"] = BackupModelSchema + globals()["ReadCapacity"] = ReadCapacity + + from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar from pinecone.openapi_support import PropertyValidationTypedDict, cached_class_property @@ -59,9 +67,7 @@ class ServerlessSpec(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - ("cloud",): {"GCP": "gcp", "AWS": "aws", "AZURE": "azure"} - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @@ -71,6 +77,7 @@ 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 @@ -85,9 +92,13 @@ def openapi_types(cls): openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { "cloud": (str,), # noqa: E501 "region": (str,), # noqa: E501 + "read_capacity": (ReadCapacity,), # noqa: E501 + "source_collection": (str,), # noqa: E501 + "schema": (BackupModelSchema,), # noqa: E501 } @cached_class_property @@ -97,6 +108,9 @@ def discriminator(cls): attribute_map: Dict[str, str] = { "cloud": "cloud", # noqa: E501 "region": "region", # noqa: E501 + "read_capacity": "read_capacity", # noqa: E501 + "source_collection": "source_collection", # noqa: E501 + "schema": "schema", # noqa: E501 } read_only_vars: Set[str] = set([]) @@ -109,7 +123,7 @@ def _from_openapi_data(cls: Type[T], cloud, region, *args, **kwargs) -> T: # no """ServerlessSpec - a model defined in OpenAPI Args: - cloud (str): The public cloud where you would like your index hosted. + cloud (str): The public cloud where you would like your index hosted. Possible values: `gcp`, `aws`, or `azure`. region (str): The region where you would like your index to be created. Keyword Args: @@ -143,6 +157,9 @@ def _from_openapi_data(cls: Type[T], cloud, region, *args, **kwargs) -> T: # no Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) + read_capacity (ReadCapacity): [optional] # noqa: E501 + source_collection (str): The name of the collection to be used as the source for the index. [optional] # noqa: E501 + schema (BackupModelSchema): [optional] # noqa: E501 """ _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", False) @@ -204,7 +221,7 @@ def __init__(self, cloud, region, *args, **kwargs) -> None: # noqa: E501 """ServerlessSpec - a model defined in OpenAPI Args: - cloud (str): The public cloud where you would like your index hosted. + cloud (str): The public cloud where you would like your index hosted. Possible values: `gcp`, `aws`, or `azure`. region (str): The region where you would like your index to be created. Keyword Args: @@ -238,6 +255,9 @@ def __init__(self, cloud, region, *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,) + read_capacity (ReadCapacity): [optional] # noqa: E501 + source_collection (str): The name of the collection to be used as the source for the index. [optional] # noqa: E501 + schema (BackupModelSchema): [optional] # noqa: E501 """ _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", True) diff --git a/pinecone/core/openapi/db_control/model/serverless_spec_response.py b/pinecone/core/openapi/db_control/model/serverless_spec_response.py new file mode 100644 index 00000000..c542323e --- /dev/null +++ b/pinecone/core/openapi/db_control/model/serverless_spec_response.py @@ -0,0 +1,306 @@ +""" +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-10 +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_schema import BackupModelSchema + from pinecone.core.openapi.db_control.model.read_capacity_response import ReadCapacityResponse + + globals()["BackupModelSchema"] = BackupModelSchema + globals()["ReadCapacityResponse"] = ReadCapacityResponse + + +from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar +from pinecone.openapi_support import PropertyValidationTypedDict, cached_class_property + +T = TypeVar("T", bound="ServerlessSpecResponse") + + +class ServerlessSpecResponse(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 { + "cloud": (str,), # noqa: E501 + "region": (str,), # noqa: E501 + "read_capacity": (ReadCapacityResponse,), # noqa: E501 + "source_collection": (str,), # noqa: E501 + "schema": (BackupModelSchema,), # noqa: E501 + } + + @cached_class_property + def discriminator(cls): + return None + + attribute_map: Dict[str, str] = { + "cloud": "cloud", # noqa: E501 + "region": "region", # noqa: E501 + "read_capacity": "read_capacity", # noqa: E501 + "source_collection": "source_collection", # noqa: E501 + "schema": "schema", # 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], cloud, region, read_capacity, *args, **kwargs) -> T: # noqa: E501 + """ServerlessSpecResponse - a model defined in OpenAPI + + Args: + cloud (str): The public cloud where you would like your index hosted. Possible values: `gcp`, `aws`, or `azure`. + region (str): The region where you would like your index to be created. + read_capacity (ReadCapacityResponse): + + 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,) + source_collection (str): The name of the collection to be used as the source for the index. [optional] # noqa: E501 + schema (BackupModelSchema): [optional] # noqa: E501 + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", False) + _enforce_validations = kwargs.pop("_enforce_validations", False) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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.cloud = cloud + self.region = region + self.read_capacity = read_capacity + 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( + [ + "_enforce_allowed_values", + "_enforce_validations", + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) + + @convert_js_args_to_python_args + def __init__(self, cloud, region, read_capacity, *args, **kwargs) -> None: # noqa: E501 + """ServerlessSpecResponse - a model defined in OpenAPI + + Args: + cloud (str): The public cloud where you would like your index hosted. Possible values: `gcp`, `aws`, or `azure`. + region (str): The region where you would like your index to be created. + read_capacity (ReadCapacityResponse): + + 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,) + source_collection (str): The name of the collection to be used as the source for the index. [optional] # noqa: E501 + schema (BackupModelSchema): [optional] # noqa: E501 + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", True) + _enforce_validations = kwargs.pop("_enforce_validations", True) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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.cloud = cloud + self.region = region + self.read_capacity = read_capacity + 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 99c3bb9d..774a057e 100644 --- a/pinecone/core/openapi/db_control/models/__init__.py +++ b/pinecone/core/openapi/db_control/models/__init__.py @@ -9,8 +9,13 @@ # import sys # sys.setrecursionlimit(n) +from pinecone.core.openapi.db_control.model.byoc import BYOC 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.backup_model_schema import BackupModelSchema +from pinecone.core.openapi.db_control.model.backup_model_schema_fields import ( + BackupModelSchemaFields, +) from pinecone.core.openapi.db_control.model.byoc_spec import ByocSpec from pinecone.core.openapi.db_control.model.collection_list import CollectionList from pinecone.core.openapi.db_control.model.collection_model import CollectionModel @@ -18,12 +23,6 @@ from pinecone.core.openapi.db_control.model.configure_index_request_embed import ( ConfigureIndexRequestEmbed, ) -from pinecone.core.openapi.db_control.model.configure_index_request_spec import ( - ConfigureIndexRequestSpec, -) -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 ( @@ -39,19 +38,39 @@ CreateIndexFromBackupResponse, ) from pinecone.core.openapi.db_control.model.create_index_request import CreateIndexRequest -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 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.index_model_spec import IndexModelSpec from pinecone.core.openapi.db_control.model.index_model_status import IndexModelStatus 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_based import PodBased 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.read_capacity import ReadCapacity +from pinecone.core.openapi.db_control.model.read_capacity_dedicated_config import ( + ReadCapacityDedicatedConfig, +) +from pinecone.core.openapi.db_control.model.read_capacity_dedicated_spec import ( + ReadCapacityDedicatedSpec, +) +from pinecone.core.openapi.db_control.model.read_capacity_dedicated_spec_response import ( + ReadCapacityDedicatedSpecResponse, +) +from pinecone.core.openapi.db_control.model.read_capacity_on_demand_spec import ( + ReadCapacityOnDemandSpec, +) +from pinecone.core.openapi.db_control.model.read_capacity_on_demand_spec_response import ( + ReadCapacityOnDemandSpecResponse, +) +from pinecone.core.openapi.db_control.model.read_capacity_response import ReadCapacityResponse +from pinecone.core.openapi.db_control.model.read_capacity_status import ReadCapacityStatus 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.scaling_config_manual import ScalingConfigManual +from pinecone.core.openapi.db_control.model.serverless import Serverless from pinecone.core.openapi.db_control.model.serverless_spec import ServerlessSpec +from pinecone.core.openapi.db_control.model.serverless_spec_response import ServerlessSpecResponse diff --git a/pinecone/core/openapi/db_data/__init__.py b/pinecone/core/openapi/db_data/__init__.py index 76701561..eb475f54 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-04 +The version of the OpenAPI document: 2025-10 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-04" +API_VERSION = "2025-10" 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 854e37af..237b9f3b 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-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ @@ -41,18 +41,21 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient() self.api_client = api_client - def __cancel_bulk_import(self, id, **kwargs: ExtraOpenApiKwargsTypedDict): + def __cancel_bulk_import( + self, id, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict + ): """Cancel an import # noqa: E501 Cancel an import operation if it is not yet finished. It has no effect if the operation is already finished. For guidance and examples, see [Import data](https://docs.pinecone.io/guides/index-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 - >>> thread = api.cancel_bulk_import(id, async_req=True) + >>> thread = api.cancel_bulk_import(id, x_pinecone_api_version="2025-10", async_req=True) >>> result = thread.get() Args: id (str): Unique identifier for the import operation. + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -78,6 +81,7 @@ def __cancel_bulk_import(self, id, **kwargs: ExtraOpenApiKwargsTypedDict): thread. """ kwargs = self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["id"] = id return self.call_with_http_info(**kwargs) @@ -91,8 +95,8 @@ def __cancel_bulk_import(self, id, **kwargs: ExtraOpenApiKwargsTypedDict): "servers": None, }, params_map={ - "all": ["id"], - "required": ["id"], + "all": ["x_pinecone_api_version", "id"], + "required": ["x_pinecone_api_version", "id"], "nullable": [], "enum": [], "validation": ["id"], @@ -100,9 +104,9 @@ def __cancel_bulk_import(self, id, **kwargs: ExtraOpenApiKwargsTypedDict): root_map={ "validations": {("id",): {"max_length": 1000, "min_length": 1}}, "allowed_values": {}, - "openapi_types": {"id": (str,)}, - "attribute_map": {"id": "id"}, - "location_map": {"id": "path"}, + "openapi_types": {"x_pinecone_api_version": (str,), "id": (str,)}, + "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version", "id": "id"}, + "location_map": {"x_pinecone_api_version": "header", "id": "path"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": []}, @@ -110,18 +114,21 @@ def __cancel_bulk_import(self, id, **kwargs: ExtraOpenApiKwargsTypedDict): callable=__cancel_bulk_import, ) - def __describe_bulk_import(self, id, **kwargs: ExtraOpenApiKwargsTypedDict): + def __describe_bulk_import( + self, id, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict + ): """Describe an import # noqa: E501 Return details of a specific import operation. For guidance and examples, see [Import data](https://docs.pinecone.io/guides/index-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 - >>> thread = api.describe_bulk_import(id, async_req=True) + >>> thread = api.describe_bulk_import(id, x_pinecone_api_version="2025-10", async_req=True) >>> result = thread.get() Args: id (str): Unique identifier for the import operation. + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -147,6 +154,7 @@ def __describe_bulk_import(self, id, **kwargs: ExtraOpenApiKwargsTypedDict): thread. """ kwargs = self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["id"] = id return self.call_with_http_info(**kwargs) @@ -160,8 +168,8 @@ def __describe_bulk_import(self, id, **kwargs: ExtraOpenApiKwargsTypedDict): "servers": None, }, params_map={ - "all": ["id"], - "required": ["id"], + "all": ["x_pinecone_api_version", "id"], + "required": ["x_pinecone_api_version", "id"], "nullable": [], "enum": [], "validation": ["id"], @@ -169,9 +177,9 @@ def __describe_bulk_import(self, id, **kwargs: ExtraOpenApiKwargsTypedDict): root_map={ "validations": {("id",): {"max_length": 1000, "min_length": 1}}, "allowed_values": {}, - "openapi_types": {"id": (str,)}, - "attribute_map": {"id": "id"}, - "location_map": {"id": "path"}, + "openapi_types": {"x_pinecone_api_version": (str,), "id": (str,)}, + "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version", "id": "id"}, + "location_map": {"x_pinecone_api_version": "header", "id": "path"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": []}, @@ -179,19 +187,23 @@ def __describe_bulk_import(self, id, **kwargs: ExtraOpenApiKwargsTypedDict): callable=__describe_bulk_import, ) - def __list_bulk_imports(self, **kwargs: ExtraOpenApiKwargsTypedDict): + def __list_bulk_imports( + self, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict + ): """List imports # 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/index-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 - >>> thread = api.list_bulk_imports(async_req=True) + >>> thread = api.list_bulk_imports(x_pinecone_api_version="2025-10", async_req=True) >>> result = thread.get() + Args: + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: - limit (int): Max number of operations to return per page. [optional] + limit (int): Max number of operations to return per page. [optional] if omitted the server will use the default value of 100. pagination_token (str): Pagination token to continue a previous listing operation. [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. @@ -216,6 +228,7 @@ def __list_bulk_imports(self, **kwargs: ExtraOpenApiKwargsTypedDict): thread. """ kwargs = self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version return self.call_with_http_info(**kwargs) self.list_bulk_imports = _Endpoint( @@ -228,8 +241,8 @@ def __list_bulk_imports(self, **kwargs: ExtraOpenApiKwargsTypedDict): "servers": None, }, params_map={ - "all": ["limit", "pagination_token"], - "required": [], + "all": ["x_pinecone_api_version", "limit", "pagination_token"], + "required": ["x_pinecone_api_version"], "nullable": [], "enum": [], "validation": ["limit"], @@ -237,9 +250,21 @@ def __list_bulk_imports(self, **kwargs: ExtraOpenApiKwargsTypedDict): 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"}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "limit": (int,), + "pagination_token": (str,), + }, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "limit": "limit", + "pagination_token": "paginationToken", + }, + "location_map": { + "x_pinecone_api_version": "header", + "limit": "query", + "pagination_token": "query", + }, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": []}, @@ -247,18 +272,24 @@ def __list_bulk_imports(self, **kwargs: ExtraOpenApiKwargsTypedDict): callable=__list_bulk_imports, ) - def __start_bulk_import(self, start_import_request, **kwargs: ExtraOpenApiKwargsTypedDict): + def __start_bulk_import( + self, + start_import_request, + x_pinecone_api_version="2025-10", + **kwargs: ExtraOpenApiKwargsTypedDict, + ): """Start import # noqa: E501 Start an asynchronous import of vectors from object storage into an index. For guidance and examples, see [Import data](https://docs.pinecone.io/guides/index-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 - >>> thread = api.start_bulk_import(start_import_request, async_req=True) + >>> thread = api.start_bulk_import(start_import_request, x_pinecone_api_version="2025-10", async_req=True) >>> result = thread.get() Args: start_import_request (StartImportRequest): + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -284,6 +315,7 @@ def __start_bulk_import(self, start_import_request, **kwargs: ExtraOpenApiKwargs thread. """ kwargs = self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["start_import_request"] = start_import_request return self.call_with_http_info(**kwargs) @@ -297,8 +329,8 @@ def __start_bulk_import(self, start_import_request, **kwargs: ExtraOpenApiKwargs "servers": None, }, params_map={ - "all": ["start_import_request"], - "required": ["start_import_request"], + "all": ["x_pinecone_api_version", "start_import_request"], + "required": ["x_pinecone_api_version", "start_import_request"], "nullable": [], "enum": [], "validation": [], @@ -306,9 +338,15 @@ def __start_bulk_import(self, start_import_request, **kwargs: ExtraOpenApiKwargs root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"start_import_request": (StartImportRequest,)}, - "attribute_map": {}, - "location_map": {"start_import_request": "body"}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "start_import_request": (StartImportRequest,), + }, + "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, + "location_map": { + "x_pinecone_api_version": "header", + "start_import_request": "body", + }, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, @@ -328,7 +366,7 @@ def __init__(self, api_client=None) -> None: api_client = AsyncioApiClient() self.api_client = api_client - async def __cancel_bulk_import(self, id, **kwargs): + async def __cancel_bulk_import(self, id, x_pinecone_api_version="2025-10", **kwargs): """Cancel an import # noqa: E501 Cancel an import operation if it is not yet finished. It has no effect if the operation is already finished. For guidance and examples, see [Import data](https://docs.pinecone.io/guides/index-data/import-data). # noqa: E501 @@ -336,6 +374,7 @@ async def __cancel_bulk_import(self, id, **kwargs): Args: id (str): Unique identifier for the import operation. + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -358,6 +397,7 @@ async def __cancel_bulk_import(self, id, **kwargs): {str: (bool, dict, float, int, list, str, none_type)} """ self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["id"] = id return await self.call_with_http_info(**kwargs) @@ -371,8 +411,8 @@ async def __cancel_bulk_import(self, id, **kwargs): "servers": None, }, params_map={ - "all": ["id"], - "required": ["id"], + "all": ["x_pinecone_api_version", "id"], + "required": ["x_pinecone_api_version", "id"], "nullable": [], "enum": [], "validation": ["id"], @@ -380,9 +420,9 @@ async def __cancel_bulk_import(self, id, **kwargs): root_map={ "validations": {("id",): {"max_length": 1000, "min_length": 1}}, "allowed_values": {}, - "openapi_types": {"id": (str,)}, - "attribute_map": {"id": "id"}, - "location_map": {"id": "path"}, + "openapi_types": {"x_pinecone_api_version": (str,), "id": (str,)}, + "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version", "id": "id"}, + "location_map": {"x_pinecone_api_version": "header", "id": "path"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": []}, @@ -390,7 +430,7 @@ async def __cancel_bulk_import(self, id, **kwargs): callable=__cancel_bulk_import, ) - async def __describe_bulk_import(self, id, **kwargs): + async def __describe_bulk_import(self, id, x_pinecone_api_version="2025-10", **kwargs): """Describe an import # noqa: E501 Return details of a specific import operation. For guidance and examples, see [Import data](https://docs.pinecone.io/guides/index-data/import-data). # noqa: E501 @@ -398,6 +438,7 @@ async def __describe_bulk_import(self, id, **kwargs): Args: id (str): Unique identifier for the import operation. + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -420,6 +461,7 @@ async def __describe_bulk_import(self, id, **kwargs): ImportModel """ self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["id"] = id return await self.call_with_http_info(**kwargs) @@ -433,8 +475,8 @@ async def __describe_bulk_import(self, id, **kwargs): "servers": None, }, params_map={ - "all": ["id"], - "required": ["id"], + "all": ["x_pinecone_api_version", "id"], + "required": ["x_pinecone_api_version", "id"], "nullable": [], "enum": [], "validation": ["id"], @@ -442,9 +484,9 @@ async def __describe_bulk_import(self, id, **kwargs): root_map={ "validations": {("id",): {"max_length": 1000, "min_length": 1}}, "allowed_values": {}, - "openapi_types": {"id": (str,)}, - "attribute_map": {"id": "id"}, - "location_map": {"id": "path"}, + "openapi_types": {"x_pinecone_api_version": (str,), "id": (str,)}, + "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version", "id": "id"}, + "location_map": {"x_pinecone_api_version": "header", "id": "path"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": []}, @@ -452,15 +494,17 @@ async def __describe_bulk_import(self, id, **kwargs): callable=__describe_bulk_import, ) - async def __list_bulk_imports(self, **kwargs): + async def __list_bulk_imports(self, x_pinecone_api_version="2025-10", **kwargs): """List imports # 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/index-data/import-data). # noqa: E501 + Args: + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: - limit (int): Max number of operations to return per page. [optional] + limit (int): Max number of operations to return per page. [optional] if omitted the server will use the default value of 100. pagination_token (str): Pagination token to continue a previous listing operation. [optional] _return_http_data_only (bool): response data without head status code and headers. Default is True. @@ -482,6 +526,7 @@ async def __list_bulk_imports(self, **kwargs): ListImportsResponse """ self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version return await self.call_with_http_info(**kwargs) self.list_bulk_imports = _AsyncioEndpoint( @@ -494,8 +539,8 @@ async def __list_bulk_imports(self, **kwargs): "servers": None, }, params_map={ - "all": ["limit", "pagination_token"], - "required": [], + "all": ["x_pinecone_api_version", "limit", "pagination_token"], + "required": ["x_pinecone_api_version"], "nullable": [], "enum": [], "validation": ["limit"], @@ -503,9 +548,21 @@ async def __list_bulk_imports(self, **kwargs): 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"}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "limit": (int,), + "pagination_token": (str,), + }, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "limit": "limit", + "pagination_token": "paginationToken", + }, + "location_map": { + "x_pinecone_api_version": "header", + "limit": "query", + "pagination_token": "query", + }, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": []}, @@ -513,7 +570,9 @@ async def __list_bulk_imports(self, **kwargs): callable=__list_bulk_imports, ) - async def __start_bulk_import(self, start_import_request, **kwargs): + async def __start_bulk_import( + self, start_import_request, x_pinecone_api_version="2025-10", **kwargs + ): """Start import # noqa: E501 Start an asynchronous import of vectors from object storage into an index. For guidance and examples, see [Import data](https://docs.pinecone.io/guides/index-data/import-data). # noqa: E501 @@ -521,6 +580,7 @@ async def __start_bulk_import(self, start_import_request, **kwargs): Args: start_import_request (StartImportRequest): + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -543,6 +603,7 @@ async def __start_bulk_import(self, start_import_request, **kwargs): StartImportResponse """ self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["start_import_request"] = start_import_request return await self.call_with_http_info(**kwargs) @@ -556,8 +617,8 @@ async def __start_bulk_import(self, start_import_request, **kwargs): "servers": None, }, params_map={ - "all": ["start_import_request"], - "required": ["start_import_request"], + "all": ["x_pinecone_api_version", "start_import_request"], + "required": ["x_pinecone_api_version", "start_import_request"], "nullable": [], "enum": [], "validation": [], @@ -565,9 +626,15 @@ async def __start_bulk_import(self, start_import_request, **kwargs): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"start_import_request": (StartImportRequest,)}, - "attribute_map": {}, - "location_map": {"start_import_request": "body"}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "start_import_request": (StartImportRequest,), + }, + "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, + "location_map": { + "x_pinecone_api_version": "header", + "start_import_request": "body", + }, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, diff --git a/pinecone/core/openapi/db_data/api/namespace_operations_api.py b/pinecone/core/openapi/db_data/api/namespace_operations_api.py index 0493286b..6111d4c4 100644 --- a/pinecone/core/openapi/db_data/api/namespace_operations_api.py +++ b/pinecone/core/openapi/db_data/api/namespace_operations_api.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ @@ -23,6 +23,7 @@ none_type, validate_and_convert_types, ) +from pinecone.core.openapi.db_data.model.create_namespace_request import CreateNamespaceRequest from pinecone.core.openapi.db_data.model.list_namespaces_response import ListNamespacesResponse from pinecone.core.openapi.db_data.model.namespace_description import NamespaceDescription from pinecone.core.openapi.db_data.model.rpc_status import RpcStatus @@ -39,18 +40,103 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient() self.api_client = api_client - def __delete_namespace(self, namespace, **kwargs: ExtraOpenApiKwargsTypedDict): + def __create_namespace( + self, + create_namespace_request, + x_pinecone_api_version="2025-10", + **kwargs: ExtraOpenApiKwargsTypedDict, + ): + """Create a namespace # noqa: E501 + + Create a namespace in a serverless index. For guidance and examples, see [Manage namespaces](https://docs.pinecone.io/guides/manage-data/manage-namespaces). **Note:** This operation is not supported for 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 + + >>> thread = api.create_namespace(create_namespace_request, x_pinecone_api_version="2025-10", async_req=True) + >>> result = thread.get() + + Args: + create_namespace_request (CreateNamespaceRequest): + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] + + 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: + NamespaceDescription + If the method is called asynchronously, returns the request + thread. + """ + kwargs = self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["create_namespace_request"] = create_namespace_request + return self.call_with_http_info(**kwargs) + + self.create_namespace = _Endpoint( + settings={ + "response_type": (NamespaceDescription,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/namespaces", + "operation_id": "create_namespace", + "http_method": "POST", + "servers": None, + }, + params_map={ + "all": ["x_pinecone_api_version", "create_namespace_request"], + "required": ["x_pinecone_api_version", "create_namespace_request"], + "nullable": [], + "enum": [], + "validation": [], + }, + root_map={ + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "create_namespace_request": (CreateNamespaceRequest,), + }, + "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, + "location_map": { + "x_pinecone_api_version": "header", + "create_namespace_request": "body", + }, + "collection_format_map": {}, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + callable=__create_namespace, + ) + + def __delete_namespace( + self, namespace, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict + ): """Delete a namespace # noqa: E501 - Delete a namespace from an index. # noqa: E501 + Delete a namespace from a serverless index. Deleting a namespace is irreversible; all data in the namespace is permanently deleted. For guidance and examples, see [Manage namespaces](https://docs.pinecone.io/guides/manage-data/manage-namespaces). **Note:** This operation is not supported for 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 - >>> thread = api.delete_namespace(namespace, async_req=True) + >>> thread = api.delete_namespace(namespace, x_pinecone_api_version="2025-10", async_req=True) >>> result = thread.get() Args: - namespace (str): The namespace to delete + namespace (str): The namespace to delete. + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -76,6 +162,7 @@ def __delete_namespace(self, namespace, **kwargs: ExtraOpenApiKwargsTypedDict): thread. """ kwargs = self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["namespace"] = namespace return self.call_with_http_info(**kwargs) @@ -89,8 +176,8 @@ def __delete_namespace(self, namespace, **kwargs: ExtraOpenApiKwargsTypedDict): "servers": None, }, params_map={ - "all": ["namespace"], - "required": ["namespace"], + "all": ["x_pinecone_api_version", "namespace"], + "required": ["x_pinecone_api_version", "namespace"], "nullable": [], "enum": [], "validation": [], @@ -98,9 +185,12 @@ def __delete_namespace(self, namespace, **kwargs: ExtraOpenApiKwargsTypedDict): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"namespace": (str,)}, - "attribute_map": {"namespace": "namespace"}, - "location_map": {"namespace": "path"}, + "openapi_types": {"x_pinecone_api_version": (str,), "namespace": (str,)}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "namespace": "namespace", + }, + "location_map": {"x_pinecone_api_version": "header", "namespace": "path"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": []}, @@ -108,18 +198,21 @@ def __delete_namespace(self, namespace, **kwargs: ExtraOpenApiKwargsTypedDict): callable=__delete_namespace, ) - def __describe_namespace(self, namespace, **kwargs: ExtraOpenApiKwargsTypedDict): + def __describe_namespace( + self, namespace, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict + ): """Describe a namespace # noqa: E501 - Describe a [namespace](https://docs.pinecone.io/guides/index-data/indexing-overview#namespaces) in a serverless index, including the total number of vectors in the namespace. # noqa: E501 + Describe a namespace in a serverless index, including the total number of vectors in the namespace. For guidance and examples, see [Manage namespaces](https://docs.pinecone.io/guides/manage-data/manage-namespaces). **Note:** This operation is not supported for 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 - >>> thread = api.describe_namespace(namespace, async_req=True) + >>> thread = api.describe_namespace(namespace, x_pinecone_api_version="2025-10", async_req=True) >>> result = thread.get() Args: - namespace (str): The namespace to describe + namespace (str): The namespace to describe. + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -145,6 +238,7 @@ def __describe_namespace(self, namespace, **kwargs: ExtraOpenApiKwargsTypedDict) thread. """ kwargs = self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["namespace"] = namespace return self.call_with_http_info(**kwargs) @@ -158,8 +252,8 @@ def __describe_namespace(self, namespace, **kwargs: ExtraOpenApiKwargsTypedDict) "servers": None, }, params_map={ - "all": ["namespace"], - "required": ["namespace"], + "all": ["x_pinecone_api_version", "namespace"], + "required": ["x_pinecone_api_version", "namespace"], "nullable": [], "enum": [], "validation": [], @@ -167,9 +261,12 @@ def __describe_namespace(self, namespace, **kwargs: ExtraOpenApiKwargsTypedDict) root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"namespace": (str,)}, - "attribute_map": {"namespace": "namespace"}, - "location_map": {"namespace": "path"}, + "openapi_types": {"x_pinecone_api_version": (str,), "namespace": (str,)}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "namespace": "namespace", + }, + "location_map": {"x_pinecone_api_version": "header", "namespace": "path"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": []}, @@ -177,20 +274,25 @@ def __describe_namespace(self, namespace, **kwargs: ExtraOpenApiKwargsTypedDict) callable=__describe_namespace, ) - def __list_namespaces_operation(self, **kwargs: ExtraOpenApiKwargsTypedDict): + def __list_namespaces_operation( + self, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict + ): """List namespaces # noqa: E501 - Get a list of all [namespaces](https://docs.pinecone.io/guides/index-data/indexing-overview#namespaces) in a serverless index. Up to 100 namespaces are returned at a time by default, in sorted order (bitwise “C” collation). If the `limit` parameter is set, up to that number of namespaces are returned instead. Whenever there are additional namespaces to return, the response also includes a `pagination_token` that you can use to get the next batch of namespaces. When the response does not include a `pagination_token`, there are no more namespaces to return. # noqa: E501 + List all namespaces in a serverless index. Up to 100 namespaces are returned at a time by default, in sorted order (bitwise “C” collation). If the `limit` parameter is set, up to that number of namespaces are returned instead. Whenever there are additional namespaces to return, the response also includes a `pagination_token` that you can use to get the next batch of namespaces. When the response does not include a `pagination_token`, there are no more namespaces to return. For guidance and examples, see [Manage namespaces](https://docs.pinecone.io/guides/manage-data/manage-namespaces). **Note:** This operation is not supported for 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 - >>> thread = api.list_namespaces_operation(async_req=True) + >>> thread = api.list_namespaces_operation(x_pinecone_api_version="2025-10", async_req=True) >>> result = thread.get() + Args: + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: limit (int): Max number namespaces to return per page. [optional] pagination_token (str): Pagination token to continue a previous listing operation. [optional] + prefix (str): Prefix of the namespaces to list. Acts as a filter to return only namespaces that start with this prefix. [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 @@ -214,6 +316,7 @@ def __list_namespaces_operation(self, **kwargs: ExtraOpenApiKwargsTypedDict): thread. """ kwargs = self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version return self.call_with_http_info(**kwargs) self.list_namespaces_operation = _Endpoint( @@ -226,8 +329,8 @@ def __list_namespaces_operation(self, **kwargs: ExtraOpenApiKwargsTypedDict): "servers": None, }, params_map={ - "all": ["limit", "pagination_token"], - "required": [], + "all": ["x_pinecone_api_version", "limit", "pagination_token", "prefix"], + "required": ["x_pinecone_api_version"], "nullable": [], "enum": [], "validation": [], @@ -235,9 +338,24 @@ def __list_namespaces_operation(self, **kwargs: ExtraOpenApiKwargsTypedDict): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"limit": (int,), "pagination_token": (str,)}, - "attribute_map": {"limit": "limit", "pagination_token": "paginationToken"}, - "location_map": {"limit": "query", "pagination_token": "query"}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "limit": (int,), + "pagination_token": (str,), + "prefix": (str,), + }, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "limit": "limit", + "pagination_token": "paginationToken", + "prefix": "prefix", + }, + "location_map": { + "x_pinecone_api_version": "header", + "limit": "query", + "pagination_token": "query", + "prefix": "query", + }, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": []}, @@ -257,14 +375,87 @@ def __init__(self, api_client=None) -> None: api_client = AsyncioApiClient() self.api_client = api_client - async def __delete_namespace(self, namespace, **kwargs): + async def __create_namespace( + self, create_namespace_request, x_pinecone_api_version="2025-10", **kwargs + ): + """Create a namespace # noqa: E501 + + Create a namespace in a serverless index. For guidance and examples, see [Manage namespaces](https://docs.pinecone.io/guides/manage-data/manage-namespaces). **Note:** This operation is not supported for pod-based indexes. # noqa: E501 + + + Args: + create_namespace_request (CreateNamespaceRequest): + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] + + 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: + NamespaceDescription + """ + self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["create_namespace_request"] = create_namespace_request + return await self.call_with_http_info(**kwargs) + + self.create_namespace = _AsyncioEndpoint( + settings={ + "response_type": (NamespaceDescription,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/namespaces", + "operation_id": "create_namespace", + "http_method": "POST", + "servers": None, + }, + params_map={ + "all": ["x_pinecone_api_version", "create_namespace_request"], + "required": ["x_pinecone_api_version", "create_namespace_request"], + "nullable": [], + "enum": [], + "validation": [], + }, + root_map={ + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "create_namespace_request": (CreateNamespaceRequest,), + }, + "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, + "location_map": { + "x_pinecone_api_version": "header", + "create_namespace_request": "body", + }, + "collection_format_map": {}, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + callable=__create_namespace, + ) + + async def __delete_namespace(self, namespace, x_pinecone_api_version="2025-10", **kwargs): """Delete a namespace # noqa: E501 - Delete a namespace from an index. # noqa: E501 + Delete a namespace from a serverless index. Deleting a namespace is irreversible; all data in the namespace is permanently deleted. For guidance and examples, see [Manage namespaces](https://docs.pinecone.io/guides/manage-data/manage-namespaces). **Note:** This operation is not supported for pod-based indexes. # noqa: E501 Args: - namespace (str): The namespace to delete + namespace (str): The namespace to delete. + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -287,6 +478,7 @@ async def __delete_namespace(self, namespace, **kwargs): {str: (bool, dict, float, int, list, str, none_type)} """ self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["namespace"] = namespace return await self.call_with_http_info(**kwargs) @@ -300,8 +492,8 @@ async def __delete_namespace(self, namespace, **kwargs): "servers": None, }, params_map={ - "all": ["namespace"], - "required": ["namespace"], + "all": ["x_pinecone_api_version", "namespace"], + "required": ["x_pinecone_api_version", "namespace"], "nullable": [], "enum": [], "validation": [], @@ -309,9 +501,12 @@ async def __delete_namespace(self, namespace, **kwargs): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"namespace": (str,)}, - "attribute_map": {"namespace": "namespace"}, - "location_map": {"namespace": "path"}, + "openapi_types": {"x_pinecone_api_version": (str,), "namespace": (str,)}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "namespace": "namespace", + }, + "location_map": {"x_pinecone_api_version": "header", "namespace": "path"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": []}, @@ -319,14 +514,15 @@ async def __delete_namespace(self, namespace, **kwargs): callable=__delete_namespace, ) - async def __describe_namespace(self, namespace, **kwargs): + async def __describe_namespace(self, namespace, x_pinecone_api_version="2025-10", **kwargs): """Describe a namespace # noqa: E501 - Describe a [namespace](https://docs.pinecone.io/guides/index-data/indexing-overview#namespaces) in a serverless index, including the total number of vectors in the namespace. # noqa: E501 + Describe a namespace in a serverless index, including the total number of vectors in the namespace. For guidance and examples, see [Manage namespaces](https://docs.pinecone.io/guides/manage-data/manage-namespaces). **Note:** This operation is not supported for pod-based indexes. # noqa: E501 Args: - namespace (str): The namespace to describe + namespace (str): The namespace to describe. + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -349,6 +545,7 @@ async def __describe_namespace(self, namespace, **kwargs): NamespaceDescription """ self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["namespace"] = namespace return await self.call_with_http_info(**kwargs) @@ -362,8 +559,8 @@ async def __describe_namespace(self, namespace, **kwargs): "servers": None, }, params_map={ - "all": ["namespace"], - "required": ["namespace"], + "all": ["x_pinecone_api_version", "namespace"], + "required": ["x_pinecone_api_version", "namespace"], "nullable": [], "enum": [], "validation": [], @@ -371,9 +568,12 @@ async def __describe_namespace(self, namespace, **kwargs): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"namespace": (str,)}, - "attribute_map": {"namespace": "namespace"}, - "location_map": {"namespace": "path"}, + "openapi_types": {"x_pinecone_api_version": (str,), "namespace": (str,)}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "namespace": "namespace", + }, + "location_map": {"x_pinecone_api_version": "header", "namespace": "path"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": []}, @@ -381,16 +581,19 @@ async def __describe_namespace(self, namespace, **kwargs): callable=__describe_namespace, ) - async def __list_namespaces_operation(self, **kwargs): + async def __list_namespaces_operation(self, x_pinecone_api_version="2025-10", **kwargs): """List namespaces # noqa: E501 - Get a list of all [namespaces](https://docs.pinecone.io/guides/index-data/indexing-overview#namespaces) in a serverless index. Up to 100 namespaces are returned at a time by default, in sorted order (bitwise “C” collation). If the `limit` parameter is set, up to that number of namespaces are returned instead. Whenever there are additional namespaces to return, the response also includes a `pagination_token` that you can use to get the next batch of namespaces. When the response does not include a `pagination_token`, there are no more namespaces to return. # noqa: E501 + List all namespaces in a serverless index. Up to 100 namespaces are returned at a time by default, in sorted order (bitwise “C” collation). If the `limit` parameter is set, up to that number of namespaces are returned instead. Whenever there are additional namespaces to return, the response also includes a `pagination_token` that you can use to get the next batch of namespaces. When the response does not include a `pagination_token`, there are no more namespaces to return. For guidance and examples, see [Manage namespaces](https://docs.pinecone.io/guides/manage-data/manage-namespaces). **Note:** This operation is not supported for pod-based indexes. # noqa: E501 + Args: + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: limit (int): Max number namespaces to return per page. [optional] pagination_token (str): Pagination token to continue a previous listing operation. [optional] + prefix (str): Prefix of the namespaces to list. Acts as a filter to return only namespaces that start with this prefix. [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 @@ -411,6 +614,7 @@ async def __list_namespaces_operation(self, **kwargs): ListNamespacesResponse """ self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version return await self.call_with_http_info(**kwargs) self.list_namespaces_operation = _AsyncioEndpoint( @@ -423,8 +627,8 @@ async def __list_namespaces_operation(self, **kwargs): "servers": None, }, params_map={ - "all": ["limit", "pagination_token"], - "required": [], + "all": ["x_pinecone_api_version", "limit", "pagination_token", "prefix"], + "required": ["x_pinecone_api_version"], "nullable": [], "enum": [], "validation": [], @@ -432,9 +636,24 @@ async def __list_namespaces_operation(self, **kwargs): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"limit": (int,), "pagination_token": (str,)}, - "attribute_map": {"limit": "limit", "pagination_token": "paginationToken"}, - "location_map": {"limit": "query", "pagination_token": "query"}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "limit": (int,), + "pagination_token": (str,), + "prefix": (str,), + }, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "limit": "limit", + "pagination_token": "paginationToken", + "prefix": "prefix", + }, + "location_map": { + "x_pinecone_api_version": "header", + "limit": "query", + "pagination_token": "query", + "prefix": "query", + }, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": []}, 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 7802de53..5f0c5641 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-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ @@ -27,6 +27,8 @@ from pinecone.core.openapi.db_data.model.describe_index_stats_request import ( DescribeIndexStatsRequest, ) +from pinecone.core.openapi.db_data.model.fetch_by_metadata_request import FetchByMetadataRequest +from pinecone.core.openapi.db_data.model.fetch_by_metadata_response import FetchByMetadataResponse from pinecone.core.openapi.db_data.model.fetch_response import FetchResponse from pinecone.core.openapi.db_data.model.index_description import IndexDescription from pinecone.core.openapi.db_data.model.list_response import ListResponse @@ -36,6 +38,7 @@ from pinecone.core.openapi.db_data.model.search_records_request import SearchRecordsRequest from pinecone.core.openapi.db_data.model.search_records_response import SearchRecordsResponse from pinecone.core.openapi.db_data.model.update_request import UpdateRequest +from pinecone.core.openapi.db_data.model.update_response import UpdateResponse from pinecone.core.openapi.db_data.model.upsert_record import UpsertRecord from pinecone.core.openapi.db_data.model.upsert_request import UpsertRequest from pinecone.core.openapi.db_data.model.upsert_response import UpsertResponse @@ -52,18 +55,24 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient() self.api_client = api_client - def __delete_vectors(self, delete_request, **kwargs: ExtraOpenApiKwargsTypedDict): + def __delete_vectors( + self, + delete_request, + x_pinecone_api_version="2025-10", + **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/manage-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 - >>> thread = api.delete_vectors(delete_request, async_req=True) + >>> thread = api.delete_vectors(delete_request, x_pinecone_api_version="2025-10", async_req=True) >>> result = thread.get() Args: delete_request (DeleteRequest): + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -89,6 +98,7 @@ def __delete_vectors(self, delete_request, **kwargs: ExtraOpenApiKwargsTypedDict thread. """ kwargs = self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["delete_request"] = delete_request return self.call_with_http_info(**kwargs) @@ -102,8 +112,8 @@ def __delete_vectors(self, delete_request, **kwargs: ExtraOpenApiKwargsTypedDict "servers": None, }, params_map={ - "all": ["delete_request"], - "required": ["delete_request"], + "all": ["x_pinecone_api_version", "delete_request"], + "required": ["x_pinecone_api_version", "delete_request"], "nullable": [], "enum": [], "validation": [], @@ -111,9 +121,12 @@ def __delete_vectors(self, delete_request, **kwargs: ExtraOpenApiKwargsTypedDict root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"delete_request": (DeleteRequest,)}, - "attribute_map": {}, - "location_map": {"delete_request": "body"}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "delete_request": (DeleteRequest,), + }, + "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, + "location_map": {"x_pinecone_api_version": "header", "delete_request": "body"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, @@ -122,7 +135,10 @@ def __delete_vectors(self, delete_request, **kwargs: ExtraOpenApiKwargsTypedDict ) def __describe_index_stats( - self, describe_index_stats_request, **kwargs: ExtraOpenApiKwargsTypedDict + self, + describe_index_stats_request, + x_pinecone_api_version="2025-10", + **kwargs: ExtraOpenApiKwargsTypedDict, ): """Get index stats # noqa: E501 @@ -130,11 +146,12 @@ def __describe_index_stats( This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.describe_index_stats(describe_index_stats_request, async_req=True) + >>> thread = api.describe_index_stats(describe_index_stats_request, x_pinecone_api_version="2025-10", async_req=True) >>> result = thread.get() Args: describe_index_stats_request (DescribeIndexStatsRequest): + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -160,6 +177,7 @@ def __describe_index_stats( thread. """ kwargs = self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["describe_index_stats_request"] = describe_index_stats_request return self.call_with_http_info(**kwargs) @@ -173,8 +191,8 @@ def __describe_index_stats( "servers": None, }, params_map={ - "all": ["describe_index_stats_request"], - "required": ["describe_index_stats_request"], + "all": ["x_pinecone_api_version", "describe_index_stats_request"], + "required": ["x_pinecone_api_version", "describe_index_stats_request"], "nullable": [], "enum": [], "validation": [], @@ -182,9 +200,15 @@ def __describe_index_stats( root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"describe_index_stats_request": (DescribeIndexStatsRequest,)}, - "attribute_map": {}, - "location_map": {"describe_index_stats_request": "body"}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "describe_index_stats_request": (DescribeIndexStatsRequest,), + }, + "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, + "location_map": { + "x_pinecone_api_version": "header", + "describe_index_stats_request": "body", + }, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, @@ -192,21 +216,106 @@ def __describe_index_stats( callable=__describe_index_stats, ) - def __fetch_vectors(self, ids, **kwargs: ExtraOpenApiKwargsTypedDict): + def __fetch_by_metadata( + self, + fetch_by_metadata_request, + x_pinecone_api_version="2025-10", + **kwargs: ExtraOpenApiKwargsTypedDict, + ): + """Fetch vectors by metadata # noqa: E501 + + Look up and return vectors by metadata filter 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/manage-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 + + >>> thread = api.fetch_by_metadata(fetch_by_metadata_request, x_pinecone_api_version="2025-10", async_req=True) + >>> result = thread.get() + + Args: + fetch_by_metadata_request (FetchByMetadataRequest): + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] + + 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: + FetchByMetadataResponse + If the method is called asynchronously, returns the request + thread. + """ + kwargs = self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["fetch_by_metadata_request"] = fetch_by_metadata_request + return self.call_with_http_info(**kwargs) + + self.fetch_by_metadata = _Endpoint( + settings={ + "response_type": (FetchByMetadataResponse,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/vectors/fetch_by_metadata", + "operation_id": "fetch_by_metadata", + "http_method": "POST", + "servers": None, + }, + params_map={ + "all": ["x_pinecone_api_version", "fetch_by_metadata_request"], + "required": ["x_pinecone_api_version", "fetch_by_metadata_request"], + "nullable": [], + "enum": [], + "validation": [], + }, + root_map={ + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "fetch_by_metadata_request": (FetchByMetadataRequest,), + }, + "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, + "location_map": { + "x_pinecone_api_version": "header", + "fetch_by_metadata_request": "body", + }, + "collection_format_map": {}, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + callable=__fetch_by_metadata, + ) + + def __fetch_vectors( + self, ids, x_pinecone_api_version="2025-10", **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/manage-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 - >>> thread = api.fetch_vectors(ids, async_req=True) + >>> thread = api.fetch_vectors(ids, x_pinecone_api_version="2025-10", async_req=True) >>> result = thread.get() Args: ids ([str]): The vector IDs to fetch. Does not accept values containing spaces. + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: - namespace (str): [optional] + namespace (str): The namespace to fetch vectors from. If not provided, the default namespace is used. [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 @@ -230,6 +339,7 @@ def __fetch_vectors(self, ids, **kwargs: ExtraOpenApiKwargsTypedDict): thread. """ kwargs = self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["ids"] = ids return self.call_with_http_info(**kwargs) @@ -243,8 +353,8 @@ def __fetch_vectors(self, ids, **kwargs: ExtraOpenApiKwargsTypedDict): "servers": None, }, params_map={ - "all": ["ids", "namespace"], - "required": ["ids"], + "all": ["x_pinecone_api_version", "ids", "namespace"], + "required": ["x_pinecone_api_version", "ids"], "nullable": [], "enum": [], "validation": [], @@ -252,9 +362,21 @@ def __fetch_vectors(self, ids, **kwargs: ExtraOpenApiKwargsTypedDict): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"ids": ([str],), "namespace": (str,)}, - "attribute_map": {"ids": "ids", "namespace": "namespace"}, - "location_map": {"ids": "query", "namespace": "query"}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "ids": ([str],), + "namespace": (str,), + }, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "ids": "ids", + "namespace": "namespace", + }, + "location_map": { + "x_pinecone_api_version": "header", + "ids": "query", + "namespace": "query", + }, "collection_format_map": {"ids": "multi"}, }, headers_map={"accept": ["application/json"], "content_type": []}, @@ -262,22 +384,26 @@ def __fetch_vectors(self, ids, **kwargs: ExtraOpenApiKwargsTypedDict): callable=__fetch_vectors, ) - def __list_vectors(self, **kwargs: ExtraOpenApiKwargsTypedDict): + def __list_vectors( + self, x_pinecone_api_version="2025-10", **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. 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/manage-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 - >>> thread = api.list_vectors(async_req=True) + >>> thread = api.list_vectors(x_pinecone_api_version="2025-10", async_req=True) >>> result = thread.get() + Args: + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: prefix (str): The vector IDs to fetch. Does not accept values containing spaces. [optional] - limit (int): Max number of IDs to return per page. [optional] + limit (int): Max number of IDs to return per page. [optional] if omitted the server will use the default value of 100. pagination_token (str): Pagination token to continue a previous listing operation. [optional] - namespace (str): [optional] + namespace (str): The namespace to list vectors from. If not provided, the default namespace is used. [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 @@ -301,6 +427,7 @@ def __list_vectors(self, **kwargs: ExtraOpenApiKwargsTypedDict): thread. """ kwargs = self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version return self.call_with_http_info(**kwargs) self.list_vectors = _Endpoint( @@ -313,8 +440,14 @@ def __list_vectors(self, **kwargs: ExtraOpenApiKwargsTypedDict): "servers": None, }, params_map={ - "all": ["prefix", "limit", "pagination_token", "namespace"], - "required": [], + "all": [ + "x_pinecone_api_version", + "prefix", + "limit", + "pagination_token", + "namespace", + ], + "required": ["x_pinecone_api_version"], "nullable": [], "enum": [], "validation": [], @@ -323,18 +456,21 @@ def __list_vectors(self, **kwargs: ExtraOpenApiKwargsTypedDict): "validations": {}, "allowed_values": {}, "openapi_types": { + "x_pinecone_api_version": (str,), "prefix": (str,), "limit": (int,), "pagination_token": (str,), "namespace": (str,), }, "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", "prefix": "prefix", "limit": "limit", "pagination_token": "paginationToken", "namespace": "namespace", }, "location_map": { + "x_pinecone_api_version": "header", "prefix": "query", "limit": "query", "pagination_token": "query", @@ -347,18 +483,24 @@ def __list_vectors(self, **kwargs: ExtraOpenApiKwargsTypedDict): callable=__list_vectors, ) - def __query_vectors(self, query_request, **kwargs: ExtraOpenApiKwargsTypedDict): + def __query_vectors( + self, + query_request, + x_pinecone_api_version="2025-10", + **kwargs: ExtraOpenApiKwargsTypedDict, + ): """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, examples, and limits, see [Search](https://docs.pinecone.io/guides/search/search-overview). # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.query_vectors(query_request, async_req=True) + >>> thread = api.query_vectors(query_request, x_pinecone_api_version="2025-10", async_req=True) >>> result = thread.get() Args: query_request (QueryRequest): + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -384,6 +526,7 @@ def __query_vectors(self, query_request, **kwargs: ExtraOpenApiKwargsTypedDict): thread. """ kwargs = self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["query_request"] = query_request return self.call_with_http_info(**kwargs) @@ -397,8 +540,8 @@ def __query_vectors(self, query_request, **kwargs: ExtraOpenApiKwargsTypedDict): "servers": None, }, params_map={ - "all": ["query_request"], - "required": ["query_request"], + "all": ["x_pinecone_api_version", "query_request"], + "required": ["x_pinecone_api_version", "query_request"], "nullable": [], "enum": [], "validation": [], @@ -406,9 +549,12 @@ def __query_vectors(self, query_request, **kwargs: ExtraOpenApiKwargsTypedDict): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"query_request": (QueryRequest,)}, - "attribute_map": {}, - "location_map": {"query_request": "body"}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "query_request": (QueryRequest,), + }, + "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, + "location_map": {"x_pinecone_api_version": "header", "query_request": "body"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, @@ -417,20 +563,25 @@ def __query_vectors(self, query_request, **kwargs: ExtraOpenApiKwargsTypedDict): ) def __search_records_namespace( - self, namespace, search_records_request, **kwargs: ExtraOpenApiKwargsTypedDict + self, + namespace, + search_records_request, + x_pinecone_api_version="2025-10", + **kwargs: ExtraOpenApiKwargsTypedDict, ): """Search with text # 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, examples, and limits, see [Search](https://docs.pinecone.io/guides/search/search-overview). # 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/index-data/indexing-overview#vector-embedding). Searching with a query vector or record ID is supported for all indexes. For guidance and examples, see [Search](https://docs.pinecone.io/guides/search/search-overview). # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.search_records_namespace(namespace, search_records_request, async_req=True) + >>> thread = api.search_records_namespace(namespace, search_records_request, x_pinecone_api_version="2025-10", async_req=True) >>> result = thread.get() Args: namespace (str): The namespace to search. search_records_request (SearchRecordsRequest): + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -456,6 +607,7 @@ def __search_records_namespace( thread. """ kwargs = self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["namespace"] = namespace kwargs["search_records_request"] = search_records_request return self.call_with_http_info(**kwargs) @@ -470,8 +622,8 @@ def __search_records_namespace( "servers": None, }, params_map={ - "all": ["namespace", "search_records_request"], - "required": ["namespace", "search_records_request"], + "all": ["x_pinecone_api_version", "namespace", "search_records_request"], + "required": ["x_pinecone_api_version", "namespace", "search_records_request"], "nullable": [], "enum": [], "validation": [], @@ -480,11 +632,19 @@ def __search_records_namespace( "validations": {}, "allowed_values": {}, "openapi_types": { + "x_pinecone_api_version": (str,), "namespace": (str,), "search_records_request": (SearchRecordsRequest,), }, - "attribute_map": {"namespace": "namespace"}, - "location_map": {"namespace": "path", "search_records_request": "body"}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "namespace": "namespace", + }, + "location_map": { + "x_pinecone_api_version": "header", + "namespace": "path", + "search_records_request": "body", + }, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, @@ -492,18 +652,24 @@ def __search_records_namespace( callable=__search_records_namespace, ) - def __update_vector(self, update_request, **kwargs: ExtraOpenApiKwargsTypedDict): + def __update_vector( + self, + update_request, + x_pinecone_api_version="2025-10", + **kwargs: ExtraOpenApiKwargsTypedDict, + ): """Update a vector # noqa: E501 Update a vector in a namespace. If a value is included, it will overwrite the previous value. If a `set_metadata` is included, the values of the fields specified in it will be added or overwrite the previous value. For guidance and examples, see [Update data](https://docs.pinecone.io/guides/manage-data/update-data). # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_vector(update_request, async_req=True) + >>> thread = api.update_vector(update_request, x_pinecone_api_version="2025-10", async_req=True) >>> result = thread.get() Args: update_request (UpdateRequest): + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -524,17 +690,18 @@ def __update_vector(self, update_request, **kwargs: ExtraOpenApiKwargsTypedDict) async_req (bool): execute request asynchronously Returns: - {str: (bool, dict, float, int, list, str, none_type)} + UpdateResponse If the method is called asynchronously, returns the request thread. """ kwargs = self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["update_request"] = update_request return self.call_with_http_info(**kwargs) self.update_vector = _Endpoint( settings={ - "response_type": ({str: (bool, dict, float, int, list, str, none_type)},), + "response_type": (UpdateResponse,), "auth": ["ApiKeyAuth"], "endpoint_path": "/vectors/update", "operation_id": "update_vector", @@ -542,8 +709,8 @@ def __update_vector(self, update_request, **kwargs: ExtraOpenApiKwargsTypedDict) "servers": None, }, params_map={ - "all": ["update_request"], - "required": ["update_request"], + "all": ["x_pinecone_api_version", "update_request"], + "required": ["x_pinecone_api_version", "update_request"], "nullable": [], "enum": [], "validation": [], @@ -551,9 +718,12 @@ def __update_vector(self, update_request, **kwargs: ExtraOpenApiKwargsTypedDict) root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"update_request": (UpdateRequest,)}, - "attribute_map": {}, - "location_map": {"update_request": "body"}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "update_request": (UpdateRequest,), + }, + "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, + "location_map": {"x_pinecone_api_version": "header", "update_request": "body"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, @@ -562,7 +732,11 @@ def __update_vector(self, update_request, **kwargs: ExtraOpenApiKwargsTypedDict) ) def __upsert_records_namespace( - self, namespace, upsert_record, **kwargs: ExtraOpenApiKwargsTypedDict + self, + namespace, + upsert_record, + x_pinecone_api_version="2025-10", + **kwargs: ExtraOpenApiKwargsTypedDict, ): """Upsert text # noqa: E501 @@ -570,12 +744,13 @@ def __upsert_records_namespace( This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.upsert_records_namespace(namespace, upsert_record, async_req=True) + >>> thread = api.upsert_records_namespace(namespace, upsert_record, x_pinecone_api_version="2025-10", async_req=True) >>> result = thread.get() Args: namespace (str): The namespace to upsert records into. upsert_record ([UpsertRecord]): + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -601,6 +776,7 @@ def __upsert_records_namespace( thread. """ kwargs = self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["namespace"] = namespace kwargs["upsert_record"] = upsert_record return self.call_with_http_info(**kwargs) @@ -615,8 +791,8 @@ def __upsert_records_namespace( "servers": None, }, params_map={ - "all": ["namespace", "upsert_record"], - "required": ["namespace", "upsert_record"], + "all": ["x_pinecone_api_version", "namespace", "upsert_record"], + "required": ["x_pinecone_api_version", "namespace", "upsert_record"], "nullable": [], "enum": [], "validation": [], @@ -624,9 +800,20 @@ def __upsert_records_namespace( root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"namespace": (str,), "upsert_record": ([UpsertRecord],)}, - "attribute_map": {"namespace": "namespace"}, - "location_map": {"namespace": "path", "upsert_record": "body"}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "namespace": (str,), + "upsert_record": ([UpsertRecord],), + }, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "namespace": "namespace", + }, + "location_map": { + "x_pinecone_api_version": "header", + "namespace": "path", + "upsert_record": "body", + }, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": ["application/x-ndjson"]}, @@ -634,18 +821,24 @@ def __upsert_records_namespace( callable=__upsert_records_namespace, ) - def __upsert_vectors(self, upsert_request, **kwargs: ExtraOpenApiKwargsTypedDict): + def __upsert_vectors( + self, + upsert_request, + x_pinecone_api_version="2025-10", + **kwargs: ExtraOpenApiKwargsTypedDict, + ): """Upsert vectors # 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, examples, and limits, see [Upsert data](https://docs.pinecone.io/guides/index-data/upsert-data). # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.upsert_vectors(upsert_request, async_req=True) + >>> thread = api.upsert_vectors(upsert_request, x_pinecone_api_version="2025-10", async_req=True) >>> result = thread.get() Args: upsert_request (UpsertRequest): + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -671,6 +864,7 @@ def __upsert_vectors(self, upsert_request, **kwargs: ExtraOpenApiKwargsTypedDict thread. """ kwargs = self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["upsert_request"] = upsert_request return self.call_with_http_info(**kwargs) @@ -684,8 +878,8 @@ def __upsert_vectors(self, upsert_request, **kwargs: ExtraOpenApiKwargsTypedDict "servers": None, }, params_map={ - "all": ["upsert_request"], - "required": ["upsert_request"], + "all": ["x_pinecone_api_version", "upsert_request"], + "required": ["x_pinecone_api_version", "upsert_request"], "nullable": [], "enum": [], "validation": [], @@ -693,9 +887,12 @@ def __upsert_vectors(self, upsert_request, **kwargs: ExtraOpenApiKwargsTypedDict root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"upsert_request": (UpsertRequest,)}, - "attribute_map": {}, - "location_map": {"upsert_request": "body"}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "upsert_request": (UpsertRequest,), + }, + "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, + "location_map": {"x_pinecone_api_version": "header", "upsert_request": "body"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, @@ -715,7 +912,9 @@ def __init__(self, api_client=None) -> None: api_client = AsyncioApiClient() self.api_client = api_client - async def __delete_vectors(self, delete_request, **kwargs): + async def __delete_vectors( + self, delete_request, x_pinecone_api_version="2025-10", **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/manage-data/delete-data). # noqa: E501 @@ -723,6 +922,7 @@ async def __delete_vectors(self, delete_request, **kwargs): Args: delete_request (DeleteRequest): + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -745,6 +945,7 @@ async def __delete_vectors(self, delete_request, **kwargs): {str: (bool, dict, float, int, list, str, none_type)} """ self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["delete_request"] = delete_request return await self.call_with_http_info(**kwargs) @@ -758,8 +959,8 @@ async def __delete_vectors(self, delete_request, **kwargs): "servers": None, }, params_map={ - "all": ["delete_request"], - "required": ["delete_request"], + "all": ["x_pinecone_api_version", "delete_request"], + "required": ["x_pinecone_api_version", "delete_request"], "nullable": [], "enum": [], "validation": [], @@ -767,9 +968,12 @@ async def __delete_vectors(self, delete_request, **kwargs): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"delete_request": (DeleteRequest,)}, - "attribute_map": {}, - "location_map": {"delete_request": "body"}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "delete_request": (DeleteRequest,), + }, + "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, + "location_map": {"x_pinecone_api_version": "header", "delete_request": "body"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, @@ -777,7 +981,9 @@ async def __delete_vectors(self, delete_request, **kwargs): callable=__delete_vectors, ) - async def __describe_index_stats(self, describe_index_stats_request, **kwargs): + async def __describe_index_stats( + self, describe_index_stats_request, x_pinecone_api_version="2025-10", **kwargs + ): """Get index stats # noqa: E501 Return statistics about the contents of an index, including the vector count per namespace, the number of dimensions, and the index fullness. Serverless indexes scale automatically as needed, so index fullness is relevant only for pod-based indexes. # noqa: E501 @@ -785,6 +991,7 @@ async def __describe_index_stats(self, describe_index_stats_request, **kwargs): Args: describe_index_stats_request (DescribeIndexStatsRequest): + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -807,6 +1014,7 @@ async def __describe_index_stats(self, describe_index_stats_request, **kwargs): IndexDescription """ self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["describe_index_stats_request"] = describe_index_stats_request return await self.call_with_http_info(**kwargs) @@ -820,8 +1028,8 @@ async def __describe_index_stats(self, describe_index_stats_request, **kwargs): "servers": None, }, params_map={ - "all": ["describe_index_stats_request"], - "required": ["describe_index_stats_request"], + "all": ["x_pinecone_api_version", "describe_index_stats_request"], + "required": ["x_pinecone_api_version", "describe_index_stats_request"], "nullable": [], "enum": [], "validation": [], @@ -829,9 +1037,15 @@ async def __describe_index_stats(self, describe_index_stats_request, **kwargs): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"describe_index_stats_request": (DescribeIndexStatsRequest,)}, - "attribute_map": {}, - "location_map": {"describe_index_stats_request": "body"}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "describe_index_stats_request": (DescribeIndexStatsRequest,), + }, + "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, + "location_map": { + "x_pinecone_api_version": "header", + "describe_index_stats_request": "body", + }, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, @@ -839,7 +1053,79 @@ async def __describe_index_stats(self, describe_index_stats_request, **kwargs): callable=__describe_index_stats, ) - async def __fetch_vectors(self, ids, **kwargs): + async def __fetch_by_metadata( + self, fetch_by_metadata_request, x_pinecone_api_version="2025-10", **kwargs + ): + """Fetch vectors by metadata # noqa: E501 + + Look up and return vectors by metadata filter 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/manage-data/fetch-data). # noqa: E501 + + + Args: + fetch_by_metadata_request (FetchByMetadataRequest): + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] + + 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: + FetchByMetadataResponse + """ + self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["fetch_by_metadata_request"] = fetch_by_metadata_request + return await self.call_with_http_info(**kwargs) + + self.fetch_by_metadata = _AsyncioEndpoint( + settings={ + "response_type": (FetchByMetadataResponse,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/vectors/fetch_by_metadata", + "operation_id": "fetch_by_metadata", + "http_method": "POST", + "servers": None, + }, + params_map={ + "all": ["x_pinecone_api_version", "fetch_by_metadata_request"], + "required": ["x_pinecone_api_version", "fetch_by_metadata_request"], + "nullable": [], + "enum": [], + "validation": [], + }, + root_map={ + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "fetch_by_metadata_request": (FetchByMetadataRequest,), + }, + "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, + "location_map": { + "x_pinecone_api_version": "header", + "fetch_by_metadata_request": "body", + }, + "collection_format_map": {}, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + callable=__fetch_by_metadata, + ) + + async def __fetch_vectors(self, ids, x_pinecone_api_version="2025-10", **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/manage-data/fetch-data). # noqa: E501 @@ -847,9 +1133,10 @@ async def __fetch_vectors(self, ids, **kwargs): Args: ids ([str]): The vector IDs to fetch. Does not accept values containing spaces. + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: - namespace (str): [optional] + namespace (str): The namespace to fetch vectors from. If not provided, the default namespace is used. [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 @@ -870,6 +1157,7 @@ async def __fetch_vectors(self, ids, **kwargs): FetchResponse """ self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["ids"] = ids return await self.call_with_http_info(**kwargs) @@ -883,8 +1171,8 @@ async def __fetch_vectors(self, ids, **kwargs): "servers": None, }, params_map={ - "all": ["ids", "namespace"], - "required": ["ids"], + "all": ["x_pinecone_api_version", "ids", "namespace"], + "required": ["x_pinecone_api_version", "ids"], "nullable": [], "enum": [], "validation": [], @@ -892,9 +1180,21 @@ async def __fetch_vectors(self, ids, **kwargs): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"ids": ([str],), "namespace": (str,)}, - "attribute_map": {"ids": "ids", "namespace": "namespace"}, - "location_map": {"ids": "query", "namespace": "query"}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "ids": ([str],), + "namespace": (str,), + }, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "ids": "ids", + "namespace": "namespace", + }, + "location_map": { + "x_pinecone_api_version": "header", + "ids": "query", + "namespace": "query", + }, "collection_format_map": {"ids": "multi"}, }, headers_map={"accept": ["application/json"], "content_type": []}, @@ -902,18 +1202,20 @@ async def __fetch_vectors(self, ids, **kwargs): callable=__fetch_vectors, ) - async def __list_vectors(self, **kwargs): + async def __list_vectors(self, x_pinecone_api_version="2025-10", **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. 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/manage-data/list-record-ids). **Note:** `list` is supported only for serverless indexes. # noqa: E501 + Args: + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: prefix (str): The vector IDs to fetch. Does not accept values containing spaces. [optional] - limit (int): Max number of IDs to return per page. [optional] + limit (int): Max number of IDs to return per page. [optional] if omitted the server will use the default value of 100. pagination_token (str): Pagination token to continue a previous listing operation. [optional] - namespace (str): [optional] + namespace (str): The namespace to list vectors from. If not provided, the default namespace is used. [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 @@ -934,6 +1236,7 @@ async def __list_vectors(self, **kwargs): ListResponse """ self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version return await self.call_with_http_info(**kwargs) self.list_vectors = _AsyncioEndpoint( @@ -946,8 +1249,14 @@ async def __list_vectors(self, **kwargs): "servers": None, }, params_map={ - "all": ["prefix", "limit", "pagination_token", "namespace"], - "required": [], + "all": [ + "x_pinecone_api_version", + "prefix", + "limit", + "pagination_token", + "namespace", + ], + "required": ["x_pinecone_api_version"], "nullable": [], "enum": [], "validation": [], @@ -956,18 +1265,21 @@ async def __list_vectors(self, **kwargs): "validations": {}, "allowed_values": {}, "openapi_types": { + "x_pinecone_api_version": (str,), "prefix": (str,), "limit": (int,), "pagination_token": (str,), "namespace": (str,), }, "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", "prefix": "prefix", "limit": "limit", "pagination_token": "paginationToken", "namespace": "namespace", }, "location_map": { + "x_pinecone_api_version": "header", "prefix": "query", "limit": "query", "pagination_token": "query", @@ -980,7 +1292,7 @@ async def __list_vectors(self, **kwargs): callable=__list_vectors, ) - async def __query_vectors(self, query_request, **kwargs): + async def __query_vectors(self, query_request, x_pinecone_api_version="2025-10", **kwargs): """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, examples, and limits, see [Search](https://docs.pinecone.io/guides/search/search-overview). # noqa: E501 @@ -988,6 +1300,7 @@ async def __query_vectors(self, query_request, **kwargs): Args: query_request (QueryRequest): + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -1010,6 +1323,7 @@ async def __query_vectors(self, query_request, **kwargs): QueryResponse """ self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["query_request"] = query_request return await self.call_with_http_info(**kwargs) @@ -1023,8 +1337,8 @@ async def __query_vectors(self, query_request, **kwargs): "servers": None, }, params_map={ - "all": ["query_request"], - "required": ["query_request"], + "all": ["x_pinecone_api_version", "query_request"], + "required": ["x_pinecone_api_version", "query_request"], "nullable": [], "enum": [], "validation": [], @@ -1032,9 +1346,12 @@ async def __query_vectors(self, query_request, **kwargs): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"query_request": (QueryRequest,)}, - "attribute_map": {}, - "location_map": {"query_request": "body"}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "query_request": (QueryRequest,), + }, + "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, + "location_map": {"x_pinecone_api_version": "header", "query_request": "body"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, @@ -1042,15 +1359,18 @@ async def __query_vectors(self, query_request, **kwargs): callable=__query_vectors, ) - async def __search_records_namespace(self, namespace, search_records_request, **kwargs): + async def __search_records_namespace( + self, namespace, search_records_request, x_pinecone_api_version="2025-10", **kwargs + ): """Search with text # 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, examples, and limits, see [Search](https://docs.pinecone.io/guides/search/search-overview). # 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/index-data/indexing-overview#vector-embedding). Searching with a query vector or record ID is supported for all indexes. For guidance and examples, see [Search](https://docs.pinecone.io/guides/search/search-overview). # noqa: E501 Args: namespace (str): The namespace to search. search_records_request (SearchRecordsRequest): + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -1073,6 +1393,7 @@ async def __search_records_namespace(self, namespace, search_records_request, ** SearchRecordsResponse """ self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["namespace"] = namespace kwargs["search_records_request"] = search_records_request return await self.call_with_http_info(**kwargs) @@ -1087,8 +1408,8 @@ async def __search_records_namespace(self, namespace, search_records_request, ** "servers": None, }, params_map={ - "all": ["namespace", "search_records_request"], - "required": ["namespace", "search_records_request"], + "all": ["x_pinecone_api_version", "namespace", "search_records_request"], + "required": ["x_pinecone_api_version", "namespace", "search_records_request"], "nullable": [], "enum": [], "validation": [], @@ -1097,11 +1418,19 @@ async def __search_records_namespace(self, namespace, search_records_request, ** "validations": {}, "allowed_values": {}, "openapi_types": { + "x_pinecone_api_version": (str,), "namespace": (str,), "search_records_request": (SearchRecordsRequest,), }, - "attribute_map": {"namespace": "namespace"}, - "location_map": {"namespace": "path", "search_records_request": "body"}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "namespace": "namespace", + }, + "location_map": { + "x_pinecone_api_version": "header", + "namespace": "path", + "search_records_request": "body", + }, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, @@ -1109,7 +1438,7 @@ async def __search_records_namespace(self, namespace, search_records_request, ** callable=__search_records_namespace, ) - async def __update_vector(self, update_request, **kwargs): + async def __update_vector(self, update_request, x_pinecone_api_version="2025-10", **kwargs): """Update a vector # noqa: E501 Update a vector in a namespace. If a value is included, it will overwrite the previous value. If a `set_metadata` is included, the values of the fields specified in it will be added or overwrite the previous value. For guidance and examples, see [Update data](https://docs.pinecone.io/guides/manage-data/update-data). # noqa: E501 @@ -1117,6 +1446,7 @@ async def __update_vector(self, update_request, **kwargs): Args: update_request (UpdateRequest): + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -1136,15 +1466,16 @@ async def __update_vector(self, update_request, **kwargs): Default is True. Returns: - {str: (bool, dict, float, int, list, str, none_type)} + UpdateResponse """ self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["update_request"] = update_request return await self.call_with_http_info(**kwargs) self.update_vector = _AsyncioEndpoint( settings={ - "response_type": ({str: (bool, dict, float, int, list, str, none_type)},), + "response_type": (UpdateResponse,), "auth": ["ApiKeyAuth"], "endpoint_path": "/vectors/update", "operation_id": "update_vector", @@ -1152,8 +1483,8 @@ async def __update_vector(self, update_request, **kwargs): "servers": None, }, params_map={ - "all": ["update_request"], - "required": ["update_request"], + "all": ["x_pinecone_api_version", "update_request"], + "required": ["x_pinecone_api_version", "update_request"], "nullable": [], "enum": [], "validation": [], @@ -1161,9 +1492,12 @@ async def __update_vector(self, update_request, **kwargs): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"update_request": (UpdateRequest,)}, - "attribute_map": {}, - "location_map": {"update_request": "body"}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "update_request": (UpdateRequest,), + }, + "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, + "location_map": {"x_pinecone_api_version": "header", "update_request": "body"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, @@ -1171,7 +1505,9 @@ async def __update_vector(self, update_request, **kwargs): callable=__update_vector, ) - async def __upsert_records_namespace(self, namespace, upsert_record, **kwargs): + async def __upsert_records_namespace( + self, namespace, upsert_record, x_pinecone_api_version="2025-10", **kwargs + ): """Upsert text # 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, examples, and limits, see [Upsert data](https://docs.pinecone.io/guides/index-data/upsert-data). # noqa: E501 @@ -1180,6 +1516,7 @@ async def __upsert_records_namespace(self, namespace, upsert_record, **kwargs): Args: namespace (str): The namespace to upsert records into. upsert_record ([UpsertRecord]): + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -1202,6 +1539,7 @@ async def __upsert_records_namespace(self, namespace, upsert_record, **kwargs): None """ self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["namespace"] = namespace kwargs["upsert_record"] = upsert_record return await self.call_with_http_info(**kwargs) @@ -1216,8 +1554,8 @@ async def __upsert_records_namespace(self, namespace, upsert_record, **kwargs): "servers": None, }, params_map={ - "all": ["namespace", "upsert_record"], - "required": ["namespace", "upsert_record"], + "all": ["x_pinecone_api_version", "namespace", "upsert_record"], + "required": ["x_pinecone_api_version", "namespace", "upsert_record"], "nullable": [], "enum": [], "validation": [], @@ -1225,9 +1563,20 @@ async def __upsert_records_namespace(self, namespace, upsert_record, **kwargs): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"namespace": (str,), "upsert_record": ([UpsertRecord],)}, - "attribute_map": {"namespace": "namespace"}, - "location_map": {"namespace": "path", "upsert_record": "body"}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "namespace": (str,), + "upsert_record": ([UpsertRecord],), + }, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "namespace": "namespace", + }, + "location_map": { + "x_pinecone_api_version": "header", + "namespace": "path", + "upsert_record": "body", + }, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": ["application/x-ndjson"]}, @@ -1235,7 +1584,9 @@ async def __upsert_records_namespace(self, namespace, upsert_record, **kwargs): callable=__upsert_records_namespace, ) - async def __upsert_vectors(self, upsert_request, **kwargs): + async def __upsert_vectors( + self, upsert_request, x_pinecone_api_version="2025-10", **kwargs + ): """Upsert vectors # 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, examples, and limits, see [Upsert data](https://docs.pinecone.io/guides/index-data/upsert-data). # noqa: E501 @@ -1243,6 +1594,7 @@ async def __upsert_vectors(self, upsert_request, **kwargs): Args: upsert_request (UpsertRequest): + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -1265,6 +1617,7 @@ async def __upsert_vectors(self, upsert_request, **kwargs): UpsertResponse """ self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["upsert_request"] = upsert_request return await self.call_with_http_info(**kwargs) @@ -1278,8 +1631,8 @@ async def __upsert_vectors(self, upsert_request, **kwargs): "servers": None, }, params_map={ - "all": ["upsert_request"], - "required": ["upsert_request"], + "all": ["x_pinecone_api_version", "upsert_request"], + "required": ["x_pinecone_api_version", "upsert_request"], "nullable": [], "enum": [], "validation": [], @@ -1287,9 +1640,12 @@ async def __upsert_vectors(self, upsert_request, **kwargs): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"upsert_request": (UpsertRequest,)}, - "attribute_map": {}, - "location_map": {"upsert_request": "body"}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "upsert_request": (UpsertRequest,), + }, + "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, + "location_map": {"x_pinecone_api_version": "header", "upsert_request": "body"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, diff --git a/pinecone/core/openapi/db_data/model/create_namespace_request.py b/pinecone/core/openapi/db_data/model/create_namespace_request.py new file mode 100644 index 00000000..6ea00aee --- /dev/null +++ b/pinecone/core/openapi/db_data/model/create_namespace_request.py @@ -0,0 +1,290 @@ +""" +Pinecone Data 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-10 +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_data.model.create_namespace_request_schema import ( + CreateNamespaceRequestSchema, + ) + + globals()["CreateNamespaceRequestSchema"] = CreateNamespaceRequestSchema + + +from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar +from pinecone.openapi_support import PropertyValidationTypedDict, cached_class_property + +T = TypeVar("T", bound="CreateNamespaceRequest") + + +class CreateNamespaceRequest(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 { + "name": (str,), # noqa: E501 + "schema": (CreateNamespaceRequestSchema,), # noqa: E501 + } + + @cached_class_property + def discriminator(cls): + return None + + attribute_map: Dict[str, str] = { + "name": "name", # noqa: E501 + "schema": "schema", # 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 + """CreateNamespaceRequest - a model defined in OpenAPI + + Args: + name (str): The name of the namespace. + + 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,) + schema (CreateNamespaceRequestSchema): [optional] # noqa: E501 + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", False) + _enforce_validations = kwargs.pop("_enforce_validations", False) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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( + [ + "_enforce_allowed_values", + "_enforce_validations", + "_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 + """CreateNamespaceRequest - a model defined in OpenAPI + + Args: + name (str): The name of the namespace. + + 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,) + schema (CreateNamespaceRequestSchema): [optional] # noqa: E501 + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", True) + _enforce_validations = kwargs.pop("_enforce_validations", True) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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_data/model/create_namespace_request_schema.py b/pinecone/core/openapi/db_data/model/create_namespace_request_schema.py new file mode 100644 index 00000000..547e23c5 --- /dev/null +++ b/pinecone/core/openapi/db_data/model/create_namespace_request_schema.py @@ -0,0 +1,286 @@ +""" +Pinecone Data 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-10 +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_data.model.create_namespace_request_schema_fields import ( + CreateNamespaceRequestSchemaFields, + ) + + globals()["CreateNamespaceRequestSchemaFields"] = CreateNamespaceRequestSchemaFields + + +from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar +from pinecone.openapi_support import PropertyValidationTypedDict, cached_class_property + +T = TypeVar("T", bound="CreateNamespaceRequestSchema") + + +class CreateNamespaceRequestSchema(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 { + "fields": ({str: (CreateNamespaceRequestSchemaFields,)},) # noqa: E501 + } + + @cached_class_property + def discriminator(cls): + return None + + attribute_map: Dict[str, str] = { + "fields": "fields" # 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], fields, *args, **kwargs) -> T: # noqa: E501 + """CreateNamespaceRequestSchema - a model defined in OpenAPI + + Args: + fields ({str: (CreateNamespaceRequestSchemaFields,)}): A map of metadata field names to their configuration. The field name must be a valid metadata field name. The field name must be unique. + + 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,) + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", False) + _enforce_validations = kwargs.pop("_enforce_validations", False) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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.fields = fields + 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( + [ + "_enforce_allowed_values", + "_enforce_validations", + "_data_store", + "_check_type", + "_spec_property_naming", + "_path_to_item", + "_configuration", + "_visited_composed_classes", + ] + ) + + @convert_js_args_to_python_args + def __init__(self, fields, *args, **kwargs) -> None: # noqa: E501 + """CreateNamespaceRequestSchema - a model defined in OpenAPI + + Args: + fields ({str: (CreateNamespaceRequestSchemaFields,)}): A map of metadata field names to their configuration. The field name must be a valid metadata field name. The field name must be unique. + + 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,) + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", True) + _enforce_validations = kwargs.pop("_enforce_validations", True) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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.fields = fields + 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_data/model/create_namespace_request_schema_fields.py b/pinecone/core/openapi/db_data/model/create_namespace_request_schema_fields.py new file mode 100644 index 00000000..149eb3aa --- /dev/null +++ b/pinecone/core/openapi/db_data/model/create_namespace_request_schema_fields.py @@ -0,0 +1,270 @@ +""" +Pinecone Data 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-10 +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="CreateNamespaceRequestSchemaFields") + + +class CreateNamespaceRequestSchemaFields(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 { + "filterable": (bool,) # noqa: E501 + } + + @cached_class_property + def discriminator(cls): + return None + + attribute_map: Dict[str, str] = { + "filterable": "filterable" # 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 + """CreateNamespaceRequestSchemaFields - 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,) + filterable (bool): Whether the field is filterable. If true, the field is indexed and can be used in filters. Only true values are allowed. [optional] # noqa: E501 + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", False) + _enforce_validations = kwargs.pop("_enforce_validations", False) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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( + [ + "_enforce_allowed_values", + "_enforce_validations", + "_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 + """CreateNamespaceRequestSchemaFields - 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,) + filterable (bool): Whether the field is filterable. If true, the field is indexed and can be used in filters. Only true values are allowed. [optional] # noqa: E501 + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", True) + _enforce_validations = kwargs.pop("_enforce_validations", True) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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_data/model/delete_request.py b/pinecone/core/openapi/db_data/model/delete_request.py index 0d3409a7..aea6d597 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-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ @@ -144,7 +144,7 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 ids ([str]): Vectors to delete. [optional] # noqa: E501 delete_all (bool): This indicates that all vectors in the index namespace should be deleted. [optional] if omitted the server will use the default value of False. # noqa: E501 namespace (str): The namespace to delete vectors from, if applicable. [optional] # noqa: E501 - filter ({str: (bool, dict, float, int, list, str, none_type)}): If specified, the metadata filter here will be used to select the vectors to delete. This is mutually exclusive with specifying ids to delete in the ids param or using delete_all=True. See [Understanding metadata](https://docs.pinecone.io/guides/index-data/indexing-overview#metadata). Serverless indexes do not support delete by metadata. Instead, you can use the `list` operation to fetch the vector IDs based on their common ID prefix and then delete the records by ID. [optional] # noqa: E501 + filter ({str: (bool, dict, float, int, list, str, none_type)}): If specified, the metadata filter here will be used to select the vectors to delete. This is mutually exclusive with specifying ids to delete in the ids param or using delete_all=True. See [Delete data](https://docs.pinecone.io/guides/manage-data/delete-data#delete-records-by-metadata). [optional] # noqa: E501 """ _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", False) @@ -237,7 +237,7 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 ids ([str]): Vectors to delete. [optional] # noqa: E501 delete_all (bool): This indicates that all vectors in the index namespace should be deleted. [optional] if omitted the server will use the default value of False. # noqa: E501 namespace (str): The namespace to delete vectors from, if applicable. [optional] # noqa: E501 - filter ({str: (bool, dict, float, int, list, str, none_type)}): If specified, the metadata filter here will be used to select the vectors to delete. This is mutually exclusive with specifying ids to delete in the ids param or using delete_all=True. See [Understanding metadata](https://docs.pinecone.io/guides/index-data/indexing-overview#metadata). Serverless indexes do not support delete by metadata. Instead, you can use the `list` operation to fetch the vector IDs based on their common ID prefix and then delete the records by ID. [optional] # noqa: E501 + filter ({str: (bool, dict, float, int, list, str, none_type)}): If specified, the metadata filter here will be used to select the vectors to delete. This is mutually exclusive with specifying ids to delete in the ids param or using delete_all=True. See [Delete data](https://docs.pinecone.io/guides/manage-data/delete-data#delete-records-by-metadata). [optional] # noqa: E501 """ _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", True) 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 6c54d92f..1e463801 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-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_data/model/fetch_by_metadata_request.py b/pinecone/core/openapi/db_data/model/fetch_by_metadata_request.py new file mode 100644 index 00000000..3d6d7067 --- /dev/null +++ b/pinecone/core/openapi/db_data/model/fetch_by_metadata_request.py @@ -0,0 +1,284 @@ +""" +Pinecone Data 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-10 +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="FetchByMetadataRequest") + + +class FetchByMetadataRequest(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] = { + ("limit",): {"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 + """ + 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 { + "namespace": (str,), # noqa: E501 + "filter": ({str: (bool, dict, float, int, list, str, none_type)},), # noqa: E501 + "limit": (int,), # noqa: E501 + "pagination_token": (str,), # noqa: E501 + } + + @cached_class_property + def discriminator(cls): + return None + + attribute_map: Dict[str, str] = { + "namespace": "namespace", # noqa: E501 + "filter": "filter", # noqa: E501 + "limit": "limit", # noqa: E501 + "pagination_token": "paginationToken", # 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 + """FetchByMetadataRequest - 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,) + namespace (str): The namespace to fetch vectors from. [optional] # noqa: E501 + filter ({str: (bool, dict, float, int, list, str, none_type)}): Metadata filter expression to select vectors. See [Understanding metadata](https://docs.pinecone.io/guides/index-data/indexing-overview#metadata). [optional] # noqa: E501 + limit (int): Max number of vectors to return. [optional] if omitted the server will use the default value of 100. # noqa: E501 + pagination_token (str): Pagination token to continue a previous listing operation. [optional] # noqa: E501 + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", False) + _enforce_validations = kwargs.pop("_enforce_validations", False) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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( + [ + "_enforce_allowed_values", + "_enforce_validations", + "_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 + """FetchByMetadataRequest - 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,) + namespace (str): The namespace to fetch vectors from. [optional] # noqa: E501 + filter ({str: (bool, dict, float, int, list, str, none_type)}): Metadata filter expression to select vectors. See [Understanding metadata](https://docs.pinecone.io/guides/index-data/indexing-overview#metadata). [optional] # noqa: E501 + limit (int): Max number of vectors to return. [optional] if omitted the server will use the default value of 100. # noqa: E501 + pagination_token (str): Pagination token to continue a previous listing operation. [optional] # noqa: E501 + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", True) + _enforce_validations = kwargs.pop("_enforce_validations", True) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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_data/model/fetch_by_metadata_response.py b/pinecone/core/openapi/db_data/model/fetch_by_metadata_response.py new file mode 100644 index 00000000..e4811b3b --- /dev/null +++ b/pinecone/core/openapi/db_data/model/fetch_by_metadata_response.py @@ -0,0 +1,294 @@ +""" +Pinecone Data 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-10 +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_data.model.pagination import Pagination + from pinecone.core.openapi.db_data.model.usage import Usage + from pinecone.core.openapi.db_data.model.vector import Vector + + globals()["Pagination"] = Pagination + globals()["Usage"] = Usage + globals()["Vector"] = Vector + + +from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar +from pinecone.openapi_support import PropertyValidationTypedDict, cached_class_property + +T = TypeVar("T", bound="FetchByMetadataResponse") + + +class FetchByMetadataResponse(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 { + "vectors": ({str: (Vector,)},), # noqa: E501 + "namespace": (str,), # noqa: E501 + "usage": (Usage,), # noqa: E501 + "pagination": (Pagination,), # noqa: E501 + } + + @cached_class_property + def discriminator(cls): + return None + + attribute_map: Dict[str, str] = { + "vectors": "vectors", # noqa: E501 + "namespace": "namespace", # noqa: E501 + "usage": "usage", # 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 + """FetchByMetadataResponse - 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,) + vectors ({str: (Vector,)}): The fetched vectors, in the form of a map between the fetched ids and the fetched vectors [optional] # noqa: E501 + namespace (str): The namespace of the vectors. [optional] if omitted the server will use the default value of "". # noqa: E501 + usage (Usage): [optional] # noqa: E501 + pagination (Pagination): [optional] # noqa: E501 + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", False) + _enforce_validations = kwargs.pop("_enforce_validations", False) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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( + [ + "_enforce_allowed_values", + "_enforce_validations", + "_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 + """FetchByMetadataResponse - 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,) + vectors ({str: (Vector,)}): The fetched vectors, in the form of a map between the fetched ids and the fetched vectors [optional] # noqa: E501 + namespace (str): The namespace of the vectors. [optional] if omitted the server will use the default value of "". # noqa: E501 + usage (Usage): [optional] # noqa: E501 + pagination (Pagination): [optional] # noqa: E501 + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", True) + _enforce_validations = kwargs.pop("_enforce_validations", True) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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_data/model/fetch_response.py b/pinecone/core/openapi/db_data/model/fetch_response.py index 092fad1c..8d39fa6b 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-04 +The version of the OpenAPI document: 2025-10 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 1a7431d1..0f5970d9 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-04 +The version of the OpenAPI document: 2025-10 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 2f320d88..955603b3 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-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ @@ -59,9 +59,7 @@ class ImportErrorMode(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - ("on_error",): {"ABORT": "abort", "CONTINUE": "continue"} - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @@ -137,7 +135,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,) - on_error (str): Indicates how to respond to errors during the import process. [optional] # noqa: E501 + on_error (str): Indicates how to respond to errors during the import process. Possible values: `abort` or `continue`. [optional] # noqa: E501 """ _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", False) @@ -227,7 +225,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,) - on_error (str): Indicates how to respond to errors during the import process. [optional] # noqa: E501 + on_error (str): Indicates how to respond to errors during the import process. Possible values: `abort` or `continue`. [optional] # noqa: E501 """ _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", True) diff --git a/pinecone/core/openapi/db_data/model/import_model.py b/pinecone/core/openapi/db_data/model/import_model.py index 6bb3c296..fe666b89 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-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ @@ -59,15 +59,7 @@ class ImportModel(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - ("status",): { - "PENDING": "Pending", - "INPROGRESS": "InProgress", - "FAILED": "Failed", - "COMPLETED": "Completed", - "CANCELLED": "Cancelled", - } - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { ("id",): {"max_length": 1000, "min_length": 1}, @@ -162,7 +154,7 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 _visited_composed_classes = (Animal,) id (str): Unique identifier for the import operation. [optional] # noqa: E501 uri (str): The URI from where the data is imported. [optional] # noqa: E501 - status (str): The status of the operation. [optional] # noqa: E501 + status (str): The status of the operation. Possible values: `Pending`, `InProgress`, `Failed`, `Completed`, or `Cancelled`. [optional] # noqa: E501 created_at (datetime): The start time of the import operation. [optional] # noqa: E501 finished_at (datetime): The end time of the import operation. [optional] # noqa: E501 percent_complete (float): The progress made by the operation, as a percentage. [optional] # noqa: E501 @@ -259,7 +251,7 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 _visited_composed_classes = (Animal,) id (str): Unique identifier for the import operation. [optional] # noqa: E501 uri (str): The URI from where the data is imported. [optional] # noqa: E501 - status (str): The status of the operation. [optional] # noqa: E501 + status (str): The status of the operation. Possible values: `Pending`, `InProgress`, `Failed`, `Completed`, or `Cancelled`. [optional] # noqa: E501 created_at (datetime): The start time of the import operation. [optional] # noqa: E501 finished_at (datetime): The end time of the import operation. [optional] # noqa: E501 percent_complete (float): The progress made by the operation, as a percentage. [optional] # noqa: E501 diff --git a/pinecone/core/openapi/db_data/model/index_description.py b/pinecone/core/openapi/db_data/model/index_description.py index 0af2c259..d49b93cd 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-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ @@ -98,6 +98,8 @@ def openapi_types(cls): "total_vector_count": (int,), # noqa: E501 "metric": (str,), # noqa: E501 "vector_type": (str,), # noqa: E501 + "memory_fullness": (float,), # noqa: E501 + "storage_fullness": (float,), # noqa: E501 } @cached_class_property @@ -111,6 +113,8 @@ def discriminator(cls): "total_vector_count": "totalVectorCount", # noqa: E501 "metric": "metric", # noqa: E501 "vector_type": "vectorType", # noqa: E501 + "memory_fullness": "memory_fullness", # noqa: E501 + "storage_fullness": "storage_fullness", # noqa: E501 } read_only_vars: Set[str] = set([]) @@ -159,6 +163,8 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 total_vector_count (int): The total number of vectors in the index, regardless of whether a metadata filter expression was passed [optional] # noqa: E501 metric (str): The metric used to measure similarity. [optional] # noqa: E501 vector_type (str): The type of vectors stored in the index. [optional] # noqa: E501 + memory_fullness (float): The amount of memory used by a dedicated index [optional] # noqa: E501 + storage_fullness (float): The amount of storage used by a dedicated index [optional] # noqa: E501 """ _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", False) @@ -254,6 +260,8 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 total_vector_count (int): The total number of vectors in the index, regardless of whether a metadata filter expression was passed [optional] # noqa: E501 metric (str): The metric used to measure similarity. [optional] # noqa: E501 vector_type (str): The type of vectors stored in the index. [optional] # noqa: E501 + memory_fullness (float): The amount of memory used by a dedicated index [optional] # noqa: E501 + storage_fullness (float): The amount of storage used by a dedicated index [optional] # noqa: E501 """ _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", True) 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 d2321fb8..378a35ba 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-04 +The version of the OpenAPI document: 2025-10 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 22d2e0fd..420eb710 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-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_data/model/list_namespaces_response.py b/pinecone/core/openapi/db_data/model/list_namespaces_response.py index 5bbc61be..18dafef4 100644 --- a/pinecone/core/openapi/db_data/model/list_namespaces_response.py +++ b/pinecone/core/openapi/db_data/model/list_namespaces_response.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-04 +The version of the OpenAPI document: 2025-10 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 f5ea54af..50aef17f 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-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_data/model/namespace_description.py b/pinecone/core/openapi/db_data/model/namespace_description.py index abd3fc50..f69a0c89 100644 --- a/pinecone/core/openapi/db_data/model/namespace_description.py +++ b/pinecone/core/openapi/db_data/model/namespace_description.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ @@ -27,6 +27,14 @@ from pinecone.openapi_support.exceptions import PineconeApiAttributeError +def lazy_import(): + from pinecone.core.openapi.db_data.model.create_namespace_request_schema import ( + CreateNamespaceRequestSchema, + ) + + globals()["CreateNamespaceRequestSchema"] = CreateNamespaceRequestSchema + + from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar from pinecone.openapi_support import PropertyValidationTypedDict, cached_class_property @@ -69,6 +77,7 @@ 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 @@ -83,9 +92,12 @@ def openapi_types(cls): openapi_types (dict): The key is attribute name and the value is attribute type. """ + lazy_import() return { "name": (str,), # noqa: E501 "record_count": (int,), # noqa: E501 + "schema": (CreateNamespaceRequestSchema,), # noqa: E501 + "total_count": (int,), # noqa: E501 } @cached_class_property @@ -95,6 +107,8 @@ def discriminator(cls): attribute_map: Dict[str, str] = { "name": "name", # noqa: E501 "record_count": "record_count", # noqa: E501 + "schema": "schema", # noqa: E501 + "total_count": "total_count", # noqa: E501 } read_only_vars: Set[str] = set([]) @@ -139,6 +153,8 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 _visited_composed_classes = (Animal,) name (str): The name of the namespace. [optional] # noqa: E501 record_count (int): The total amount of records within the namespace. [optional] # noqa: E501 + schema (CreateNamespaceRequestSchema): [optional] # noqa: E501 + total_count (int): The total number of namespaces in the index matching the prefix [optional] # noqa: E501 """ _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", False) @@ -230,6 +246,8 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 _visited_composed_classes = (Animal,) name (str): The name of the namespace. [optional] # noqa: E501 record_count (int): The total amount of records within the namespace. [optional] # noqa: E501 + schema (CreateNamespaceRequestSchema): [optional] # noqa: E501 + total_count (int): The total number of namespaces in the index matching the prefix [optional] # noqa: E501 """ _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", True) diff --git a/pinecone/core/openapi/db_data/model/namespace_summary.py b/pinecone/core/openapi/db_data/model/namespace_summary.py index 752f95ee..b6ef77ab 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-04 +The version of the OpenAPI document: 2025-10 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 6ddb4973..37456231 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-04 +The version of the OpenAPI document: 2025-10 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 fe7f54c2..1dc76bc3 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-04 +The version of the OpenAPI document: 2025-10 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 deleted file mode 100644 index ecf6b359..00000000 --- a/pinecone/core/openapi/db_data/model/protobuf_null_value.py +++ /dev/null @@ -1,286 +0,0 @@ -""" -Pinecone Data 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="ProtobufNullValue") - - -class ProtobufNullValue(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",): {"NULL_VALUE": "NULL_VALUE"} - } - - 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( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_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: - """ProtobufNullValue - 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): `NullValue` is a singleton enumeration to represent the null value for the `Value` type union. The JSON representation for `NullValue` is JSON `null`.. if omitted defaults to "NULL_VALUE", must be one of ["NULL_VALUE", ] # noqa: E501 - - Keyword Args: - value (str): `NullValue` is a singleton enumeration to represent the null value for the `Value` type union. The JSON representation for `NullValue` is JSON `null`.. if omitted defaults to "NULL_VALUE", must be one of ["NULL_VALUE", ] # 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: - value = "NULL_VALUE" - - _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", True) - _enforce_validations = kwargs.pop("_enforce_validations", True) - _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._enforce_allowed_values = _enforce_allowed_values - self._enforce_validations = _enforce_validations - 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: - """ProtobufNullValue - 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): `NullValue` is a singleton enumeration to represent the null value for the `Value` type union. The JSON representation for `NullValue` is JSON `null`. if omitted defaults to "NULL_VALUE", must be one of ["NULL_VALUE", ] # noqa: E501 - - Keyword Args: - value (str): `NullValue` is a singleton enumeration to represent the null value for the `Value` type union. The JSON representation for `NullValue` is JSON `null`. if omitted defaults to "NULL_VALUE", must be one of ["NULL_VALUE", ] # 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: - value = "NULL_VALUE" - - _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", False) - _enforce_validations = kwargs.pop("_enforce_validations", False) - _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._enforce_allowed_values = _enforce_allowed_values - self._enforce_validations = _enforce_validations - 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/db_data/model/query_request.py b/pinecone/core/openapi/db_data/model/query_request.py index 74577d1b..88d12c23 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-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_data/model/query_response.py b/pinecone/core/openapi/db_data/model/query_response.py index 9d693f34..a28efa5f 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-04 +The version of the OpenAPI document: 2025-10 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 3ea0196f..4e8f3be2 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-04 +The version of the OpenAPI document: 2025-10 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 ac8da180..8feaf20d 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-04 +The version of the OpenAPI document: 2025-10 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 61f28530..a18f7d7e 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-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_data/model/search_match_terms.py b/pinecone/core/openapi/db_data/model/search_match_terms.py new file mode 100644 index 00000000..c5d59569 --- /dev/null +++ b/pinecone/core/openapi/db_data/model/search_match_terms.py @@ -0,0 +1,274 @@ +""" +Pinecone Data 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-10 +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="SearchMatchTerms") + + +class SearchMatchTerms(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 { + "strategy": (str,), # noqa: E501 + "terms": ([str],), # noqa: E501 + } + + @cached_class_property + def discriminator(cls): + return None + + attribute_map: Dict[str, str] = { + "strategy": "strategy", # noqa: E501 + "terms": "terms", # 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 + """SearchMatchTerms - 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,) + strategy (str): The strategy for matching terms in the text. Currently, only `all` is supported, which means all specified terms must be present. [optional] # noqa: E501 + terms ([str]): A list of terms that must be present in the text of each search hit based on the specified strategy. [optional] # noqa: E501 + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", False) + _enforce_validations = kwargs.pop("_enforce_validations", False) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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( + [ + "_enforce_allowed_values", + "_enforce_validations", + "_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 + """SearchMatchTerms - 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,) + strategy (str): The strategy for matching terms in the text. Currently, only `all` is supported, which means all specified terms must be present. [optional] # noqa: E501 + terms ([str]): A list of terms that must be present in the text of each search hit based on the specified strategy. [optional] # noqa: E501 + """ + + _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", True) + _enforce_validations = kwargs.pop("_enforce_validations", True) + _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._enforce_allowed_values = _enforce_allowed_values + self._enforce_validations = _enforce_validations + 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_data/model/search_records_request.py b/pinecone/core/openapi/db_data/model/search_records_request.py index 19b0ba55..1030ef90 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-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ 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 790dbf82..68d3a3da 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-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ @@ -28,8 +28,10 @@ def lazy_import(): + from pinecone.core.openapi.db_data.model.search_match_terms import SearchMatchTerms from pinecone.core.openapi.db_data.model.search_records_vector import SearchRecordsVector + globals()["SearchMatchTerms"] = SearchMatchTerms globals()["SearchRecordsVector"] = SearchRecordsVector @@ -97,6 +99,7 @@ def openapi_types(cls): "inputs": ({str: (bool, dict, float, int, list, str, none_type)},), # noqa: E501 "vector": (SearchRecordsVector,), # noqa: E501 "id": (str,), # noqa: E501 + "match_terms": (SearchMatchTerms,), # noqa: E501 } @cached_class_property @@ -109,6 +112,7 @@ def discriminator(cls): "inputs": "inputs", # noqa: E501 "vector": "vector", # noqa: E501 "id": "id", # noqa: E501 + "match_terms": "match_terms", # noqa: E501 } read_only_vars: Set[str] = set([]) @@ -158,6 +162,7 @@ def _from_openapi_data(cls: Type[T], top_k, *args, **kwargs) -> T: # 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 + match_terms (SearchMatchTerms): [optional] # noqa: E501 """ _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", False) @@ -255,6 +260,7 @@ def __init__(self, top_k, *args, **kwargs) -> None: # 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 + match_terms (SearchMatchTerms): [optional] # noqa: E501 """ _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", True) 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 b365a7d3..c52907d0 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-04 +The version of the OpenAPI document: 2025-10 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 229b60dd..0fead75f 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-04 +The version of the OpenAPI document: 2025-10 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 ab04277f..477da0a1 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-04 +The version of the OpenAPI document: 2025-10 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 34afe2cf..15868d04 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-04 +The version of the OpenAPI document: 2025-10 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 c4444c8b..cc7e1f79 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-04 +The version of the OpenAPI document: 2025-10 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 d5636688..94e041d2 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-04 +The version of the OpenAPI document: 2025-10 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 8100f664..7670fc29 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-04 +The version of the OpenAPI document: 2025-10 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 20e23275..351f05cd 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-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ @@ -120,7 +120,7 @@ def _from_openapi_data(cls: Type[T], uri, *args, **kwargs) -> T: # noqa: E501 """StartImportRequest - a model defined in OpenAPI Args: - uri (str): The [URI prefix](https://docs.pinecone.io/guides/index-data/import-data#prepare-your-data) under which the data to import is available. All data within this prefix will be listed then imported into the target index. Currently only `s3://` URIs are supported. + uri (str): The URI of the bucket (or container) and import directory containing the namespaces and Parquet files you want to import. For example, `s3://BUCKET_NAME/IMPORT_DIR` for Amazon S3, `gs://BUCKET_NAME/IMPORT_DIR` for Google Cloud Storage, or `https://STORAGE_ACCOUNT.blob.core.windows.net/CONTAINER_NAME/IMPORT_DIR` for Azure Blob Storage. For more information, see [Import records](https://docs.pinecone.io/guides/index-data/import-data#prepare-your-data). Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -215,7 +215,7 @@ def __init__(self, uri, *args, **kwargs) -> None: # noqa: E501 """StartImportRequest - a model defined in OpenAPI Args: - uri (str): The [URI prefix](https://docs.pinecone.io/guides/index-data/import-data#prepare-your-data) under which the data to import is available. All data within this prefix will be listed then imported into the target index. Currently only `s3://` URIs are supported. + uri (str): The URI of the bucket (or container) and import directory containing the namespaces and Parquet files you want to import. For example, `s3://BUCKET_NAME/IMPORT_DIR` for Amazon S3, `gs://BUCKET_NAME/IMPORT_DIR` for Google Cloud Storage, or `https://STORAGE_ACCOUNT.blob.core.windows.net/CONTAINER_NAME/IMPORT_DIR` for Azure Blob Storage. For more information, see [Import records](https://docs.pinecone.io/guides/index-data/import-data#prepare-your-data). Keyword Args: _check_type (bool): if True, values for parameters in openapi_types 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 d8511fe8..a34ccf9a 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-04 +The version of the OpenAPI document: 2025-10 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 c45849b1..92786fce 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-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ @@ -100,6 +100,8 @@ def openapi_types(cls): "sparse_values": (SparseValues,), # noqa: E501 "set_metadata": ({str: (bool, dict, float, int, list, str, none_type)},), # noqa: E501 "namespace": (str,), # noqa: E501 + "filter": ({str: (bool, dict, float, int, list, str, none_type)},), # noqa: E501 + "dry_run": (bool,), # noqa: E501 } @cached_class_property @@ -112,6 +114,8 @@ def discriminator(cls): "sparse_values": "sparseValues", # noqa: E501 "set_metadata": "setMetadata", # noqa: E501 "namespace": "namespace", # noqa: E501 + "filter": "filter", # noqa: E501 + "dry_run": "dryRun", # noqa: E501 } read_only_vars: Set[str] = set([]) @@ -120,12 +124,9 @@ def discriminator(cls): @classmethod @convert_js_args_to_python_args - def _from_openapi_data(cls: Type[T], id, *args, **kwargs) -> T: # noqa: E501 + def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 """UpdateRequest - a model defined in OpenAPI - Args: - id (str): Vector's unique id. - Keyword Args: _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be @@ -157,10 +158,13 @@ def _from_openapi_data(cls: Type[T], id, *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,) + id (str): Vector's unique id. [optional] # noqa: E501 values ([float]): Vector data. [optional] # noqa: E501 sparse_values (SparseValues): [optional] # noqa: E501 set_metadata ({str: (bool, dict, float, int, list, str, none_type)}): Metadata to set for the vector. [optional] # noqa: E501 namespace (str): The namespace containing the vector to update. [optional] # noqa: E501 + filter ({str: (bool, dict, float, int, list, str, none_type)}): A metadata filter expression. When updating metadata across records in a namespace, the update is applied to all records that match the filter. See [Understanding metadata](https://docs.pinecone.io/guides/index-data/indexing-overview#metadata). [optional] # noqa: E501 + dry_run (bool): If `true`, return the number of records that match the `filter`, but do not execute the update. Default is `false`. [optional] if omitted the server will use the default value of False. # noqa: E501 """ _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", False) @@ -190,7 +194,6 @@ def _from_openapi_data(cls: Type[T], id, *args, **kwargs) -> T: # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.id = id for var_name, var_value in kwargs.items(): if ( var_name not in self.attribute_map @@ -217,12 +220,9 @@ def _from_openapi_data(cls: Type[T], id, *args, **kwargs) -> T: # noqa: E501 ) @convert_js_args_to_python_args - def __init__(self, id, *args, **kwargs) -> None: # noqa: E501 + def __init__(self, *args, **kwargs) -> None: # noqa: E501 """UpdateRequest - a model defined in OpenAPI - Args: - id (str): Vector's unique id. - Keyword Args: _check_type (bool): if True, values for parameters in openapi_types will be type checked and a TypeError will be @@ -254,10 +254,13 @@ def __init__(self, id, *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,) + id (str): Vector's unique id. [optional] # noqa: E501 values ([float]): Vector data. [optional] # noqa: E501 sparse_values (SparseValues): [optional] # noqa: E501 set_metadata ({str: (bool, dict, float, int, list, str, none_type)}): Metadata to set for the vector. [optional] # noqa: E501 namespace (str): The namespace containing the vector to update. [optional] # noqa: E501 + filter ({str: (bool, dict, float, int, list, str, none_type)}): A metadata filter expression. When updating metadata across records in a namespace, the update is applied to all records that match the filter. See [Understanding metadata](https://docs.pinecone.io/guides/index-data/indexing-overview#metadata). [optional] # noqa: E501 + dry_run (bool): If `true`, return the number of records that match the `filter`, but do not execute the update. Default is `false`. [optional] if omitted the server will use the default value of False. # noqa: E501 """ _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", True) @@ -285,7 +288,6 @@ def __init__(self, id, *args, **kwargs) -> None: # noqa: E501 self._configuration = _configuration self._visited_composed_classes = _visited_composed_classes + (self.__class__,) - self.id = id for var_name, var_value in kwargs.items(): if ( var_name not in self.attribute_map diff --git a/pinecone/core/openapi/db_data/model/search_vector.py b/pinecone/core/openapi/db_data/model/update_response.py similarity index 94% rename from pinecone/core/openapi/db_data/model/search_vector.py rename to pinecone/core/openapi/db_data/model/update_response.py index 00be22b5..8b4a63c1 100644 --- a/pinecone/core/openapi/db_data/model/search_vector.py +++ b/pinecone/core/openapi/db_data/model/update_response.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ @@ -27,19 +27,13 @@ from pinecone.openapi_support.exceptions import PineconeApiAttributeError -def lazy_import(): - from pinecone.core.openapi.db_data.model.vector_values import VectorValues - - globals()["VectorValues"] = VectorValues - - from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar from pinecone.openapi_support import PropertyValidationTypedDict, cached_class_property -T = TypeVar("T", bound="SearchVector") +T = TypeVar("T", bound="UpdateResponse") -class SearchVector(ModelNormal): +class UpdateResponse(ModelNormal): """NOTE: This class is @generated using OpenAPI. Do not edit the class manually. @@ -75,7 +69,6 @@ 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 @@ -90,9 +83,8 @@ def openapi_types(cls): openapi_types (dict): The key is attribute name and the value is attribute type. """ - lazy_import() return { - "values": (VectorValues,) # noqa: E501 + "matched_records": (int,) # noqa: E501 } @cached_class_property @@ -100,7 +92,7 @@ def discriminator(cls): return None attribute_map: Dict[str, str] = { - "values": "values" # noqa: E501 + "matched_records": "matchedRecords" # noqa: E501 } read_only_vars: Set[str] = set([]) @@ -110,7 +102,7 @@ def discriminator(cls): @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 - """SearchVector - a model defined in OpenAPI + """UpdateResponse - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -143,7 +135,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,) - values (VectorValues): [optional] # noqa: E501 + matched_records (int): The number of records that matched the filter (if a filter was provided). [optional] # noqa: E501 """ _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", False) @@ -200,7 +192,7 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 @convert_js_args_to_python_args def __init__(self, *args, **kwargs) -> None: # noqa: E501 - """SearchVector - a model defined in OpenAPI + """UpdateResponse - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -233,7 +225,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,) - values (VectorValues): [optional] # noqa: E501 + matched_records (int): The number of records that matched the filter (if a filter was provided). [optional] # noqa: E501 """ _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", True) diff --git a/pinecone/core/openapi/db_data/model/upsert_record.py b/pinecone/core/openapi/db_data/model/upsert_record.py index 31445ab4..42e97e11 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-04 +The version of the OpenAPI document: 2025-10 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 a00e1d61..2d016731 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-04 +The version of the OpenAPI document: 2025-10 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 57098ed2..7a53c74f 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-04 +The version of the OpenAPI document: 2025-10 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 61f3faa5..5710338e 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-04 +The version of the OpenAPI document: 2025-10 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 a83536a5..d5ae043e 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-04 +The version of the OpenAPI document: 2025-10 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 b18494cd..0175fda4 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-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/db_data/models/__init__.py b/pinecone/core/openapi/db_data/models/__init__.py index 34e9a6d8..c1597681 100644 --- a/pinecone/core/openapi/db_data/models/__init__.py +++ b/pinecone/core/openapi/db_data/models/__init__.py @@ -9,10 +9,19 @@ # import sys # sys.setrecursionlimit(n) +from pinecone.core.openapi.db_data.model.create_namespace_request import CreateNamespaceRequest +from pinecone.core.openapi.db_data.model.create_namespace_request_schema import ( + CreateNamespaceRequestSchema, +) +from pinecone.core.openapi.db_data.model.create_namespace_request_schema_fields import ( + CreateNamespaceRequestSchemaFields, +) from pinecone.core.openapi.db_data.model.delete_request import DeleteRequest from pinecone.core.openapi.db_data.model.describe_index_stats_request import ( DescribeIndexStatsRequest, ) +from pinecone.core.openapi.db_data.model.fetch_by_metadata_request import FetchByMetadataRequest +from pinecone.core.openapi.db_data.model.fetch_by_metadata_response import FetchByMetadataResponse from pinecone.core.openapi.db_data.model.fetch_response import FetchResponse from pinecone.core.openapi.db_data.model.hit import Hit from pinecone.core.openapi.db_data.model.import_error_mode import ImportErrorMode @@ -26,12 +35,12 @@ from pinecone.core.openapi.db_data.model.namespace_summary import NamespaceSummary from pinecone.core.openapi.db_data.model.pagination import Pagination from pinecone.core.openapi.db_data.model.protobuf_any import ProtobufAny -from pinecone.core.openapi.db_data.model.protobuf_null_value import ProtobufNullValue from pinecone.core.openapi.db_data.model.query_request import QueryRequest from pinecone.core.openapi.db_data.model.query_response import QueryResponse from pinecone.core.openapi.db_data.model.query_vector import QueryVector from pinecone.core.openapi.db_data.model.rpc_status import RpcStatus from pinecone.core.openapi.db_data.model.scored_vector import ScoredVector +from pinecone.core.openapi.db_data.model.search_match_terms import SearchMatchTerms from pinecone.core.openapi.db_data.model.search_records_request import SearchRecordsRequest from pinecone.core.openapi.db_data.model.search_records_request_query import ( SearchRecordsRequestQuery, @@ -45,12 +54,12 @@ ) from pinecone.core.openapi.db_data.model.search_records_vector import SearchRecordsVector from pinecone.core.openapi.db_data.model.search_usage import SearchUsage -from pinecone.core.openapi.db_data.model.search_vector import SearchVector from pinecone.core.openapi.db_data.model.single_query_results import SingleQueryResults from pinecone.core.openapi.db_data.model.sparse_values import SparseValues from pinecone.core.openapi.db_data.model.start_import_request import StartImportRequest from pinecone.core.openapi.db_data.model.start_import_response import StartImportResponse from pinecone.core.openapi.db_data.model.update_request import UpdateRequest +from pinecone.core.openapi.db_data.model.update_response import UpdateResponse from pinecone.core.openapi.db_data.model.upsert_record import UpsertRecord from pinecone.core.openapi.db_data.model.upsert_request import UpsertRequest from pinecone.core.openapi.db_data.model.upsert_response import UpsertResponse diff --git a/pinecone/core/openapi/inference/__init__.py b/pinecone/core/openapi/inference/__init__.py index 9bf0fcdb..e483fc73 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-04 +The version of the OpenAPI document: 2025-10 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-04" +API_VERSION = "2025-10" diff --git a/pinecone/core/openapi/inference/api/inference_api.py b/pinecone/core/openapi/inference/api/inference_api.py index ad5f7d3e..63b7a43c 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-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ @@ -43,16 +43,18 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient() self.api_client = api_client - def __embed(self, **kwargs: ExtraOpenApiKwargsTypedDict): + def __embed(self, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict): """Generate vectors # noqa: E501 Generate vector embeddings for input data. This endpoint uses Pinecone's [hosted embedding models](https://docs.pinecone.io/guides/index-data/create-an-index#embedding-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.embed(async_req=True) + >>> thread = api.embed(x_pinecone_api_version="2025-10", async_req=True) >>> result = thread.get() + Args: + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: embed_request (EmbedRequest): Generate embeddings for inputs. [optional] @@ -79,6 +81,7 @@ def __embed(self, **kwargs: ExtraOpenApiKwargsTypedDict): thread. """ kwargs = self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version return self.call_with_http_info(**kwargs) self.embed = _Endpoint( @@ -91,8 +94,8 @@ def __embed(self, **kwargs: ExtraOpenApiKwargsTypedDict): "servers": None, }, params_map={ - "all": ["embed_request"], - "required": [], + "all": ["x_pinecone_api_version", "embed_request"], + "required": ["x_pinecone_api_version"], "nullable": [], "enum": [], "validation": [], @@ -100,9 +103,12 @@ def __embed(self, **kwargs: ExtraOpenApiKwargsTypedDict): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"embed_request": (EmbedRequest,)}, - "attribute_map": {}, - "location_map": {"embed_request": "body"}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "embed_request": (EmbedRequest,), + }, + "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, + "location_map": {"x_pinecone_api_version": "header", "embed_request": "body"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, @@ -110,18 +116,24 @@ def __embed(self, **kwargs: ExtraOpenApiKwargsTypedDict): callable=__embed, ) - def __get_model(self, model_name, **kwargs: ExtraOpenApiKwargsTypedDict): + def __get_model( + self, + model_name, + x_pinecone_api_version="2025-10", + **kwargs: ExtraOpenApiKwargsTypedDict, + ): """Describe a model # noqa: E501 Get a description of a model hosted by Pinecone. You can use hosted models as an integrated part of Pinecone operations or for standalone embedding and reranking. For more details, see [Vector embedding](https://docs.pinecone.io/guides/index-data/indexing-overview#vector-embedding) and [Rerank results](https://docs.pinecone.io/guides/search/rerank-results). # 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) + >>> thread = api.get_model(model_name, x_pinecone_api_version="2025-10", async_req=True) >>> result = thread.get() Args: model_name (str): The name of the model to look up. + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -147,6 +159,7 @@ def __get_model(self, model_name, **kwargs: ExtraOpenApiKwargsTypedDict): thread. """ kwargs = self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["model_name"] = model_name return self.call_with_http_info(**kwargs) @@ -160,8 +173,8 @@ def __get_model(self, model_name, **kwargs: ExtraOpenApiKwargsTypedDict): "servers": None, }, params_map={ - "all": ["model_name"], - "required": ["model_name"], + "all": ["x_pinecone_api_version", "model_name"], + "required": ["x_pinecone_api_version", "model_name"], "nullable": [], "enum": [], "validation": [], @@ -169,9 +182,12 @@ def __get_model(self, model_name, **kwargs: ExtraOpenApiKwargsTypedDict): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"model_name": (str,)}, - "attribute_map": {"model_name": "model_name"}, - "location_map": {"model_name": "path"}, + "openapi_types": {"x_pinecone_api_version": (str,), "model_name": (str,)}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "model_name": "model_name", + }, + "location_map": {"x_pinecone_api_version": "header", "model_name": "path"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": []}, @@ -179,16 +195,20 @@ def __get_model(self, model_name, **kwargs: ExtraOpenApiKwargsTypedDict): callable=__get_model, ) - def __list_models(self, **kwargs: ExtraOpenApiKwargsTypedDict): + def __list_models( + self, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict + ): """List available models # noqa: E501 List the embedding and reranking models hosted by Pinecone. You can use hosted models as an integrated part of Pinecone operations or for standalone embedding and reranking. For more details, see [Vector embedding](https://docs.pinecone.io/guides/index-data/indexing-overview#vector-embedding) and [Rerank results](https://docs.pinecone.io/guides/search/rerank-results). # 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) + >>> thread = api.list_models(x_pinecone_api_version="2025-10", async_req=True) >>> result = thread.get() + Args: + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: type (str): Filter models by type ('embed' or 'rerank'). [optional] @@ -216,6 +236,7 @@ def __list_models(self, **kwargs: ExtraOpenApiKwargsTypedDict): thread. """ kwargs = self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version return self.call_with_http_info(**kwargs) self.list_models = _Endpoint( @@ -228,8 +249,8 @@ def __list_models(self, **kwargs: ExtraOpenApiKwargsTypedDict): "servers": None, }, params_map={ - "all": ["type", "vector_type"], - "required": [], + "all": ["x_pinecone_api_version", "type", "vector_type"], + "required": ["x_pinecone_api_version"], "nullable": [], "enum": [], "validation": [], @@ -237,9 +258,21 @@ def __list_models(self, **kwargs: ExtraOpenApiKwargsTypedDict): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"type": (str,), "vector_type": (str,)}, - "attribute_map": {"type": "type", "vector_type": "vector_type"}, - "location_map": {"type": "query", "vector_type": "query"}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "type": (str,), + "vector_type": (str,), + }, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "type": "type", + "vector_type": "vector_type", + }, + "location_map": { + "x_pinecone_api_version": "header", + "type": "query", + "vector_type": "query", + }, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": []}, @@ -247,16 +280,18 @@ def __list_models(self, **kwargs: ExtraOpenApiKwargsTypedDict): callable=__list_models, ) - def __rerank(self, **kwargs: ExtraOpenApiKwargsTypedDict): - """Rerank documents # noqa: E501 + def __rerank(self, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict): + """Rerank results # noqa: E501 Rerank results according to their relevance to a query. For guidance and examples, see [Rerank results](https://docs.pinecone.io/guides/search/rerank-results). # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.rerank(async_req=True) + >>> thread = api.rerank(x_pinecone_api_version="2025-10", async_req=True) >>> result = thread.get() + Args: + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: rerank_request (RerankRequest): Rerank documents for the given query [optional] @@ -283,6 +318,7 @@ def __rerank(self, **kwargs: ExtraOpenApiKwargsTypedDict): thread. """ kwargs = self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version return self.call_with_http_info(**kwargs) self.rerank = _Endpoint( @@ -295,8 +331,8 @@ def __rerank(self, **kwargs: ExtraOpenApiKwargsTypedDict): "servers": None, }, params_map={ - "all": ["rerank_request"], - "required": [], + "all": ["x_pinecone_api_version", "rerank_request"], + "required": ["x_pinecone_api_version"], "nullable": [], "enum": [], "validation": [], @@ -304,9 +340,12 @@ def __rerank(self, **kwargs: ExtraOpenApiKwargsTypedDict): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"rerank_request": (RerankRequest,)}, - "attribute_map": {}, - "location_map": {"rerank_request": "body"}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "rerank_request": (RerankRequest,), + }, + "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, + "location_map": {"x_pinecone_api_version": "header", "rerank_request": "body"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, @@ -326,12 +365,14 @@ def __init__(self, api_client=None) -> None: api_client = AsyncioApiClient() self.api_client = api_client - async def __embed(self, **kwargs): + async def __embed(self, x_pinecone_api_version="2025-10", **kwargs): """Generate vectors # noqa: E501 Generate vector embeddings for input data. This endpoint uses Pinecone's [hosted embedding models](https://docs.pinecone.io/guides/index-data/create-an-index#embedding-models). # noqa: E501 + Args: + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: embed_request (EmbedRequest): Generate embeddings for inputs. [optional] @@ -355,6 +396,7 @@ async def __embed(self, **kwargs): EmbeddingsList """ self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version return await self.call_with_http_info(**kwargs) self.embed = _AsyncioEndpoint( @@ -367,8 +409,8 @@ async def __embed(self, **kwargs): "servers": None, }, params_map={ - "all": ["embed_request"], - "required": [], + "all": ["x_pinecone_api_version", "embed_request"], + "required": ["x_pinecone_api_version"], "nullable": [], "enum": [], "validation": [], @@ -376,9 +418,12 @@ async def __embed(self, **kwargs): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"embed_request": (EmbedRequest,)}, - "attribute_map": {}, - "location_map": {"embed_request": "body"}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "embed_request": (EmbedRequest,), + }, + "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, + "location_map": {"x_pinecone_api_version": "header", "embed_request": "body"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, @@ -386,7 +431,7 @@ async def __embed(self, **kwargs): callable=__embed, ) - async def __get_model(self, model_name, **kwargs): + async def __get_model(self, model_name, x_pinecone_api_version="2025-10", **kwargs): """Describe a model # noqa: E501 Get a description of a model hosted by Pinecone. You can use hosted models as an integrated part of Pinecone operations or for standalone embedding and reranking. For more details, see [Vector embedding](https://docs.pinecone.io/guides/index-data/indexing-overview#vector-embedding) and [Rerank results](https://docs.pinecone.io/guides/search/rerank-results). # noqa: E501 @@ -394,6 +439,7 @@ async def __get_model(self, model_name, **kwargs): Args: model_name (str): The name of the model to look up. + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -416,6 +462,7 @@ async def __get_model(self, model_name, **kwargs): ModelInfo """ self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["model_name"] = model_name return await self.call_with_http_info(**kwargs) @@ -429,8 +476,8 @@ async def __get_model(self, model_name, **kwargs): "servers": None, }, params_map={ - "all": ["model_name"], - "required": ["model_name"], + "all": ["x_pinecone_api_version", "model_name"], + "required": ["x_pinecone_api_version", "model_name"], "nullable": [], "enum": [], "validation": [], @@ -438,9 +485,12 @@ async def __get_model(self, model_name, **kwargs): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"model_name": (str,)}, - "attribute_map": {"model_name": "model_name"}, - "location_map": {"model_name": "path"}, + "openapi_types": {"x_pinecone_api_version": (str,), "model_name": (str,)}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "model_name": "model_name", + }, + "location_map": {"x_pinecone_api_version": "header", "model_name": "path"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": []}, @@ -448,12 +498,14 @@ async def __get_model(self, model_name, **kwargs): callable=__get_model, ) - async def __list_models(self, **kwargs): + async def __list_models(self, x_pinecone_api_version="2025-10", **kwargs): """List available models # noqa: E501 List the embedding and reranking models hosted by Pinecone. You can use hosted models as an integrated part of Pinecone operations or for standalone embedding and reranking. For more details, see [Vector embedding](https://docs.pinecone.io/guides/index-data/indexing-overview#vector-embedding) and [Rerank results](https://docs.pinecone.io/guides/search/rerank-results). # noqa: E501 + Args: + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: type (str): Filter models by type ('embed' or 'rerank'). [optional] @@ -478,6 +530,7 @@ async def __list_models(self, **kwargs): ModelInfoList """ self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version return await self.call_with_http_info(**kwargs) self.list_models = _AsyncioEndpoint( @@ -490,8 +543,8 @@ async def __list_models(self, **kwargs): "servers": None, }, params_map={ - "all": ["type", "vector_type"], - "required": [], + "all": ["x_pinecone_api_version", "type", "vector_type"], + "required": ["x_pinecone_api_version"], "nullable": [], "enum": [], "validation": [], @@ -499,9 +552,21 @@ async def __list_models(self, **kwargs): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"type": (str,), "vector_type": (str,)}, - "attribute_map": {"type": "type", "vector_type": "vector_type"}, - "location_map": {"type": "query", "vector_type": "query"}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "type": (str,), + "vector_type": (str,), + }, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "type": "type", + "vector_type": "vector_type", + }, + "location_map": { + "x_pinecone_api_version": "header", + "type": "query", + "vector_type": "query", + }, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": []}, @@ -509,12 +574,14 @@ async def __list_models(self, **kwargs): callable=__list_models, ) - async def __rerank(self, **kwargs): - """Rerank documents # noqa: E501 + async def __rerank(self, x_pinecone_api_version="2025-10", **kwargs): + """Rerank results # noqa: E501 Rerank results according to their relevance to a query. For guidance and examples, see [Rerank results](https://docs.pinecone.io/guides/search/rerank-results). # noqa: E501 + Args: + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: rerank_request (RerankRequest): Rerank documents for the given query [optional] @@ -538,6 +605,7 @@ async def __rerank(self, **kwargs): RerankResult """ self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version return await self.call_with_http_info(**kwargs) self.rerank = _AsyncioEndpoint( @@ -550,8 +618,8 @@ async def __rerank(self, **kwargs): "servers": None, }, params_map={ - "all": ["rerank_request"], - "required": [], + "all": ["x_pinecone_api_version", "rerank_request"], + "required": ["x_pinecone_api_version"], "nullable": [], "enum": [], "validation": [], @@ -559,9 +627,12 @@ async def __rerank(self, **kwargs): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"rerank_request": (RerankRequest,)}, - "attribute_map": {}, - "location_map": {"rerank_request": "body"}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "rerank_request": (RerankRequest,), + }, + "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, + "location_map": {"x_pinecone_api_version": "header", "rerank_request": "body"}, "collection_format_map": {}, }, headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, diff --git a/pinecone/core/openapi/inference/model/dense_embedding.py b/pinecone/core/openapi/inference/model/dense_embedding.py index 50b6a725..37452cd2 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-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/inference/model/document.py b/pinecone/core/openapi/inference/model/document.py index 79ebb5d0..6151a77a 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-04 +The version of the OpenAPI document: 2025-10 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 0141f9db..5aee7b1b 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-04 +The version of the OpenAPI document: 2025-10 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 55fa9f69..6deaa490 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-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ @@ -135,7 +135,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,) - text (str): [optional] # noqa: E501 + text (str): The text input to generate embeddings for. [optional] # noqa: E501 """ _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", False) @@ -225,7 +225,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,) - text (str): [optional] # noqa: E501 + text (str): The text input to generate embeddings for. [optional] # noqa: E501 """ _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", True) diff --git a/pinecone/core/openapi/inference/model/embedding.py b/pinecone/core/openapi/inference/model/embedding.py index 8b0bf05b..d6cf5556 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-04 +The version of the OpenAPI document: 2025-10 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 87df31f8..adf9b5e9 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-04 +The version of the OpenAPI document: 2025-10 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 6cdea666..02cb83c1 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-04 +The version of the OpenAPI document: 2025-10 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 b526e6a2..9556ba16 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-04 +The version of the OpenAPI document: 2025-10 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 595a5f1f..61c41023 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-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ @@ -59,28 +59,7 @@ class ErrorResponseError(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - ("code",): { - "OK": "OK", - "UNKNOWN": "UNKNOWN", - "INVALID_ARGUMENT": "INVALID_ARGUMENT", - "DEADLINE_EXCEEDED": "DEADLINE_EXCEEDED", - "QUOTA_EXCEEDED": "QUOTA_EXCEEDED", - "NOT_FOUND": "NOT_FOUND", - "ALREADY_EXISTS": "ALREADY_EXISTS", - "PERMISSION_DENIED": "PERMISSION_DENIED", - "UNAUTHENTICATED": "UNAUTHENTICATED", - "RESOURCE_EXHAUSTED": "RESOURCE_EXHAUSTED", - "FAILED_PRECONDITION": "FAILED_PRECONDITION", - "ABORTED": "ABORTED", - "OUT_OF_RANGE": "OUT_OF_RANGE", - "UNIMPLEMENTED": "UNIMPLEMENTED", - "INTERNAL": "INTERNAL", - "UNAVAILABLE": "UNAVAILABLE", - "DATA_LOSS": "DATA_LOSS", - "FORBIDDEN": "FORBIDDEN", - } - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @@ -130,8 +109,8 @@ def _from_openapi_data(cls: Type[T], code, message, *args, **kwargs) -> T: # no """ErrorResponseError - a model defined in OpenAPI Args: - code (str): - message (str): + code (str): The error code. Possible values: `OK`, `UNKNOWN`, `INVALID_ARGUMENT`, `DEADLINE_EXCEEDED`, `QUOTA_EXCEEDED`, `NOT_FOUND`, `ALREADY_EXISTS`, `PERMISSION_DENIED`, `UNAUTHENTICATED`, `RESOURCE_EXHAUSTED`, `FAILED_PRECONDITION`, `ABORTED`, `OUT_OF_RANGE`, `UNIMPLEMENTED`, `INTERNAL`, `UNAVAILABLE`, `DATA_LOSS`, or `FORBIDDEN`. + message (str): A human-readable error message describing the error. Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -226,8 +205,8 @@ def __init__(self, code, message, *args, **kwargs) -> None: # noqa: E501 """ErrorResponseError - a model defined in OpenAPI Args: - code (str): - message (str): + code (str): The error code. Possible values: `OK`, `UNKNOWN`, `INVALID_ARGUMENT`, `DEADLINE_EXCEEDED`, `QUOTA_EXCEEDED`, `NOT_FOUND`, `ALREADY_EXISTS`, `PERMISSION_DENIED`, `UNAUTHENTICATED`, `RESOURCE_EXHAUSTED`, `FAILED_PRECONDITION`, `ABORTED`, `OUT_OF_RANGE`, `UNIMPLEMENTED`, `INTERNAL`, `UNAVAILABLE`, `DATA_LOSS`, or `FORBIDDEN`. + message (str): A human-readable error message describing the error. Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/pinecone/core/openapi/inference/model/model_info.py b/pinecone/core/openapi/inference/model/model_info.py index 2d983cd9..a1e10b4c 100644 --- a/pinecone/core/openapi/inference/model/model_info.py +++ b/pinecone/core/openapi/inference/model/model_info.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ @@ -150,7 +150,7 @@ def _from_openapi_data( model (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]): + supported_parameters ([ModelInfoSupportedParameter]): List of parameters supported by the model. Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -259,7 +259,7 @@ def __init__( model (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]): + supported_parameters ([ModelInfoSupportedParameter]): List of parameters supported by the model. Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/pinecone/core/openapi/inference/model/model_info_list.py b/pinecone/core/openapi/inference/model/model_info_list.py index a47cb910..753524ed 100644 --- a/pinecone/core/openapi/inference/model/model_info_list.py +++ b/pinecone/core/openapi/inference/model/model_info_list.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ @@ -143,7 +143,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,) - models ([ModelInfo]): [optional] # noqa: E501 + models ([ModelInfo]): List of available models. [optional] # noqa: E501 """ _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", False) @@ -233,7 +233,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,) - models ([ModelInfo]): [optional] # noqa: E501 + models ([ModelInfo]): List of available models. [optional] # noqa: E501 """ _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", True) diff --git a/pinecone/core/openapi/inference/model/model_info_metric.py b/pinecone/core/openapi/inference/model/model_info_metric.py deleted file mode 100644 index 0dbcbf1f..00000000 --- a/pinecone/core/openapi/inference/model/model_info_metric.py +++ /dev/null @@ -1,294 +0,0 @@ -""" -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( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_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__,), - ) - - _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", True) - _enforce_validations = kwargs.pop("_enforce_validations", True) - _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._enforce_allowed_values = _enforce_allowed_values - self._enforce_validations = _enforce_validations - 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__,), - ) - - _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", False) - _enforce_validations = kwargs.pop("_enforce_validations", False) - _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._enforce_allowed_values = _enforce_allowed_values - self._enforce_validations = _enforce_validations - 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 index a13fec67..ff34dfed 100644 --- a/pinecone/core/openapi/inference/model/model_info_supported_metrics.py +++ b/pinecone/core/openapi/inference/model/model_info_supported_metrics.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ @@ -27,12 +27,6 @@ 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 @@ -71,7 +65,6 @@ 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 @@ -86,8 +79,7 @@ def openapi_types(cls): openapi_types (dict): The key is attribute name and the value is attribute type. """ - lazy_import() - return {"value": ([ModelInfoMetric],)} + return {"value": ([str],)} @cached_class_property def discriminator(cls): @@ -119,10 +111,10 @@ def __init__(self, *args, **kwargs) -> None: 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 + args[0] ([str]): 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 + value ([str]): 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. @@ -211,10 +203,10 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: 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 + args[0] ([str]): 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 + value ([str]): 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. diff --git a/pinecone/core/openapi/inference/model/model_info_supported_parameter.py b/pinecone/core/openapi/inference/model/model_info_supported_parameter.py index ec84f8ea..542d50ba 100644 --- a/pinecone/core/openapi/inference/model/model_info_supported_parameter.py +++ b/pinecone/core/openapi/inference/model/model_info_supported_parameter.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-04 +The version of the OpenAPI document: 2025-10 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 e222d005..2caa6dd8 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-04 +The version of the OpenAPI document: 2025-10 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 f9539da4..2f777938 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-04 +The version of the OpenAPI document: 2025-10 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 cc7e2b7c..458d27f7 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-04 +The version of the OpenAPI document: 2025-10 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 02ae6320..a92a2ab7 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-04 +The version of the OpenAPI document: 2025-10 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 a86574f9..56aaddec 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-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ diff --git a/pinecone/core/openapi/inference/models/__init__.py b/pinecone/core/openapi/inference/models/__init__.py index d68ec1ff..c4e2d613 100644 --- a/pinecone/core/openapi/inference/models/__init__.py +++ b/pinecone/core/openapi/inference/models/__init__.py @@ -20,7 +20,6 @@ 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, ) diff --git a/pinecone/core/openapi/oauth/__init__.py b/pinecone/core/openapi/oauth/__init__.py index 95b9e822..d9fb0907 100644 --- a/pinecone/core/openapi/oauth/__init__.py +++ b/pinecone/core/openapi/oauth/__init__.py @@ -7,7 +7,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-04 +The version of the OpenAPI document: 2025-10 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-04" +API_VERSION = "2025-10" diff --git a/pinecone/core/openapi/oauth/api/o_auth_api.py b/pinecone/core/openapi/oauth/api/o_auth_api.py index e2d90fb7..818e7c2c 100644 --- a/pinecone/core/openapi/oauth/api/o_auth_api.py +++ b/pinecone/core/openapi/oauth/api/o_auth_api.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ @@ -23,7 +23,7 @@ none_type, validate_and_convert_types, ) -from pinecone.core.openapi.oauth.model.inline_response400 import InlineResponse400 +from pinecone.core.openapi.oauth.model.error_response import ErrorResponse from pinecone.core.openapi.oauth.model.token_request import TokenRequest from pinecone.core.openapi.oauth.model.token_response import TokenResponse @@ -39,18 +39,24 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient() self.api_client = api_client - def __get_token(self, token_request, **kwargs: ExtraOpenApiKwargsTypedDict): - """Get an access token # noqa: E501 + def __get_token( + self, + token_request, + x_pinecone_api_version="2025-10", + **kwargs: ExtraOpenApiKwargsTypedDict, + ): + """Create an access token # noqa: E501 Obtain an access token for a service account using the OAuth2 client credentials flow. An access token is needed to authorize requests to the Pinecone Admin API. The host domain for OAuth endpoints is `login.pinecone.io`. # 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_token(token_request, async_req=True) + >>> thread = api.get_token(token_request, x_pinecone_api_version="2025-10", async_req=True) >>> result = thread.get() Args: token_request (TokenRequest): A request to exchange client credentials for an access token. + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -76,6 +82,7 @@ def __get_token(self, token_request, **kwargs: ExtraOpenApiKwargsTypedDict): thread. """ kwargs = self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["token_request"] = token_request return self.call_with_http_info(**kwargs) @@ -89,8 +96,8 @@ def __get_token(self, token_request, **kwargs: ExtraOpenApiKwargsTypedDict): "servers": None, }, params_map={ - "all": ["token_request"], - "required": ["token_request"], + "all": ["x_pinecone_api_version", "token_request"], + "required": ["x_pinecone_api_version", "token_request"], "nullable": [], "enum": [], "validation": [], @@ -98,9 +105,12 @@ def __get_token(self, token_request, **kwargs: ExtraOpenApiKwargsTypedDict): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"token_request": (TokenRequest,)}, - "attribute_map": {}, - "location_map": {"token_request": "body"}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "token_request": (TokenRequest,), + }, + "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, + "location_map": {"x_pinecone_api_version": "header", "token_request": "body"}, "collection_format_map": {}, }, headers_map={ @@ -123,14 +133,15 @@ def __init__(self, api_client=None) -> None: api_client = AsyncioApiClient() self.api_client = api_client - async def __get_token(self, token_request, **kwargs): - """Get an access token # noqa: E501 + async def __get_token(self, token_request, x_pinecone_api_version="2025-10", **kwargs): + """Create an access token # noqa: E501 Obtain an access token for a service account using the OAuth2 client credentials flow. An access token is needed to authorize requests to the Pinecone Admin API. The host domain for OAuth endpoints is `login.pinecone.io`. # noqa: E501 Args: token_request (TokenRequest): A request to exchange client credentials for an access token. + x_pinecone_api_version (str): Required date-based version header Defaults to "2025-10", must be one of ["2025-10"] Keyword Args: _return_http_data_only (bool): response data without head status @@ -153,6 +164,7 @@ async def __get_token(self, token_request, **kwargs): TokenResponse """ self._process_openapi_kwargs(kwargs) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version kwargs["token_request"] = token_request return await self.call_with_http_info(**kwargs) @@ -166,8 +178,8 @@ async def __get_token(self, token_request, **kwargs): "servers": None, }, params_map={ - "all": ["token_request"], - "required": ["token_request"], + "all": ["x_pinecone_api_version", "token_request"], + "required": ["x_pinecone_api_version", "token_request"], "nullable": [], "enum": [], "validation": [], @@ -175,9 +187,12 @@ async def __get_token(self, token_request, **kwargs): root_map={ "validations": {}, "allowed_values": {}, - "openapi_types": {"token_request": (TokenRequest,)}, - "attribute_map": {}, - "location_map": {"token_request": "body"}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "token_request": (TokenRequest,), + }, + "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, + "location_map": {"x_pinecone_api_version": "header", "token_request": "body"}, "collection_format_map": {}, }, headers_map={ diff --git a/pinecone/core/openapi/oauth/model/inline_response400.py b/pinecone/core/openapi/oauth/model/error_response.py similarity index 98% rename from pinecone/core/openapi/oauth/model/inline_response400.py rename to pinecone/core/openapi/oauth/model/error_response.py index 44d0a076..62670741 100644 --- a/pinecone/core/openapi/oauth/model/inline_response400.py +++ b/pinecone/core/openapi/oauth/model/error_response.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ @@ -30,10 +30,10 @@ from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar from pinecone.openapi_support import PropertyValidationTypedDict, cached_class_property -T = TypeVar("T", bound="InlineResponse400") +T = TypeVar("T", bound="ErrorResponse") -class InlineResponse400(ModelNormal): +class ErrorResponse(ModelNormal): """NOTE: This class is @generated using OpenAPI. Do not edit the class manually. @@ -104,7 +104,7 @@ def discriminator(cls): @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 - """InlineResponse400 - a model defined in OpenAPI + """ErrorResponse - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -195,7 +195,7 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 @convert_js_args_to_python_args def __init__(self, *args, **kwargs) -> None: # noqa: E501 - """InlineResponse400 - a model defined in OpenAPI + """ErrorResponse - a model defined in OpenAPI Keyword Args: _check_type (bool): if True, values for parameters in openapi_types diff --git a/pinecone/core/openapi/oauth/model/token_request.py b/pinecone/core/openapi/oauth/model/token_request.py index 8695acbd..bcf94e93 100644 --- a/pinecone/core/openapi/oauth/model/token_request.py +++ b/pinecone/core/openapi/oauth/model/token_request.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ @@ -59,10 +59,7 @@ class TokenRequest(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - ("grant_type",): {"CLIENT_CREDENTIALS": "client_credentials"}, - ("audience",): {"HTTPS://API.PINECONE.IO/": "https://api.pinecone.io/"}, - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @@ -110,16 +107,18 @@ def discriminator(cls): @classmethod @convert_js_args_to_python_args - def _from_openapi_data(cls: Type[T], client_id, client_secret, *args, **kwargs) -> T: # noqa: E501 + def _from_openapi_data( + cls: Type[T], client_id, client_secret, grant_type, audience, *args, **kwargs + ) -> T: # noqa: E501 """TokenRequest - a model defined in OpenAPI Args: client_id (str): The service account's client ID. client_secret (str): The service account's client secret. + grant_type (str): The type of grant to use. + audience (str): The audience for the token. Keyword Args: - grant_type (str): The type of grant to use. defaults to "client_credentials", must be one of ["client_credentials", ] # noqa: E501 - audience (str): The audience for the token. defaults to "https://api.pinecone.io/", must be one of ["https://api.pinecone.io/", ] # 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. @@ -152,8 +151,6 @@ def _from_openapi_data(cls: Type[T], client_id, client_secret, *args, **kwargs) _visited_composed_classes = (Animal,) """ - grant_type = kwargs.get("grant_type", "client_credentials") - audience = kwargs.get("audience", "https://api.pinecone.io/") _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", False) _enforce_validations = kwargs.pop("_enforce_validations", False) _check_type = kwargs.pop("_check_type", True) @@ -211,16 +208,16 @@ def _from_openapi_data(cls: Type[T], client_id, client_secret, *args, **kwargs) ) @convert_js_args_to_python_args - def __init__(self, client_id, client_secret, *args, **kwargs) -> None: # noqa: E501 + def __init__(self, client_id, client_secret, grant_type, audience, *args, **kwargs) -> None: # noqa: E501 """TokenRequest - a model defined in OpenAPI Args: client_id (str): The service account's client ID. client_secret (str): The service account's client secret. + grant_type (str): The type of grant to use. + audience (str): The audience for the token. Keyword Args: - grant_type (str): The type of grant to use. defaults to "client_credentials", must be one of ["client_credentials", ] # noqa: E501 - audience (str): The audience for the token. defaults to "https://api.pinecone.io/", must be one of ["https://api.pinecone.io/", ] # 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. @@ -253,8 +250,6 @@ def __init__(self, client_id, client_secret, *args, **kwargs) -> None: # noqa: _visited_composed_classes = (Animal,) """ - grant_type = kwargs.get("grant_type", "client_credentials") - audience = kwargs.get("audience", "https://api.pinecone.io/") _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", True) _enforce_validations = kwargs.pop("_enforce_validations", True) _check_type = kwargs.pop("_check_type", True) diff --git a/pinecone/core/openapi/oauth/model/token_response.py b/pinecone/core/openapi/oauth/model/token_response.py index d6039c0f..d657275d 100644 --- a/pinecone/core/openapi/oauth/model/token_response.py +++ b/pinecone/core/openapi/oauth/model/token_response.py @@ -5,7 +5,7 @@ This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-04 +The version of the OpenAPI document: 2025-10 Contact: support@pinecone.io """ @@ -59,7 +59,7 @@ class TokenResponse(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {("token_type",): {"BEARER": "Bearer"}} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @@ -105,15 +105,17 @@ def discriminator(cls): @classmethod @convert_js_args_to_python_args - def _from_openapi_data(cls: Type[T], access_token, expires_in, *args, **kwargs) -> T: # noqa: E501 + def _from_openapi_data( + cls: Type[T], access_token, token_type, expires_in, *args, **kwargs + ) -> T: # noqa: E501 """TokenResponse - a model defined in OpenAPI Args: access_token (str): The access token. + token_type (str): The type of token. Possible values: `Bearer`. expires_in (int): The number of seconds until the token expires. Keyword Args: - token_type (str): The type of token. defaults to "Bearer", must be one of ["Bearer", ] # 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. @@ -146,7 +148,6 @@ def _from_openapi_data(cls: Type[T], access_token, expires_in, *args, **kwargs) _visited_composed_classes = (Animal,) """ - token_type = kwargs.get("token_type", "Bearer") _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", False) _enforce_validations = kwargs.pop("_enforce_validations", False) _check_type = kwargs.pop("_check_type", True) @@ -203,15 +204,15 @@ def _from_openapi_data(cls: Type[T], access_token, expires_in, *args, **kwargs) ) @convert_js_args_to_python_args - def __init__(self, access_token, expires_in, *args, **kwargs) -> None: # noqa: E501 + def __init__(self, access_token, token_type, expires_in, *args, **kwargs) -> None: # noqa: E501 """TokenResponse - a model defined in OpenAPI Args: access_token (str): The access token. + token_type (str): The type of token. Possible values: `Bearer`. expires_in (int): The number of seconds until the token expires. Keyword Args: - token_type (str): The type of token. defaults to "Bearer", must be one of ["Bearer", ] # 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. @@ -244,7 +245,6 @@ def __init__(self, access_token, expires_in, *args, **kwargs) -> None: # noqa: _visited_composed_classes = (Animal,) """ - token_type = kwargs.get("token_type", "Bearer") _enforce_allowed_values = kwargs.pop("_enforce_allowed_values", True) _enforce_validations = kwargs.pop("_enforce_validations", True) _check_type = kwargs.pop("_check_type", True) diff --git a/pinecone/core/openapi/oauth/models/__init__.py b/pinecone/core/openapi/oauth/models/__init__.py index 00cf81bf..fd3cea8c 100644 --- a/pinecone/core/openapi/oauth/models/__init__.py +++ b/pinecone/core/openapi/oauth/models/__init__.py @@ -9,6 +9,6 @@ # import sys # sys.setrecursionlimit(n) -from pinecone.core.openapi.oauth.model.inline_response400 import InlineResponse400 +from pinecone.core.openapi.oauth.model.error_response import ErrorResponse from pinecone.core.openapi.oauth.model.token_request import TokenRequest from pinecone.core.openapi.oauth.model.token_response import TokenResponse diff --git a/pinecone/db_control/models/index_model.py b/pinecone/db_control/models/index_model.py index a268df57..e91a12b6 100644 --- a/pinecone/db_control/models/index_model.py +++ b/pinecone/db_control/models/index_model.py @@ -1,18 +1,22 @@ from pinecone.core.openapi.db_control.model.index_model import IndexModel as OpenAPIIndexModel import json from pinecone.utils.repr_overrides import custom_serializer +from pinecone.utils.dict_like import DictLike class IndexModel: def __init__(self, index: OpenAPIIndexModel): self.index = index - self.deletion_protection = index.deletion_protection.value def __str__(self): return str(self.index) def __getattr__(self, attr): - return getattr(self.index, attr) + value = getattr(self.index, attr) + # If the attribute is 'spec' and it's a dictionary, wrap it in DictLike + if attr == "spec" and isinstance(value, dict): + return DictLike(value) + return value def __getitem__(self, key): return self.__getattr__(key) diff --git a/pinecone/db_control/models/serverless_spec.py b/pinecone/db_control/models/serverless_spec.py index 1fc51564..4c844c56 100644 --- a/pinecone/db_control/models/serverless_spec.py +++ b/pinecone/db_control/models/serverless_spec.py @@ -1,5 +1,5 @@ from dataclasses import dataclass -from typing import Union +from typing import Union, Optional, Dict, Any from enum import Enum from ..enums import CloudProvider, AwsRegion, GcpRegion, AzureRegion @@ -9,17 +9,23 @@ class ServerlessSpec: cloud: str region: str + read_capacity: Optional[Dict[str, Any]] = None def __init__( self, cloud: Union[CloudProvider, str], region: Union[AwsRegion, GcpRegion, AzureRegion, str], + read_capacity: Optional[Dict[str, Any]] = None, ): # Convert Enums to their string values if necessary object.__setattr__(self, "cloud", cloud.value if isinstance(cloud, Enum) else str(cloud)) object.__setattr__( self, "region", region.value if isinstance(region, Enum) else str(region) ) + object.__setattr__(self, "read_capacity", read_capacity) def asdict(self): - return {"serverless": {"cloud": self.cloud, "region": self.region}} + result = {"serverless": {"cloud": self.cloud, "region": self.region}} + if self.read_capacity is not None: + result["serverless"]["read_capacity"] = self.read_capacity + return result diff --git a/pinecone/db_control/request_factory.py b/pinecone/db_control/request_factory.py index 070185e9..581ce9b2 100644 --- a/pinecone/db_control/request_factory.py +++ b/pinecone/db_control/request_factory.py @@ -13,23 +13,26 @@ ) from pinecone.core.openapi.db_control.model.create_index_request import CreateIndexRequest from pinecone.core.openapi.db_control.model.configure_index_request import ConfigureIndexRequest -from pinecone.core.openapi.db_control.model.configure_index_request_spec import ( - ConfigureIndexRequestSpec, -) -from pinecone.core.openapi.db_control.model.configure_index_request_spec_pod import ( - ConfigureIndexRequestSpecPod, -) from pinecone.core.openapi.db_control.model.configure_index_request_embed import ( ConfigureIndexRequestEmbed, ) -from pinecone.core.openapi.db_control.model.deletion_protection import ( - DeletionProtection as DeletionProtectionModel, -) 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.serverless_spec import ( ServerlessSpec as ServerlessSpecModel, ) +from pinecone.core.openapi.db_control.model.read_capacity_on_demand_spec import ( + ReadCapacityOnDemandSpec, +) +from pinecone.core.openapi.db_control.model.read_capacity_dedicated_spec import ( + ReadCapacityDedicatedSpec, +) +from pinecone.core.openapi.db_control.model.read_capacity_dedicated_config import ( + ReadCapacityDedicatedConfig, +) +from pinecone.core.openapi.db_control.model.scaling_config_manual import ( + ScalingConfigManual, +) from pinecone.core.openapi.db_control.model.byoc_spec import ByocSpec as ByocSpecModel from pinecone.core.openapi.db_control.model.pod_spec import PodSpec as PodSpecModel from pinecone.core.openapi.db_control.model.pod_spec_metadata_config import PodSpecMetadataConfig @@ -70,15 +73,39 @@ def __parse_tags(tags: Optional[Dict[str, str]]) -> IndexTags: return IndexTags(**tags) @staticmethod - def __parse_deletion_protection( - deletion_protection: Union[DeletionProtection, str], - ) -> DeletionProtectionModel: + def __parse_deletion_protection(deletion_protection: Union[DeletionProtection, str]) -> str: deletion_protection = convert_enum_to_string(deletion_protection) if deletion_protection in ["enabled", "disabled"]: - return DeletionProtectionModel(deletion_protection) + return deletion_protection else: raise ValueError("deletion_protection must be either 'enabled' or 'disabled'") + @staticmethod + def __parse_read_capacity(read_capacity: Dict[str, Any]): + """Convert read_capacity dict to appropriate OpenAPI model.""" + if not read_capacity: + return None + + mode = read_capacity.get("mode") + if mode == "OnDemand": + return ReadCapacityOnDemandSpec(mode="OnDemand") + elif mode == "Dedicated": + dedicated_config = read_capacity.get("dedicated", {}) + manual_config = dedicated_config.get("manual") + manual = None + if manual_config: + manual = ScalingConfigManual( + shards=manual_config["shards"], replicas=manual_config["replicas"] + ) + dedicated = ReadCapacityDedicatedConfig( + node_type=dedicated_config["node_type"], + scaling=dedicated_config["scaling"], + manual=manual, + ) + return ReadCapacityDedicatedSpec(mode="Dedicated", dedicated=dedicated) + else: + raise ValueError(f"Invalid read_capacity mode: {mode}. Must be 'OnDemand' or 'Dedicated'") + @staticmethod def __parse_index_spec(spec: Union[Dict, ServerlessSpec, PodSpec, ByocSpec]) -> IndexSpec: if isinstance(spec, dict): @@ -86,7 +113,13 @@ def __parse_index_spec(spec: Union[Dict, ServerlessSpec, PodSpec, ByocSpec]) -> spec["serverless"]["cloud"] = convert_enum_to_string(spec["serverless"]["cloud"]) spec["serverless"]["region"] = convert_enum_to_string(spec["serverless"]["region"]) - index_spec = IndexSpec(serverless=ServerlessSpecModel(**spec["serverless"])) + serverless_dict = spec["serverless"].copy() + if "read_capacity" in serverless_dict: + serverless_dict["read_capacity"] = PineconeDBControlRequestFactory.__parse_read_capacity( + serverless_dict["read_capacity"] + ) + + index_spec = IndexSpec(serverless=ServerlessSpecModel(**serverless_dict)) elif "pod" in spec: spec["pod"]["environment"] = convert_enum_to_string(spec["pod"]["environment"]) args_dict = parse_non_empty_args( @@ -109,9 +142,12 @@ def __parse_index_spec(spec: Union[Dict, ServerlessSpec, PodSpec, ByocSpec]) -> else: raise ValueError("spec must contain either 'serverless', 'pod', or 'byoc' key") elif isinstance(spec, ServerlessSpec): - index_spec = IndexSpec( - serverless=ServerlessSpecModel(cloud=spec.cloud, region=spec.region) - ) + serverless_args = {"cloud": spec.cloud, "region": spec.region} + if spec.read_capacity is not None: + serverless_args["read_capacity"] = PineconeDBControlRequestFactory.__parse_read_capacity( + spec.read_capacity + ) + index_spec = IndexSpec(serverless=ServerlessSpecModel(**serverless_args)) elif isinstance(spec, PodSpec): args_dict = parse_non_empty_args( [ @@ -247,11 +283,11 @@ def configure_index_request( embed: Optional[Union[ConfigureIndexEmbed, Dict]] = None, ): if deletion_protection is None: - dp = DeletionProtectionModel(description.deletion_protection) + dp = description.deletion_protection elif isinstance(deletion_protection, DeletionProtection): - dp = DeletionProtectionModel(deletion_protection.value) + dp = deletion_protection.value elif deletion_protection in ["enabled", "disabled"]: - dp = DeletionProtectionModel(deletion_protection) + dp = deletion_protection else: raise ValueError("deletion_protection must be either 'enabled' or 'disabled'") @@ -281,7 +317,7 @@ def configure_index_request( spec = None if pod_config_args: - spec = ConfigureIndexRequestSpec(pod=ConfigureIndexRequestSpecPod(**pod_config_args)) + spec = {"pod": pod_config_args} args_dict = parse_non_empty_args( [ diff --git a/pinecone/db_data/index.py b/pinecone/db_data/index.py index fdee9092..37f9ca56 100644 --- a/pinecone/db_data/index.py +++ b/pinecone/db_data/index.py @@ -643,7 +643,7 @@ def delete_namespace(self, namespace: str, **kwargs) -> Dict[str, Any]: @validate_and_convert_errors @require_kwargs def list_namespaces( - self, limit: Optional[int] = None, **kwargs + self, limit: Optional[int] = None, **kwargs ) -> Iterator[ListNamespacesResponse]: return self.namespace.list(limit=limit, **kwargs) @@ -652,4 +652,6 @@ def list_namespaces( def list_namespaces_paginated( self, limit: Optional[int] = None, pagination_token: Optional[str] = None, **kwargs ) -> ListNamespacesResponse: - return self.namespace.list_paginated(limit=limit, pagination_token=pagination_token, **kwargs) \ No newline at end of file + return self.namespace.list_paginated( + limit=limit, pagination_token=pagination_token, **kwargs + ) diff --git a/pinecone/db_data/index_asyncio.py b/pinecone/db_data/index_asyncio.py index 6bfd53da..65fe6643 100644 --- a/pinecone/db_data/index_asyncio.py +++ b/pinecone/db_data/index_asyncio.py @@ -682,7 +682,7 @@ async def delete_namespace(self, namespace: str, **kwargs) -> Dict[str, Any]: @validate_and_convert_errors @require_kwargs async def list_namespaces( - self, limit: Optional[int] = None, **kwargs + self, limit: Optional[int] = None, **kwargs ) -> AsyncIterator[ListNamespacesResponse]: async for namespace in self.namespace.list(limit=limit, **kwargs): yield namespace @@ -692,6 +692,9 @@ async def list_namespaces( async def list_namespaces_paginated( self, limit: Optional[int] = None, pagination_token: Optional[str] = None, **kwargs ) -> ListNamespacesResponse: - return await self.namespace.list_paginated(limit=limit, pagination_token=pagination_token, **kwargs) + return await self.namespace.list_paginated( + limit=limit, pagination_token=pagination_token, **kwargs + ) + IndexAsyncio = _IndexAsyncio diff --git a/pinecone/db_data/index_asyncio_interface.py b/pinecone/db_data/index_asyncio_interface.py index e057f0a0..af8841fb 100644 --- a/pinecone/db_data/index_asyncio_interface.py +++ b/pinecone/db_data/index_asyncio_interface.py @@ -886,4 +886,4 @@ async def list_namespaces_paginated( eyJza2lwX3Bhc3QiOiI5OTMiLCJwcmVmaXgiOiI5OSJ9 >>> next_results = await index.list_namespaces_paginated(limit=5, pagination_token=results.pagination.next) """ - pass \ No newline at end of file + pass diff --git a/pinecone/db_data/interfaces.py b/pinecone/db_data/interfaces.py index 12c47071..4cc47364 100644 --- a/pinecone/db_data/interfaces.py +++ b/pinecone/db_data/interfaces.py @@ -823,7 +823,7 @@ def delete_namespace(self, namespace: str, **kwargs) -> Dict[str, Any]: @abstractmethod @require_kwargs def list_namespaces( - self, limit: Optional[int] = None, **kwargs + self, limit: Optional[int] = None, **kwargs ) -> Iterator[ListNamespacesResponse]: """List all namespaces in an index. This method automatically handles pagination to return all results. @@ -867,4 +867,4 @@ def list_namespaces_paginated( eyJza2lwX3Bhc3QiOiI5OTMiLCJwcmVmaXgiOiI5OSJ9 >>> next_results = index.list_namespaces_paginated(limit=5, pagination_token=results.pagination.next) """ - pass \ No newline at end of file + pass diff --git a/pinecone/db_data/resources/asyncio/namespace_asyncio.py b/pinecone/db_data/resources/asyncio/namespace_asyncio.py index 5be4e4ae..f59b0cc2 100644 --- a/pinecone/db_data/resources/asyncio/namespace_asyncio.py +++ b/pinecone/db_data/resources/asyncio/namespace_asyncio.py @@ -1,10 +1,7 @@ from typing import Optional, AsyncIterator from pinecone.core.openapi.db_data.api.namespace_operations_api import AsyncioNamespaceOperationsApi -from pinecone.core.openapi.db_data.models import ( - ListNamespacesResponse, - NamespaceDescription, -) +from pinecone.core.openapi.db_data.models import ListNamespacesResponse, NamespaceDescription from pinecone.utils import install_json_repr_override, require_kwargs @@ -44,7 +41,9 @@ async def delete(self, namespace: str, **kwargs): return await self.__namespace_operations_api.delete_namespace(**args) @require_kwargs - async def list(self, limit: Optional[int] = None, **kwargs) -> AsyncIterator[ListNamespacesResponse]: + async def list( + self, limit: Optional[int] = None, **kwargs + ) -> AsyncIterator[ListNamespacesResponse]: """ Args: limit (Optional[int]): The maximum number of namespaces to fetch in each network call. If unspecified, the server will use a default value. [optional] @@ -103,5 +102,7 @@ async def list_paginated( eyJza2lwX3Bhc3QiOiI5OTMiLCJwcmVmaXgiOiI5OSJ9 >>> next_results = await index.list_paginated(limit=5, pagination_token=results.pagination.next) """ - args = NamespaceRequestFactory.list_namespaces_args(limit=limit, pagination_token=pagination_token, **kwargs) - return await self.__namespace_operations_api.list_namespaces_operation(**args) \ No newline at end of file + args = NamespaceRequestFactory.list_namespaces_args( + limit=limit, pagination_token=pagination_token, **kwargs + ) + return await self.__namespace_operations_api.list_namespaces_operation(**args) diff --git a/pinecone/db_data/resources/sync/namespace.py b/pinecone/db_data/resources/sync/namespace.py index 944573bc..5980ec71 100644 --- a/pinecone/db_data/resources/sync/namespace.py +++ b/pinecone/db_data/resources/sync/namespace.py @@ -1,10 +1,7 @@ from typing import Optional, Iterator from pinecone.core.openapi.db_data.api.namespace_operations_api import NamespaceOperationsApi -from pinecone.core.openapi.db_data.models import ( - ListNamespacesResponse, - NamespaceDescription, -) +from pinecone.core.openapi.db_data.models import ListNamespacesResponse, NamespaceDescription from pinecone.utils import install_json_repr_override, PluginAware, require_kwargs @@ -15,13 +12,7 @@ class NamespaceResource(PluginAware): - def __init__( - self, - api_client, - config, - openapi_config, - pool_threads: int, - ) -> None: + def __init__(self, api_client, config, openapi_config, pool_threads: int) -> None: self.config = config """ :meta private: """ @@ -119,5 +110,7 @@ def list_paginated( eyJza2lwX3Bhc3QiOiI5OTMiLCJwcmVmaXgiOiI5OSJ9 >>> next_results = index.list_paginated(limit=5, pagination_token=results.pagination.next) """ - args = NamespaceRequestFactory.list_namespaces_args(limit=limit, pagination_token=pagination_token, **kwargs) - return self.__namespace_operations_api.list_namespaces_operation(**args) \ No newline at end of file + args = NamespaceRequestFactory.list_namespaces_args( + limit=limit, pagination_token=pagination_token, **kwargs + ) + return self.__namespace_operations_api.list_namespaces_operation(**args) diff --git a/pinecone/db_data/resources/sync/namespace_request_factory.py b/pinecone/db_data/resources/sync/namespace_request_factory.py index 7174276b..30ae5498 100644 --- a/pinecone/db_data/resources/sync/namespace_request_factory.py +++ b/pinecone/db_data/resources/sync/namespace_request_factory.py @@ -15,14 +15,14 @@ class NamespaceRequestFactory: @staticmethod def describe_namespace_args(namespace: str, **kwargs) -> DescribeNamespaceArgs: if not isinstance(namespace, str): - raise ValueError('namespace must be string') + raise ValueError("namespace must be string") base_args = {"namespace": namespace} return cast(DescribeNamespaceArgs, {**base_args, **kwargs}) @staticmethod def delete_namespace_args(namespace: str, **kwargs) -> DeleteNamespaceArgs: if not isinstance(namespace, str): - raise ValueError('namespace must be string') + raise ValueError("namespace must be string") base_args = {"namespace": namespace} return cast(DeleteNamespaceArgs, {**base_args, **kwargs}) @@ -31,4 +31,4 @@ def list_namespaces_args( limit: Optional[int] = None, pagination_token: Optional[str] = None, **kwargs ) -> dict[str, Any]: base_args = parse_non_empty_args([("limit", limit), ("pagination_token", pagination_token)]) - return {**base_args, **kwargs} \ No newline at end of file + return {**base_args, **kwargs} diff --git a/pinecone/db_data/types/__init__.py b/pinecone/db_data/types/__init__.py index 277731d5..53a6e5a8 100644 --- a/pinecone/db_data/types/__init__.py +++ b/pinecone/db_data/types/__init__.py @@ -18,4 +18,3 @@ "SearchQueryTypedDict", "SearchQueryVectorTypedDict", ] - diff --git a/pinecone/grpc/index_grpc.py b/pinecone/grpc/index_grpc.py index 83fce126..ef51a8d2 100644 --- a/pinecone/grpc/index_grpc.py +++ b/pinecone/grpc/index_grpc.py @@ -62,7 +62,14 @@ ) -__all__ = ["GRPCIndex", "GRPCVector", "GRPCQueryVector", "GRPCSparseValues", "NamespaceDescription", "ListNamespacesResponse"] +__all__ = [ + "GRPCIndex", + "GRPCVector", + "GRPCQueryVector", + "GRPCSparseValues", + "NamespaceDescription", + "ListNamespacesResponse", +] _logger = logging.getLogger(__name__) """ :meta private: """ @@ -690,9 +697,7 @@ def describe_index_stats( return parse_stats_response(json_response) @require_kwargs - def describe_namespace( - self, namespace: str, **kwargs - ) -> NamespaceDescription: + def describe_namespace(self, namespace: str, **kwargs) -> NamespaceDescription: """ The describe_namespace operation returns information about a specific namespace, including the total number of vectors in the namespace. @@ -714,9 +719,7 @@ def describe_namespace( return parse_namespace_description(response) @require_kwargs - def delete_namespace( - self, namespace: str, **kwargs - ) -> Dict[str, Any]: + def delete_namespace(self, namespace: str, **kwargs) -> Dict[str, Any]: """ The delete_namespace operation deletes a namespace from an index. This operation is irreversible and will permanently delete all data in the namespace. @@ -739,10 +742,7 @@ def delete_namespace( @require_kwargs def list_namespaces_paginated( - self, - limit: Optional[int] = None, - pagination_token: Optional[str] = None, - **kwargs, + self, limit: Optional[int] = None, pagination_token: Optional[str] = None, **kwargs ) -> ListNamespacesResponse: """ The list_namespaces_paginated operation returns a list of all namespaces in a serverless index. @@ -767,10 +767,7 @@ def list_namespaces_paginated( Returns: ListNamespacesResponse object which contains the list of namespaces and pagination information. """ args_dict = self._parse_non_empty_args( - [ - ("limit", limit), - ("pagination_token", pagination_token), - ] + [("limit", limit), ("pagination_token", pagination_token)] ) timeout = kwargs.pop("timeout", None) request = ListNamespacesRequest(**args_dict, **kwargs) diff --git a/pinecone/grpc/utils.py b/pinecone/grpc/utils.py index 1be98f5b..e741809a 100644 --- a/pinecone/grpc/utils.py +++ b/pinecone/grpc/utils.py @@ -142,24 +142,17 @@ def parse_namespace_description(response: Message) -> NamespaceDescription: def parse_list_namespaces_response(response: Message) -> ListNamespacesResponse: json_response = json_format.MessageToDict(response) - + namespaces = [] for ns in json_response.get("namespaces", []): - namespaces.append(NamespaceDescription( - name=ns.get("name", ""), - record_count=ns.get("recordCount", 0), - _check_type=False, - )) - + namespaces.append( + NamespaceDescription( + name=ns.get("name", ""), record_count=ns.get("recordCount", 0), _check_type=False + ) + ) + pagination = None if "pagination" in json_response and json_response["pagination"]: - pagination = Pagination( - next=json_response["pagination"].get("next", ""), - _check_type=False, - ) - - return ListNamespacesResponse( - namespaces=namespaces, - pagination=pagination, - _check_type=False, - ) + pagination = Pagination(next=json_response["pagination"].get("next", ""), _check_type=False) + + return ListNamespacesResponse(namespaces=namespaces, pagination=pagination, _check_type=False) diff --git a/pinecone/inference/inference_request_builder.py b/pinecone/inference/inference_request_builder.py index 3e10c1fe..7617eb68 100644 --- a/pinecone/inference/inference_request_builder.py +++ b/pinecone/inference/inference_request_builder.py @@ -13,6 +13,7 @@ class EmbedModel(Enum): Multilingual_E5_Large = "multilingual-e5-large" Pinecone_Sparse_English_V0 = "pinecone-sparse-english-v0" + Llama_Text_Embed_V2 = "llama-text-embed-v2" class RerankModel(Enum): diff --git a/pinecone/openapi_support/api_version.py b/pinecone/openapi_support/api_version.py index 403ff26f..37874aca 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-04" -APIS_REPO_SHA = "7e21ca9adb6a530ce11909d6209d69551f86e9bd" +API_VERSION = "2025-10" +APIS_REPO_SHA = "8a238ada85d2e0a2937d225afba35e3aac4832e1" diff --git a/pinecone/pinecone_interface_asyncio.py b/pinecone/pinecone_interface_asyncio.py index 0d544f10..e69def8a 100644 --- a/pinecone/pinecone_interface_asyncio.py +++ b/pinecone/pinecone_interface_asyncio.py @@ -311,7 +311,8 @@ async def create_index( :param metric: Type of similarity metric used in the vector index when querying, one of ``{"cosine", "dotproduct", "euclidean"}``. :type metric: str, optional :param spec: A dictionary containing configurations describing how the index should be deployed. For serverless indexes, - specify region and cloud. For pod indexes, specify replicas, shards, pods, pod_type, metadata_config, and source_collection. + specify region, cloud, and optionally read_capacity (for OnDemand or Dedicated read capacity modes). + For pod indexes, specify replicas, shards, pods, pod_type, metadata_config, and source_collection. Alternatively, use the ``ServerlessSpec`` or ``PodSpec`` objects to specify these configurations. :type spec: Dict :param dimension: If you are creating an index with ``vector_type="dense"`` (which is the default), you need to specify ``dimension`` to indicate the size of your vectors. @@ -349,13 +350,15 @@ async def create_index( async def main(): async with PineconeAsyncio(api_key=os.environ.get("PINECONE_API_KEY")) as pc: + # Create with OnDemand read capacity (default) await pc.create_index( name="my_index", dimension=1536, metric=Metric.COSINE, spec=ServerlessSpec( cloud=CloudProvider.AWS, - region=AwsRegion.US_WEST_2 + region=AwsRegion.US_WEST_2, + read_capacity={"mode": "OnDemand"} ), deletion_protection=DeletionProtection.DISABLED, vector_type=VectorType.DENSE, @@ -366,6 +369,30 @@ async def main(): } ) + # Create with Dedicated read capacity + await pc.create_index( + name="my_dedicated_index", + dimension=1536, + metric=Metric.COSINE, + spec=ServerlessSpec( + cloud=CloudProvider.AWS, + region=AwsRegion.US_WEST_2, + read_capacity={ + "mode": "Dedicated", + "dedicated": { + "node_type": "t1", + "scaling": "Manual", + "manual": { + "shards": 2, + "replicas": 2 + } + } + } + ), + deletion_protection=DeletionProtection.DISABLED, + vector_type=VectorType.DENSE + ) + asyncio.run(main()) diff --git a/pinecone/utils/dict_like.py b/pinecone/utils/dict_like.py new file mode 100644 index 00000000..235b6c4e --- /dev/null +++ b/pinecone/utils/dict_like.py @@ -0,0 +1,346 @@ +""" +Dictionary-like object that supports both square bracket and dot notation access. + +This utility class allows you to access dictionary values using either: +- Square bracket notation: obj['key'] +- Dot notation: obj.key + +It also supports nested access for dictionaries within the structure. +""" + +from typing import Any, Dict, Union, Iterator, KeysView, ValuesView, ItemsView, MutableMapping + + +class DictLike(MutableMapping[str, Any]): + """ + A dictionary-like object that supports both square bracket and dot notation access. + + This class wraps a dictionary and provides attribute-style access to its keys. + Nested dictionaries are automatically wrapped in DictLike objects as well. + + Example: + >>> data = {'name': 'test', 'config': {'timeout': 30, 'retries': 3}} + >>> obj = DictLike(data) + >>> obj.name # 'test' + >>> obj['name'] # 'test' + >>> obj.config.timeout # 30 + >>> obj['config']['timeout'] # 30 + """ + + def __init__(self, data: Dict[str, Any]): + """ + Initialize the DictLike object with a dictionary. + + Args: + data: The dictionary to wrap + """ + self._data = data + + def __getattr__(self, key: str) -> Any: + """ + Provide dot notation access to dictionary keys. + + Args: + key: The key to access + + Returns: + The value associated with the key, wrapped in DictLike if it's a dict + + Raises: + AttributeError: If the key doesn't exist + """ + if key.startswith("_"): + # Don't interfere with private attributes + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{key}'") + + if key not in self._data: + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{key}'") + + value = self._data[key] + # Recursively wrap nested dictionaries + if isinstance(value, dict): + return DictLike(value) + return value + + def __getitem__(self, key: str) -> Any: + """ + Provide square bracket access to dictionary keys. + + Args: + key: The key to access + + Returns: + The value associated with the key, wrapped in DictLike if it's a dict + + Raises: + KeyError: If the key doesn't exist + """ + if key not in self._data: + raise KeyError(key) + + value = self._data[key] + # Recursively wrap nested dictionaries + if isinstance(value, dict): + return DictLike(value) + return value + + def __setattr__(self, key: str, value: Any) -> None: + """ + Set attributes, distinguishing between internal attributes and data keys. + + Args: + key: The key to set + value: The value to set + """ + if key.startswith("_"): + # Set internal attributes normally + super().__setattr__(key, value) + else: + # Set data keys + if not hasattr(self, "_data"): + super().__setattr__("_data", {}) + self._data[key] = value + + def __setitem__(self, key: str, value: Any) -> None: + """ + Set dictionary keys using square bracket notation. + + Args: + key: The key to set + value: The value to set + """ + self._data[key] = value + + def __delattr__(self, key: str) -> None: + """ + Delete attributes using dot notation. + + Args: + key: The key to delete + + Raises: + AttributeError: If the key doesn't exist + """ + if key.startswith("_"): + super().__delattr__(key) + elif key in self._data: + del self._data[key] + else: + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{key}'") + + def __delitem__(self, key: str) -> None: + """ + Delete dictionary keys using square bracket notation. + + Args: + key: The key to delete + + Raises: + KeyError: If the key doesn't exist + """ + if key not in self._data: + raise KeyError(key) + del self._data[key] + + def __contains__(self, key: str) -> bool: + """ + Check if a key exists in the dictionary. + + Args: + key: The key to check + + Returns: + True if the key exists, False otherwise + """ + return key in self._data + + def __iter__(self) -> Iterator[str]: + """ + Iterate over the dictionary keys. + + Returns: + An iterator over the keys + """ + return iter(self._data) + + def __len__(self) -> int: + """ + Get the number of items in the dictionary. + + Returns: + The number of items + """ + return len(self._data) + + def __repr__(self) -> str: + """ + String representation of the DictLike object. + + Returns: + A string representation showing the wrapped dictionary + """ + return f"DictLike({self._data})" + + def __str__(self) -> str: + """ + String representation of the DictLike object. + + Returns: + A string representation of the wrapped dictionary + """ + return str(self._data) + + def keys(self) -> KeysView[str]: + """Return the keys of the dictionary.""" + return self._data.keys() + + def values(self) -> ValuesView[Any]: + """Return the values of the dictionary.""" + return self._data.values() + + def items(self) -> ItemsView[str, Any]: + """Return the items of the dictionary.""" + return self._data.items() + + def get(self, key: str, default: Any = None) -> Any: + """ + Get a value with a default if the key doesn't exist. + + Args: + key: The key to get + default: The default value if key doesn't exist + + Returns: + The value or default + """ + value = self._data.get(key, default) + if isinstance(value, dict): + return DictLike(value) + return value + + def to_dict(self) -> Dict[str, Any]: + """ + Convert the DictLike object back to a regular dictionary. + + Returns: + The underlying dictionary + """ + return self._data.copy() + + def update(self, other: Union[Dict[str, Any], "DictLike"] = None, **kwargs) -> None: + """ + Update the dictionary with elements from another dictionary or iterable. + + Args: + other: Another dictionary or DictLike object to update from + **kwargs: Additional key-value pairs to update + """ + if other is not None: + if hasattr(other, "items"): + # Handle both dict and DictLike objects + for key, value in other.items(): + self._data[key] = value + else: + # Handle iterable of key-value pairs + for key, value in other: + self._data[key] = value + + # Update with keyword arguments + for key, value in kwargs.items(): + self._data[key] = value + + def pop(self, key: str, default: Any = None) -> Any: + """ + Remove and return a value from the dictionary. + + Args: + key: The key to remove + default: The default value if key doesn't exist + + Returns: + The value that was removed, or default if key doesn't exist + """ + return self._data.pop(key, default) + + def popitem(self) -> tuple[str, Any]: + """ + Remove and return a (key, value) pair from the dictionary. + + Returns: + A (key, value) pair + + Raises: + KeyError: If the dictionary is empty + """ + return self._data.popitem() + + def setdefault(self, key: str, default: Any = None) -> Any: + """ + Get a value from the dictionary, setting it to default if it doesn't exist. + + Args: + key: The key to get/set + default: The default value to set if key doesn't exist + + Returns: + The value for the key + """ + if key not in self._data: + self._data[key] = default + return self._data[key] + + def clear(self) -> None: + """Remove all items from the dictionary.""" + self._data.clear() + + def copy(self) -> "DictLike": + """ + Create a shallow copy of the DictLike object. + + Returns: + A new DictLike object with a copy of the data + """ + return DictLike(self._data.copy()) + + def __eq__(self, other: Any) -> bool: + """ + Check equality with another object. + + Args: + other: The object to compare with + + Returns: + True if equal, False otherwise + """ + if isinstance(other, DictLike): + return self._data == other._data + elif isinstance(other, dict): + return self._data == other + return False + + def __ne__(self, other: Any) -> bool: + """ + Check inequality with another object. + + Args: + other: The object to compare with + + Returns: + True if not equal, False otherwise + """ + return not self.__eq__(other) + + def __hash__(self) -> int: + """ + Hash the DictLike object. + + Note: This makes DictLike objects unhashable, which is consistent + with regular dictionaries. + + Returns: + The hash value + + Raises: + TypeError: DictLike objects are unhashable + """ + raise TypeError(f"unhashable type: '{self.__class__.__name__}'") diff --git a/tests/integration/admin/test_projects.py b/tests/integration/admin/test_projects.py index d1293240..3c41762c 100644 --- a/tests/integration/admin/test_projects.py +++ b/tests/integration/admin/test_projects.py @@ -14,7 +14,9 @@ def test_create_project(self): try: assert project.name == "test-project" - assert project.max_pods == 0 + # Our test org sees a different default value + # than typical users so we won't test it here + # assert project.max_pods == 0 assert project.force_encryption_with_cmek is False assert project.organization_id is not None assert isinstance(project.organization_id, str) @@ -23,7 +25,9 @@ def test_create_project(self): # Test dictionary-style access to project attributes assert project["name"] == "test-project" - assert project["max_pods"] == 0 + # Our test org sees a different default value + # than typical users so we won't test it here + # assert project["max_pods"] == 0 assert project["force_encryption_with_cmek"] is False assert project["organization_id"] is not None assert isinstance(project["organization_id"], str) @@ -31,7 +35,9 @@ def test_create_project(self): # Test get-style access to project attributes assert project.get("name") == "test-project" - assert project.get("max_pods") == 0 + # Our test org sees a different default value + # than typical users so we won't test it here + # assert project.get("max_pods") == 0 assert project.get("force_encryption_with_cmek") is False assert project.get("organization_id") is not None assert isinstance(project.get("organization_id"), str) diff --git a/tests/integration/control/pod/test_deletion_protection.py b/tests/integration/control/pod/test_deletion_protection.py index 8358adaf..141bb234 100644 --- a/tests/integration/control/pod/test_deletion_protection.py +++ b/tests/integration/control/pod/test_deletion_protection.py @@ -53,7 +53,7 @@ def test_configure_index_with_deletion_protection(self, client, index_name, envi delta = 2 desc = client.describe_index(index_name) if desc.status.state == "Ready": - print(f"Index {index_name} is ready after {(t-1)*delta} seconds") + print(f"Index {index_name} is ready after {(t - 1) * delta} seconds") break print("Index is not ready yet. Waiting for 2 seconds.") time.sleep(delta) diff --git a/tests/integration/control/resources/index/test_configure.py b/tests/integration/control/resources/index/test_configure.py index 96203e1a..adb4aff1 100644 --- a/tests/integration/control/resources/index/test_configure.py +++ b/tests/integration/control/resources/index/test_configure.py @@ -49,20 +49,14 @@ def test_configure_index_embed(self, pc, create_index_params): desc = pc.db.index.describe(name=name) assert desc.embed is None - embed_config = { - "model": "multilingual-e5-large", - "field_map": {"text": "chunk_text"}, - } + embed_config = {"model": "multilingual-e5-large", "field_map": {"text": "chunk_text"}} pc.db.index.configure(name=name, embed=embed_config) desc = pc.db.index.describe(name=name) assert desc.embed.model == "multilingual-e5-large" assert desc.embed.field_map == {"text": "chunk_text"} assert desc.embed.read_parameters == {"input_type": "query", "truncate": "END"} - assert desc.embed.write_parameters == { - "input_type": "passage", - "truncate": "END", - } + assert desc.embed.write_parameters == {"input_type": "passage", "truncate": "END"} assert desc.embed.vector_type == "dense" assert desc.embed.dimension == 1024 assert desc.embed.metric == "cosine" diff --git a/tests/integration/control/resources/index/test_create.py b/tests/integration/control/resources/index/test_create.py index 55bf66c2..8d62c3c3 100644 --- a/tests/integration/control/resources/index/test_create.py +++ b/tests/integration/control/resources/index/test_create.py @@ -214,7 +214,7 @@ def test_create_index_with_invalid_name(self, pc, create_index_params): def test_create_index_invalid_metric(self, pc, create_index_params): create_index_params["metric"] = "invalid" - with pytest.raises(PineconeApiValueError): + with pytest.raises(PineconeApiException): pc.db.index.create(**create_index_params) def test_create_index_with_invalid_neg_dimension(self, pc, create_index_params): diff --git a/tests/integration/control/serverless/test_configure_index_embed.py b/tests/integration/control/serverless/test_configure_index_embed.py index 82658b8a..2c1de284 100644 --- a/tests/integration/control/serverless/test_configure_index_embed.py +++ b/tests/integration/control/serverless/test_configure_index_embed.py @@ -6,20 +6,14 @@ def test_convert_index_to_integrated(self, client, create_sl_index_params): desc = client.describe_index(name) assert desc.embed is None - embed_config = { - "model": "multilingual-e5-large", - "field_map": {"text": "chunk_text"}, - } + embed_config = {"model": "multilingual-e5-large", "field_map": {"text": "chunk_text"}} client.configure_index(name, embed=embed_config) desc = client.describe_index(name) assert desc.embed.model == "multilingual-e5-large" assert desc.embed.field_map == {"text": "chunk_text"} assert desc.embed.read_parameters == {"input_type": "query", "truncate": "END"} - assert desc.embed.write_parameters == { - "input_type": "passage", - "truncate": "END", - } + assert desc.embed.write_parameters == {"input_type": "passage", "truncate": "END"} assert desc.embed.vector_type == "dense" assert desc.embed.dimension == 1024 assert desc.embed.metric == "cosine" diff --git a/tests/integration/control/serverless/test_create_index.py b/tests/integration/control/serverless/test_create_index.py index 5e7f46fe..fc308b9a 100644 --- a/tests/integration/control/serverless/test_create_index.py +++ b/tests/integration/control/serverless/test_create_index.py @@ -113,3 +113,90 @@ def test_create_with_optional_tags(self, client, create_sl_index_params): client.create_index(**create_sl_index_params) desc = client.describe_index(create_sl_index_params["name"]) assert desc.tags.to_dict() == tags + + +class TestCreateSLIndexWithReadCapacity: + def test_create_index_with_ondemand_read_capacity( + self, client: Pinecone, index_name, serverless_cloud, serverless_region + ): + """Test creating an index with explicit OnDemand read capacity.""" + resp = client.create_index( + name=index_name, + dimension=10, + spec=ServerlessSpec( + cloud=serverless_cloud, + region=serverless_region, + read_capacity={"mode": "OnDemand"}, + ), + ) + assert resp.name == index_name + assert resp.dimension == 10 + + desc = client.describe_index(name=index_name) + assert desc.name == index_name + assert desc.dimension == 10 + assert desc.spec.serverless["cloud"] == serverless_cloud + assert desc.spec.serverless["region"] == serverless_region + # Verify read_capacity is set to OnDemand + assert "read_capacity" in desc.spec.serverless + assert desc.spec.serverless["read_capacity"]["mode"] == "OnDemand" + + def test_create_index_with_dedicated_read_capacity( + self, client: Pinecone, index_name, serverless_cloud, serverless_region + ): + """Test creating an index with Dedicated read capacity configuration.""" + read_capacity_config = { + "mode": "Dedicated", + "dedicated": { + "node_type": "t1", + "scaling": "Manual", + "manual": { + "shards": 2, + "replicas": 2, + }, + }, + } + + resp = client.create_index( + name=index_name, + dimension=10, + spec=ServerlessSpec( + cloud=serverless_cloud, + region=serverless_region, + read_capacity=read_capacity_config, + ), + ) + assert resp.name == index_name + assert resp.dimension == 10 + + desc = client.describe_index(name=index_name) + assert desc.name == index_name + assert desc.dimension == 10 + assert desc.spec.serverless["cloud"] == serverless_cloud + assert desc.spec.serverless["region"] == serverless_region + # Verify read_capacity configuration + assert "read_capacity" in desc.spec.serverless + read_capacity = desc.spec.serverless["read_capacity"] + assert read_capacity["mode"] == "Dedicated" + assert "dedicated" in read_capacity + assert read_capacity["dedicated"]["node_type"] == "t1" + assert read_capacity["dedicated"]["scaling"] == "Manual" + assert read_capacity["dedicated"]["manual"]["shards"] == 2 + assert read_capacity["dedicated"]["manual"]["replicas"] == 2 + + def test_create_index_without_read_capacity_defaults_to_ondemand( + self, client: Pinecone, index_name, serverless_cloud, serverless_region + ): + """Test that creating an index without read_capacity defaults to OnDemand.""" + resp = client.create_index( + name=index_name, + dimension=10, + spec=ServerlessSpec(cloud=serverless_cloud, region=serverless_region), + ) + assert resp.name == index_name + + desc = client.describe_index(name=index_name) + # Verify read_capacity defaults to OnDemand (should be present in response) + assert "read_capacity" in desc.spec.serverless + # The API should return OnDemand as the default + assert desc.spec.serverless["read_capacity"]["mode"] == "OnDemand" diff --git a/tests/integration/control/serverless/test_create_index_api_errors.py b/tests/integration/control/serverless/test_create_index_api_errors.py index b4807b2c..b9f4b7cc 100644 --- a/tests/integration/control/serverless/test_create_index_api_errors.py +++ b/tests/integration/control/serverless/test_create_index_api_errors.py @@ -10,7 +10,7 @@ def test_create_index_with_invalid_name(self, client, create_sl_index_params): def test_create_index_invalid_metric(self, client, create_sl_index_params): create_sl_index_params["metric"] = "invalid" - with pytest.raises(PineconeApiValueError): + with pytest.raises(PineconeApiException): client.create_index(**create_sl_index_params) def test_create_index_with_invalid_neg_dimension(self, client, create_sl_index_params): diff --git a/tests/integration/control/serverless/test_create_index_for_model_errors.py b/tests/integration/control/serverless/test_create_index_for_model_errors.py index 0fa372d5..ed2ba03f 100644 --- a/tests/integration/control/serverless/test_create_index_for_model_errors.py +++ b/tests/integration/control/serverless/test_create_index_for_model_errors.py @@ -1,12 +1,5 @@ import pytest -from pinecone import ( - EmbedModel, - CloudProvider, - AwsRegion, - Metric, - PineconeApiException, - PineconeApiValueError, -) +from pinecone import EmbedModel, CloudProvider, AwsRegion, Metric, PineconeApiException class TestCreateIndexForModelErrors: @@ -26,19 +19,21 @@ def test_create_index_for_model_with_invalid_model(self, client, index_name): assert "Model invalid-model not found." in str(e.value) def test_invalid_cloud(self, client, index_name): - with pytest.raises(PineconeApiValueError) as e: - client.create_index_for_model( - name=index_name, - cloud="invalid-cloud", - region=AwsRegion.US_EAST_1, - embed={ - "model": EmbedModel.Multilingual_E5_Large, - "field_map": {"text": "my-sample-text"}, - "metric": Metric.COSINE, - }, - timeout=-1, - ) - assert "Invalid value for `cloud`" in str(e.value) + # The API now accepts invalid cloud values, so this test should verify + # that the call succeeds rather than raising an exception + result = client.create_index_for_model( + name=index_name, + cloud="invalid-cloud", + region=AwsRegion.US_EAST_1, + embed={ + "model": EmbedModel.Multilingual_E5_Large, + "field_map": {"text": "my-sample-text"}, + "metric": Metric.COSINE, + }, + timeout=-1, + ) + assert result.name == index_name + assert result.spec.serverless.cloud == "invalid-cloud" @pytest.mark.skip(reason="This seems to not raise an error in preprod-aws-0") def test_invalid_region(self, client, index_name): @@ -72,7 +67,7 @@ def test_create_index_for_model_with_invalid_field_map(self, client, index_name) assert "Missing required key 'text'" in str(e.value) def test_create_index_for_model_with_invalid_metric(self, client, index_name): - with pytest.raises(PineconeApiValueError) as e: + with pytest.raises(PineconeApiException) as e: client.create_index_for_model( name=index_name, cloud=CloudProvider.AWS, @@ -84,7 +79,7 @@ def test_create_index_for_model_with_invalid_metric(self, client, index_name): }, timeout=-1, ) - assert "Invalid value for `metric`" in str(e.value) + assert "Invalid field 'metric'" in str(e.value) def test_create_index_for_model_with_missing_name(self, client): with pytest.raises(TypeError) as e: diff --git a/tests/integration/control_asyncio/test_configure_index_embed.py b/tests/integration/control_asyncio/test_configure_index_embed.py index db05094d..05ef28df 100644 --- a/tests/integration/control_asyncio/test_configure_index_embed.py +++ b/tests/integration/control_asyncio/test_configure_index_embed.py @@ -10,20 +10,14 @@ async def test_convert_index_to_integrated(self, create_sl_index_params): desc = await pc.describe_index(name) assert desc.embed is None - embed_config = { - "model": "multilingual-e5-large", - "field_map": {"text": "chunk_text"}, - } + embed_config = {"model": "multilingual-e5-large", "field_map": {"text": "chunk_text"}} await pc.configure_index(name, embed=embed_config) desc = await pc.describe_index(name) assert desc.embed.model == "multilingual-e5-large" assert desc.embed.field_map == {"text": "chunk_text"} assert desc.embed.read_parameters == {"input_type": "query", "truncate": "END"} - assert desc.embed.write_parameters == { - "input_type": "passage", - "truncate": "END", - } + assert desc.embed.write_parameters == {"input_type": "passage", "truncate": "END"} assert desc.embed.vector_type == "dense" assert desc.embed.dimension == 1024 assert desc.embed.metric == "cosine" diff --git a/tests/integration/data/seed.py b/tests/integration/data/seed.py index f606367f..c177c623 100644 --- a/tests/integration/data/seed.py +++ b/tests/integration/data/seed.py @@ -124,7 +124,7 @@ def weird_valid_ids(): '" onfocus=JaVaSCript:alert(10) autofocus', "javascript:alert(1)", "javascript:alert(1);", - '' "1;DROP TABLE users", + '1;DROP TABLE users', "' OR 1=1 -- 1", "' OR '1'='1", ] diff --git a/tests/integration/data/test_namespace.py b/tests/integration/data/test_namespace.py index 6c2099ee..0016d2c3 100644 --- a/tests/integration/data/test_namespace.py +++ b/tests/integration/data/test_namespace.py @@ -5,6 +5,7 @@ logger = logging.getLogger(__name__) + def setup_namespace_data(index, namespace: str, num_vectors: int = 2): """Helper function to set up test data in a namespace""" vectors = [(f"id_{i}", [0.1, 0.2]) for i in range(num_vectors)] @@ -40,6 +41,7 @@ def delete_all_namespaces(index): except Exception as e: logger.error(f"Error in delete_all_namespaces: {e}") + class TestNamespaceOperations: def test_describe_namespace(self, idx): """Test describing a namespace""" @@ -68,11 +70,21 @@ def test_delete_namespace(self, idx): # Delete namespace idx.delete_namespace(namespace=test_namespace) - # Wait for namespace to be deleted - time.sleep(10) + # Wait for namespace to be deleted with polling + max_wait_time = 60 # 60 seconds max wait + poll_interval = 2 # Check every 2 seconds + total_wait = 0 + + while total_wait < max_wait_time: + if not verify_namespace_exists(idx, test_namespace): + break + time.sleep(poll_interval) + total_wait += poll_interval # Verify namespace is deleted - assert not verify_namespace_exists(idx, test_namespace) + assert not verify_namespace_exists( + idx, test_namespace + ), f"Namespace {test_namespace} still exists after {total_wait} seconds" def test_list_namespaces(self, idx): """Test listing namespaces""" @@ -94,8 +106,8 @@ def test_list_namespaces(self, idx): # Verify each namespace has correct structure for ns in namespaces: assert isinstance(ns, NamespaceDescription) - assert hasattr(ns, 'name') - assert hasattr(ns, 'vector_count') + assert hasattr(ns, "name") + assert hasattr(ns, "vector_count") finally: # Delete all namespaces before next test is run delete_all_namespaces(idx) @@ -115,14 +127,13 @@ def test_list_namespaces_with_limit(self, idx): assert len(namespaces) >= 2 # Should get at least 2 namespaces for ns in namespaces: assert isinstance(ns, NamespaceDescription) - assert hasattr(ns, 'name') - assert hasattr(ns, 'vector_count') + assert hasattr(ns, "name") + assert hasattr(ns, "vector_count") finally: # Delete all namespaces before next test is run delete_all_namespaces(idx) - def test_list_namespaces_paginated(self, idx): """Test listing namespaces with pagination""" # Create multiple test namespaces @@ -138,18 +149,16 @@ def test_list_namespaces_paginated(self, idx): # Get second page next_response = idx.list_namespaces_paginated( - limit=2, - pagination_token=response.pagination.next + limit=2, pagination_token=response.pagination.next ) assert len(next_response.namespaces) == 2 assert next_response.pagination.next is not None # Get final page final_response = idx.list_namespaces_paginated( - limit=2, - pagination_token=next_response.pagination.next + limit=2, pagination_token=next_response.pagination.next ) assert len(final_response.namespaces) == 1 assert final_response.pagination is None finally: - delete_all_namespaces(idx) \ No newline at end of file + delete_all_namespaces(idx) diff --git a/tests/integration/data/test_upsert_dense.py b/tests/integration/data/test_upsert_dense.py index dd3be6dd..ec01491f 100644 --- a/tests/integration/data/test_upsert_dense.py +++ b/tests/integration/data/test_upsert_dense.py @@ -48,4 +48,6 @@ def test_upsert_to_namespace(self, idx, upsert_dense_namespace, use_nondefault_n # Check the vector count reflects some data has been upserted stats = idx.describe_index_stats() assert stats.total_vector_count >= 9 - assert stats.namespaces[target_namespace].vector_count == 9 + # Handle empty namespace being stored as "__default__" in the API response + actual_namespace = target_namespace if target_namespace != "" else "__default__" + assert stats.namespaces[actual_namespace].vector_count == 9 diff --git a/tests/integration/data_asyncio/test_namespace_asyncio.py b/tests/integration/data_asyncio/test_namespace_asyncio.py index 0a509df0..01ad8ece 100644 --- a/tests/integration/data_asyncio/test_namespace_asyncio.py +++ b/tests/integration/data_asyncio/test_namespace_asyncio.py @@ -7,6 +7,7 @@ logger = logging.getLogger(__name__) + async def setup_namespace_data(index, namespace: str, num_vectors: int = 2): """Helper function to set up test data in a namespace""" vectors = [(f"id_{i}", [0.1, 0.2]) for i in range(num_vectors)] @@ -106,8 +107,8 @@ async def test_list_namespaces(self, index_host): # Verify each namespace has correct structure for ns in namespaces: assert isinstance(ns, NamespaceDescription) - assert hasattr(ns, 'name') - assert hasattr(ns, 'vector_count') + assert hasattr(ns, "name") + assert hasattr(ns, "vector_count") finally: # Delete all namespaces before next test is run await delete_all_namespaces(asyncio_idx) @@ -129,8 +130,8 @@ async def test_list_namespaces_with_limit(self, index_host): assert len(namespaces.namespaces) == 2 # Should get exactly 2 namespaces for ns in namespaces.namespaces: assert isinstance(ns, NamespaceDescription) - assert hasattr(ns, 'name') - assert hasattr(ns, 'vector_count') + assert hasattr(ns, "name") + assert hasattr(ns, "vector_count") finally: # Delete all namespaces before next test is run await delete_all_namespaces(asyncio_idx) @@ -152,19 +153,17 @@ async def test_list_namespaces_paginated(self, index_host): # Get second page next_response = await asyncio_idx.list_namespaces_paginated( - limit=2, - pagination_token=response.pagination.next + limit=2, pagination_token=response.pagination.next ) assert len(next_response.namespaces) == 2 assert next_response.pagination.next is not None # Get final page final_response = await asyncio_idx.list_namespaces_paginated( - limit=2, - pagination_token=next_response.pagination.next + limit=2, pagination_token=next_response.pagination.next ) assert len(final_response.namespaces) == 1 assert final_response.pagination is None finally: # Delete all namespaces before next test is run - await delete_all_namespaces(asyncio_idx) \ No newline at end of file + await delete_all_namespaces(asyncio_idx) diff --git a/tests/integration/helpers/helpers.py b/tests/integration/helpers/helpers.py index 208017d7..31b1d33a 100644 --- a/tests/integration/helpers/helpers.py +++ b/tests/integration/helpers/helpers.py @@ -85,9 +85,11 @@ def poll_stats_for_namespace( f'Waiting for namespace "{namespace}" to have vectors. Total time waited: {total_time} seconds' ) stats = idx.describe_index_stats() + # Handle empty namespace being stored as "__default__" in the API response + target_namespace = namespace if namespace != "" else "__default__" if ( - namespace in stats.namespaces - and stats.namespaces[namespace].vector_count >= expected_count + target_namespace in stats.namespaces + and stats.namespaces[target_namespace].vector_count >= expected_count ): done = True elif total_time > max_sleep: @@ -96,7 +98,7 @@ def poll_stats_for_namespace( total_time += delta_t logger.debug(f"Found index stats: {stats}.") logger.debug( - f"Waiting for {expected_count} vectors in namespace {namespace}. Found {stats.namespaces.get(namespace, {'vector_count': 0})['vector_count']} vectors." + f"Waiting for {expected_count} vectors in namespace {namespace}. Found {stats.namespaces.get(target_namespace, {'vector_count': 0})['vector_count']} vectors." ) time.sleep(delta_t) diff --git a/tests/unit/data/test_bulk_import.py b/tests/unit/data/test_bulk_import.py index 3561b092..4bda9622 100644 --- a/tests/unit/data/test_bulk_import.py +++ b/tests/unit/data/test_bulk_import.py @@ -1,10 +1,7 @@ import pytest from pinecone.openapi_support import ApiClient, PineconeApiException -from pinecone.core.openapi.db_data.models import ( - StartImportResponse, - ImportErrorMode as ImportErrorModeGeneratedClass, -) +from pinecone.core.openapi.db_data.models import StartImportResponse from pinecone.db_data.resources.sync.bulk_import import BulkImportResource, ImportErrorMode @@ -136,11 +133,6 @@ def test_no_arguments(self, mocker): assert "missing 1 required positional argument" in str(e.value) - def test_enums_are_aligned(self): - modes = dir(ImportErrorMode) - for key, _ in ImportErrorModeGeneratedClass().allowed_values[("on_error",)].items(): - assert key in modes - class TestDescribeImport: def test_describe_import(self, mocker): diff --git a/tests/unit/db_control/test_index.py b/tests/unit/db_control/test_index.py index 5fca4b18..83b76173 100644 --- a/tests/unit/db_control/test_index.py +++ b/tests/unit/db_control/test_index.py @@ -61,7 +61,7 @@ def test_describe_index(self, mocker): assert desc.description == "test-description" assert desc.dimension == 1024 assert desc.metric == "cosine" - assert desc.spec.byoc.environment == "test-environment" + assert desc.spec["byoc"]["environment"] == "test-environment" assert desc.vector_type == "dense" assert desc.status.ready == True assert desc.deletion_protection == "disabled" diff --git a/tests/unit/db_control/test_index_request_factory.py b/tests/unit/db_control/test_index_request_factory.py index 777486b5..ee0d47fd 100644 --- a/tests/unit/db_control/test_index_request_factory.py +++ b/tests/unit/db_control/test_index_request_factory.py @@ -15,7 +15,7 @@ def test_create_index_request_with_spec_byoc(self): assert req.dimension == 1024 assert req.spec.byoc.environment == "test-byoc-spec-id" assert req.vector_type == "dense" - assert req.deletion_protection.value == "disabled" + assert req.deletion_protection == "disabled" def test_create_index_request_with_spec_serverless(self): req = PineconeDBControlRequestFactory.create_index_request( @@ -30,7 +30,7 @@ def test_create_index_request_with_spec_serverless(self): assert req.spec.serverless.cloud == "aws" assert req.spec.serverless.region == "us-east-1" assert req.vector_type == "dense" - assert req.deletion_protection.value == "disabled" + assert req.deletion_protection == "disabled" def test_create_index_request_with_spec_serverless_dict(self): req = PineconeDBControlRequestFactory.create_index_request( @@ -45,7 +45,7 @@ def test_create_index_request_with_spec_serverless_dict(self): assert req.spec.serverless.cloud == "aws" assert req.spec.serverless.region == "us-east-1" assert req.vector_type == "dense" - assert req.deletion_protection.value == "disabled" + assert req.deletion_protection == "disabled" def test_create_index_request_with_spec_byoc_dict(self): req = PineconeDBControlRequestFactory.create_index_request( @@ -59,4 +59,4 @@ def test_create_index_request_with_spec_byoc_dict(self): assert req.dimension == 1024 assert req.spec.byoc.environment == "test-byoc-spec-id" assert req.vector_type == "dense" - assert req.deletion_protection.value == "disabled" + assert req.deletion_protection == "disabled" diff --git a/tests/unit/models/test_index_list.py b/tests/unit/models/test_index_list.py index 4696cfd6..bdd9b284 100644 --- a/tests/unit/models/test_index_list.py +++ b/tests/unit/models/test_index_list.py @@ -3,10 +3,7 @@ from pinecone.core.openapi.db_control.models import ( IndexList as OpenApiIndexList, IndexModel as OpenApiIndexModel, - IndexModelSpec, IndexModelStatus, - DeletionProtection, - PodSpec as OpenApiPodSpec, ) @@ -20,12 +17,16 @@ def index_list_response(): metric="cosine", host="https://test-index-1.pinecone.io/", status=IndexModelStatus(ready=True, state="Ready"), - deletion_protection=DeletionProtection("enabled"), - spec=IndexModelSpec( - pod=OpenApiPodSpec( - environment="us-west1-gcp", pod_type="p1.x1", pods=1, replicas=1, shards=1 - ) - ), + deletion_protection="enabled", + spec={ + "pod": { + "environment": "us-west1-gcp", + "pod_type": "p1.x1", + "pods": 1, + "replicas": 1, + "shards": 1, + } + }, ), OpenApiIndexModel( name="test-index-2", @@ -33,12 +34,16 @@ def index_list_response(): metric="cosine", host="https://test-index-2.pinecone.io/", status=IndexModelStatus(ready=True, state="Ready"), - deletion_protection=DeletionProtection("disabled"), - spec=IndexModelSpec( - pod=OpenApiPodSpec( - environment="us-west1-gcp", pod_type="p1.x1", pods=1, replicas=1, shards=1 - ) - ), + deletion_protection="disabled", + spec={ + "pod": { + "environment": "us-west1-gcp", + "pod_type": "p1.x1", + "pods": 1, + "replicas": 1, + "shards": 1, + } + }, ), ], _check_type=False, @@ -66,7 +71,7 @@ def test_index_list_getitem(self, index_list_response): assert input.indexes[0].dimension == iil[0].dimension assert input.indexes[0].metric == iil[0].metric assert input.indexes[0].host == iil[0].host - assert input.indexes[0].deletion_protection.value == iil[0].deletion_protection + assert input.indexes[0].deletion_protection == iil[0].deletion_protection assert iil[0].deletion_protection == "enabled" assert input.indexes[1].name == iil[1].name diff --git a/tests/unit/models/test_index_model.py b/tests/unit/models/test_index_model.py index 7aeb88d1..58d4288f 100644 --- a/tests/unit/models/test_index_model.py +++ b/tests/unit/models/test_index_model.py @@ -1,9 +1,6 @@ from pinecone.core.openapi.db_control.models import ( IndexModel as OpenApiIndexModel, IndexModelStatus, - IndexModelSpec, - ServerlessSpec, - DeletionProtection, ) from pinecone.db_control.models import IndexModel from pinecone import CloudProvider, AwsRegion @@ -17,12 +14,13 @@ def test_index_model(self): metric="cosine", host="https://test-index-1.pinecone.io/", status=IndexModelStatus(ready=True, state="Ready"), - deletion_protection=DeletionProtection("enabled"), - spec=IndexModelSpec( - serverless=ServerlessSpec( - cloud=CloudProvider.AWS.value, region=AwsRegion.US_EAST_1.value - ) - ), + deletion_protection="enabled", + spec={ + "serverless": { + "cloud": CloudProvider.AWS.value, + "region": AwsRegion.US_EAST_1.value, + } + }, ) wrapped = IndexModel(openapi_model) diff --git a/tests/unit/openapi_support/test_api_client.py b/tests/unit/openapi_support/test_api_client.py index 21a232cc..35abc74b 100644 --- a/tests/unit/openapi_support/test_api_client.py +++ b/tests/unit/openapi_support/test_api_client.py @@ -1,9 +1,5 @@ -from pinecone.core.openapi.db_control.models import ( - IndexModel, - IndexModelStatus, - IndexModelSpec, - DeletionProtection, -) +from pinecone.core.openapi.db_control.models import IndexModel, IndexModelStatus +from pinecone.core.openapi.db_data.models import VectorValues from pinecone.openapi_support.serializer import Serializer from pinecone.openapi_support.api_client_utils import parameters_to_tuples from datetime import date, datetime @@ -64,7 +60,7 @@ def test_sanitize_for_serialization_serializes_model_normal(self): dimension=10, metric="cosine", host="localhost", - spec=IndexModelSpec(), + spec={}, status=IndexModelStatus(ready=True, state="Ready"), vector_type="dense", ) @@ -82,10 +78,10 @@ def test_sanitize_for_serialization_serializes_model_normal(self): name="myindex2", metric="cosine", host="localhost", - spec=IndexModelSpec(), + spec={}, status=IndexModelStatus(ready=True, state="Ready"), vector_type="sparse", - deletion_protection=DeletionProtection(value="enabled"), + deletion_protection="enabled", ) assert Serializer.sanitize_for_serialization(m2) == { "name": "myindex2", @@ -99,8 +95,8 @@ def test_sanitize_for_serialization_serializes_model_normal(self): def test_sanitize_for_serialization_serializes_model_simple(self): # ModelSimple is used to model named values which are not objects - m = DeletionProtection(value="enabled") - assert Serializer.sanitize_for_serialization(m) == "enabled" + m = VectorValues(value=[1.0, 2.0, 3.0]) + assert Serializer.sanitize_for_serialization(m) == [1.0, 2.0, 3.0] class TestParametersToTuples: diff --git a/tests/unit/openapi_support/test_model_simple.py b/tests/unit/openapi_support/test_model_simple.py index 0193efba..86f8faf4 100644 --- a/tests/unit/openapi_support/test_model_simple.py +++ b/tests/unit/openapi_support/test_model_simple.py @@ -1,12 +1,6 @@ -from pinecone.core.openapi.db_control.models import DeletionProtection +from pinecone.core.openapi.db_data.models import VectorValues def test_simple_model_instantiation(): - dp = DeletionProtection(value="enabled") - assert dp.value == "enabled" - - dp2 = DeletionProtection(value="disabled") - assert dp2.value == "disabled" - - dp3 = DeletionProtection("enabled") - assert dp3.value == "enabled" + vv = VectorValues(value=[1.0, 2.0, 3.0]) + assert vv.value == [1.0, 2.0, 3.0] diff --git a/tests/unit/test_control.py b/tests/unit/test_control.py index 6cce0f92..a48544d8 100644 --- a/tests/unit/test_control.py +++ b/tests/unit/test_control.py @@ -11,14 +11,7 @@ PodIndexEnvironment, PodType, ) -from pinecone.core.openapi.db_control.models import ( - IndexList, - IndexModel, - DeletionProtection, - IndexModelSpec, - ServerlessSpec as ServerlessSpecOpenApi, - IndexModelStatus, -) +from pinecone.core.openapi.db_control.models import IndexList, IndexModel, IndexModelStatus from pinecone.utils import PluginAware @@ -31,10 +24,10 @@ def description_with_status(status: bool): name="foo", status=IndexModelStatus(ready=status, state=state), dimension=10, - deletion_protection=DeletionProtection(value="enabled"), + deletion_protection="enabled", host="https://foo.pinecone.io/", metric="euclidean", - spec=IndexModelSpec(serverless=ServerlessSpecOpenApi(cloud="aws", region="us-west1")), + spec={"serverless": {"cloud": "aws", "region": "us-west1"}}, ) @@ -49,7 +42,7 @@ def index_list_response(): host="asdf.pinecone.io", status={"ready": True}, spec={}, - deletion_protection=DeletionProtection("enabled"), + deletion_protection="enabled", _check_type=False, ), IndexModel( @@ -59,7 +52,7 @@ def index_list_response(): host="asdf.pinecone.io", status={"ready": True}, spec={}, - deletion_protection=DeletionProtection("enabled"), + deletion_protection="enabled", _check_type=False, ), IndexModel( @@ -69,7 +62,7 @@ def index_list_response(): host="asdf.pinecone.io", status={"ready": True}, spec={}, - deletion_protection=DeletionProtection("disabled"), + deletion_protection="disabled", _check_type=False, ), ] diff --git a/tests/unit_grpc/test_channel_factory.py b/tests/unit_grpc/test_channel_factory.py index bac13202..41dbbefb 100644 --- a/tests/unit_grpc/test_channel_factory.py +++ b/tests/unit_grpc/test_channel_factory.py @@ -25,9 +25,11 @@ def test_create_secure_channel_with_default_settings(self, config, grpc_client_c ) endpoint = "test.endpoint:443" - with patch("grpc.secure_channel") as mock_secure_channel, patch( - "certifi.where", return_value="/path/to/certifi/cacert.pem" - ), patch("builtins.open", new_callable=MagicMock) as mock_open: + with ( + patch("grpc.secure_channel") as mock_secure_channel, + patch("certifi.where", return_value="/path/to/certifi/cacert.pem"), + patch("builtins.open", new_callable=MagicMock) as mock_open, + ): # Mock the file object to return bytes when read() is called mock_file = MagicMock() mock_file.read.return_value = b"mocked_cert_data" @@ -94,9 +96,11 @@ def test_create_secure_channel_with_default_settings(self, config, grpc_client_c ) endpoint = "test.endpoint:443" - with patch("grpc.aio.secure_channel") as mock_secure_aio_channel, patch( - "certifi.where", return_value="/path/to/certifi/cacert.pem" - ), patch("builtins.open", new_callable=MagicMock) as mock_open: + with ( + patch("grpc.aio.secure_channel") as mock_secure_aio_channel, + patch("certifi.where", return_value="/path/to/certifi/cacert.pem"), + patch("builtins.open", new_callable=MagicMock) as mock_open, + ): # Mock the file object to return bytes when read() is called mock_file = MagicMock() mock_file.read.return_value = b"mocked_cert_data" diff --git a/tests/unit_grpc/test_grpc_index_namespace.py b/tests/unit_grpc/test_grpc_index_namespace.py index d44dd4e8..427585d9 100644 --- a/tests/unit_grpc/test_grpc_index_namespace.py +++ b/tests/unit_grpc/test_grpc_index_namespace.py @@ -18,61 +18,57 @@ def test_describe_namespace(self, mocker): mocker.patch.object(self.index.runner, "run", autospec=True) self.index.describe_namespace(namespace="test_namespace") self.index.runner.run.assert_called_once_with( - self.index.stub.DescribeNamespace, - DescribeNamespaceRequest(namespace="test_namespace"), - timeout=None + self.index.stub.DescribeNamespace, + DescribeNamespaceRequest(namespace="test_namespace"), + timeout=None, ) def test_describe_namespace_with_timeout(self, mocker): mocker.patch.object(self.index.runner, "run", autospec=True) self.index.describe_namespace(namespace="test_namespace", timeout=30) self.index.runner.run.assert_called_once_with( - self.index.stub.DescribeNamespace, - DescribeNamespaceRequest(namespace="test_namespace"), - timeout=30 + self.index.stub.DescribeNamespace, + DescribeNamespaceRequest(namespace="test_namespace"), + timeout=30, ) def test_delete_namespace(self, mocker): mocker.patch.object(self.index.runner, "run", autospec=True) self.index.delete_namespace(namespace="test_namespace") self.index.runner.run.assert_called_once_with( - self.index.stub.DeleteNamespace, - DeleteNamespaceRequest(namespace="test_namespace"), - timeout=None + self.index.stub.DeleteNamespace, + DeleteNamespaceRequest(namespace="test_namespace"), + timeout=None, ) def test_delete_namespace_with_timeout(self, mocker): mocker.patch.object(self.index.runner, "run", autospec=True) self.index.delete_namespace(namespace="test_namespace", timeout=30) self.index.runner.run.assert_called_once_with( - self.index.stub.DeleteNamespace, - DeleteNamespaceRequest(namespace="test_namespace"), - timeout=30 + self.index.stub.DeleteNamespace, + DeleteNamespaceRequest(namespace="test_namespace"), + timeout=30, ) def test_list_namespaces_paginated(self, mocker): mocker.patch.object(self.index.runner, "run", autospec=True) self.index.list_namespaces_paginated(limit=10, pagination_token="token123") self.index.runner.run.assert_called_once_with( - self.index.stub.ListNamespaces, - ListNamespacesRequest(limit=10, pagination_token="token123"), - timeout=None + self.index.stub.ListNamespaces, + ListNamespacesRequest(limit=10, pagination_token="token123"), + timeout=None, ) def test_list_namespaces_paginated_with_timeout(self, mocker): mocker.patch.object(self.index.runner, "run", autospec=True) self.index.list_namespaces_paginated(limit=10, timeout=30) self.index.runner.run.assert_called_once_with( - self.index.stub.ListNamespaces, - ListNamespacesRequest(limit=10), - timeout=30 + self.index.stub.ListNamespaces, ListNamespacesRequest(limit=10), timeout=30 ) def test_list_namespaces_paginated_no_args(self, mocker): mocker.patch.object(self.index.runner, "run", autospec=True) self.index.list_namespaces_paginated() self.index.runner.run.assert_called_once_with( - self.index.stub.ListNamespaces, - ListNamespacesRequest(), - timeout=None - ) \ No newline at end of file + self.index.stub.ListNamespaces, ListNamespacesRequest(), timeout=None + )