From 5ea1792844ef4878cea44475aac729496e7e8273 Mon Sep 17 00:00:00 2001 From: Jen Hamon Date: Sun, 16 Nov 2025 20:29:35 -0500 Subject: [PATCH 1/7] Type improvements --- codegen/python-oas-templates | 2 +- mypy.ini | 65 +++++- pinecone/admin/admin.py | 19 +- pinecone/config/openapi_configuration.py | 11 +- .../core/openapi/admin/api/api_keys_api.py | 31 ++- .../openapi/admin/api/organizations_api.py | 25 +- .../core/openapi/admin/api/projects_api.py | 31 ++- pinecone/core/openapi/admin/model/api_key.py | 10 + .../admin/model/api_key_with_secret.py | 10 + .../admin/model/create_api_key_request.py | 10 + .../admin/model/create_project_request.py | 10 + .../openapi/admin/model/error_response.py | 10 + .../admin/model/error_response_error.py | 10 + .../admin/model/list_api_keys_response.py | 10 + .../core/openapi/admin/model/organization.py | 10 + .../openapi/admin/model/organization_list.py | 10 + pinecone/core/openapi/admin/model/project.py | 10 + .../core/openapi/admin/model/project_list.py | 10 + .../admin/model/update_api_key_request.py | 10 + .../model/update_organization_request.py | 10 + .../admin/model/update_project_request.py | 10 + .../db_control/api/manage_indexes_api.py | 95 +++++--- .../openapi/db_control/model/backup_list.py | 10 + .../openapi/db_control/model/backup_model.py | 10 + .../db_control/model/backup_model_schema.py | 10 + .../model/backup_model_schema_fields.py | 10 + .../core/openapi/db_control/model/byoc.py | 10 + .../openapi/db_control/model/byoc_spec.py | 10 + .../db_control/model/collection_list.py | 10 + .../db_control/model/collection_model.py | 10 + .../model/configure_index_request.py | 10 + .../model/configure_index_request_embed.py | 10 + .../db_control/model/create_backup_request.py | 10 + .../model/create_collection_request.py | 10 + .../model/create_index_for_model_request.py | 10 + .../create_index_for_model_request_embed.py | 10 + .../model/create_index_from_backup_request.py | 10 + .../create_index_from_backup_response.py | 10 + .../db_control/model/create_index_request.py | 10 + .../db_control/model/error_response.py | 10 + .../db_control/model/error_response_error.py | 10 + .../openapi/db_control/model/index_list.py | 10 + .../openapi/db_control/model/index_model.py | 10 + .../db_control/model/index_model_status.py | 10 + .../openapi/db_control/model/index_tags.py | 10 + .../db_control/model/model_index_embed.py | 10 + .../db_control/model/pagination_response.py | 10 + .../openapi/db_control/model/pod_based.py | 10 + .../core/openapi/db_control/model/pod_spec.py | 10 + .../model/pod_spec_metadata_config.py | 10 + .../model/read_capacity_dedicated_config.py | 10 + .../model/read_capacity_dedicated_spec.py | 10 + .../read_capacity_dedicated_spec_response.py | 10 + .../model/read_capacity_on_demand_spec.py | 10 + .../read_capacity_on_demand_spec_response.py | 10 + .../db_control/model/read_capacity_status.py | 10 + .../db_control/model/restore_job_list.py | 10 + .../db_control/model/restore_job_model.py | 10 + .../db_control/model/scaling_config_manual.py | 10 + .../openapi/db_control/model/serverless.py | 10 + .../db_control/model/serverless_spec.py | 10 + .../model/serverless_spec_response.py | 10 + .../db_data/api/bulk_operations_api.py | 31 ++- .../db_data/api/namespace_operations_api.py | 31 ++- .../db_data/api/vector_operations_api.py | 55 +++-- .../db_data/model/create_namespace_request.py | 10 + .../model/create_namespace_request_schema.py | 10 + .../create_namespace_request_schema_fields.py | 10 + .../openapi/db_data/model/delete_request.py | 10 + .../model/describe_index_stats_request.py | 10 + .../model/fetch_by_metadata_request.py | 10 + .../model/fetch_by_metadata_response.py | 10 + .../openapi/db_data/model/fetch_response.py | 10 + pinecone/core/openapi/db_data/model/hit.py | 10 + .../db_data/model/import_error_mode.py | 10 + .../openapi/db_data/model/import_model.py | 10 + .../db_data/model/index_description.py | 10 + .../db_data/model/list_imports_response.py | 10 + .../core/openapi/db_data/model/list_item.py | 10 + .../db_data/model/list_namespaces_response.py | 10 + .../openapi/db_data/model/list_response.py | 10 + .../db_data/model/namespace_description.py | 10 + .../namespace_description_indexed_fields.py | 10 + .../db_data/model/namespace_summary.py | 10 + .../core/openapi/db_data/model/pagination.py | 10 + .../openapi/db_data/model/protobuf_any.py | 10 + .../openapi/db_data/model/query_request.py | 10 + .../openapi/db_data/model/query_response.py | 10 + .../openapi/db_data/model/query_vector.py | 10 + .../core/openapi/db_data/model/rpc_status.py | 10 + .../openapi/db_data/model/scored_vector.py | 10 + .../db_data/model/search_match_terms.py | 10 + .../db_data/model/search_records_request.py | 10 + .../model/search_records_request_query.py | 10 + .../model/search_records_request_rerank.py | 10 + .../db_data/model/search_records_response.py | 10 + .../model/search_records_response_result.py | 10 + .../db_data/model/search_records_vector.py | 10 + .../openapi/db_data/model/search_usage.py | 10 + .../db_data/model/single_query_results.py | 10 + .../openapi/db_data/model/sparse_values.py | 10 + .../db_data/model/start_import_request.py | 10 + .../db_data/model/start_import_response.py | 10 + .../openapi/db_data/model/update_request.py | 10 + .../openapi/db_data/model/update_response.py | 10 + .../openapi/db_data/model/upsert_record.py | 10 + .../openapi/db_data/model/upsert_request.py | 10 + .../openapi/db_data/model/upsert_response.py | 10 + pinecone/core/openapi/db_data/model/usage.py | 10 + pinecone/core/openapi/db_data/model/vector.py | 10 + .../openapi/inference/api/inference_api.py | 29 ++- .../inference/model/dense_embedding.py | 10 + .../core/openapi/inference/model/document.py | 10 + .../openapi/inference/model/embed_request.py | 10 + .../inference/model/embed_request_inputs.py | 10 + .../inference/model/embeddings_list.py | 10 + .../inference/model/embeddings_list_usage.py | 10 + .../openapi/inference/model/error_response.py | 10 + .../inference/model/error_response_error.py | 10 + .../openapi/inference/model/model_info.py | 10 + .../inference/model/model_info_list.py | 10 + .../model/model_info_supported_parameter.py | 10 + .../inference/model/ranked_document.py | 10 + .../openapi/inference/model/rerank_request.py | 10 + .../openapi/inference/model/rerank_result.py | 10 + .../inference/model/rerank_result_usage.py | 10 + .../inference/model/sparse_embedding.py | 10 + pinecone/core/openapi/oauth/api/o_auth_api.py | 13 +- .../openapi/oauth/model/error_response.py | 10 + .../core/openapi/oauth/model/token_request.py | 10 + .../openapi/oauth/model/token_response.py | 10 + pinecone/db_control/db_control.py | 2 +- pinecone/db_control/db_control_asyncio.py | 2 +- pinecone/db_control/index_host_store.py | 4 +- pinecone/db_control/models/serverless_spec.py | 6 +- pinecone/db_control/request_factory.py | 61 +++-- .../db_control/resources/asyncio/backup.py | 3 +- .../resources/asyncio/collection.py | 12 +- .../db_control/resources/asyncio/index.py | 16 +- pinecone/db_control/resources/sync/backup.py | 3 +- pinecone/db_control/resources/sync/index.py | 12 +- pinecone/db_data/dataclasses/search_query.py | 2 +- pinecone/db_data/dataclasses/utils.py | 17 +- pinecone/db_data/filter_builder.py | 2 +- pinecone/db_data/index.py | 214 ++++++++++-------- pinecone/db_data/index_asyncio.py | 95 +++++--- pinecone/db_data/index_asyncio_interface.py | 31 +-- pinecone/db_data/interfaces.py | 37 +-- pinecone/db_data/request_factory.py | 133 ++++++----- .../resources/asyncio/bulk_import_asyncio.py | 15 +- .../resources/asyncio/namespace_asyncio.py | 15 +- .../resources/asyncio/record_asyncio.py | 5 +- .../resources/asyncio/vector_asyncio.py | 51 +++-- .../db_data/resources/sync/bulk_import.py | 15 +- .../sync/bulk_import_request_factory.py | 13 +- pinecone/db_data/resources/sync/namespace.py | 15 +- .../sync/namespace_request_factory.py | 2 +- pinecone/db_data/resources/sync/record.py | 5 +- pinecone/db_data/resources/sync/vector.py | 84 ++++--- pinecone/db_data/sparse_values_factory.py | 25 +- pinecone/db_data/vector_factory.py | 18 +- pinecone/grpc/channel_factory.py | 12 +- pinecone/grpc/future.py | 2 +- pinecone/grpc/grpc_runner.py | 4 +- pinecone/grpc/index_grpc.py | 47 +++- pinecone/grpc/resources/vector_grpc.py | 13 +- pinecone/grpc/retry.py | 12 +- pinecone/grpc/utils.py | 61 +++-- .../inference/inference_request_builder.py | 13 +- pinecone/openapi_support/api_version.py | 2 +- pinecone/openapi_support/deserializer.py | 10 +- pinecone/openapi_support/model_utils.py | 65 +++--- pinecone/openapi_support/retry_aiohttp.py | 2 +- pinecone/pinecone.py | 29 ++- pinecone/pinecone_asyncio.py | 37 +-- pinecone/pinecone_interface_asyncio.py | 2 +- pinecone/utils/check_kwargs.py | 5 +- pinecone/utils/error_handling.py | 18 +- pinecone/utils/lazy_imports.py | 24 +- pinecone/utils/require_kwargs.py | 16 +- .../grpc/db/data/test_query_future.py | 3 +- tests/integration/helpers/helpers.py | 3 +- 182 files changed, 2313 insertions(+), 600 deletions(-) diff --git a/codegen/python-oas-templates b/codegen/python-oas-templates index 57a4c44d6..f39260048 160000 --- a/codegen/python-oas-templates +++ b/codegen/python-oas-templates @@ -1 +1 @@ -Subproject commit 57a4c44d6f18bbabedfe25aa173359c37fb9f705 +Subproject commit f39260048b2e24efa42238b20a3aaf7ff95e338b diff --git a/mypy.ini b/mypy.ini index ca626d5a1..ad6a34416 100644 --- a/mypy.ini +++ b/mypy.ini @@ -1,15 +1,62 @@ [mypy] -; pretty = True -; disallow_untyped_calls = True -; check_untyped_defs = True -; disallow_untyped_defs = True -; warn_return_any = True -; warn_unused_configs = True +pretty = True +warn_return_any = True +warn_unused_configs = True +warn_redundant_casts = True +warn_unused_ignores = True +check_untyped_defs = True +# disallow_untyped_calls = True # Gradually enable as types are added +# disallow_untyped_defs = True # Gradually enable as types are added +# disallow_incomplete_defs = True # Gradually enable as types are added +no_implicit_optional = True +strict_equality = True -# Per-module options: +# Ignore generated code +[mypy-pinecone.core.*] +ignore_errors = True -; [mypy-mycode.foo.*] -; disallow_untyped_defs = True +# Ignore openapi_support - uses dynamic attributes that mypy can't fully type-check +[mypy-pinecone.openapi_support.*] +ignore_errors = True + +# Per-module options for gradual rollout: +# These can be enabled module by module as types are added [mypy-google.api.*] ignore_missing_imports = True + +# Handle library stub issues +# These libraries have type stubs available but may not always be installed +# or may have incomplete stubs. We suppress these errors to avoid noise. +[mypy-tqdm.*] +ignore_missing_imports = True + +[mypy-urllib3.*] +ignore_missing_imports = True + +[mypy-grpc.*] +ignore_missing_imports = True + +# Suppress "Library stubs not installed" errors for modules that have +# type stubs available but may not be installed in all environments +# Note: These should be installed via `uv sync --extra types` for development +[mypy-pinecone.utils.tqdm] +ignore_missing_imports = True + +[mypy-pinecone.utils.error_handling] +ignore_missing_imports = True + +[mypy-pinecone.grpc.retry] +ignore_missing_imports = True + +[mypy-pinecone.grpc.channel_factory] +ignore_missing_imports = True + +[mypy-pinecone.openapi_support.retry_urllib3] +ignore_missing_imports = True + +[mypy-pinecone.openapi_support.retry_aiohttp] +ignore_missing_imports = True + +[mypy-aiohttp_retry.*] +ignore_missing_imports = True diff --git a/pinecone/admin/admin.py b/pinecone/admin/admin.py index 1e0c43a7d..d2bc8ec32 100644 --- a/pinecone/admin/admin.py +++ b/pinecone/admin/admin.py @@ -112,9 +112,22 @@ def __init__( self._child_api_client.user_agent = get_user_agent(Config()) # Lazily initialize resources - self._project = None - self._api_key = None - self._organization = None + from typing import TYPE_CHECKING, Optional + + if TYPE_CHECKING: + from pinecone.admin.resources import ( + ProjectResource, + ApiKeyResource, + OrganizationResource, + ) + + self._project: Optional[ProjectResource] = None + self._api_key: Optional[ApiKeyResource] = None + self._organization: Optional[OrganizationResource] = None + else: + self._project = None # type: ignore[assignment] + self._api_key = None # type: ignore[assignment] + self._organization = None # type: ignore[assignment] @property def project(self): diff --git a/pinecone/config/openapi_configuration.py b/pinecone/config/openapi_configuration.py index 19610e63f..b33ce91e9 100644 --- a/pinecone/config/openapi_configuration.py +++ b/pinecone/config/openapi_configuration.py @@ -3,7 +3,7 @@ import multiprocessing from pinecone.exceptions import PineconeApiValueError -from typing import TypedDict +from typing import TypedDict, Optional class HostSetting(TypedDict): @@ -219,7 +219,7 @@ def __deepcopy__(self, memo): def __setattr__(self, name, value): object.__setattr__(self, name, value) if name == "disabled_client_side_validations": - s = set(filter(None, value.split(","))) + s: set[str] = set(filter(None, value.split(","))) for v in s: if v not in JSON_SCHEMA_VALIDATION_KEYWORDS: raise PineconeApiValueError("Invalid keyword: '{0}''".format(v)) @@ -291,16 +291,13 @@ def debug(self): return self._debug @debug.setter - def debug(self, value): + def debug(self, value: bool) -> None: """Debug status :param value: The debug status, True or False. :type: bool """ - if hasattr(self, "_debug"): - previous_debug = self._debug - else: - previous_debug = None + previous_debug: Optional[bool] = getattr(self, "_debug", None) self._debug = value def enable_http_logging(): diff --git a/pinecone/core/openapi/admin/api/api_keys_api.py b/pinecone/core/openapi/admin/api/api_keys_api.py index e835e2793..c4db4170a 100644 --- a/pinecone/core/openapi/admin/api/api_keys_api.py +++ b/pinecone/core/openapi/admin/api/api_keys_api.py @@ -9,6 +9,13 @@ Contact: support@pinecone.io """ +from __future__ import annotations + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from multiprocessing.pool import ApplyResult + from pinecone.openapi_support import ApiClient, AsyncioApiClient from pinecone.openapi_support.endpoint_utils import ( ExtraOpenApiKwargsTypedDict, @@ -48,7 +55,7 @@ def __create_api_key( create_api_key_request, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict, - ): + ) -> APIKeyWithSecret | ApplyResult[APIKeyWithSecret]: """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 @@ -137,7 +144,7 @@ def __delete_api_key( api_key_id, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict, - ): + ) -> None: """Delete an API key # noqa: E501 Delete an API key from a project. # noqa: E501 @@ -216,7 +223,7 @@ def __fetch_api_key( api_key_id, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict, - ): + ) -> APIKey | ApplyResult[APIKey]: """Get API key details # noqa: E501 Get the details of an API key, excluding the API key secret. # noqa: E501 @@ -295,7 +302,7 @@ def __list_project_api_keys( project_id, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict, - ): + ) -> ListApiKeysResponse | ApplyResult[ListApiKeysResponse]: """List API keys # noqa: E501 List all API keys in a project. # noqa: E501 @@ -375,7 +382,7 @@ def __update_api_key( update_api_key_request, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict, - ): + ) -> APIKey | ApplyResult[APIKey]: """Update an API key # noqa: E501 Update the name and roles of an API key. # noqa: E501 @@ -473,7 +480,7 @@ def __init__(self, api_client=None) -> None: async def __create_api_key( self, project_id, create_api_key_request, x_pinecone_api_version="2025-10", **kwargs - ): + ) -> APIKeyWithSecret: """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 @@ -550,7 +557,9 @@ async def __create_api_key( callable=__create_api_key, ) - async def __delete_api_key(self, api_key_id, x_pinecone_api_version="2025-10", **kwargs): + async def __delete_api_key( + self, api_key_id, x_pinecone_api_version="2025-10", **kwargs + ) -> None: """Delete an API key # noqa: E501 Delete an API key from a project. # noqa: E501 @@ -617,7 +626,9 @@ async def __delete_api_key(self, api_key_id, x_pinecone_api_version="2025-10", * callable=__delete_api_key, ) - async def __fetch_api_key(self, api_key_id, x_pinecone_api_version="2025-10", **kwargs): + async def __fetch_api_key( + self, api_key_id, x_pinecone_api_version="2025-10", **kwargs + ) -> APIKey: """Get API key details # noqa: E501 Get the details of an API key, excluding the API key secret. # noqa: E501 @@ -686,7 +697,7 @@ async def __fetch_api_key(self, api_key_id, x_pinecone_api_version="2025-10", ** async def __list_project_api_keys( self, project_id, x_pinecone_api_version="2025-10", **kwargs - ): + ) -> ListApiKeysResponse: """List API keys # noqa: E501 List all API keys in a project. # noqa: E501 @@ -755,7 +766,7 @@ async def __list_project_api_keys( async def __update_api_key( self, api_key_id, update_api_key_request, x_pinecone_api_version="2025-10", **kwargs - ): + ) -> APIKey: """Update an API key # noqa: E501 Update the name and roles of an API key. # noqa: E501 diff --git a/pinecone/core/openapi/admin/api/organizations_api.py b/pinecone/core/openapi/admin/api/organizations_api.py index c3cca33c3..f1d393e2a 100644 --- a/pinecone/core/openapi/admin/api/organizations_api.py +++ b/pinecone/core/openapi/admin/api/organizations_api.py @@ -9,6 +9,13 @@ Contact: support@pinecone.io """ +from __future__ import annotations + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from multiprocessing.pool import ApplyResult + from pinecone.openapi_support import ApiClient, AsyncioApiClient from pinecone.openapi_support.endpoint_utils import ( ExtraOpenApiKwargsTypedDict, @@ -45,7 +52,7 @@ def __delete_organization( organization_id, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict, - ): + ) -> None: """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 @@ -124,7 +131,7 @@ def __fetch_organization( organization_id, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict, - ): + ) -> Organization | ApplyResult[Organization]: """Get organization details # noqa: E501 Get details about an organization. # noqa: E501 @@ -200,7 +207,7 @@ def __fetch_organization( def __list_organizations( self, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict - ): + ) -> OrganizationList | ApplyResult[OrganizationList]: """List organizations # noqa: E501 List all organizations associated with an account. # noqa: E501 @@ -275,7 +282,7 @@ def __update_organization( update_organization_request, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict, - ): + ) -> Organization | ApplyResult[Organization]: """Update an organization # noqa: E501 Update an organization's name. # noqa: E501 @@ -377,7 +384,7 @@ def __init__(self, api_client=None) -> None: async def __delete_organization( self, organization_id, x_pinecone_api_version="2025-10", **kwargs - ): + ) -> None: """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 @@ -446,7 +453,7 @@ async def __delete_organization( async def __fetch_organization( self, organization_id, x_pinecone_api_version="2025-10", **kwargs - ): + ) -> Organization: """Get organization details # noqa: E501 Get details about an organization. # noqa: E501 @@ -513,7 +520,9 @@ async def __fetch_organization( callable=__fetch_organization, ) - async def __list_organizations(self, x_pinecone_api_version="2025-10", **kwargs): + async def __list_organizations( + self, x_pinecone_api_version="2025-10", **kwargs + ) -> OrganizationList: """List organizations # noqa: E501 List all organizations associated with an account. # noqa: E501 @@ -581,7 +590,7 @@ async def __update_organization( update_organization_request, x_pinecone_api_version="2025-10", **kwargs, - ): + ) -> Organization: """Update an organization # noqa: E501 Update an organization's name. # noqa: E501 diff --git a/pinecone/core/openapi/admin/api/projects_api.py b/pinecone/core/openapi/admin/api/projects_api.py index ee2a9be6a..4d2c18d46 100644 --- a/pinecone/core/openapi/admin/api/projects_api.py +++ b/pinecone/core/openapi/admin/api/projects_api.py @@ -9,6 +9,13 @@ Contact: support@pinecone.io """ +from __future__ import annotations + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from multiprocessing.pool import ApplyResult + from pinecone.openapi_support import ApiClient, AsyncioApiClient from pinecone.openapi_support.endpoint_utils import ( ExtraOpenApiKwargsTypedDict, @@ -46,7 +53,7 @@ def __create_project( create_project_request, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict, - ): + ) -> Project | ApplyResult[Project]: """Create a new project # noqa: E501 Creates a new project. # noqa: E501 @@ -128,7 +135,7 @@ def __delete_project( project_id, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict, - ): + ) -> None: """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 @@ -207,7 +214,7 @@ def __fetch_project( project_id, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict, - ): + ) -> Project | ApplyResult[Project]: """Get project details # noqa: E501 Get details about a project. # noqa: E501 @@ -283,7 +290,7 @@ def __fetch_project( def __list_projects( self, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict - ): + ) -> ProjectList | ApplyResult[ProjectList]: """List projects # noqa: E501 List all projects in an organization. # noqa: E501 @@ -358,7 +365,7 @@ def __update_project( update_project_request, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict, - ): + ) -> Project | ApplyResult[Project]: """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 @@ -456,7 +463,7 @@ def __init__(self, api_client=None) -> None: async def __create_project( self, create_project_request, x_pinecone_api_version="2025-10", **kwargs - ): + ) -> Project: """Create a new project # noqa: E501 Creates a new project. # noqa: E501 @@ -526,7 +533,9 @@ async def __create_project( callable=__create_project, ) - async def __delete_project(self, project_id, x_pinecone_api_version="2025-10", **kwargs): + async def __delete_project( + self, project_id, x_pinecone_api_version="2025-10", **kwargs + ) -> None: """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 @@ -593,7 +602,9 @@ async def __delete_project(self, project_id, x_pinecone_api_version="2025-10", * callable=__delete_project, ) - async def __fetch_project(self, project_id, x_pinecone_api_version="2025-10", **kwargs): + async def __fetch_project( + self, project_id, x_pinecone_api_version="2025-10", **kwargs + ) -> Project: """Get project details # noqa: E501 Get details about a project. # noqa: E501 @@ -660,7 +671,7 @@ async def __fetch_project(self, project_id, x_pinecone_api_version="2025-10", ** callable=__fetch_project, ) - async def __list_projects(self, x_pinecone_api_version="2025-10", **kwargs): + async def __list_projects(self, x_pinecone_api_version="2025-10", **kwargs) -> ProjectList: """List projects # noqa: E501 List all projects in an organization. # noqa: E501 @@ -724,7 +735,7 @@ async def __list_projects(self, x_pinecone_api_version="2025-10", **kwargs): async def __update_project( self, project_id, update_project_request, x_pinecone_api_version="2025-10", **kwargs - ): + ) -> Project: """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 diff --git a/pinecone/core/openapi/admin/model/api_key.py b/pinecone/core/openapi/admin/model/api_key.py index 33ad8554d..4ebc545b8 100644 --- a/pinecone/core/openapi/admin/model/api_key.py +++ b/pinecone/core/openapi/admin/model/api_key.py @@ -105,6 +105,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of APIKey. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], id, name, project_id, roles, *args, **kwargs) -> T: # noqa: E501 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 e74471a3e..a009a2690 100644 --- a/pinecone/core/openapi/admin/model/api_key_with_secret.py +++ b/pinecone/core/openapi/admin/model/api_key_with_secret.py @@ -109,6 +109,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of APIKeyWithSecret. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], key, value, *args, **kwargs) -> T: # noqa: E501 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 5a88a0bcd..1b1a0c372 100644 --- a/pinecone/core/openapi/admin/model/create_api_key_request.py +++ b/pinecone/core/openapi/admin/model/create_api_key_request.py @@ -103,6 +103,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of CreateAPIKeyRequest. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], name, *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/admin/model/create_project_request.py b/pinecone/core/openapi/admin/model/create_project_request.py index e6f710c3f..93d2e8a52 100644 --- a/pinecone/core/openapi/admin/model/create_project_request.py +++ b/pinecone/core/openapi/admin/model/create_project_request.py @@ -105,6 +105,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of CreateProjectRequest. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], name, *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/admin/model/error_response.py b/pinecone/core/openapi/admin/model/error_response.py index 062b3e6b4..107a3ac2f 100644 --- a/pinecone/core/openapi/admin/model/error_response.py +++ b/pinecone/core/openapi/admin/model/error_response.py @@ -109,6 +109,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of ErrorResponse. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], status, error, *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/admin/model/error_response_error.py b/pinecone/core/openapi/admin/model/error_response_error.py index e83454ee0..89eb7c22b 100644 --- a/pinecone/core/openapi/admin/model/error_response_error.py +++ b/pinecone/core/openapi/admin/model/error_response_error.py @@ -103,6 +103,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of ErrorResponseError. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], code, message, *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/admin/model/list_api_keys_response.py b/pinecone/core/openapi/admin/model/list_api_keys_response.py index dcda7c011..7ea374573 100644 --- a/pinecone/core/openapi/admin/model/list_api_keys_response.py +++ b/pinecone/core/openapi/admin/model/list_api_keys_response.py @@ -107,6 +107,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of ListApiKeysResponse. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], data, *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/admin/model/organization.py b/pinecone/core/openapi/admin/model/organization.py index 63e3da5b3..418e86a0e 100644 --- a/pinecone/core/openapi/admin/model/organization.py +++ b/pinecone/core/openapi/admin/model/organization.py @@ -111,6 +111,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of Organization. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data( diff --git a/pinecone/core/openapi/admin/model/organization_list.py b/pinecone/core/openapi/admin/model/organization_list.py index 49a6846a6..c2912659c 100644 --- a/pinecone/core/openapi/admin/model/organization_list.py +++ b/pinecone/core/openapi/admin/model/organization_list.py @@ -107,6 +107,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of OrganizationList. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], data, *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/admin/model/project.py b/pinecone/core/openapi/admin/model/project.py index 2fc158e0f..5f9128d2f 100644 --- a/pinecone/core/openapi/admin/model/project.py +++ b/pinecone/core/openapi/admin/model/project.py @@ -111,6 +111,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of Project. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data( diff --git a/pinecone/core/openapi/admin/model/project_list.py b/pinecone/core/openapi/admin/model/project_list.py index 2d06bc505..77dc486e8 100644 --- a/pinecone/core/openapi/admin/model/project_list.py +++ b/pinecone/core/openapi/admin/model/project_list.py @@ -107,6 +107,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of ProjectList. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], data, *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/admin/model/update_api_key_request.py b/pinecone/core/openapi/admin/model/update_api_key_request.py index 68d0cea83..c2cd1b6ec 100644 --- a/pinecone/core/openapi/admin/model/update_api_key_request.py +++ b/pinecone/core/openapi/admin/model/update_api_key_request.py @@ -103,6 +103,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of UpdateAPIKeyRequest. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/admin/model/update_organization_request.py b/pinecone/core/openapi/admin/model/update_organization_request.py index ce0095cd3..f17163a54 100644 --- a/pinecone/core/openapi/admin/model/update_organization_request.py +++ b/pinecone/core/openapi/admin/model/update_organization_request.py @@ -101,6 +101,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of UpdateOrganizationRequest. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/admin/model/update_project_request.py b/pinecone/core/openapi/admin/model/update_project_request.py index 20e8ae2a1..2bab05cb3 100644 --- a/pinecone/core/openapi/admin/model/update_project_request.py +++ b/pinecone/core/openapi/admin/model/update_project_request.py @@ -105,6 +105,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of UpdateProjectRequest. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 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 c4e75a45b..8d6ad8d02 100644 --- a/pinecone/core/openapi/db_control/api/manage_indexes_api.py +++ b/pinecone/core/openapi/db_control/api/manage_indexes_api.py @@ -9,6 +9,13 @@ Contact: support@pinecone.io """ +from __future__ import annotations + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from multiprocessing.pool import ApplyResult + from pinecone.openapi_support import ApiClient, AsyncioApiClient from pinecone.openapi_support.endpoint_utils import ( ExtraOpenApiKwargsTypedDict, @@ -64,7 +71,7 @@ def __configure_index( configure_index_request, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict, - ): + ) -> IndexModel | ApplyResult[IndexModel]: """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 @@ -154,7 +161,7 @@ def __create_backup( create_backup_request, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict, - ): + ) -> BackupModel | ApplyResult[BackupModel]: """Create a backup of an index # noqa: E501 Create a backup of an index. # noqa: E501 @@ -243,7 +250,7 @@ def __create_collection( create_collection_request, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict, - ): + ) -> CollectionModel | ApplyResult[CollectionModel]: """Create a collection # noqa: E501 Create a Pinecone collection. Serverless indexes do not support collections. # noqa: E501 @@ -325,7 +332,7 @@ def __create_index( create_index_request, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict, - ): + ) -> IndexModel | ApplyResult[IndexModel]: """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 @@ -407,7 +414,7 @@ def __create_index_for_model( create_index_for_model_request, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict, - ): + ) -> IndexModel | ApplyResult[IndexModel]: """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-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 @@ -490,7 +497,7 @@ def __create_index_from_backup_operation( create_index_from_backup_request, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict, - ): + ) -> CreateIndexFromBackupResponse | ApplyResult[CreateIndexFromBackupResponse]: """Create an index from a backup # noqa: E501 Create an index from a backup. # noqa: E501 @@ -580,7 +587,7 @@ def __create_index_from_backup_operation( def __delete_backup( self, backup_id, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict - ): + ) -> None: """Delete a backup # noqa: E501 Delete a backup. # noqa: E501 @@ -659,7 +666,7 @@ def __delete_collection( collection_name, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict, - ): + ) -> None: """Delete a collection # noqa: E501 Delete an existing collection. Serverless indexes do not support collections. # noqa: E501 @@ -738,7 +745,7 @@ def __delete_index( index_name, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict, - ): + ) -> None: """Delete an index # noqa: E501 Delete an existing index. # noqa: E501 @@ -814,7 +821,7 @@ def __delete_index( def __describe_backup( self, backup_id, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict - ): + ) -> BackupModel | ApplyResult[BackupModel]: """Describe a backup # noqa: E501 Get a description of a backup. # noqa: E501 @@ -893,7 +900,7 @@ def __describe_collection( collection_name, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict, - ): + ) -> CollectionModel | ApplyResult[CollectionModel]: """Describe a collection # noqa: E501 Get a description of a collection. Serverless indexes do not support collections. # noqa: E501 @@ -972,7 +979,7 @@ def __describe_index( index_name, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict, - ): + ) -> IndexModel | ApplyResult[IndexModel]: """Describe an index # noqa: E501 Get a description of an index. # noqa: E501 @@ -1048,7 +1055,7 @@ def __describe_index( def __describe_restore_job( self, job_id, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict - ): + ) -> RestoreJobModel | ApplyResult[RestoreJobModel]: """Describe a restore job # noqa: E501 Get a description of a restore job. # noqa: E501 @@ -1124,7 +1131,7 @@ def __describe_restore_job( def __list_collections( self, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict - ): + ) -> CollectionList | ApplyResult[CollectionList]: """List collections # noqa: E501 List all collections in a project. Serverless indexes do not support collections. # noqa: E501 @@ -1198,7 +1205,7 @@ def __list_index_backups( index_name, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict, - ): + ) -> BackupList | ApplyResult[BackupList]: """List backups for an index # noqa: E501 List all backups for an index. # noqa: E501 @@ -1288,7 +1295,7 @@ def __list_index_backups( def __list_indexes( self, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict - ): + ) -> IndexList | ApplyResult[IndexList]: """List indexes # noqa: E501 List all indexes in a project. # noqa: E501 @@ -1359,7 +1366,7 @@ def __list_indexes( def __list_project_backups( self, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict - ): + ) -> BackupList | ApplyResult[BackupList]: """List backups for all indexes in a project # noqa: E501 List all backups for a project. # noqa: E501 @@ -1444,7 +1451,7 @@ def __list_project_backups( def __list_restore_jobs( self, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict - ): + ) -> RestoreJobList | ApplyResult[RestoreJobList]: """List restore jobs # noqa: E501 List all restore jobs for a project. # noqa: E501 @@ -1541,7 +1548,7 @@ def __init__(self, api_client=None) -> None: async def __configure_index( self, index_name, configure_index_request, x_pinecone_api_version="2025-10", **kwargs - ): + ) -> IndexModel: """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 @@ -1620,7 +1627,7 @@ async def __configure_index( async def __create_backup( self, index_name, create_backup_request, x_pinecone_api_version="2025-10", **kwargs - ): + ) -> BackupModel: """Create a backup of an index # noqa: E501 Create a backup of an index. # noqa: E501 @@ -1699,7 +1706,7 @@ async def __create_backup( async def __create_collection( self, create_collection_request, x_pinecone_api_version="2025-10", **kwargs - ): + ) -> CollectionModel: """Create a collection # noqa: E501 Create a Pinecone collection. Serverless indexes do not support collections. # noqa: E501 @@ -1771,7 +1778,7 @@ async def __create_collection( async def __create_index( self, create_index_request, x_pinecone_api_version="2025-10", **kwargs - ): + ) -> IndexModel: """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 @@ -1843,7 +1850,7 @@ async def __create_index( async def __create_index_for_model( self, create_index_for_model_request, x_pinecone_api_version="2025-10", **kwargs - ): + ) -> IndexModel: """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-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 @@ -1919,7 +1926,7 @@ async def __create_index_from_backup_operation( create_index_from_backup_request, x_pinecone_api_version="2025-10", **kwargs, - ): + ) -> CreateIndexFromBackupResponse: """Create an index from a backup # noqa: E501 Create an index from a backup. # noqa: E501 @@ -2000,7 +2007,9 @@ async def __create_index_from_backup_operation( callable=__create_index_from_backup_operation, ) - async def __delete_backup(self, backup_id, x_pinecone_api_version="2025-10", **kwargs): + async def __delete_backup( + self, backup_id, x_pinecone_api_version="2025-10", **kwargs + ) -> None: """Delete a backup # noqa: E501 Delete a backup. # noqa: E501 @@ -2069,7 +2078,7 @@ async def __delete_backup(self, backup_id, x_pinecone_api_version="2025-10", **k async def __delete_collection( self, collection_name, x_pinecone_api_version="2025-10", **kwargs - ): + ) -> None: """Delete a collection # noqa: E501 Delete an existing collection. Serverless indexes do not support collections. # noqa: E501 @@ -2136,7 +2145,9 @@ async def __delete_collection( callable=__delete_collection, ) - async def __delete_index(self, index_name, x_pinecone_api_version="2025-10", **kwargs): + async def __delete_index( + self, index_name, x_pinecone_api_version="2025-10", **kwargs + ) -> None: """Delete an index # noqa: E501 Delete an existing index. # noqa: E501 @@ -2203,7 +2214,9 @@ async def __delete_index(self, index_name, x_pinecone_api_version="2025-10", **k callable=__delete_index, ) - async def __describe_backup(self, backup_id, x_pinecone_api_version="2025-10", **kwargs): + async def __describe_backup( + self, backup_id, x_pinecone_api_version="2025-10", **kwargs + ) -> BackupModel: """Describe a backup # noqa: E501 Get a description of a backup. # noqa: E501 @@ -2272,7 +2285,7 @@ async def __describe_backup(self, backup_id, x_pinecone_api_version="2025-10", * async def __describe_collection( self, collection_name, x_pinecone_api_version="2025-10", **kwargs - ): + ) -> CollectionModel: """Describe a collection # noqa: E501 Get a description of a collection. Serverless indexes do not support collections. # noqa: E501 @@ -2339,7 +2352,9 @@ async def __describe_collection( callable=__describe_collection, ) - async def __describe_index(self, index_name, x_pinecone_api_version="2025-10", **kwargs): + async def __describe_index( + self, index_name, x_pinecone_api_version="2025-10", **kwargs + ) -> IndexModel: """Describe an index # noqa: E501 Get a description of an index. # noqa: E501 @@ -2406,7 +2421,9 @@ async def __describe_index(self, index_name, x_pinecone_api_version="2025-10", * callable=__describe_index, ) - async def __describe_restore_job(self, job_id, x_pinecone_api_version="2025-10", **kwargs): + async def __describe_restore_job( + self, job_id, x_pinecone_api_version="2025-10", **kwargs + ) -> RestoreJobModel: """Describe a restore job # noqa: E501 Get a description of a restore job. # noqa: E501 @@ -2473,7 +2490,9 @@ async def __describe_restore_job(self, job_id, x_pinecone_api_version="2025-10", callable=__describe_restore_job, ) - async def __list_collections(self, x_pinecone_api_version="2025-10", **kwargs): + async def __list_collections( + self, x_pinecone_api_version="2025-10", **kwargs + ) -> CollectionList: """List collections # noqa: E501 List all collections in a project. Serverless indexes do not support collections. # noqa: E501 @@ -2537,7 +2556,7 @@ async def __list_collections(self, x_pinecone_api_version="2025-10", **kwargs): async def __list_index_backups( self, index_name, x_pinecone_api_version="2025-10", **kwargs - ): + ) -> BackupList: """List backups for an index # noqa: E501 List all backups for an index. # noqa: E501 @@ -2618,7 +2637,7 @@ async def __list_index_backups( callable=__list_index_backups, ) - async def __list_indexes(self, x_pinecone_api_version="2025-10", **kwargs): + async def __list_indexes(self, x_pinecone_api_version="2025-10", **kwargs) -> IndexList: """List indexes # noqa: E501 List all indexes in a project. # noqa: E501 @@ -2680,7 +2699,9 @@ async def __list_indexes(self, x_pinecone_api_version="2025-10", **kwargs): callable=__list_indexes, ) - async def __list_project_backups(self, x_pinecone_api_version="2025-10", **kwargs): + async def __list_project_backups( + self, x_pinecone_api_version="2025-10", **kwargs + ) -> BackupList: """List backups for all indexes in a project # noqa: E501 List all backups for a project. # noqa: E501 @@ -2756,7 +2777,9 @@ async def __list_project_backups(self, x_pinecone_api_version="2025-10", **kwarg callable=__list_project_backups, ) - async def __list_restore_jobs(self, x_pinecone_api_version="2025-10", **kwargs): + async def __list_restore_jobs( + self, x_pinecone_api_version="2025-10", **kwargs + ) -> RestoreJobList: """List restore jobs # noqa: E501 List all restore jobs for a project. # noqa: E501 diff --git a/pinecone/core/openapi/db_control/model/backup_list.py b/pinecone/core/openapi/db_control/model/backup_list.py index c45302c6c..550b4e3b0 100644 --- a/pinecone/core/openapi/db_control/model/backup_list.py +++ b/pinecone/core/openapi/db_control/model/backup_list.py @@ -111,6 +111,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of BackupList. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # 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 96182174d..245821dfb 100644 --- a/pinecone/core/openapi/db_control/model/backup_model.py +++ b/pinecone/core/openapi/db_control/model/backup_model.py @@ -141,6 +141,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of BackupModel. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data( diff --git a/pinecone/core/openapi/db_control/model/backup_model_schema.py b/pinecone/core/openapi/db_control/model/backup_model_schema.py index 0b9a02d34..f0d386577 100644 --- a/pinecone/core/openapi/db_control/model/backup_model_schema.py +++ b/pinecone/core/openapi/db_control/model/backup_model_schema.py @@ -109,6 +109,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of BackupModelSchema. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], fields, *args, **kwargs) -> T: # noqa: E501 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 index 51a95c0d6..cde8ec5a9 100644 --- a/pinecone/core/openapi/db_control/model/backup_model_schema_fields.py +++ b/pinecone/core/openapi/db_control/model/backup_model_schema_fields.py @@ -99,6 +99,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of BackupModelSchemaFields. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/db_control/model/byoc.py b/pinecone/core/openapi/db_control/model/byoc.py index 7d87e24bf..582b92864 100644 --- a/pinecone/core/openapi/db_control/model/byoc.py +++ b/pinecone/core/openapi/db_control/model/byoc.py @@ -107,6 +107,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of BYOC. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], byoc, *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/db_control/model/byoc_spec.py b/pinecone/core/openapi/db_control/model/byoc_spec.py index ef30a46db..9563109cc 100644 --- a/pinecone/core/openapi/db_control/model/byoc_spec.py +++ b/pinecone/core/openapi/db_control/model/byoc_spec.py @@ -109,6 +109,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of ByocSpec. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], environment, *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/db_control/model/collection_list.py b/pinecone/core/openapi/db_control/model/collection_list.py index 5c1166e7d..39a366e52 100644 --- a/pinecone/core/openapi/db_control/model/collection_list.py +++ b/pinecone/core/openapi/db_control/model/collection_list.py @@ -107,6 +107,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of CollectionList. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/db_control/model/collection_model.py b/pinecone/core/openapi/db_control/model/collection_model.py index 380be520a..20e72a00a 100644 --- a/pinecone/core/openapi/db_control/model/collection_model.py +++ b/pinecone/core/openapi/db_control/model/collection_model.py @@ -111,6 +111,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of CollectionModel. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], name, status, environment, *args, **kwargs) -> T: # noqa: E501 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 7e8d58884..9a0848bce 100644 --- a/pinecone/core/openapi/db_control/model/configure_index_request.py +++ b/pinecone/core/openapi/db_control/model/configure_index_request.py @@ -117,6 +117,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of ConfigureIndexRequest. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # 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 3491145a1..88ab1d7fb 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 @@ -105,6 +105,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of ConfigureIndexRequestEmbed. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 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 b6eeb1da8..6aa071db5 100644 --- a/pinecone/core/openapi/db_control/model/create_backup_request.py +++ b/pinecone/core/openapi/db_control/model/create_backup_request.py @@ -101,6 +101,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of CreateBackupRequest. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 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 4d957bfde..89decafc4 100644 --- a/pinecone/core/openapi/db_control/model/create_collection_request.py +++ b/pinecone/core/openapi/db_control/model/create_collection_request.py @@ -103,6 +103,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of CreateCollectionRequest. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], name, source, *args, **kwargs) -> T: # noqa: E501 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 78207021b..76d917383 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 @@ -131,6 +131,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of CreateIndexForModelRequest. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], name, cloud, region, embed, *args, **kwargs) -> T: # noqa: E501 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 38027b94b..1596a3c5f 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 @@ -109,6 +109,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of CreateIndexForModelRequestEmbed. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], model, field_map, *args, **kwargs) -> T: # 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 083749941..f423bf004 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 @@ -113,6 +113,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of CreateIndexFromBackupRequest. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], name, *args, **kwargs) -> T: # noqa: E501 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 88df35705..42655b049 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 @@ -101,6 +101,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of CreateIndexFromBackupResponse. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], restore_job_id, index_id, *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/db_control/model/create_index_request.py b/pinecone/core/openapi/db_control/model/create_index_request.py index 2106ab86b..c43cc4bc8 100644 --- a/pinecone/core/openapi/db_control/model/create_index_request.py +++ b/pinecone/core/openapi/db_control/model/create_index_request.py @@ -124,6 +124,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of CreateIndexRequest. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], name, spec, *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/db_control/model/error_response.py b/pinecone/core/openapi/db_control/model/error_response.py index 56222a1f6..4ef4eb266 100644 --- a/pinecone/core/openapi/db_control/model/error_response.py +++ b/pinecone/core/openapi/db_control/model/error_response.py @@ -109,6 +109,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of ErrorResponse. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], status, error, *args, **kwargs) -> T: # noqa: E501 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 ee7b00355..8a6447e09 100644 --- a/pinecone/core/openapi/db_control/model/error_response_error.py +++ b/pinecone/core/openapi/db_control/model/error_response_error.py @@ -103,6 +103,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of ErrorResponseError. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], code, message, *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/db_control/model/index_list.py b/pinecone/core/openapi/db_control/model/index_list.py index 046492c1f..db71f2ce9 100644 --- a/pinecone/core/openapi/db_control/model/index_list.py +++ b/pinecone/core/openapi/db_control/model/index_list.py @@ -107,6 +107,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of IndexList. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/db_control/model/index_model.py b/pinecone/core/openapi/db_control/model/index_model.py index b4af577fa..50fbd16b2 100644 --- a/pinecone/core/openapi/db_control/model/index_model.py +++ b/pinecone/core/openapi/db_control/model/index_model.py @@ -134,6 +134,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of IndexModel. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], name, metric, host, spec, status, *args, **kwargs) -> T: # 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 d020f8cbf..aff29b628 100644 --- a/pinecone/core/openapi/db_control/model/index_model_status.py +++ b/pinecone/core/openapi/db_control/model/index_model_status.py @@ -101,6 +101,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of IndexModelStatus. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], ready, state, *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/db_control/model/index_tags.py b/pinecone/core/openapi/db_control/model/index_tags.py index b4df234ba..61f3060a8 100644 --- a/pinecone/core/openapi/db_control/model/index_tags.py +++ b/pinecone/core/openapi/db_control/model/index_tags.py @@ -95,6 +95,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of IndexTags. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 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 c94396381..b860c6db5 100644 --- a/pinecone/core/openapi/db_control/model/model_index_embed.py +++ b/pinecone/core/openapi/db_control/model/model_index_embed.py @@ -113,6 +113,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of ModelIndexEmbed. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], model, *args, **kwargs) -> T: # 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 b357e5224..fdabb8dfa 100644 --- a/pinecone/core/openapi/db_control/model/pagination_response.py +++ b/pinecone/core/openapi/db_control/model/pagination_response.py @@ -99,6 +99,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of PaginationResponse. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], next, *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/db_control/model/pod_based.py b/pinecone/core/openapi/db_control/model/pod_based.py index dddba5b11..13df8964a 100644 --- a/pinecone/core/openapi/db_control/model/pod_based.py +++ b/pinecone/core/openapi/db_control/model/pod_based.py @@ -107,6 +107,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of PodBased. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], pod, *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/db_control/model/pod_spec.py b/pinecone/core/openapi/db_control/model/pod_spec.py index 1714212c5..c401b050a 100644 --- a/pinecone/core/openapi/db_control/model/pod_spec.py +++ b/pinecone/core/openapi/db_control/model/pod_spec.py @@ -125,6 +125,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of PodSpec. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], environment, *args, **kwargs) -> T: # noqa: E501 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 5508d9316..9ce33ee3e 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 @@ -99,6 +99,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of PodSpecMetadataConfig. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 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 index e95c2fdf1..371fed24a 100644 --- a/pinecone/core/openapi/db_control/model/read_capacity_dedicated_config.py +++ b/pinecone/core/openapi/db_control/model/read_capacity_dedicated_config.py @@ -111,6 +111,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of ReadCapacityDedicatedConfig. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], node_type, scaling, *args, **kwargs) -> T: # noqa: E501 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 index 54bfafc61..df34bf63e 100644 --- a/pinecone/core/openapi/db_control/model/read_capacity_dedicated_spec.py +++ b/pinecone/core/openapi/db_control/model/read_capacity_dedicated_spec.py @@ -111,6 +111,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of ReadCapacityDedicatedSpec. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], mode, dedicated, *args, **kwargs) -> T: # noqa: E501 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 index c1eb3b18a..9c74257e0 100644 --- 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 @@ -108,6 +108,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of ReadCapacityDedicatedSpecResponse. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], mode, dedicated, status, *args, **kwargs) -> T: # noqa: E501 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 index 9446c424f..15e0907ed 100644 --- 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 @@ -93,6 +93,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of ReadCapacityOnDemandSpec. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], mode, *args, **kwargs) -> T: # noqa: E501 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 index e01b47d51..e1ce9d7fc 100644 --- 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 @@ -102,6 +102,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of ReadCapacityOnDemandSpecResponse. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], mode, status, *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/db_control/model/read_capacity_status.py b/pinecone/core/openapi/db_control/model/read_capacity_status.py index 107e40317..40ea91cc0 100644 --- a/pinecone/core/openapi/db_control/model/read_capacity_status.py +++ b/pinecone/core/openapi/db_control/model/read_capacity_status.py @@ -105,6 +105,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of ReadCapacityStatus. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], state, *args, **kwargs) -> T: # noqa: E501 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 a01d8b6b8..5d1121128 100644 --- a/pinecone/core/openapi/db_control/model/restore_job_list.py +++ b/pinecone/core/openapi/db_control/model/restore_job_list.py @@ -111,6 +111,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of RestoreJobList. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], data, *args, **kwargs) -> T: # noqa: E501 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 5f68f3c5a..857feb17c 100644 --- a/pinecone/core/openapi/db_control/model/restore_job_model.py +++ b/pinecone/core/openapi/db_control/model/restore_job_model.py @@ -115,6 +115,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of RestoreJobModel. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data( diff --git a/pinecone/core/openapi/db_control/model/scaling_config_manual.py b/pinecone/core/openapi/db_control/model/scaling_config_manual.py index 0639533f7..069ccfd7f 100644 --- a/pinecone/core/openapi/db_control/model/scaling_config_manual.py +++ b/pinecone/core/openapi/db_control/model/scaling_config_manual.py @@ -104,6 +104,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of ScalingConfigManual. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], replicas, shards, *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/db_control/model/serverless.py b/pinecone/core/openapi/db_control/model/serverless.py index d36a79a52..3dce85d9a 100644 --- a/pinecone/core/openapi/db_control/model/serverless.py +++ b/pinecone/core/openapi/db_control/model/serverless.py @@ -107,6 +107,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of Serverless. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], serverless, *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/db_control/model/serverless_spec.py b/pinecone/core/openapi/db_control/model/serverless_spec.py index 0f1800f1e..dc549ed8d 100644 --- a/pinecone/core/openapi/db_control/model/serverless_spec.py +++ b/pinecone/core/openapi/db_control/model/serverless_spec.py @@ -117,6 +117,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of ServerlessSpec. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], cloud, region, *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/db_control/model/serverless_spec_response.py b/pinecone/core/openapi/db_control/model/serverless_spec_response.py index c542323e9..55197559d 100644 --- a/pinecone/core/openapi/db_control/model/serverless_spec_response.py +++ b/pinecone/core/openapi/db_control/model/serverless_spec_response.py @@ -117,6 +117,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of ServerlessSpecResponse. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], cloud, region, read_capacity, *args, **kwargs) -> T: # noqa: E501 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 237b9f3b2..ab7c22d9d 100644 --- a/pinecone/core/openapi/db_data/api/bulk_operations_api.py +++ b/pinecone/core/openapi/db_data/api/bulk_operations_api.py @@ -9,6 +9,13 @@ Contact: support@pinecone.io """ +from __future__ import annotations + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from multiprocessing.pool import ApplyResult + from pinecone.openapi_support import ApiClient, AsyncioApiClient from pinecone.openapi_support.endpoint_utils import ( ExtraOpenApiKwargsTypedDict, @@ -43,7 +50,9 @@ def __init__(self, api_client=None) -> None: def __cancel_bulk_import( self, id, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict - ): + ) -> {str: (bool, dict, float, int, list, str, none_type)} | ApplyResult[ + {str: (bool, dict, float, int, list, str, none_type)} + ]: """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 @@ -116,7 +125,7 @@ def __cancel_bulk_import( def __describe_bulk_import( self, id, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict - ): + ) -> ImportModel | ApplyResult[ImportModel]: """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 @@ -189,7 +198,7 @@ def __describe_bulk_import( def __list_bulk_imports( self, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict - ): + ) -> ListImportsResponse | ApplyResult[ListImportsResponse]: """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 @@ -277,7 +286,7 @@ def __start_bulk_import( start_import_request, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict, - ): + ) -> StartImportResponse | ApplyResult[StartImportResponse]: """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 @@ -366,7 +375,9 @@ def __init__(self, api_client=None) -> None: api_client = AsyncioApiClient() self.api_client = api_client - async def __cancel_bulk_import(self, id, x_pinecone_api_version="2025-10", **kwargs): + async def __cancel_bulk_import( + self, id, x_pinecone_api_version="2025-10", **kwargs + ) -> {str: (bool, dict, float, int, list, str, none_type)}: """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 @@ -430,7 +441,9 @@ async def __cancel_bulk_import(self, id, x_pinecone_api_version="2025-10", **kwa callable=__cancel_bulk_import, ) - async def __describe_bulk_import(self, id, x_pinecone_api_version="2025-10", **kwargs): + async def __describe_bulk_import( + self, id, x_pinecone_api_version="2025-10", **kwargs + ) -> ImportModel: """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 @@ -494,7 +507,9 @@ async def __describe_bulk_import(self, id, x_pinecone_api_version="2025-10", **k callable=__describe_bulk_import, ) - async def __list_bulk_imports(self, x_pinecone_api_version="2025-10", **kwargs): + async def __list_bulk_imports( + self, x_pinecone_api_version="2025-10", **kwargs + ) -> ListImportsResponse: """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 @@ -572,7 +587,7 @@ async def __list_bulk_imports(self, x_pinecone_api_version="2025-10", **kwargs): async def __start_bulk_import( self, start_import_request, x_pinecone_api_version="2025-10", **kwargs - ): + ) -> StartImportResponse: """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 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 6111d4c41..60bedcb4c 100644 --- a/pinecone/core/openapi/db_data/api/namespace_operations_api.py +++ b/pinecone/core/openapi/db_data/api/namespace_operations_api.py @@ -9,6 +9,13 @@ Contact: support@pinecone.io """ +from __future__ import annotations + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from multiprocessing.pool import ApplyResult + from pinecone.openapi_support import ApiClient, AsyncioApiClient from pinecone.openapi_support.endpoint_utils import ( ExtraOpenApiKwargsTypedDict, @@ -45,7 +52,7 @@ def __create_namespace( create_namespace_request, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict, - ): + ) -> NamespaceDescription | ApplyResult[NamespaceDescription]: """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 @@ -124,7 +131,9 @@ def __create_namespace( def __delete_namespace( self, namespace, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict - ): + ) -> {str: (bool, dict, float, int, list, str, none_type)} | ApplyResult[ + {str: (bool, dict, float, int, list, str, none_type)} + ]: """Delete a namespace # 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 @@ -200,7 +209,7 @@ def __delete_namespace( def __describe_namespace( self, namespace, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict - ): + ) -> NamespaceDescription | ApplyResult[NamespaceDescription]: """Describe a 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 @@ -276,7 +285,7 @@ def __describe_namespace( def __list_namespaces_operation( self, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict - ): + ) -> ListNamespacesResponse | ApplyResult[ListNamespacesResponse]: """List namespaces # 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 @@ -377,7 +386,7 @@ def __init__(self, api_client=None) -> None: async def __create_namespace( self, create_namespace_request, x_pinecone_api_version="2025-10", **kwargs - ): + ) -> NamespaceDescription: """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 @@ -447,7 +456,9 @@ async def __create_namespace( callable=__create_namespace, ) - async def __delete_namespace(self, namespace, x_pinecone_api_version="2025-10", **kwargs): + async def __delete_namespace( + self, namespace, x_pinecone_api_version="2025-10", **kwargs + ) -> {str: (bool, dict, float, int, list, str, none_type)}: """Delete a namespace # 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 @@ -514,7 +525,9 @@ async def __delete_namespace(self, namespace, x_pinecone_api_version="2025-10", callable=__delete_namespace, ) - async def __describe_namespace(self, namespace, x_pinecone_api_version="2025-10", **kwargs): + async def __describe_namespace( + self, namespace, x_pinecone_api_version="2025-10", **kwargs + ) -> NamespaceDescription: """Describe a 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 @@ -581,7 +594,9 @@ async def __describe_namespace(self, namespace, x_pinecone_api_version="2025-10" callable=__describe_namespace, ) - async def __list_namespaces_operation(self, x_pinecone_api_version="2025-10", **kwargs): + async def __list_namespaces_operation( + self, x_pinecone_api_version="2025-10", **kwargs + ) -> ListNamespacesResponse: """List namespaces # 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 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 d6f1b7652..1cefc5e83 100644 --- a/pinecone/core/openapi/db_data/api/vector_operations_api.py +++ b/pinecone/core/openapi/db_data/api/vector_operations_api.py @@ -9,6 +9,13 @@ Contact: support@pinecone.io """ +from __future__ import annotations + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from multiprocessing.pool import ApplyResult + from pinecone.openapi_support import ApiClient, AsyncioApiClient from pinecone.openapi_support.endpoint_utils import ( ExtraOpenApiKwargsTypedDict, @@ -60,7 +67,9 @@ def __delete_vectors( delete_request, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict, - ): + ) -> {str: (bool, dict, float, int, list, str, none_type)} | ApplyResult[ + {str: (bool, dict, float, int, list, str, none_type)} + ]: """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 @@ -139,7 +148,7 @@ def __describe_index_stats( describe_index_stats_request, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict, - ): + ) -> IndexDescription | ApplyResult[IndexDescription]: """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 @@ -218,7 +227,7 @@ def __describe_index_stats( def __fetch_vectors( self, ids, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict - ): + ) -> FetchResponse | ApplyResult[FetchResponse]: """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 @@ -307,7 +316,7 @@ def __fetch_vectors_by_metadata( fetch_by_metadata_request, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict, - ): + ) -> FetchByMetadataResponse | ApplyResult[FetchByMetadataResponse]: """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 @@ -386,7 +395,7 @@ def __fetch_vectors_by_metadata( def __list_vectors( self, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict - ): + ) -> ListResponse | ApplyResult[ListResponse]: """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 @@ -488,7 +497,7 @@ def __query_vectors( query_request, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict, - ): + ) -> QueryResponse | ApplyResult[QueryResponse]: """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 @@ -568,7 +577,7 @@ def __search_records_namespace( search_records_request, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict, - ): + ) -> SearchRecordsResponse | ApplyResult[SearchRecordsResponse]: """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/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 @@ -657,7 +666,7 @@ def __update_vector( update_request, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict, - ): + ) -> UpdateResponse | ApplyResult[UpdateResponse]: """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 @@ -737,7 +746,7 @@ def __upsert_records_namespace( upsert_record, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict, - ): + ) -> None: """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 @@ -826,7 +835,7 @@ def __upsert_vectors( upsert_request, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict, - ): + ) -> UpsertResponse | ApplyResult[UpsertResponse]: """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 @@ -914,7 +923,7 @@ def __init__(self, api_client=None) -> None: async def __delete_vectors( self, delete_request, x_pinecone_api_version="2025-10", **kwargs - ): + ) -> {str: (bool, dict, float, int, list, str, none_type)}: """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 @@ -983,7 +992,7 @@ async def __delete_vectors( async def __describe_index_stats( self, describe_index_stats_request, x_pinecone_api_version="2025-10", **kwargs - ): + ) -> IndexDescription: """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 @@ -1053,7 +1062,9 @@ async def __describe_index_stats( callable=__describe_index_stats, ) - async def __fetch_vectors(self, ids, x_pinecone_api_version="2025-10", **kwargs): + async def __fetch_vectors( + self, ids, x_pinecone_api_version="2025-10", **kwargs + ) -> FetchResponse: """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 @@ -1132,7 +1143,7 @@ async def __fetch_vectors(self, ids, x_pinecone_api_version="2025-10", **kwargs) async def __fetch_vectors_by_metadata( self, fetch_by_metadata_request, x_pinecone_api_version="2025-10", **kwargs - ): + ) -> FetchByMetadataResponse: """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 @@ -1202,7 +1213,7 @@ async def __fetch_vectors_by_metadata( callable=__fetch_vectors_by_metadata, ) - async def __list_vectors(self, x_pinecone_api_version="2025-10", **kwargs): + async def __list_vectors(self, x_pinecone_api_version="2025-10", **kwargs) -> ListResponse: """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 @@ -1292,7 +1303,9 @@ async def __list_vectors(self, x_pinecone_api_version="2025-10", **kwargs): callable=__list_vectors, ) - async def __query_vectors(self, query_request, x_pinecone_api_version="2025-10", **kwargs): + async def __query_vectors( + self, query_request, x_pinecone_api_version="2025-10", **kwargs + ) -> QueryResponse: """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 @@ -1361,7 +1374,7 @@ async def __query_vectors(self, query_request, x_pinecone_api_version="2025-10", async def __search_records_namespace( self, namespace, search_records_request, x_pinecone_api_version="2025-10", **kwargs - ): + ) -> SearchRecordsResponse: """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/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 @@ -1438,7 +1451,9 @@ async def __search_records_namespace( callable=__search_records_namespace, ) - async def __update_vector(self, update_request, x_pinecone_api_version="2025-10", **kwargs): + async def __update_vector( + self, update_request, x_pinecone_api_version="2025-10", **kwargs + ) -> UpdateResponse: """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 @@ -1507,7 +1522,7 @@ async def __update_vector(self, update_request, x_pinecone_api_version="2025-10" async def __upsert_records_namespace( self, namespace, upsert_record, x_pinecone_api_version="2025-10", **kwargs - ): + ) -> None: """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 @@ -1586,7 +1601,7 @@ async def __upsert_records_namespace( async def __upsert_vectors( self, upsert_request, x_pinecone_api_version="2025-10", **kwargs - ): + ) -> UpsertResponse: """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 diff --git a/pinecone/core/openapi/db_data/model/create_namespace_request.py b/pinecone/core/openapi/db_data/model/create_namespace_request.py index 6ea00aee8..41b0fccef 100644 --- a/pinecone/core/openapi/db_data/model/create_namespace_request.py +++ b/pinecone/core/openapi/db_data/model/create_namespace_request.py @@ -111,6 +111,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of CreateNamespaceRequest. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], name, *args, **kwargs) -> T: # noqa: E501 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 index 547e23c58..5e2bab334 100644 --- a/pinecone/core/openapi/db_data/model/create_namespace_request_schema.py +++ b/pinecone/core/openapi/db_data/model/create_namespace_request_schema.py @@ -109,6 +109,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of CreateNamespaceRequestSchema. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], fields, *args, **kwargs) -> T: # noqa: E501 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 index 149eb3aad..b98d27cdb 100644 --- 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 @@ -99,6 +99,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of CreateNamespaceRequestSchemaFields. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/db_data/model/delete_request.py b/pinecone/core/openapi/db_data/model/delete_request.py index aea6d5974..3c941e532 100644 --- a/pinecone/core/openapi/db_data/model/delete_request.py +++ b/pinecone/core/openapi/db_data/model/delete_request.py @@ -105,6 +105,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of DeleteRequest. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 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 1e4638018..ea037a747 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 @@ -99,6 +99,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of DescribeIndexStatsRequest. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 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 index 3d6d70676..3db3d451a 100644 --- a/pinecone/core/openapi/db_data/model/fetch_by_metadata_request.py +++ b/pinecone/core/openapi/db_data/model/fetch_by_metadata_request.py @@ -107,6 +107,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of FetchByMetadataRequest. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 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 index e4811b3be..e5a18ff7d 100644 --- a/pinecone/core/openapi/db_data/model/fetch_by_metadata_response.py +++ b/pinecone/core/openapi/db_data/model/fetch_by_metadata_response.py @@ -117,6 +117,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of FetchByMetadataResponse. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/db_data/model/fetch_response.py b/pinecone/core/openapi/db_data/model/fetch_response.py index 8d39fa6bb..bec3cc982 100644 --- a/pinecone/core/openapi/db_data/model/fetch_response.py +++ b/pinecone/core/openapi/db_data/model/fetch_response.py @@ -113,6 +113,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of FetchResponse. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/db_data/model/hit.py b/pinecone/core/openapi/db_data/model/hit.py index 0f5970d94..6e1f6d7a1 100644 --- a/pinecone/core/openapi/db_data/model/hit.py +++ b/pinecone/core/openapi/db_data/model/hit.py @@ -103,6 +103,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of Hit. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], _id, _score, fields, *args, **kwargs) -> T: # noqa: E501 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 955603b3b..3cb889d49 100644 --- a/pinecone/core/openapi/db_data/model/import_error_mode.py +++ b/pinecone/core/openapi/db_data/model/import_error_mode.py @@ -99,6 +99,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of ImportErrorMode. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/db_data/model/import_model.py b/pinecone/core/openapi/db_data/model/import_model.py index fe666b89a..d96a623bb 100644 --- a/pinecone/core/openapi/db_data/model/import_model.py +++ b/pinecone/core/openapi/db_data/model/import_model.py @@ -116,6 +116,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of ImportModel. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # 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 d49b93cdb..2b8ef628e 100644 --- a/pinecone/core/openapi/db_data/model/index_description.py +++ b/pinecone/core/openapi/db_data/model/index_description.py @@ -121,6 +121,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of IndexDescription. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 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 378a35ba0..3394ebf31 100644 --- a/pinecone/core/openapi/db_data/model/list_imports_response.py +++ b/pinecone/core/openapi/db_data/model/list_imports_response.py @@ -111,6 +111,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of ListImportsResponse. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/db_data/model/list_item.py b/pinecone/core/openapi/db_data/model/list_item.py index 420eb710b..f7da88428 100644 --- a/pinecone/core/openapi/db_data/model/list_item.py +++ b/pinecone/core/openapi/db_data/model/list_item.py @@ -99,6 +99,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of ListItem. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 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 7320854aa..1eae7e80b 100644 --- a/pinecone/core/openapi/db_data/model/list_namespaces_response.py +++ b/pinecone/core/openapi/db_data/model/list_namespaces_response.py @@ -113,6 +113,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of ListNamespacesResponse. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/db_data/model/list_response.py b/pinecone/core/openapi/db_data/model/list_response.py index 50aef17f5..9ffc40fb4 100644 --- a/pinecone/core/openapi/db_data/model/list_response.py +++ b/pinecone/core/openapi/db_data/model/list_response.py @@ -117,6 +117,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of ListResponse. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/db_data/model/namespace_description.py b/pinecone/core/openapi/db_data/model/namespace_description.py index 0127e3652..6d2d87438 100644 --- a/pinecone/core/openapi/db_data/model/namespace_description.py +++ b/pinecone/core/openapi/db_data/model/namespace_description.py @@ -119,6 +119,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of NamespaceDescription. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/db_data/model/namespace_description_indexed_fields.py b/pinecone/core/openapi/db_data/model/namespace_description_indexed_fields.py index edd8ace1d..b5d039961 100644 --- a/pinecone/core/openapi/db_data/model/namespace_description_indexed_fields.py +++ b/pinecone/core/openapi/db_data/model/namespace_description_indexed_fields.py @@ -99,6 +99,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of NamespaceDescriptionIndexedFields. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/db_data/model/namespace_summary.py b/pinecone/core/openapi/db_data/model/namespace_summary.py index b6ef77ab2..32be17646 100644 --- a/pinecone/core/openapi/db_data/model/namespace_summary.py +++ b/pinecone/core/openapi/db_data/model/namespace_summary.py @@ -99,6 +99,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of NamespaceSummary. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/db_data/model/pagination.py b/pinecone/core/openapi/db_data/model/pagination.py index 374562312..2167046cb 100644 --- a/pinecone/core/openapi/db_data/model/pagination.py +++ b/pinecone/core/openapi/db_data/model/pagination.py @@ -99,6 +99,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of Pagination. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/db_data/model/protobuf_any.py b/pinecone/core/openapi/db_data/model/protobuf_any.py index 1dc76bc39..26066116b 100644 --- a/pinecone/core/openapi/db_data/model/protobuf_any.py +++ b/pinecone/core/openapi/db_data/model/protobuf_any.py @@ -101,6 +101,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of ProtobufAny. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/db_data/model/query_request.py b/pinecone/core/openapi/db_data/model/query_request.py index 88d12c238..fd523a1e8 100644 --- a/pinecone/core/openapi/db_data/model/query_request.py +++ b/pinecone/core/openapi/db_data/model/query_request.py @@ -130,6 +130,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of QueryRequest. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], top_k, *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/db_data/model/query_response.py b/pinecone/core/openapi/db_data/model/query_response.py index a28efa5fc..536710098 100644 --- a/pinecone/core/openapi/db_data/model/query_response.py +++ b/pinecone/core/openapi/db_data/model/query_response.py @@ -117,6 +117,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of QueryResponse. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/db_data/model/query_vector.py b/pinecone/core/openapi/db_data/model/query_vector.py index 4e8f3be20..8096695eb 100644 --- a/pinecone/core/openapi/db_data/model/query_vector.py +++ b/pinecone/core/openapi/db_data/model/query_vector.py @@ -118,6 +118,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of QueryVector. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], values, *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/db_data/model/rpc_status.py b/pinecone/core/openapi/db_data/model/rpc_status.py index 8feaf20d5..ffa392dcc 100644 --- a/pinecone/core/openapi/db_data/model/rpc_status.py +++ b/pinecone/core/openapi/db_data/model/rpc_status.py @@ -111,6 +111,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of RpcStatus. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/db_data/model/scored_vector.py b/pinecone/core/openapi/db_data/model/scored_vector.py index a18f7d7e8..7f6d5f195 100644 --- a/pinecone/core/openapi/db_data/model/scored_vector.py +++ b/pinecone/core/openapi/db_data/model/scored_vector.py @@ -117,6 +117,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of ScoredVector. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], id, *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/db_data/model/search_match_terms.py b/pinecone/core/openapi/db_data/model/search_match_terms.py index c5d59569f..5c92c874c 100644 --- a/pinecone/core/openapi/db_data/model/search_match_terms.py +++ b/pinecone/core/openapi/db_data/model/search_match_terms.py @@ -101,6 +101,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of SearchMatchTerms. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 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 1030ef90d..ff043a4f6 100644 --- a/pinecone/core/openapi/db_data/model/search_records_request.py +++ b/pinecone/core/openapi/db_data/model/search_records_request.py @@ -117,6 +117,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of SearchRecordsRequest. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], query, *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/db_data/model/search_records_request_query.py b/pinecone/core/openapi/db_data/model/search_records_request_query.py index 68d3a3da6..0f1b1ee52 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 @@ -119,6 +119,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of SearchRecordsRequestQuery. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], top_k, *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/db_data/model/search_records_request_rerank.py b/pinecone/core/openapi/db_data/model/search_records_request_rerank.py index c52907d05..331baeaff 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 @@ -107,6 +107,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of SearchRecordsRequestRerank. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], model, rank_fields, *args, **kwargs) -> T: # noqa: E501 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 0fead75f3..f2d3fe045 100644 --- a/pinecone/core/openapi/db_data/model/search_records_response.py +++ b/pinecone/core/openapi/db_data/model/search_records_response.py @@ -113,6 +113,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of SearchRecordsResponse. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], result, usage, *args, **kwargs) -> T: # noqa: E501 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 477da0a16..0c568aecc 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 @@ -107,6 +107,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of SearchRecordsResponseResult. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], hits, *args, **kwargs) -> T: # noqa: E501 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 15868d042..a19005d2b 100644 --- a/pinecone/core/openapi/db_data/model/search_records_vector.py +++ b/pinecone/core/openapi/db_data/model/search_records_vector.py @@ -111,6 +111,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of SearchRecordsVector. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/db_data/model/search_usage.py b/pinecone/core/openapi/db_data/model/search_usage.py index cc7e1f795..22bbd73a2 100644 --- a/pinecone/core/openapi/db_data/model/search_usage.py +++ b/pinecone/core/openapi/db_data/model/search_usage.py @@ -107,6 +107,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of SearchUsage. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], read_units, *args, **kwargs) -> T: # noqa: E501 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 94e041d27..a5edcb0ac 100644 --- a/pinecone/core/openapi/db_data/model/single_query_results.py +++ b/pinecone/core/openapi/db_data/model/single_query_results.py @@ -109,6 +109,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of SingleQueryResults. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/db_data/model/sparse_values.py b/pinecone/core/openapi/db_data/model/sparse_values.py index 7670fc295..4f4d77887 100644 --- a/pinecone/core/openapi/db_data/model/sparse_values.py +++ b/pinecone/core/openapi/db_data/model/sparse_values.py @@ -104,6 +104,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of SparseValues. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], indices, values, *args, **kwargs) -> T: # noqa: E501 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 351f05cd8..1f2f820a9 100644 --- a/pinecone/core/openapi/db_data/model/start_import_request.py +++ b/pinecone/core/openapi/db_data/model/start_import_request.py @@ -114,6 +114,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of StartImportRequest. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], uri, *args, **kwargs) -> T: # noqa: E501 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 a34ccf9ac..362c1030a 100644 --- a/pinecone/core/openapi/db_data/model/start_import_response.py +++ b/pinecone/core/openapi/db_data/model/start_import_response.py @@ -101,6 +101,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of StartImportResponse. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/db_data/model/update_request.py b/pinecone/core/openapi/db_data/model/update_request.py index 92786fceb..bf4e8d431 100644 --- a/pinecone/core/openapi/db_data/model/update_request.py +++ b/pinecone/core/openapi/db_data/model/update_request.py @@ -122,6 +122,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of UpdateRequest. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/db_data/model/update_response.py b/pinecone/core/openapi/db_data/model/update_response.py index 8b4a63c1f..599a63fed 100644 --- a/pinecone/core/openapi/db_data/model/update_response.py +++ b/pinecone/core/openapi/db_data/model/update_response.py @@ -99,6 +99,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of UpdateResponse. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/db_data/model/upsert_record.py b/pinecone/core/openapi/db_data/model/upsert_record.py index 42e97e114..cb9293a87 100644 --- a/pinecone/core/openapi/db_data/model/upsert_record.py +++ b/pinecone/core/openapi/db_data/model/upsert_record.py @@ -99,6 +99,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of UpsertRecord. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], _id, *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/db_data/model/upsert_request.py b/pinecone/core/openapi/db_data/model/upsert_request.py index 2d0167316..28a89533f 100644 --- a/pinecone/core/openapi/db_data/model/upsert_request.py +++ b/pinecone/core/openapi/db_data/model/upsert_request.py @@ -109,6 +109,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of UpsertRequest. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], vectors, *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/db_data/model/upsert_response.py b/pinecone/core/openapi/db_data/model/upsert_response.py index 7a53c74fb..d21e99d91 100644 --- a/pinecone/core/openapi/db_data/model/upsert_response.py +++ b/pinecone/core/openapi/db_data/model/upsert_response.py @@ -99,6 +99,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of UpsertResponse. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/db_data/model/usage.py b/pinecone/core/openapi/db_data/model/usage.py index 5710338ef..8c8d108e8 100644 --- a/pinecone/core/openapi/db_data/model/usage.py +++ b/pinecone/core/openapi/db_data/model/usage.py @@ -99,6 +99,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of Usage. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/db_data/model/vector.py b/pinecone/core/openapi/db_data/model/vector.py index d5ae043ed..6d72376c5 100644 --- a/pinecone/core/openapi/db_data/model/vector.py +++ b/pinecone/core/openapi/db_data/model/vector.py @@ -116,6 +116,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of Vector. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], id, *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/inference/api/inference_api.py b/pinecone/core/openapi/inference/api/inference_api.py index 63b7a43ca..d2f82def0 100644 --- a/pinecone/core/openapi/inference/api/inference_api.py +++ b/pinecone/core/openapi/inference/api/inference_api.py @@ -9,6 +9,13 @@ Contact: support@pinecone.io """ +from __future__ import annotations + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from multiprocessing.pool import ApplyResult + from pinecone.openapi_support import ApiClient, AsyncioApiClient from pinecone.openapi_support.endpoint_utils import ( ExtraOpenApiKwargsTypedDict, @@ -43,7 +50,9 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient() self.api_client = api_client - def __embed(self, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict): + def __embed( + self, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict + ) -> EmbeddingsList | ApplyResult[EmbeddingsList]: """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 @@ -121,7 +130,7 @@ def __get_model( model_name, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict, - ): + ) -> ModelInfo | ApplyResult[ModelInfo]: """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 @@ -197,7 +206,7 @@ def __get_model( def __list_models( self, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict - ): + ) -> ModelInfoList | ApplyResult[ModelInfoList]: """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 @@ -280,7 +289,9 @@ def __list_models( callable=__list_models, ) - def __rerank(self, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict): + def __rerank( + self, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict + ) -> RerankResult | ApplyResult[RerankResult]: """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 @@ -365,7 +376,7 @@ def __init__(self, api_client=None) -> None: api_client = AsyncioApiClient() self.api_client = api_client - async def __embed(self, x_pinecone_api_version="2025-10", **kwargs): + async def __embed(self, x_pinecone_api_version="2025-10", **kwargs) -> EmbeddingsList: """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 @@ -431,7 +442,9 @@ async def __embed(self, x_pinecone_api_version="2025-10", **kwargs): callable=__embed, ) - async def __get_model(self, model_name, x_pinecone_api_version="2025-10", **kwargs): + async def __get_model( + self, model_name, x_pinecone_api_version="2025-10", **kwargs + ) -> ModelInfo: """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 @@ -498,7 +511,7 @@ async def __get_model(self, model_name, x_pinecone_api_version="2025-10", **kwar callable=__get_model, ) - async def __list_models(self, x_pinecone_api_version="2025-10", **kwargs): + async def __list_models(self, x_pinecone_api_version="2025-10", **kwargs) -> ModelInfoList: """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 @@ -574,7 +587,7 @@ async def __list_models(self, x_pinecone_api_version="2025-10", **kwargs): callable=__list_models, ) - async def __rerank(self, x_pinecone_api_version="2025-10", **kwargs): + async def __rerank(self, x_pinecone_api_version="2025-10", **kwargs) -> RerankResult: """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 diff --git a/pinecone/core/openapi/inference/model/dense_embedding.py b/pinecone/core/openapi/inference/model/dense_embedding.py index 37452cd28..455ac87b0 100644 --- a/pinecone/core/openapi/inference/model/dense_embedding.py +++ b/pinecone/core/openapi/inference/model/dense_embedding.py @@ -101,6 +101,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of DenseEmbedding. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], values, vector_type, *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/inference/model/document.py b/pinecone/core/openapi/inference/model/document.py index 6151a77a1..1a3262fbc 100644 --- a/pinecone/core/openapi/inference/model/document.py +++ b/pinecone/core/openapi/inference/model/document.py @@ -95,6 +95,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of Document. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/inference/model/embed_request.py b/pinecone/core/openapi/inference/model/embed_request.py index 5aee7b1b4..c8d760646 100644 --- a/pinecone/core/openapi/inference/model/embed_request.py +++ b/pinecone/core/openapi/inference/model/embed_request.py @@ -111,6 +111,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of EmbedRequest. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], model, inputs, *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/inference/model/embed_request_inputs.py b/pinecone/core/openapi/inference/model/embed_request_inputs.py index 6deaa4906..e42174606 100644 --- a/pinecone/core/openapi/inference/model/embed_request_inputs.py +++ b/pinecone/core/openapi/inference/model/embed_request_inputs.py @@ -99,6 +99,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of EmbedRequestInputs. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/inference/model/embeddings_list.py b/pinecone/core/openapi/inference/model/embeddings_list.py index adf9b5e9b..d8b67c137 100644 --- a/pinecone/core/openapi/inference/model/embeddings_list.py +++ b/pinecone/core/openapi/inference/model/embeddings_list.py @@ -115,6 +115,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of EmbeddingsList. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], model, vector_type, data, usage, *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/inference/model/embeddings_list_usage.py b/pinecone/core/openapi/inference/model/embeddings_list_usage.py index 02cb83c18..04695e9e0 100644 --- a/pinecone/core/openapi/inference/model/embeddings_list_usage.py +++ b/pinecone/core/openapi/inference/model/embeddings_list_usage.py @@ -101,6 +101,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of EmbeddingsListUsage. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/inference/model/error_response.py b/pinecone/core/openapi/inference/model/error_response.py index 9556ba16d..12e1f25de 100644 --- a/pinecone/core/openapi/inference/model/error_response.py +++ b/pinecone/core/openapi/inference/model/error_response.py @@ -109,6 +109,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of ErrorResponse. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], status, error, *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/inference/model/error_response_error.py b/pinecone/core/openapi/inference/model/error_response_error.py index 61c410238..e6af5aae6 100644 --- a/pinecone/core/openapi/inference/model/error_response_error.py +++ b/pinecone/core/openapi/inference/model/error_response_error.py @@ -103,6 +103,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of ErrorResponseError. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], code, message, *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/inference/model/model_info.py b/pinecone/core/openapi/inference/model/model_info.py index a1e10b4ca..95a55447f 100644 --- a/pinecone/core/openapi/inference/model/model_info.py +++ b/pinecone/core/openapi/inference/model/model_info.py @@ -139,6 +139,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of ModelInfo. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data( diff --git a/pinecone/core/openapi/inference/model/model_info_list.py b/pinecone/core/openapi/inference/model/model_info_list.py index 753524ed6..a1e23c2b9 100644 --- a/pinecone/core/openapi/inference/model/model_info_list.py +++ b/pinecone/core/openapi/inference/model/model_info_list.py @@ -107,6 +107,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of ModelInfoList. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 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 542d50bab..058d1b8d7 100644 --- a/pinecone/core/openapi/inference/model/model_info_supported_parameter.py +++ b/pinecone/core/openapi/inference/model/model_info_supported_parameter.py @@ -113,6 +113,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of ModelInfoSupportedParameter. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data( diff --git a/pinecone/core/openapi/inference/model/ranked_document.py b/pinecone/core/openapi/inference/model/ranked_document.py index 2caa6dd8d..97c792dce 100644 --- a/pinecone/core/openapi/inference/model/ranked_document.py +++ b/pinecone/core/openapi/inference/model/ranked_document.py @@ -111,6 +111,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of RankedDocument. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], index, score, *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/inference/model/rerank_request.py b/pinecone/core/openapi/inference/model/rerank_request.py index 2f777938d..95120be4c 100644 --- a/pinecone/core/openapi/inference/model/rerank_request.py +++ b/pinecone/core/openapi/inference/model/rerank_request.py @@ -119,6 +119,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of RerankRequest. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], model, query, documents, *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/inference/model/rerank_result.py b/pinecone/core/openapi/inference/model/rerank_result.py index 458d27f7b..3dd945fed 100644 --- a/pinecone/core/openapi/inference/model/rerank_result.py +++ b/pinecone/core/openapi/inference/model/rerank_result.py @@ -113,6 +113,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of RerankResult. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], model, data, usage, *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/inference/model/rerank_result_usage.py b/pinecone/core/openapi/inference/model/rerank_result_usage.py index a92a2ab71..eeb617ae4 100644 --- a/pinecone/core/openapi/inference/model/rerank_result_usage.py +++ b/pinecone/core/openapi/inference/model/rerank_result_usage.py @@ -101,6 +101,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of RerankResultUsage. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/inference/model/sparse_embedding.py b/pinecone/core/openapi/inference/model/sparse_embedding.py index 56aaddec2..05324fc81 100644 --- a/pinecone/core/openapi/inference/model/sparse_embedding.py +++ b/pinecone/core/openapi/inference/model/sparse_embedding.py @@ -105,6 +105,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of SparseEmbedding. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data( diff --git a/pinecone/core/openapi/oauth/api/o_auth_api.py b/pinecone/core/openapi/oauth/api/o_auth_api.py index 818e7c2c4..6605f1afc 100644 --- a/pinecone/core/openapi/oauth/api/o_auth_api.py +++ b/pinecone/core/openapi/oauth/api/o_auth_api.py @@ -9,6 +9,13 @@ Contact: support@pinecone.io """ +from __future__ import annotations + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from multiprocessing.pool import ApplyResult + from pinecone.openapi_support import ApiClient, AsyncioApiClient from pinecone.openapi_support.endpoint_utils import ( ExtraOpenApiKwargsTypedDict, @@ -44,7 +51,7 @@ def __get_token( token_request, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict, - ): + ) -> TokenResponse | ApplyResult[TokenResponse]: """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 @@ -133,7 +140,9 @@ def __init__(self, api_client=None) -> None: api_client = AsyncioApiClient() self.api_client = api_client - async def __get_token(self, token_request, x_pinecone_api_version="2025-10", **kwargs): + async def __get_token( + self, token_request, x_pinecone_api_version="2025-10", **kwargs + ) -> TokenResponse: """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 diff --git a/pinecone/core/openapi/oauth/model/error_response.py b/pinecone/core/openapi/oauth/model/error_response.py index 626707410..311c647c5 100644 --- a/pinecone/core/openapi/oauth/model/error_response.py +++ b/pinecone/core/openapi/oauth/model/error_response.py @@ -101,6 +101,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of ErrorResponse. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 diff --git a/pinecone/core/openapi/oauth/model/token_request.py b/pinecone/core/openapi/oauth/model/token_request.py index bcf94e93b..64e7b4f2c 100644 --- a/pinecone/core/openapi/oauth/model/token_request.py +++ b/pinecone/core/openapi/oauth/model/token_request.py @@ -105,6 +105,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of TokenRequest. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data( diff --git a/pinecone/core/openapi/oauth/model/token_response.py b/pinecone/core/openapi/oauth/model/token_response.py index d657275de..25d371fd1 100644 --- a/pinecone/core/openapi/oauth/model/token_response.py +++ b/pinecone/core/openapi/oauth/model/token_response.py @@ -103,6 +103,16 @@ def discriminator(cls): _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: + """Create a new instance of TokenResponse. + + This method is overridden to provide proper type inference for mypy. + The actual instance creation logic (including discriminator handling) + is handled by the parent class's __new__ method. + """ + # Call parent's __new__ with all arguments to preserve discriminator logic + return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + @classmethod @convert_js_args_to_python_args def _from_openapi_data( diff --git a/pinecone/db_control/db_control.py b/pinecone/db_control/db_control.py index daa81b68e..145cce4b4 100644 --- a/pinecone/db_control/db_control.py +++ b/pinecone/db_control/db_control.py @@ -32,7 +32,7 @@ def __init__( self._pool_threads = pool_threads """ :meta private: """ - self._index_api = setup_openapi_client( + self._index_api: ManageIndexesApi = setup_openapi_client( api_client_klass=ApiClient, api_klass=ManageIndexesApi, config=self.config, diff --git a/pinecone/db_control/db_control_asyncio.py b/pinecone/db_control/db_control_asyncio.py index 005c25f22..cd87c207c 100644 --- a/pinecone/db_control/db_control_asyncio.py +++ b/pinecone/db_control/db_control_asyncio.py @@ -27,7 +27,7 @@ def __init__(self, config: "Config", openapi_config: "OpenApiConfiguration") -> self._openapi_config = openapi_config """ :meta private: """ - self._index_api = setup_async_openapi_client( + self._index_api: AsyncioManageIndexesApi = setup_async_openapi_client( api_client_klass=AsyncioApiClient, api_klass=AsyncioManageIndexesApi, config=self._config, diff --git a/pinecone/db_control/index_host_store.py b/pinecone/db_control/index_host_store.py index eec2e7efe..43e383099 100644 --- a/pinecone/db_control/index_host_store.py +++ b/pinecone/db_control/index_host_store.py @@ -1,4 +1,4 @@ -from typing import Dict +from typing import Dict, Any, Type from pinecone.config import Config from pinecone.core.openapi.db_control.api.manage_indexes_api import ( ManageIndexesApi as IndexOperationsApi, @@ -8,7 +8,7 @@ class SingletonMeta(type): - _instances: Dict[str, str] = {} + _instances: Dict[Type[Any], Any] = {} def __call__(cls, *args, **kwargs): if cls not in cls._instances: diff --git a/pinecone/db_control/models/serverless_spec.py b/pinecone/db_control/models/serverless_spec.py index f7adc64d5..e2e8a3e37 100644 --- a/pinecone/db_control/models/serverless_spec.py +++ b/pinecone/db_control/models/serverless_spec.py @@ -108,8 +108,10 @@ def __init__( object.__setattr__(self, "read_capacity", read_capacity) object.__setattr__(self, "schema", schema) - def asdict(self): - result = {"serverless": {"cloud": self.cloud, "region": self.region}} + def asdict(self) -> Dict[str, Any]: + from typing import Dict, Any + + result: Dict[str, Any] = {"serverless": {"cloud": self.cloud, "region": self.region}} if self.read_capacity is not None: result["serverless"]["read_capacity"] = self.read_capacity if self.schema is not None: diff --git a/pinecone/db_control/request_factory.py b/pinecone/db_control/request_factory.py index 32a456482..a7838969a 100644 --- a/pinecone/db_control/request_factory.py +++ b/pinecone/db_control/request_factory.py @@ -75,10 +75,14 @@ class PineconeDBControlRequestFactory: @staticmethod def __parse_tags(tags: Optional[Dict[str, str]]) -> IndexTags: + from typing import cast + if tags is None: - return IndexTags() + result = IndexTags() + return cast(IndexTags, result) else: - return IndexTags(**tags) + result = IndexTags(**tags) + return cast(IndexTags, result) @staticmethod def __parse_deletion_protection(deletion_protection: Union[DeletionProtection, str]) -> str: @@ -99,10 +103,13 @@ def __parse_read_capacity( :param read_capacity: Dict with read capacity configuration or existing ReadCapacity model instance :return: ReadCapacityOnDemandSpec, ReadCapacityDedicatedSpec, or existing model instance """ + from typing import cast + if isinstance(read_capacity, dict): mode = read_capacity.get("mode", "OnDemand") if mode == "OnDemand": - return ReadCapacityOnDemandSpec(mode="OnDemand") + result = ReadCapacityOnDemandSpec(mode="OnDemand") + return cast(ReadCapacityOnDemandSpec, result) elif mode == "Dedicated": dedicated_dict: Dict[str, Any] = read_capacity.get("dedicated", {}) # type: ignore # Construct ReadCapacityDedicatedConfig @@ -152,13 +159,19 @@ def __parse_read_capacity( dedicated_config_kwargs["manual"] = ScalingConfigManual(**manual_dict) dedicated_config = ReadCapacityDedicatedConfig(**dedicated_config_kwargs) - return ReadCapacityDedicatedSpec(mode="Dedicated", dedicated=dedicated_config) + result = ReadCapacityDedicatedSpec(mode="Dedicated", dedicated=dedicated_config) + return cast(ReadCapacityDedicatedSpec, result) else: # Fallback: let OpenAPI handle it - return read_capacity # type: ignore + from typing import cast + + return cast( + Union[ReadCapacityOnDemandSpec, ReadCapacityDedicatedSpec, "ReadCapacity"], + read_capacity, + ) else: # Already a ReadCapacity model instance - return read_capacity # type: ignore + return read_capacity @staticmethod def __parse_schema( @@ -221,10 +234,13 @@ def __parse_schema( "or provide field_name: field_config pairs directly." ) - return BackupModelSchema(**schema_kwargs) + from typing import cast + + result = BackupModelSchema(**schema_kwargs) + return cast(BackupModelSchema, result) else: # Already a BackupModelSchema instance - return schema # type: ignore + return schema @staticmethod def __parse_index_spec(spec: Union[Dict, ServerlessSpec, PodSpec, ByocSpec]) -> IndexSpec: @@ -336,7 +352,9 @@ def __parse_index_spec(spec: Union[Dict, ServerlessSpec, PodSpec, ByocSpec]) -> else: raise TypeError("spec must be of type dict, ServerlessSpec, PodSpec, or ByocSpec") - return index_spec + from typing import cast + + return cast(IndexSpec, index_spec) @staticmethod def create_index_request( @@ -375,7 +393,10 @@ def create_index_request( ] ) - return CreateIndexRequest(**args) + from typing import cast + + result = CreateIndexRequest(**args) + return cast(CreateIndexRequest, result) @staticmethod def create_index_for_model_request( @@ -454,7 +475,10 @@ def create_index_for_model_request( ] ) - return CreateIndexForModelRequest(**args) + from typing import cast + + result = CreateIndexForModelRequest(**args) + return cast(CreateIndexForModelRequest, result) @staticmethod def create_index_from_backup_request( @@ -469,7 +493,10 @@ def create_index_from_backup_request( tags_obj = PineconeDBControlRequestFactory.__parse_tags(tags) - return CreateIndexFromBackupRequest(name=name, deletion_protection=dp, tags=tags_obj) + from typing import cast + + result = CreateIndexFromBackupRequest(name=name, deletion_protection=dp, tags=tags_obj) + return cast(CreateIndexFromBackupRequest, result) @staticmethod def configure_index_request( @@ -544,8 +571,14 @@ def configure_index_request( ] ) - return ConfigureIndexRequest(**args_dict) + from typing import cast + + result = ConfigureIndexRequest(**args_dict) + return cast(ConfigureIndexRequest, result) @staticmethod def create_collection_request(name: str, source: str) -> CreateCollectionRequest: - return CreateCollectionRequest(name=name, source=source) + from typing import cast + + result = CreateCollectionRequest(name=name, source=source) + return cast(CreateCollectionRequest, result) diff --git a/pinecone/db_control/resources/asyncio/backup.py b/pinecone/db_control/resources/asyncio/backup.py index f01f9fcc4..0a54cf45d 100644 --- a/pinecone/db_control/resources/asyncio/backup.py +++ b/pinecone/db_control/resources/asyncio/backup.py @@ -94,4 +94,5 @@ async def delete(self, *, backup_id: str) -> None: :param backup_id: The ID of the backup to delete. :type backup_id: str """ - return await self._index_api.delete_backup(backup_id=backup_id) + await self._index_api.delete_backup(backup_id=backup_id) + return None diff --git a/pinecone/db_control/resources/asyncio/collection.py b/pinecone/db_control/resources/asyncio/collection.py index 27916df50..7f7d2d64d 100644 --- a/pinecone/db_control/resources/asyncio/collection.py +++ b/pinecone/db_control/resources/asyncio/collection.py @@ -1,4 +1,5 @@ import logging +from typing import Dict, Any from pinecone.db_control.models import CollectionList @@ -14,7 +15,7 @@ def __init__(self, index_api): self.index_api = index_api @require_kwargs - async def create(self, *, name: str, source: str): + async def create(self, *, name: str, source: str) -> None: req = PineconeDBControlRequestFactory.create_collection_request(name=name, source=source) await self.index_api.create_collection(create_collection_request=req) @@ -24,9 +25,12 @@ async def list(self) -> CollectionList: return CollectionList(response) @require_kwargs - async def delete(self, *, name: str): + async def delete(self, *, name: str) -> None: await self.index_api.delete_collection(name) @require_kwargs - async def describe(self, *, name: str): - return await self.index_api.describe_collection(name).to_dict() + async def describe(self, *, name: str) -> Dict[str, Any]: + from typing import cast + + result = await self.index_api.describe_collection(name) + return cast(Dict[str, Any], result.to_dict()) diff --git a/pinecone/db_control/resources/asyncio/index.py b/pinecone/db_control/resources/asyncio/index.py index 36871cf6d..f7825e02b 100644 --- a/pinecone/db_control/resources/asyncio/index.py +++ b/pinecone/db_control/resources/asyncio/index.py @@ -77,7 +77,9 @@ async def create( resp = await self._index_api.create_index(create_index_request=req) if timeout == -1: - return IndexModel(resp) + from typing import cast + + return IndexModel(cast(Any, resp)) return await self.__poll_describe_index_until_ready(name, timeout) @require_kwargs @@ -124,7 +126,9 @@ async def create_for_model( resp = await self._index_api.create_index_for_model(req) if timeout == -1: - return IndexModel(resp) + from typing import cast + + return IndexModel(cast(Any, resp)) return await self.__poll_describe_index_until_ready(name, timeout) @require_kwargs @@ -145,7 +149,9 @@ async def create_from_backup( ) return await self.__poll_describe_index_until_ready(name, timeout) - async def __poll_describe_index_until_ready(self, name: str, timeout: Optional[int] = None): + async def __poll_describe_index_until_ready( + self, name: str, timeout: Optional[int] = None + ) -> IndexModel: total_wait_time = 0 while True: description = await self.describe(name=name) @@ -170,7 +176,7 @@ async def __poll_describe_index_until_ready(self, name: str, timeout: Optional[i await asyncio.sleep(5) @require_kwargs - async def delete(self, *, name: str, timeout: Optional[int] = None): + async def delete(self, *, name: str, timeout: Optional[int] = None) -> None: await self._index_api.delete_index(name) if timeout == -1: @@ -228,7 +234,7 @@ async def configure( "ReadCapacityDedicatedSpec", ] ] = None, - ): + ) -> None: description = await self.describe(name=name) req = PineconeDBControlRequestFactory.configure_index_request( diff --git a/pinecone/db_control/resources/sync/backup.py b/pinecone/db_control/resources/sync/backup.py index b5d565fc2..051c183cc 100644 --- a/pinecone/db_control/resources/sync/backup.py +++ b/pinecone/db_control/resources/sync/backup.py @@ -108,4 +108,5 @@ def delete(self, *, backup_id: str) -> None: :param backup_id: The ID of the backup to delete. :type backup_id: str """ - return self._index_api.delete_backup(backup_id=backup_id) + self._index_api.delete_backup(backup_id=backup_id) + return None diff --git a/pinecone/db_control/resources/sync/index.py b/pinecone/db_control/resources/sync/index.py index 6a3096ae3..afe11ee45 100644 --- a/pinecone/db_control/resources/sync/index.py +++ b/pinecone/db_control/resources/sync/index.py @@ -93,7 +93,9 @@ def create( resp = self._index_api.create_index(create_index_request=req) if timeout == -1: - return IndexModel(resp) + from typing import cast + + return IndexModel(cast(Any, resp)) return self.__poll_describe_index_until_ready(name, timeout) @require_kwargs @@ -140,7 +142,9 @@ def create_for_model( resp = self._index_api.create_index_for_model(req) if timeout == -1: - return IndexModel(resp) + from typing import cast + + return IndexModel(cast(Any, resp)) return self.__poll_describe_index_until_ready(name, timeout) @require_kwargs @@ -178,7 +182,9 @@ def create_from_backup( return self.describe(name=name) return self.__poll_describe_index_until_ready(name, timeout) - def __poll_describe_index_until_ready(self, name: str, timeout: Optional[int] = None): + def __poll_describe_index_until_ready( + self, name: str, timeout: Optional[int] = None + ) -> IndexModel: total_wait_time = 0 while True: description = self.describe(name=name) diff --git a/pinecone/db_data/dataclasses/search_query.py b/pinecone/db_data/dataclasses/search_query.py index 6ce904f47..16e5dbdb2 100644 --- a/pinecone/db_data/dataclasses/search_query.py +++ b/pinecone/db_data/dataclasses/search_query.py @@ -57,7 +57,7 @@ def __post_init__(self): Converts `vector` to a `SearchQueryVectorTypedDict` instance if an enum is provided. """ if isinstance(self.vector, SearchQueryVector): - self.vector = self.vector.as_dict() + self.vector = self.vector.as_dict() # type: ignore[assignment] def as_dict(self) -> Dict[str, Any]: """ diff --git a/pinecone/db_data/dataclasses/utils.py b/pinecone/db_data/dataclasses/utils.py index 62c8ba978..890b31910 100644 --- a/pinecone/db_data/dataclasses/utils.py +++ b/pinecone/db_data/dataclasses/utils.py @@ -1,16 +1,23 @@ +from typing import Any + + class DictLike: - def __getitem__(self, key): - if key in self.__dataclass_fields__: + def __getitem__(self, key: str) -> Any: + if hasattr(self, "__dataclass_fields__") and key in getattr( + self, "__dataclass_fields__", {} + ): return getattr(self, key) raise KeyError(f"{key} is not a valid field") - def __setitem__(self, key, value): - if key in self.__dataclass_fields__: + def __setitem__(self, key: str, value: Any) -> None: + if hasattr(self, "__dataclass_fields__") and key in getattr( + self, "__dataclass_fields__", {} + ): setattr(self, key, value) else: raise KeyError(f"{key} is not a valid field") - def get(self, key, default=None): + def get(self, key: str, default: Any = None) -> Any: """Dict-like get method for compatibility with tests that use .get()""" try: return self[key] diff --git a/pinecone/db_data/filter_builder.py b/pinecone/db_data/filter_builder.py index a26e03f80..b31d190af 100644 --- a/pinecone/db_data/filter_builder.py +++ b/pinecone/db_data/filter_builder.py @@ -387,4 +387,4 @@ def build(self) -> FilterTypedDict: raise ValueError("FilterBuilder must have at least one condition") # Type cast to FilterTypedDict - the actual structure may support # nested $and/$or even though the type system doesn't fully capture it - return self._filter # type: ignore[return-value] + return self._filter diff --git a/pinecone/db_data/index.py b/pinecone/db_data/index.py index f98c6f173..113e15cce 100644 --- a/pinecone/db_data/index.py +++ b/pinecone/db_data/index.py @@ -1,8 +1,10 @@ +from __future__ import annotations + from pinecone.utils.tqdm import tqdm import warnings import logging import json -from typing import Union, List, Optional, Dict, Any, Literal, Iterator, TYPE_CHECKING +from typing import List, Dict, Any, Literal, Iterator, TYPE_CHECKING from pinecone.config import ConfigBuilder @@ -74,7 +76,7 @@ """ :meta private: """ -def parse_query_response(response: OpenAPIQueryResponse): +def parse_query_response(response: OpenAPIQueryResponse) -> QueryResponse: """:meta private:""" # Convert OpenAPI QueryResponse to dataclass QueryResponse from pinecone.utils.response_info import extract_response_info @@ -104,18 +106,18 @@ class Index(PluginAware, IndexInterface): For improved performance, use the Pinecone GRPC index client. """ - _bulk_import_resource: Optional["BulkImportResource"] + _bulk_import_resource: "BulkImportResource" | None """ :meta private: """ - _namespace_resource: Optional["NamespaceResource"] + _namespace_resource: "NamespaceResource" | None """ :meta private: """ def __init__( self, api_key: str, host: str, - pool_threads: Optional[int] = None, - additional_headers: Optional[Dict[str, str]] = {}, + pool_threads: int | None = None, + additional_headers: Dict[str, str] | None = {}, openapi_config=None, **kwargs, ): @@ -133,8 +135,9 @@ def __init__( self._pool_threads = pool_threads """ :meta private: """ - if kwargs.get("connection_pool_maxsize", None): - self._openapi_config.connection_pool_maxsize = kwargs.get("connection_pool_maxsize") + connection_pool_maxsize = kwargs.get("connection_pool_maxsize", None) + if connection_pool_maxsize is not None: + self._openapi_config.connection_pool_maxsize = connection_pool_maxsize self._vector_api = setup_openapi_client( api_client_klass=ApiClient, @@ -219,14 +222,14 @@ def close(self): @validate_and_convert_errors def upsert( self, - vectors: Union[ - List[Vector], List[VectorTuple], List[VectorTupleWithMetadata], List[VectorTypedDict] - ], - namespace: Optional[str] = None, - batch_size: Optional[int] = None, + vectors: ( + List[Vector] | List[VectorTuple] | List[VectorTupleWithMetadata] | List[VectorTypedDict] + ), + namespace: str | None = None, + batch_size: int | None = None, show_progress: bool = True, **kwargs, - ) -> Union[UpsertResponse, ApplyResult]: + ) -> UpsertResponse | ApplyResult: _check_type = kwargs.pop("_check_type", True) if kwargs.get("async_req", False) and batch_size is not None: @@ -267,7 +270,8 @@ def __getattr__(self, name): # result is ApplyResult when async_req=True return UpsertResponseTransformer(result) # type: ignore[arg-type, return-value] # result is UpsertResponse when async_req=False - return result # type: ignore[return-value] + # _upsert_batch already returns UpsertResponse when async_req=False + return result if not isinstance(batch_size, int) or batch_size <= 0: raise ValueError("batch_size must be a positive integer") @@ -301,13 +305,13 @@ def __getattr__(self, name): def _upsert_batch( self, - vectors: Union[ - List[Vector], List[VectorTuple], List[VectorTupleWithMetadata], List[VectorTypedDict] - ], - namespace: Optional[str], + vectors: ( + List[Vector] | List[VectorTuple] | List[VectorTupleWithMetadata] | List[VectorTypedDict] + ), + namespace: str | None, _check_type: bool, **kwargs, - ) -> Union[UpsertResponse, ApplyResult]: + ) -> UpsertResponse | ApplyResult: # Convert OpenAPI UpsertResponse to dataclass UpsertResponse result = self._vector_api.upsert_vectors( IndexRequestFactory.upsert_request(vectors, namespace, _check_type, **kwargs), @@ -319,7 +323,7 @@ def _upsert_batch( if kwargs.get("async_req", False): # Return ApplyResult - it will be unwrapped by the caller # The ApplyResult contains OpenAPIUpsertResponse which will be converted when .get() is called - return result # type: ignore[return-value] # ApplyResult is not tracked through OpenAPI layers + return result # type: ignore[no-any-return] # ApplyResult is not tracked through OpenAPI layers from pinecone.utils.response_info import extract_response_info @@ -339,7 +343,7 @@ def _iter_dataframe(df, batch_size): @validate_and_convert_errors def upsert_from_dataframe( - self, df, namespace: Optional[str] = None, batch_size: int = 500, show_progress: bool = True + self, df, namespace: str | None = None, batch_size: int = 500, show_progress: bool = True ) -> UpsertResponse: try: import pandas as pd @@ -361,6 +365,10 @@ def upsert_from_dataframe( upserted_count = 0 last_result = None for res in results: + # upsert_from_dataframe doesn't use async_req, so res is always UpsertResponse + assert isinstance( + res, UpsertResponse + ), "Expected UpsertResponse when not using async_req" upserted_count += res.upserted_count last_result = res @@ -403,45 +411,51 @@ def upsert_records(self, namespace: str, records: List[Dict]) -> UpsertResponse: def search( self, namespace: str, - query: Union[SearchQueryTypedDict, SearchQuery], - rerank: Optional[Union[SearchRerankTypedDict, SearchRerank]] = None, - fields: Optional[List[str]] = ["*"], # Default to returning all fields + query: SearchQueryTypedDict | SearchQuery, + rerank: SearchRerankTypedDict | SearchRerank | None = None, + fields: List[str] | None = ["*"], # Default to returning all fields ) -> SearchRecordsResponse: if namespace is None: raise Exception("Namespace is required when searching records") request = IndexRequestFactory.search_request(query=query, rerank=rerank, fields=fields) - return self._vector_api.search_records_namespace(namespace, request) + from typing import cast + + result = self._vector_api.search_records_namespace(namespace, request) + return cast(SearchRecordsResponse, result) @validate_and_convert_errors def search_records( self, namespace: str, - query: Union[SearchQueryTypedDict, SearchQuery], - rerank: Optional[Union[SearchRerankTypedDict, SearchRerank]] = None, - fields: Optional[List[str]] = ["*"], # Default to returning all fields + query: SearchQueryTypedDict | SearchQuery, + rerank: SearchRerankTypedDict | SearchRerank | None = None, + fields: List[str] | None = ["*"], # Default to returning all fields ) -> SearchRecordsResponse: return self.search(namespace, query=query, rerank=rerank, fields=fields) @validate_and_convert_errors def delete( self, - ids: Optional[List[str]] = None, - delete_all: Optional[bool] = None, - namespace: Optional[str] = None, - filter: Optional[Dict[str, Union[str, float, int, bool, List, dict]]] = None, + ids: List[str] | None = None, + delete_all: bool | None = None, + namespace: str | None = None, + filter: FilterTypedDict | None = None, **kwargs, ) -> Dict[str, Any]: - return self._vector_api.delete_vectors( + from typing import cast + + result = self._vector_api.delete_vectors( IndexRequestFactory.delete_request( ids=ids, delete_all=delete_all, namespace=namespace, filter=filter, **kwargs ), **self._openapi_kwargs(kwargs), ) + return cast(Dict[str, Any], result) @validate_and_convert_errors - def fetch(self, ids: List[str], namespace: Optional[str] = None, **kwargs) -> FetchResponse: + def fetch(self, ids: List[str], namespace: str | None = None, **kwargs) -> FetchResponse: args_dict = parse_non_empty_args([("namespace", namespace)]) result = self._vector_api.fetch_vectors(ids=ids, **args_dict, **kwargs) # Copy response info from OpenAPI response if present @@ -465,9 +479,9 @@ def fetch(self, ids: List[str], namespace: Optional[str] = None, **kwargs) -> Fe def fetch_by_metadata( self, filter: FilterTypedDict, - namespace: Optional[str] = None, - limit: Optional[int] = None, - pagination_token: Optional[str] = None, + namespace: str | None = None, + limit: int | None = None, + pagination_token: str | None = None, **kwargs, ) -> FetchByMetadataResponse: """Fetch vectors by metadata filter. @@ -490,7 +504,7 @@ def fetch_by_metadata( ... ) Args: - filter (Dict[str, Union[str, float, int, bool, List, dict]]): + filter (Dict[str, str | float | int | bool | List | dict]): Metadata filter expression to select vectors. See `metadata filtering _` namespace (str): The namespace to fetch vectors from. @@ -537,15 +551,15 @@ def query( self, *args, top_k: int, - vector: Optional[List[float]] = None, - id: Optional[str] = None, - namespace: Optional[str] = None, - filter: Optional[FilterTypedDict] = None, - include_values: Optional[bool] = None, - include_metadata: Optional[bool] = None, - sparse_vector: Optional[Union[SparseValues, SparseVectorTypedDict]] = None, + vector: List[float] | None = None, + id: str | None = None, + namespace: str | None = None, + filter: FilterTypedDict | None = None, + include_values: bool | None = None, + include_metadata: bool | None = None, + sparse_vector: SparseValues | SparseVectorTypedDict | None = None, **kwargs, - ) -> Union[QueryResponse, ApplyResult]: + ) -> QueryResponse | ApplyResult: response = self._query( *args, top_k=top_k, @@ -570,13 +584,13 @@ def _query( self, *args, top_k: int, - vector: Optional[List[float]] = None, - id: Optional[str] = None, - namespace: Optional[str] = None, - filter: Optional[FilterTypedDict] = None, - include_values: Optional[bool] = None, - include_metadata: Optional[bool] = None, - sparse_vector: Optional[Union[SparseValues, SparseVectorTypedDict]] = None, + vector: List[float] | None = None, + id: str | None = None, + namespace: str | None = None, + filter: FilterTypedDict | None = None, + include_values: bool | None = None, + include_metadata: bool | None = None, + sparse_vector: SparseValues | SparseVectorTypedDict | None = None, **kwargs, ) -> OpenAPIQueryResponse: if len(args) > 0: @@ -598,21 +612,23 @@ def _query( sparse_vector=sparse_vector, **kwargs, ) - return self._vector_api.query_vectors(request, **self._openapi_kwargs(kwargs)) + from typing import cast + + result = self._vector_api.query_vectors(request, **self._openapi_kwargs(kwargs)) + # When async_req=False, result is QueryResponse, not ApplyResult + return cast(OpenAPIQueryResponse, result) @validate_and_convert_errors def query_namespaces( self, - vector: Optional[List[float]], + vector: List[float] | None, namespaces: List[str], metric: Literal["cosine", "euclidean", "dotproduct"], - top_k: Optional[int] = None, - filter: Optional[Dict[str, Union[str, float, int, bool, List, dict]]] = None, - include_values: Optional[bool] = None, - include_metadata: Optional[bool] = None, - sparse_vector: Optional[ - Union[SparseValues, Dict[str, Union[List[float], List[int]]]] - ] = None, + top_k: int | None = None, + filter: FilterTypedDict | None = None, + include_values: bool | None = None, + include_metadata: bool | None = None, + sparse_vector: SparseValues | SparseVectorTypedDict | None = None, **kwargs, ) -> QueryNamespacesResults: if namespaces is None or len(namespaces) == 0: @@ -641,7 +657,12 @@ def query_namespaces( for ns in target_namespaces ] - for result in as_completed(async_futures): + from typing import cast + from concurrent.futures import Future + + # async_futures is a list of ApplyResult, but as_completed expects Future + futures: List[Future[Any]] = cast(List[Future[Any]], async_futures) + for result in as_completed(futures): raw_result = result.result() response = json.loads(raw_result.data.decode("utf-8")) aggregator.add_results(response) @@ -652,13 +673,13 @@ def query_namespaces( @validate_and_convert_errors def update( self, - id: Optional[str] = None, - values: Optional[List[float]] = None, - set_metadata: Optional[VectorMetadataTypedDict] = None, - namespace: Optional[str] = None, - sparse_values: Optional[Union[SparseValues, SparseVectorTypedDict]] = None, - filter: Optional[FilterTypedDict] = None, - dry_run: Optional[bool] = None, + id: str | None = None, + values: List[float] | None = None, + set_metadata: VectorMetadataTypedDict | None = None, + namespace: str | None = None, + sparse_values: SparseValues | SparseVectorTypedDict | None = None, + filter: FilterTypedDict | None = None, + dry_run: bool | None = None, **kwargs, ) -> UpdateResponse: # Validate that exactly one of id or filter is provided @@ -706,20 +727,24 @@ def update( @validate_and_convert_errors def describe_index_stats( - self, filter: Optional[FilterTypedDict] = None, **kwargs + self, filter: FilterTypedDict | None = None, **kwargs ) -> DescribeIndexStatsResponse: - return self._vector_api.describe_index_stats( + from typing import cast + + result = self._vector_api.describe_index_stats( IndexRequestFactory.describe_index_stats_request(filter, **kwargs), **self._openapi_kwargs(kwargs), ) + # When async_req=False, result is IndexDescription, not ApplyResult + return cast(DescribeIndexStatsResponse, result) @validate_and_convert_errors def list_paginated( self, - prefix: Optional[str] = None, - limit: Optional[int] = None, - pagination_token: Optional[str] = None, - namespace: Optional[str] = None, + prefix: str | None = None, + limit: int | None = None, + pagination_token: str | None = None, + namespace: str | None = None, **kwargs, ) -> ListResponse: args_dict = IndexRequestFactory.list_paginated_args( @@ -729,7 +754,11 @@ def list_paginated( namespace=namespace, **kwargs, ) - return self._vector_api.list_vectors(**args_dict, **kwargs) + from typing import cast + + result = self._vector_api.list_vectors(**args_dict, **kwargs) + # When async_req=False, result is ListResponse, not ApplyResult + return cast(ListResponse, result) @validate_and_convert_errors def list(self, **kwargs): @@ -748,15 +777,13 @@ def list(self, **kwargs): def start_import( self, uri: str, - integration_id: Optional[str] = None, - error_mode: Optional[ - Union["ImportErrorMode", Literal["CONTINUE", "ABORT"], str] - ] = "CONTINUE", + integration_id: str | None = None, + error_mode: ("ImportErrorMode" | Literal["CONTINUE", "ABORT"] | str) | None = "CONTINUE", ) -> "StartImportResponse": """ Args: uri (str): The URI of the data to import. The URI must start with the scheme of a supported storage provider. - integration_id (Optional[str], optional): If your bucket requires authentication to access, you need to pass the id of your storage integration using this property. Defaults to None. + integration_id (str | None, optional): If your bucket requires authentication to access, you need to pass the id of your storage integration using this property. Defaults to None. error_mode: Defaults to "CONTINUE". If set to "CONTINUE", the import operation will continue even if some records fail to import. Pass "ABORT" to stop the import operation if any records fail to import. @@ -779,8 +806,8 @@ def start_import( def list_imports(self, **kwargs) -> Iterator["ImportModel"]: """ Args: - limit (Optional[int]): The maximum number of operations to fetch in each network call. If unspecified, the server will use a default value. [optional] - pagination_token (Optional[str]): When there are multiple pages of results, a pagination token is returned in the response. The token can be used + limit (int | None): The maximum number of operations to fetch in each network call. If unspecified, the server will use a default value. [optional] + pagination_token (str | None): When there are multiple pages of results, a pagination token is returned in the response. The token can be used to fetch the next page of results. [optional] Returns: @@ -807,12 +834,12 @@ def list_imports(self, **kwargs) -> Iterator["ImportModel"]: @validate_and_convert_errors def list_imports_paginated( - self, limit: Optional[int] = None, pagination_token: Optional[str] = None, **kwargs + self, limit: int | None = None, pagination_token: str | None = None, **kwargs ) -> "ListImportsResponse": """ Args: - limit (Optional[int]): The maximum number of ids to return. If unspecified, the server will use a default value. [optional] - pagination_token (Optional[str]): A token needed to fetch the next page of results. This token is returned + limit (int | None): The maximum number of ids to return. If unspecified, the server will use a default value. [optional] + pagination_token (str | None): A token needed to fetch the next page of results. This token is returned in the response if additional results are available. [optional] Returns: ListImportsResponse object which contains the list of operations as ImportModel objects, pagination information, @@ -872,7 +899,7 @@ def cancel_import(self, id: str): @validate_and_convert_errors @require_kwargs def create_namespace( - self, name: str, schema: Optional[Dict[str, Any]] = None, **kwargs + self, name: str, schema: Dict[str, Any] | None = None, **kwargs ) -> "NamespaceDescription": return self.namespace.create(name=name, schema=schema, **kwargs) @@ -884,19 +911,22 @@ def describe_namespace(self, namespace: str, **kwargs) -> "NamespaceDescription" @validate_and_convert_errors @require_kwargs def delete_namespace(self, namespace: str, **kwargs) -> Dict[str, Any]: - return self.namespace.delete(namespace=namespace, **kwargs) + from typing import cast + + result = self.namespace.delete(namespace=namespace, **kwargs) + return cast(Dict[str, Any], result) @validate_and_convert_errors @require_kwargs def list_namespaces( - self, limit: Optional[int] = None, **kwargs + self, limit: int | None = None, **kwargs ) -> Iterator[ListNamespacesResponse]: return self.namespace.list(limit=limit, **kwargs) @validate_and_convert_errors @require_kwargs def list_namespaces_paginated( - self, limit: Optional[int] = None, pagination_token: Optional[str] = None, **kwargs + self, limit: int | None = None, pagination_token: str | None = None, **kwargs ) -> ListNamespacesResponse: 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 f4046fc2d..ebf20a013 100644 --- a/pinecone/db_data/index_asyncio.py +++ b/pinecone/db_data/index_asyncio.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from pinecone.utils.tqdm import tqdm @@ -7,7 +9,8 @@ from .index_asyncio_interface import IndexAsyncioInterface from .query_results_aggregator import QueryResultsAggregator -from typing import Union, List, Optional, Dict, Any, Literal, AsyncIterator, TYPE_CHECKING +from typing import List, Optional, Dict, Any, Literal, AsyncIterator, TYPE_CHECKING +from typing_extensions import Self from pinecone.config import ConfigBuilder @@ -87,7 +90,7 @@ """ :meta private: """ -def parse_query_response(response: OpenAPIQueryResponse): +def parse_query_response(response: OpenAPIQueryResponse) -> QueryResponse: """:meta private:""" # Convert OpenAPI QueryResponse to dataclass QueryResponse from pinecone.utils.response_info import extract_response_info @@ -178,7 +181,7 @@ def __init__( additional_headers: Optional[Dict[str, str]] = {}, openapi_config=None, **kwargs, - ): + ) -> None: self.config = ConfigBuilder.build( api_key=api_key, host=host, additional_headers=additional_headers, **kwargs ) @@ -186,8 +189,9 @@ def __init__( self._openapi_config = ConfigBuilder.build_openapi_config(self.config, openapi_config) """ :meta private: """ - if kwargs.get("connection_pool_maxsize", None): - self._openapi_config.connection_pool_maxsize = kwargs.get("connection_pool_maxsize") + connection_pool_maxsize = kwargs.get("connection_pool_maxsize", None) + if connection_pool_maxsize is not None: + self._openapi_config.connection_pool_maxsize = connection_pool_maxsize self._vector_api = setup_async_openapi_client( api_client_klass=AsyncioApiClient, @@ -207,13 +211,16 @@ def __init__( self._namespace_resource = None """ :meta private: """ - async def __aenter__(self): + async def __aenter__(self) -> Self: return self - async def __aexit__(self, exc_type, exc_value, traceback): + async def __aexit__( + self, exc_type: Optional[type], exc_value: Optional[Exception], traceback: Optional[Any] + ) -> Optional[bool]: await self._api_client.close() + return None - async def close(self): + async def close(self) -> None: """Cleanup resources used by the Pinecone Index client. This method should be called when the client is no longer needed so that @@ -287,9 +294,9 @@ def namespace(self) -> "NamespaceResourceAsyncio": @validate_and_convert_errors async def upsert( self, - vectors: Union[ - List[Vector], List[VectorTuple], List[VectorTupleWithMetadata], List[VectorTypedDict] - ], + vectors: ( + List[Vector] | List[VectorTuple] | List[VectorTupleWithMetadata] | List[VectorTypedDict] + ), namespace: Optional[str] = None, batch_size: Optional[int] = None, show_progress: bool = True, @@ -332,9 +339,9 @@ async def upsert( @validate_and_convert_errors async def _upsert_batch( self, - vectors: Union[ - List[Vector], List[VectorTuple], List[VectorTupleWithMetadata], List[VectorTypedDict] - ], + vectors: ( + List[Vector] | List[VectorTuple] | List[VectorTupleWithMetadata] | List[VectorTypedDict] + ), namespace: Optional[str], _check_type: bool, **kwargs, @@ -385,7 +392,9 @@ async def delete( [("ids", ids), ("delete_all", delete_all), ("namespace", namespace), ("filter", filter)] ) - return await self._vector_api.delete_vectors( + from typing import cast + + result = await self._vector_api.delete_vectors( DeleteRequest( **args_dict, **{ @@ -397,6 +406,7 @@ async def delete( ), **{k: v for k, v in kwargs.items() if k in _OPENAPI_ENDPOINT_PARAMS}, ) + return cast(Dict[str, Any], result) @validate_and_convert_errors async def fetch( @@ -458,7 +468,7 @@ async def main(): asyncio.run(main()) Args: - filter (Dict[str, Union[str, float, int, bool, List, dict]]): + filter (Dict[str, str | float | int | bool | List | dict]): Metadata filter expression to select vectors. See `metadata filtering _` namespace (str): The namespace to fetch vectors from. @@ -513,7 +523,7 @@ async def query( filter: Optional[FilterTypedDict] = None, include_values: Optional[bool] = None, include_metadata: Optional[bool] = None, - sparse_vector: Optional[Union[SparseValues, SparseVectorTypedDict]] = None, + sparse_vector: Optional[SparseValues | SparseVectorTypedDict] = None, **kwargs, ) -> QueryResponse: response = await self._query( @@ -540,7 +550,7 @@ async def _query( filter: Optional[FilterTypedDict] = None, include_values: Optional[bool] = None, include_metadata: Optional[bool] = None, - sparse_vector: Optional[Union[SparseValues, SparseVectorTypedDict]] = None, + sparse_vector: Optional[SparseValues | SparseVectorTypedDict] = None, **kwargs, ) -> OpenAPIQueryResponse: if len(args) > 0: @@ -559,9 +569,12 @@ async def _query( sparse_vector=sparse_vector, **kwargs, ) - return await self._vector_api.query_vectors( + from typing import cast + + result = await self._vector_api.query_vectors( request, **{k: v for k, v in kwargs.items() if k in _OPENAPI_ENDPOINT_PARAMS} ) + return cast(OpenAPIQueryResponse, result) @validate_and_convert_errors async def query_namespaces( @@ -569,13 +582,11 @@ async def query_namespaces( namespaces: List[str], metric: Literal["cosine", "euclidean", "dotproduct"], top_k: Optional[int] = None, - filter: Optional[Dict[str, Union[str, float, int, bool, List, dict]]] = None, + filter: Optional[FilterTypedDict] = None, include_values: Optional[bool] = None, include_metadata: Optional[bool] = None, vector: Optional[List[float]] = None, - sparse_vector: Optional[ - Union[SparseValues, Dict[str, Union[List[float], List[int]]]] - ] = None, + sparse_vector: Optional[SparseValues | SparseVectorTypedDict] = None, **kwargs, ) -> QueryNamespacesResults: if namespaces is None or len(namespaces) == 0: @@ -593,10 +604,10 @@ async def query_namespaces( top_k=overall_topk, vector=vector, namespace=ns, - filter=filter, # type: ignore[arg-type] + filter=filter, include_values=include_values, include_metadata=include_metadata, - sparse_vector=sparse_vector, # type: ignore[arg-type] + sparse_vector=sparse_vector, async_threadpool_executor=True, _preload_content=False, **kwargs, @@ -627,7 +638,7 @@ async def update( values: Optional[List[float]] = None, set_metadata: Optional[VectorMetadataTypedDict] = None, namespace: Optional[str] = None, - sparse_values: Optional[Union[SparseValues, SparseVectorTypedDict]] = None, + sparse_values: Optional[SparseValues | SparseVectorTypedDict] = None, filter: Optional[FilterTypedDict] = None, dry_run: Optional[bool] = None, **kwargs, @@ -679,10 +690,13 @@ async def update( async def describe_index_stats( self, filter: Optional[FilterTypedDict] = None, **kwargs ) -> DescribeIndexStatsResponse: - return await self._vector_api.describe_index_stats( + from typing import cast + + result = await self._vector_api.describe_index_stats( IndexRequestFactory.describe_index_stats_request(filter, **kwargs), **self._openapi_kwargs(kwargs), ) + return cast(DescribeIndexStatsResponse, result) @validate_and_convert_errors async def list_paginated( @@ -700,10 +714,13 @@ async def list_paginated( namespace=namespace, **kwargs, ) - return await self._vector_api.list_vectors(**args_dict, **kwargs) + from typing import cast + + result = await self._vector_api.list_vectors(**args_dict, **kwargs) + return cast(ListResponse, result) @validate_and_convert_errors - async def list(self, **kwargs): + async def list(self, **kwargs) -> AsyncIterator[List[str]]: done = False while not done: results = await self.list_paginated(**kwargs) @@ -744,8 +761,8 @@ async def upsert_records(self, namespace: str, records: List[Dict]) -> UpsertRes async def search( self, namespace: str, - query: Union[SearchQueryTypedDict, SearchQuery], - rerank: Optional[Union[SearchRerankTypedDict, SearchRerank]] = None, + query: SearchQueryTypedDict | SearchQuery, + rerank: Optional[SearchRerankTypedDict | SearchRerank] = None, fields: Optional[List[str]] = ["*"], # Default to returning all fields ) -> SearchRecordsResponse: if namespace is None: @@ -753,13 +770,16 @@ async def search( request = IndexRequestFactory.search_request(query=query, rerank=rerank, fields=fields) - return await self._vector_api.search_records_namespace(namespace, request) + from typing import cast + + result = await self._vector_api.search_records_namespace(namespace, request) + return cast(SearchRecordsResponse, result) async def search_records( self, namespace: str, - query: Union[SearchQueryTypedDict, SearchQuery], - rerank: Optional[Union[SearchRerankTypedDict, SearchRerank]] = None, + query: SearchQueryTypedDict | SearchQuery, + rerank: Optional[SearchRerankTypedDict | SearchRerank] = None, fields: Optional[List[str]] = ["*"], # Default to returning all fields ) -> SearchRecordsResponse: return await self.search(namespace, query=query, rerank=rerank, fields=fields) @@ -891,11 +911,14 @@ async def describe_namespace(self, namespace: str, **kwargs) -> "NamespaceDescri @validate_and_convert_errors @require_kwargs async def delete_namespace(self, namespace: str, **kwargs) -> Dict[str, Any]: - return await self.namespace.delete(namespace=namespace, **kwargs) + from typing import cast + + result = await self.namespace.delete(namespace=namespace, **kwargs) + return cast(Dict[str, Any], result) @validate_and_convert_errors @require_kwargs - async def list_namespaces( + async def list_namespaces( # type: ignore[override] self, limit: Optional[int] = None, **kwargs ) -> AsyncIterator[ListNamespacesResponse]: async for namespace in self.namespace.list(limit=limit, **kwargs): diff --git a/pinecone/db_data/index_asyncio_interface.py b/pinecone/db_data/index_asyncio_interface.py index 8996f6a81..a245804f0 100644 --- a/pinecone/db_data/index_asyncio_interface.py +++ b/pinecone/db_data/index_asyncio_interface.py @@ -1,11 +1,11 @@ +from __future__ import annotations + from abc import ABC, abstractmethod -from typing import Union, List, Optional, Dict, Any, AsyncIterator +from typing import List, Optional, Dict, Any, AsyncIterator, Literal from pinecone.core.openapi.db_data.models import ( IndexDescription as DescribeIndexStatsResponse, - Vector, ListResponse, - SparseValues, SearchRecordsResponse, NamespaceDescription, ListNamespacesResponse, @@ -22,6 +22,8 @@ SearchRerankTypedDict, ) from .dataclasses import ( + Vector, + SparseValues, SearchQuery, SearchRerank, FetchResponse, @@ -37,9 +39,9 @@ class IndexAsyncioInterface(ABC): @abstractmethod async def upsert( self, - vectors: Union[ - List[Vector], List[VectorTuple], List[VectorTupleWithMetadata], List[VectorTypedDict] - ], + vectors: ( + List[Vector] | List[VectorTuple] | List[VectorTupleWithMetadata] | List[VectorTypedDict] + ), namespace: Optional[str] = None, batch_size: Optional[int] = None, show_progress: bool = True, @@ -193,7 +195,7 @@ async def delete( namespace: Optional[str] = None, filter: Optional[FilterTypedDict] = None, **kwargs, - ) -> UpdateResponse: + ) -> Dict[str, Any]: """ Args: ids (List[str]): Vector ids to delete [optional] @@ -352,7 +354,7 @@ async def query( filter: Optional[FilterTypedDict] = None, include_values: Optional[bool] = None, include_metadata: Optional[bool] = None, - sparse_vector: Optional[Union[SparseValues, SparseVectorTypedDict]] = None, + sparse_vector: Optional[SparseValues | SparseVectorTypedDict] = None, **kwargs, ) -> QueryResponse: """ @@ -467,12 +469,13 @@ async def main(): async def query_namespaces( self, namespaces: List[str], + metric: Literal["cosine", "euclidean", "dotproduct"], top_k: Optional[int] = None, filter: Optional[FilterTypedDict] = None, include_values: Optional[bool] = None, include_metadata: Optional[bool] = None, vector: Optional[List[float]] = None, - sparse_vector: Optional[Union[SparseValues, SparseVectorTypedDict]] = None, + sparse_vector: Optional[SparseValues | SparseVectorTypedDict] = None, **kwargs, ) -> QueryNamespacesResults: """The query_namespaces() method is used to make a query to multiple namespaces in parallel and combine the results into one result set. @@ -529,7 +532,7 @@ async def update( values: Optional[List[float]] = None, set_metadata: Optional[VectorMetadataTypedDict] = None, namespace: Optional[str] = None, - sparse_values: Optional[Union[SparseValues, SparseVectorTypedDict]] = None, + sparse_values: Optional[SparseValues | SparseVectorTypedDict] = None, filter: Optional[FilterTypedDict] = None, dry_run: Optional[bool] = None, **kwargs, @@ -821,8 +824,8 @@ async def main(): async def search( self, namespace: str, - query: Union[SearchQueryTypedDict, SearchQuery], - rerank: Optional[Union[SearchRerankTypedDict, SearchRerank]] = None, + query: SearchQueryTypedDict | SearchQuery, + rerank: Optional[SearchRerankTypedDict | SearchRerank] = None, fields: Optional[List[str]] = ["*"], # Default to returning all fields ) -> SearchRecordsResponse: """ @@ -917,8 +920,8 @@ async def main(): async def search_records( self, namespace: str, - query: Union[SearchQueryTypedDict, SearchQuery], - rerank: Optional[Union[SearchRerankTypedDict, SearchRerank]] = None, + query: SearchQueryTypedDict | SearchQuery, + rerank: Optional[SearchRerankTypedDict | SearchRerank] = None, fields: Optional[List[str]] = ["*"], # Default to returning all fields ) -> SearchRecordsResponse: """Alias of the search() method.""" diff --git a/pinecone/db_data/interfaces.py b/pinecone/db_data/interfaces.py index 0974694b2..3ac888d46 100644 --- a/pinecone/db_data/interfaces.py +++ b/pinecone/db_data/interfaces.py @@ -1,11 +1,11 @@ +from __future__ import annotations + from abc import ABC, abstractmethod -from typing import Union, List, Optional, Dict, Any, Iterator +from typing import List, Optional, Dict, Any, Iterator, Literal from pinecone.core.openapi.db_data.models import ( IndexDescription as DescribeIndexStatsResponse, - Vector, ListResponse, - SparseValues, SearchRecordsResponse, NamespaceDescription, ListNamespacesResponse, @@ -30,6 +30,8 @@ QueryResponse, UpsertResponse, UpdateResponse, + SparseValues, + Vector, ) from pinecone.utils import require_kwargs @@ -38,14 +40,14 @@ class IndexInterface(ABC): @abstractmethod def upsert( self, - vectors: Union[ - List[Vector], List[VectorTuple], List[VectorTupleWithMetadata], List[VectorTypedDict] - ], + vectors: ( + List[Vector] | List[VectorTuple] | List[VectorTupleWithMetadata] | List[VectorTypedDict] + ), namespace: Optional[str] = None, batch_size: Optional[int] = None, show_progress: bool = True, **kwargs, - ) -> UpsertResponse: + ) -> UpsertResponse | ApplyResult: """ Args: vectors (Union[List[Vector], List[VectorTuple], List[VectorTupleWithMetadata], List[VectorTypedDict]]): A list of vectors to upsert. @@ -350,8 +352,8 @@ def upsert_records(self, namespace: str, records: List[Dict]) -> UpsertResponse: def search( self, namespace: str, - query: Union[SearchQueryTypedDict, SearchQuery], - rerank: Optional[Union[SearchRerankTypedDict, SearchRerank]] = None, + query: SearchQueryTypedDict | SearchQuery, + rerank: Optional[SearchRerankTypedDict | SearchRerank] = None, fields: Optional[List[str]] = ["*"], # Default to returning all fields ) -> SearchRecordsResponse: """ @@ -456,8 +458,8 @@ def search( def search_records( self, namespace: str, - query: Union[SearchQueryTypedDict, SearchQuery], - rerank: Optional[Union[SearchRerankTypedDict, SearchRerank]] = None, + query: SearchQueryTypedDict | SearchQuery, + rerank: Optional[SearchRerankTypedDict | SearchRerank] = None, fields: Optional[List[str]] = ["*"], # Default to returning all fields ) -> SearchRecordsResponse: """Alias of the search() method.""" @@ -471,7 +473,7 @@ def delete( namespace: Optional[str] = None, filter: Optional[FilterTypedDict] = None, **kwargs, - ) -> UpdateResponse: + ) -> Dict[str, Any]: """ Args: ids (List[str]): Vector ids to delete [optional] @@ -589,9 +591,9 @@ def query( filter: Optional[FilterTypedDict] = None, include_values: Optional[bool] = None, include_metadata: Optional[bool] = None, - sparse_vector: Optional[Union[SparseValues, SparseVectorTypedDict]] = None, + sparse_vector: Optional[SparseValues | SparseVectorTypedDict] = None, **kwargs, - ) -> Union[QueryResponse, ApplyResult]: + ) -> QueryResponse | ApplyResult: """ The Query operation searches a namespace, using a query vector. It retrieves the ids of the most similar items in a namespace, along with their similarity scores. @@ -638,13 +640,14 @@ def query( @abstractmethod def query_namespaces( self, - vector: List[float], + vector: Optional[List[float]], namespaces: List[str], + metric: Literal["cosine", "euclidean", "dotproduct"], top_k: Optional[int] = None, filter: Optional[FilterTypedDict] = None, include_values: Optional[bool] = None, include_metadata: Optional[bool] = None, - sparse_vector: Optional[Union[SparseValues, SparseVectorTypedDict]] = None, + sparse_vector: Optional[SparseValues | SparseVectorTypedDict] = None, **kwargs, ) -> QueryNamespacesResults: """The ``query_namespaces()`` method is used to make a query to multiple namespaces in parallel and combine the results into one result set. @@ -714,7 +717,7 @@ def update( values: Optional[List[float]] = None, set_metadata: Optional[VectorMetadataTypedDict] = None, namespace: Optional[str] = None, - sparse_values: Optional[Union[SparseValues, SparseVectorTypedDict]] = None, + sparse_values: Optional[SparseValues | SparseVectorTypedDict] = None, filter: Optional[FilterTypedDict] = None, dry_run: Optional[bool] = None, **kwargs, diff --git a/pinecone/db_data/request_factory.py b/pinecone/db_data/request_factory.py index 23125abb5..b8c9ba96d 100644 --- a/pinecone/db_data/request_factory.py +++ b/pinecone/db_data/request_factory.py @@ -1,5 +1,7 @@ +from __future__ import annotations + import logging -from typing import Union, List, Optional, Dict, Any, cast +from typing import List, Dict, Any from pinecone.core.openapi.db_data.models import ( QueryRequest, @@ -15,6 +17,7 @@ VectorValues, SearchRecordsVector, UpsertRecord, + Vector as OpenApiVector, ) from ..utils import parse_non_empty_args, convert_enum_to_string from .vector_factory import VectorFactory @@ -46,13 +49,13 @@ class IndexRequestFactory: @staticmethod def query_request( top_k: int, - vector: Optional[List[float]] = None, - id: Optional[str] = None, - namespace: Optional[str] = None, - filter: Optional[FilterTypedDict] = None, - include_values: Optional[bool] = None, - include_metadata: Optional[bool] = None, - sparse_vector: Optional[Union[SparseValues, SparseVectorTypedDict]] = None, + vector: List[float] | None = None, + id: str | None = None, + namespace: str | None = None, + filter: FilterTypedDict | None = None, + include_values: bool | None = None, + include_metadata: bool | None = None, + sparse_vector: SparseValues | SparseVectorTypedDict | None = None, **kwargs, ) -> QueryRequest: if vector is not None and id is not None: @@ -73,51 +76,58 @@ def query_request( ] ) - return QueryRequest( + result: QueryRequest = QueryRequest( **args_dict, _check_type=kwargs.pop("_check_type", False), **non_openapi_kwargs(kwargs) ) + return result @staticmethod def upsert_request( - vectors: Union[ - List[Vector], List[VectorTuple], List[VectorTupleWithMetadata], List[VectorTypedDict] - ], - namespace: Optional[str], + vectors: ( + List[Vector] | List[VectorTuple] | List[VectorTupleWithMetadata] | List[VectorTypedDict] + ), + namespace: str | None, _check_type: bool, **kwargs, ) -> UpsertRequest: args_dict = parse_non_empty_args([("namespace", namespace)]) - def vec_builder(v): + def vec_builder( + v: Vector | VectorTuple | VectorTupleWithMetadata | VectorTypedDict, + ) -> OpenApiVector: return VectorFactory.build(v, check_type=_check_type) - return UpsertRequest( + result: UpsertRequest = UpsertRequest( vectors=list(map(vec_builder, vectors)), **args_dict, _check_type=_check_type, **non_openapi_kwargs(kwargs), ) + return result @staticmethod def delete_request( - ids: Optional[List[str]] = None, - delete_all: Optional[bool] = None, - namespace: Optional[str] = None, - filter: Optional[Dict[str, Union[str, float, int, bool, List, dict]]] = None, + ids: List[str] | None = None, + delete_all: bool | None = None, + namespace: str | None = None, + filter: FilterTypedDict | None = None, **kwargs, ) -> DeleteRequest: _check_type = kwargs.pop("_check_type", False) args_dict = parse_non_empty_args( [("ids", ids), ("delete_all", delete_all), ("namespace", namespace), ("filter", filter)] ) - return DeleteRequest(**args_dict, **non_openapi_kwargs(kwargs), _check_type=_check_type) + result: DeleteRequest = DeleteRequest( + **args_dict, **non_openapi_kwargs(kwargs), _check_type=_check_type + ) + return result @staticmethod def fetch_by_metadata_request( filter: FilterTypedDict, - namespace: Optional[str] = None, - limit: Optional[int] = None, - pagination_token: Optional[str] = None, + namespace: str | None = None, + limit: int | None = None, + pagination_token: str | None = None, **kwargs, ) -> FetchByMetadataRequest: _check_type = kwargs.pop("_check_type", False) @@ -129,19 +139,20 @@ def fetch_by_metadata_request( ("pagination_token", pagination_token), ] ) - return FetchByMetadataRequest( + result: FetchByMetadataRequest = FetchByMetadataRequest( **args_dict, **non_openapi_kwargs(kwargs), _check_type=_check_type ) + return result @staticmethod def update_request( - id: Optional[str] = None, - values: Optional[List[float]] = None, - set_metadata: Optional[VectorMetadataTypedDict] = None, - namespace: Optional[str] = None, - sparse_values: Optional[Union[SparseValues, SparseVectorTypedDict]] = None, - filter: Optional[FilterTypedDict] = None, - dry_run: Optional[bool] = None, + id: str | None = None, + values: List[float] | None = None, + set_metadata: VectorMetadataTypedDict | None = None, + namespace: str | None = None, + sparse_values: SparseValues | SparseVectorTypedDict | None = None, + filter: FilterTypedDict | None = None, + dry_run: bool | None = None, **kwargs, ) -> UpdateRequest: _check_type = kwargs.pop("_check_type", False) @@ -158,25 +169,29 @@ def update_request( ] ) - return UpdateRequest(**args_dict, _check_type=_check_type, **non_openapi_kwargs(kwargs)) + result: UpdateRequest = UpdateRequest( + **args_dict, _check_type=_check_type, **non_openapi_kwargs(kwargs) + ) + return result @staticmethod def describe_index_stats_request( - filter: Optional[FilterTypedDict] = None, **kwargs + filter: FilterTypedDict | None = None, **kwargs ) -> DescribeIndexStatsRequest: _check_type = kwargs.pop("_check_type", False) args_dict = parse_non_empty_args([("filter", filter)]) - return DescribeIndexStatsRequest( + result: DescribeIndexStatsRequest = DescribeIndexStatsRequest( **args_dict, **non_openapi_kwargs(kwargs), _check_type=_check_type ) + return result @staticmethod def list_paginated_args( - prefix: Optional[str] = None, - limit: Optional[int] = None, - pagination_token: Optional[str] = None, - namespace: Optional[str] = None, + prefix: str | None = None, + limit: int | None = None, + pagination_token: str | None = None, + namespace: str | None = None, **kwargs, ) -> Dict[str, Any]: return parse_non_empty_args( @@ -190,9 +205,9 @@ def list_paginated_args( @staticmethod def search_request( - query: Union[SearchQueryTypedDict, SearchQuery], - rerank: Optional[Union[SearchRerankTypedDict, SearchRerank]] = None, - fields: Optional[List[str]] = ["*"], # Default to returning all fields + query: SearchQueryTypedDict | SearchQuery, + rerank: SearchRerankTypedDict | SearchRerank | None = None, + fields: List[str] | None = ["*"], # Default to returning all fields ) -> SearchRecordsRequest: request_args = parse_non_empty_args( [ @@ -202,16 +217,16 @@ def search_request( ] ) - return SearchRecordsRequest(**request_args) + result: SearchRecordsRequest = SearchRecordsRequest(**request_args) + return result @staticmethod - def _parse_search_query( - query: Union[SearchQueryTypedDict, SearchQuery], - ) -> SearchRecordsRequestQuery: + def _parse_search_query(query: SearchQueryTypedDict | SearchQuery) -> SearchRecordsRequestQuery: if isinstance(query, SearchQuery): query_dict = query.as_dict() else: - query_dict = cast(dict[str, Any], query) + # query is SearchQueryTypedDict which is a TypedDict, so it's already a dict + query_dict = query # type: ignore[assignment] required_fields = {"top_k"} for key in required_fields: @@ -234,12 +249,13 @@ def _parse_search_query( srrq.vector = IndexRequestFactory._parse_search_vector(query_dict["vector"]) if match_terms is not None: srrq.match_terms = match_terms - return srrq + result: SearchRecordsRequestQuery = srrq + return result @staticmethod def _parse_search_vector( - vector: Optional[Union[SearchQueryVectorTypedDict, SearchQueryVector]], - ): + vector: SearchQueryVectorTypedDict | SearchQueryVector | None, + ) -> SearchRecordsVector | None: if vector is None: return None @@ -248,30 +264,36 @@ def _parse_search_vector( return None vector_dict = vector.as_dict() else: - vector_dict = cast(dict[str, Any], vector) + # vector is SearchQueryVectorTypedDict which is a TypedDict, so it's already a dict + vector_dict = vector # type: ignore[assignment] if ( vector_dict.get("values", None) is None and vector_dict.get("sparse_values", None) is None ): return None + from typing import cast + srv = SearchRecordsVector(**{k: v for k, v in vector_dict.items() if k not in {"values"}}) values = vector_dict.get("values", None) if values is not None: srv.values = VectorValues(value=values) - return srv + return cast(SearchRecordsVector, srv) @staticmethod - def _parse_search_rerank(rerank: Optional[Union[SearchRerankTypedDict, SearchRerank]] = None): + def _parse_search_rerank( + rerank: SearchRerankTypedDict | SearchRerank | None = None, + ) -> SearchRecordsRequestRerank | None: if rerank is None: return None if isinstance(rerank, SearchRerank): rerank_dict = rerank.as_dict() else: - rerank_dict = cast(dict[str, Any], rerank) + # rerank is SearchRerankTypedDict which is a TypedDict, so it's already a dict + rerank_dict = rerank # type: ignore[assignment] required_fields = {"model", "rank_fields"} for key in required_fields: @@ -280,10 +302,11 @@ def _parse_search_rerank(rerank: Optional[Union[SearchRerankTypedDict, SearchRer rerank_dict["model"] = convert_enum_to_string(rerank_dict["model"]) - return SearchRecordsRequestRerank(**rerank_dict) + result: SearchRecordsRequestRerank = SearchRecordsRequestRerank(**rerank_dict) + return result @staticmethod - def upsert_records_args(namespace: str, records: List[Dict]): + def upsert_records_args(namespace: str, records: List[Dict[str, Any]]) -> Dict[str, Any]: if namespace is None: raise ValueError("namespace is required when upserting records") if not records or len(records) == 0: diff --git a/pinecone/db_data/resources/asyncio/bulk_import_asyncio.py b/pinecone/db_data/resources/asyncio/bulk_import_asyncio.py index 6d9cf88f6..41c537ab2 100644 --- a/pinecone/db_data/resources/asyncio/bulk_import_asyncio.py +++ b/pinecone/db_data/resources/asyncio/bulk_import_asyncio.py @@ -50,7 +50,10 @@ async def start( req = BulkImportRequestFactory.start_import_request( uri=uri, integration_id=integration_id, error_mode=error_mode ) - return await self.__import_operations_api.start_bulk_import(req) + from typing import cast + + result = await self.__import_operations_api.start_bulk_import(req) + return cast(StartImportResponse, result) async def list(self, **kwargs) -> AsyncIterator["ImportModel"]: """ @@ -117,7 +120,10 @@ async def list_paginated( args_dict = BulkImportRequestFactory.list_imports_paginated_args( limit=limit, pagination_token=pagination_token, **kwargs ) - return await self.__import_operations_api.list_bulk_imports(**args_dict) + from typing import cast + + result = await self.__import_operations_api.list_bulk_imports(**args_dict) + return cast(ListImportsResponse, result) async def describe(self, id: str) -> ImportModel: """ @@ -131,7 +137,10 @@ async def describe(self, id: str) -> ImportModel: `describe_import` is used to get detailed information about a specific import operation. """ args = BulkImportRequestFactory.describe_import_args(id=id) - return await self.__import_operations_api.describe_bulk_import(**args) + from typing import cast + + result = await self.__import_operations_api.describe_bulk_import(**args) + return cast(ImportModel, result) async def cancel(self, id: str): """Cancel an import operation. diff --git a/pinecone/db_data/resources/asyncio/namespace_asyncio.py b/pinecone/db_data/resources/asyncio/namespace_asyncio.py index 13180fd77..0a408faef 100644 --- a/pinecone/db_data/resources/asyncio/namespace_asyncio.py +++ b/pinecone/db_data/resources/asyncio/namespace_asyncio.py @@ -32,8 +32,11 @@ async def create( **Note:** This operation is not supported for pod-based indexes. """ + from typing import cast + args = NamespaceRequestFactory.create_namespace_args(name=name, schema=schema, **kwargs) - return await self.__namespace_operations_api.create_namespace(**args) + result = await self.__namespace_operations_api.create_namespace(**args) + return cast(NamespaceDescription, result) @require_kwargs async def describe(self, namespace: str, **kwargs) -> NamespaceDescription: @@ -46,8 +49,11 @@ async def describe(self, namespace: str, **kwargs) -> NamespaceDescription: Describe a namespace within an index, showing the vector count within the namespace. """ + from typing import cast + args = NamespaceRequestFactory.describe_namespace_args(namespace=namespace, **kwargs) - return await self.__namespace_operations_api.describe_namespace(**args) + result = await self.__namespace_operations_api.describe_namespace(**args) + return cast(NamespaceDescription, result) @require_kwargs async def delete(self, namespace: str, **kwargs): @@ -122,7 +128,10 @@ async def list_paginated( eyJza2lwX3Bhc3QiOiI5OTMiLCJwcmVmaXgiOiI5OSJ9 >>> next_results = await index.list_paginated(limit=5, pagination_token=results.pagination.next) """ + from typing import cast + args = NamespaceRequestFactory.list_namespaces_args( limit=limit, pagination_token=pagination_token, **kwargs ) - return await self.__namespace_operations_api.list_namespaces_operation(**args) + result = await self.__namespace_operations_api.list_namespaces_operation(**args) + return cast(ListNamespacesResponse, result) diff --git a/pinecone/db_data/resources/asyncio/record_asyncio.py b/pinecone/db_data/resources/asyncio/record_asyncio.py index 14cd6b28d..1f23f9a14 100644 --- a/pinecone/db_data/resources/asyncio/record_asyncio.py +++ b/pinecone/db_data/resources/asyncio/record_asyncio.py @@ -144,7 +144,10 @@ async def search( request = IndexRequestFactory.search_request(query=query, rerank=rerank, fields=fields) - return await self._vector_api.search_records_namespace(namespace, request) + from typing import cast + + result = await self._vector_api.search_records_namespace(namespace, request) + return cast(SearchRecordsResponse, result) @validate_and_convert_errors async def search_records( diff --git a/pinecone/db_data/resources/asyncio/vector_asyncio.py b/pinecone/db_data/resources/asyncio/vector_asyncio.py index e4d953314..86a5371db 100644 --- a/pinecone/db_data/resources/asyncio/vector_asyncio.py +++ b/pinecone/db_data/resources/asyncio/vector_asyncio.py @@ -1,8 +1,10 @@ +from __future__ import annotations + from pinecone.utils.tqdm import tqdm import logging import asyncio import json -from typing import Union, List, Optional, Dict, Any, Literal, AsyncIterator +from typing import List, Optional, Dict, Any, Literal, AsyncIterator from pinecone.core.openapi.db_data.api.vector_operations_api import AsyncioVectorOperationsApi from pinecone.core.openapi.db_data.models import ( @@ -53,7 +55,7 @@ """ :meta private: """ -def parse_query_response(response: OpenAPIQueryResponse): +def parse_query_response(response: OpenAPIQueryResponse) -> QueryResponse: """:meta private:""" # Convert OpenAPI QueryResponse to dataclass QueryResponse from pinecone.utils.response_info import extract_response_info @@ -95,9 +97,9 @@ def _openapi_kwargs(self, kwargs: Dict[str, Any]) -> Dict[str, Any]: @validate_and_convert_errors async def upsert( self, - vectors: Union[ - List[Vector], List[VectorTuple], List[VectorTupleWithMetadata], List[VectorTypedDict] - ], + vectors: ( + List[Vector] | List[VectorTuple] | List[VectorTupleWithMetadata] | List[VectorTypedDict] + ), namespace: Optional[str] = None, batch_size: Optional[int] = None, show_progress: bool = True, @@ -168,9 +170,9 @@ async def upsert( @validate_and_convert_errors async def _upsert_batch( self, - vectors: Union[ - List[Vector], List[VectorTuple], List[VectorTupleWithMetadata], List[VectorTypedDict] - ], + vectors: ( + List[Vector] | List[VectorTuple] | List[VectorTupleWithMetadata] | List[VectorTypedDict] + ), namespace: Optional[str], _check_type: bool, **kwargs, @@ -259,7 +261,9 @@ async def delete( [("ids", ids), ("delete_all", delete_all), ("namespace", namespace), ("filter", filter)] ) - return await self._vector_api.delete_vectors( + from typing import cast + + result = await self._vector_api.delete_vectors( DeleteRequest( **args_dict, **{ @@ -271,6 +275,7 @@ async def delete( ), **{k: v for k, v in kwargs.items() if k in _OPENAPI_ENDPOINT_PARAMS}, ) + return cast(Dict[str, Any], result) @validate_and_convert_errors async def fetch( @@ -396,7 +401,7 @@ async def query( filter: Optional[FilterTypedDict] = None, include_values: Optional[bool] = None, include_metadata: Optional[bool] = None, - sparse_vector: Optional[Union[SparseValues, SparseVectorTypedDict]] = None, + sparse_vector: Optional[SparseValues | SparseVectorTypedDict] = None, **kwargs, ) -> QueryResponse: """Query the index. @@ -450,6 +455,7 @@ async def query( sparse_vector=sparse_vector, **kwargs, ) + # parse_query_response already returns QueryResponse return parse_query_response(response) async def _query( @@ -462,7 +468,7 @@ async def _query( filter: Optional[FilterTypedDict] = None, include_values: Optional[bool] = None, include_metadata: Optional[bool] = None, - sparse_vector: Optional[Union[SparseValues, SparseVectorTypedDict]] = None, + sparse_vector: Optional[SparseValues | SparseVectorTypedDict] = None, **kwargs, ) -> OpenAPIQueryResponse: if len(args) > 0: @@ -481,9 +487,12 @@ async def _query( sparse_vector=sparse_vector, **kwargs, ) - return await self._vector_api.query_vectors( + from typing import cast + + result = await self._vector_api.query_vectors( request, **{k: v for k, v in kwargs.items() if k in _OPENAPI_ENDPOINT_PARAMS} ) + return cast(OpenAPIQueryResponse, result) @validate_and_convert_errors async def query_namespaces( @@ -491,13 +500,11 @@ async def query_namespaces( namespaces: List[str], metric: Literal["cosine", "euclidean", "dotproduct"], top_k: Optional[int] = None, - filter: Optional[Dict[str, Union[str, float, int, bool, List, dict]]] = None, + filter: Optional[Dict[str, str | float | int | bool | List | dict]] = None, include_values: Optional[bool] = None, include_metadata: Optional[bool] = None, vector: Optional[List[float]] = None, - sparse_vector: Optional[ - Union[SparseValues, Dict[str, Union[List[float], List[int]]]] - ] = None, + sparse_vector: Optional[SparseValues | Dict[str, List[float] | List[int]]] = None, **kwargs, ) -> QueryNamespacesResults: """Query across multiple namespaces. @@ -583,7 +590,7 @@ async def update( values: Optional[List[float]] = None, set_metadata: Optional[VectorMetadataTypedDict] = None, namespace: Optional[str] = None, - sparse_values: Optional[Union[SparseValues, SparseVectorTypedDict]] = None, + sparse_values: Optional[SparseValues | SparseVectorTypedDict] = None, **kwargs, ) -> UpdateResponse: """Update a vector in the index. @@ -657,10 +664,13 @@ async def describe_index_stats( >>> await index.vector.describe_index_stats() >>> await index.vector.describe_index_stats(filter={'key': 'value'}) """ - return await self._vector_api.describe_index_stats( + from typing import cast + + result = await self._vector_api.describe_index_stats( IndexRequestFactory.describe_index_stats_request(filter, **kwargs), **self._openapi_kwargs(kwargs), ) + return cast(DescribeIndexStatsResponse, result) @validate_and_convert_errors async def list_paginated( @@ -705,7 +715,10 @@ async def list_paginated( namespace=namespace, **kwargs, ) - return await self._vector_api.list_vectors(**args_dict, **kwargs) + from typing import cast + + result = await self._vector_api.list_vectors(**args_dict, **kwargs) + return cast(ListResponse, result) @validate_and_convert_errors async def list(self, **kwargs) -> AsyncIterator[List[str]]: diff --git a/pinecone/db_data/resources/sync/bulk_import.py b/pinecone/db_data/resources/sync/bulk_import.py index 35a015d2e..e78b4d68e 100644 --- a/pinecone/db_data/resources/sync/bulk_import.py +++ b/pinecone/db_data/resources/sync/bulk_import.py @@ -51,7 +51,10 @@ def start( req = BulkImportRequestFactory.start_import_request( uri=uri, integration_id=integration_id, error_mode=error_mode ) - return self.__import_operations_api.start_bulk_import(req) + from typing import cast + + result = self.__import_operations_api.start_bulk_import(req) + return cast(StartImportResponse, result) def list(self, **kwargs) -> Iterator[ImportModel]: """ @@ -126,7 +129,10 @@ def list_paginated( args_dict = BulkImportRequestFactory.list_imports_paginated_args( limit=limit, pagination_token=pagination_token, **kwargs ) - return self.__import_operations_api.list_bulk_imports(**args_dict) + from typing import cast + + result = self.__import_operations_api.list_bulk_imports(**args_dict) + return cast(ListImportsResponse, result) def describe(self, id: str) -> ImportModel: """ @@ -140,7 +146,10 @@ def describe(self, id: str) -> ImportModel: describe_import is used to get detailed information about a specific import operation. """ args = BulkImportRequestFactory.describe_import_args(id=id) - return self.__import_operations_api.describe_bulk_import(**args) + from typing import cast + + result = self.__import_operations_api.describe_bulk_import(**args) + return cast(ImportModel, result) def cancel(self, id: str): """Cancel an import operation. diff --git a/pinecone/db_data/resources/sync/bulk_import_request_factory.py b/pinecone/db_data/resources/sync/bulk_import_request_factory.py index fd729efcd..52c088c8f 100644 --- a/pinecone/db_data/resources/sync/bulk_import_request_factory.py +++ b/pinecone/db_data/resources/sync/bulk_import_request_factory.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from enum import Enum -from typing import Optional, TypedDict, Any, Union +from typing import TypedDict, Any from pinecone.core.openapi.db_data.models import ( StartImportRequest, @@ -26,8 +28,8 @@ class BulkImportRequestFactory: @staticmethod def start_import_request( uri: str, - integration_id: Optional[str] = None, - error_mode: Optional[Union[ImportErrorMode, str]] = "CONTINUE", + integration_id: str | None = None, + error_mode: (ImportErrorMode | str) | None = "CONTINUE", ) -> StartImportRequest: if error_mode is None: error_mode = "CONTINUE" @@ -46,11 +48,12 @@ def start_import_request( ] ) - return StartImportRequest(**args_dict) + import_request: StartImportRequest = StartImportRequest(**args_dict) + return import_request @staticmethod def list_imports_paginated_args( - limit: Optional[int] = None, pagination_token: Optional[str] = None, **kwargs + limit: int | None = None, pagination_token: str | None = None, **kwargs ) -> dict[str, Any]: return parse_non_empty_args([("limit", limit), ("pagination_token", pagination_token)]) diff --git a/pinecone/db_data/resources/sync/namespace.py b/pinecone/db_data/resources/sync/namespace.py index 791034e0b..32b098a64 100644 --- a/pinecone/db_data/resources/sync/namespace.py +++ b/pinecone/db_data/resources/sync/namespace.py @@ -40,8 +40,11 @@ def create(self, name: str, schema: Optional[Any] = None, **kwargs) -> Namespace **Note:** This operation is not supported for pod-based indexes. """ + from typing import cast + args = NamespaceRequestFactory.create_namespace_args(name=name, schema=schema, **kwargs) - return self.__namespace_operations_api.create_namespace(**args) + result = self.__namespace_operations_api.create_namespace(**args) + return cast(NamespaceDescription, result) @require_kwargs def describe(self, namespace: str, **kwargs) -> NamespaceDescription: @@ -54,8 +57,11 @@ def describe(self, namespace: str, **kwargs) -> NamespaceDescription: Describe a namespace within an index, showing the vector count within the namespace. """ + from typing import cast + args = NamespaceRequestFactory.describe_namespace_args(namespace=namespace, **kwargs) - return self.__namespace_operations_api.describe_namespace(**args) + result = self.__namespace_operations_api.describe_namespace(**args) + return cast(NamespaceDescription, result) @require_kwargs def delete(self, namespace: str, **kwargs): @@ -128,7 +134,10 @@ def list_paginated( eyJza2lwX3Bhc3QiOiI5OTMiLCJwcmVmaXgiOiI5OSJ9 >>> next_results = index.list_paginated(limit=5, pagination_token=results.pagination.next) """ + from typing import cast + args = NamespaceRequestFactory.list_namespaces_args( limit=limit, pagination_token=pagination_token, **kwargs ) - return self.__namespace_operations_api.list_namespaces_operation(**args) + result = self.__namespace_operations_api.list_namespaces_operation(**args) + return cast(ListNamespacesResponse, result) diff --git a/pinecone/db_data/resources/sync/namespace_request_factory.py b/pinecone/db_data/resources/sync/namespace_request_factory.py index 468dd8a7a..7bc313b99 100644 --- a/pinecone/db_data/resources/sync/namespace_request_factory.py +++ b/pinecone/db_data/resources/sync/namespace_request_factory.py @@ -52,7 +52,7 @@ def create_namespace_args( request_kwargs["schema"] = schema_obj else: # schema is already CreateNamespaceRequestSchema - request_kwargs["schema"] = cast(CreateNamespaceRequestSchema, schema) + request_kwargs["schema"] = schema create_namespace_request = CreateNamespaceRequest(**request_kwargs) base_args = {"create_namespace_request": create_namespace_request} diff --git a/pinecone/db_data/resources/sync/record.py b/pinecone/db_data/resources/sync/record.py index 447071b94..b9683e48c 100644 --- a/pinecone/db_data/resources/sync/record.py +++ b/pinecone/db_data/resources/sync/record.py @@ -142,7 +142,10 @@ def search( request = IndexRequestFactory.search_request(query=query, rerank=rerank, fields=fields) - return self._vector_api.search_records_namespace(namespace, request) + from typing import cast + + result = self._vector_api.search_records_namespace(namespace, request) + return cast(SearchRecordsResponse, result) @validate_and_convert_errors def search_records( diff --git a/pinecone/db_data/resources/sync/vector.py b/pinecone/db_data/resources/sync/vector.py index 1162eff41..6de666c7e 100644 --- a/pinecone/db_data/resources/sync/vector.py +++ b/pinecone/db_data/resources/sync/vector.py @@ -1,7 +1,9 @@ +from __future__ import annotations + from pinecone.utils.tqdm import tqdm import logging import json -from typing import Union, List, Optional, Dict, Any, Literal +from typing import List, Optional, Dict, Any, Literal from multiprocessing.pool import ApplyResult from concurrent.futures import as_completed @@ -43,7 +45,7 @@ """ :meta private: """ -def parse_query_response(response: OpenAPIQueryResponse): +def parse_query_response(response: OpenAPIQueryResponse) -> QueryResponse: """:meta private:""" # Convert OpenAPI QueryResponse to dataclass QueryResponse from pinecone.utils.response_info import extract_response_info @@ -87,14 +89,14 @@ def _openapi_kwargs(self, kwargs: Dict[str, Any]) -> Dict[str, Any]: @validate_and_convert_errors def upsert( self, - vectors: Union[ - List[Vector], List[VectorTuple], List[VectorTupleWithMetadata], List[VectorTypedDict] - ], + vectors: ( + List[Vector] | List[VectorTuple] | List[VectorTupleWithMetadata] | List[VectorTypedDict] + ), namespace: Optional[str] = None, batch_size: Optional[int] = None, show_progress: bool = True, **kwargs, - ) -> Union[UpsertResponse, ApplyResult]: + ) -> UpsertResponse | ApplyResult: """Upsert vectors into the index. The upsert operation writes vectors into a namespace. If a new value is upserted @@ -162,9 +164,12 @@ def __getattr__(self, name): return getattr(self._apply_result, name) # result is ApplyResult when async_req=True - return UpsertResponseTransformer(result) # type: ignore[arg-type, return-value] + from typing import cast + + return cast(UpsertResponse, UpsertResponseTransformer(result)) # type: ignore[arg-type] # result is UpsertResponse when async_req=False - return result # type: ignore[return-value] + # _upsert_batch already returns UpsertResponse when async_req=False + return result if not isinstance(batch_size, int) or batch_size <= 0: raise ValueError("batch_size must be a positive integer") @@ -198,13 +203,13 @@ def __getattr__(self, name): def _upsert_batch( self, - vectors: Union[ - List[Vector], List[VectorTuple], List[VectorTupleWithMetadata], List[VectorTypedDict] - ], + vectors: ( + List[Vector] | List[VectorTuple] | List[VectorTupleWithMetadata] | List[VectorTypedDict] + ), namespace: Optional[str], _check_type: bool, **kwargs, - ) -> Union[UpsertResponse, ApplyResult]: + ) -> UpsertResponse | ApplyResult: # Convert OpenAPI UpsertResponse to dataclass UpsertResponse result = self._vector_api.upsert_vectors( IndexRequestFactory.upsert_request(vectors, namespace, _check_type, **kwargs), @@ -216,7 +221,9 @@ def _upsert_batch( if kwargs.get("async_req", False): # Return ApplyResult - it will be unwrapped by the caller # The ApplyResult contains OpenAPIUpsertResponse which will be converted when .get() is called - return result # type: ignore[return-value] # ApplyResult is not tracked through OpenAPI layers + from typing import cast + + return cast(UpsertResponse, result) # ApplyResult is not tracked through OpenAPI layers from pinecone.utils.response_info import extract_response_info @@ -274,6 +281,11 @@ def upsert_from_dataframe( upserted_count = 0 last_result = None for res in results: + # res is always UpsertResponse when not using async_req + # upsert() doesn't use async_req, so res is always UpsertResponse + assert isinstance( + res, UpsertResponse + ), "Expected UpsertResponse when not using async_req" upserted_count += res.upserted_count last_result = res @@ -294,7 +306,7 @@ def delete( ids: Optional[List[str]] = None, delete_all: Optional[bool] = None, namespace: Optional[str] = None, - filter: Optional[Dict[str, Union[str, float, int, bool, List, dict]]] = None, + filter: Optional[FilterTypedDict] = None, **kwargs, ) -> Dict[str, Any]: """Delete vectors from the index. @@ -320,12 +332,15 @@ def delete( >>> index.vector.delete(delete_all=True, namespace='my_namespace') >>> index.vector.delete(filter={'key': 'value'}, namespace='my_namespace') """ - return self._vector_api.delete_vectors( + from typing import cast + + result = self._vector_api.delete_vectors( IndexRequestFactory.delete_request( ids=ids, delete_all=delete_all, namespace=namespace, filter=filter, **kwargs ), **self._openapi_kwargs(kwargs), ) + return cast(Dict[str, Any], result) @validate_and_convert_errors def fetch(self, ids: List[str], namespace: Optional[str] = None, **kwargs) -> FetchResponse: @@ -447,9 +462,9 @@ def query( filter: Optional[FilterTypedDict] = None, include_values: Optional[bool] = None, include_metadata: Optional[bool] = None, - sparse_vector: Optional[Union[SparseValues, SparseVectorTypedDict]] = None, + sparse_vector: Optional[SparseValues | SparseVectorTypedDict] = None, **kwargs, - ) -> Union[QueryResponse, ApplyResult]: + ) -> QueryResponse | ApplyResult: """Query the index. The Query operation searches a namespace, using a query vector. It retrieves the @@ -507,6 +522,7 @@ def query( # The response is already an ApplyResult[OpenAPIQueryResponse] return response # type: ignore[return-value] # ApplyResult is not tracked through OpenAPI layers else: + # parse_query_response already returns QueryResponse return parse_query_response(response) def _query( @@ -519,7 +535,7 @@ def _query( filter: Optional[FilterTypedDict] = None, include_values: Optional[bool] = None, include_metadata: Optional[bool] = None, - sparse_vector: Optional[Union[SparseValues, SparseVectorTypedDict]] = None, + sparse_vector: Optional[SparseValues | SparseVectorTypedDict] = None, **kwargs, ) -> OpenAPIQueryResponse: if len(args) > 0: @@ -541,7 +557,10 @@ def _query( sparse_vector=sparse_vector, **kwargs, ) - return self._vector_api.query_vectors(request, **self._openapi_kwargs(kwargs)) + from typing import cast + + result = self._vector_api.query_vectors(request, **self._openapi_kwargs(kwargs)) + return cast(OpenAPIQueryResponse, result) @validate_and_convert_errors def query_namespaces( @@ -550,12 +569,10 @@ def query_namespaces( namespaces: List[str], metric: Literal["cosine", "euclidean", "dotproduct"], top_k: Optional[int] = None, - filter: Optional[Dict[str, Union[str, float, int, bool, List, dict]]] = None, + filter: Optional[FilterTypedDict] = None, include_values: Optional[bool] = None, include_metadata: Optional[bool] = None, - sparse_vector: Optional[ - Union[SparseValues, Dict[str, Union[List[float], List[int]]]] - ] = None, + sparse_vector: Optional[SparseValues | SparseVectorTypedDict] = None, **kwargs, ) -> QueryNamespacesResults: """Query across multiple namespaces. @@ -618,7 +635,14 @@ def query_namespaces( for ns in target_namespaces ] - for result in as_completed(async_futures): + from typing import cast + from concurrent.futures import Future + + # async_futures is List[QueryResponse | ApplyResult] + # When async_threadpool_executor=True, query returns ApplyResult + # as_completed expects Iterable[Future], so we need to cast + futures: List[Future[Any]] = cast(List[Future[Any]], async_futures) + for result in as_completed(futures): raw_result = result.result() response = json.loads(raw_result.data.decode("utf-8")) aggregator.add_results(response) @@ -633,7 +657,7 @@ def update( values: Optional[List[float]] = None, set_metadata: Optional[VectorMetadataTypedDict] = None, namespace: Optional[str] = None, - sparse_values: Optional[Union[SparseValues, SparseVectorTypedDict]] = None, + sparse_values: Optional[SparseValues | SparseVectorTypedDict] = None, **kwargs, ) -> UpdateResponse: """Update a vector in the index. @@ -707,10 +731,13 @@ def describe_index_stats( >>> index.vector.describe_index_stats() >>> index.vector.describe_index_stats(filter={'key': 'value'}) """ - return self._vector_api.describe_index_stats( + from typing import cast + + result = self._vector_api.describe_index_stats( IndexRequestFactory.describe_index_stats_request(filter, **kwargs), **self._openapi_kwargs(kwargs), ) + return cast(DescribeIndexStatsResponse, result) @validate_and_convert_errors def list_paginated( @@ -755,7 +782,10 @@ def list_paginated( namespace=namespace, **kwargs, ) - return self._vector_api.list_vectors(**args_dict, **kwargs) + from typing import cast + + result = self._vector_api.list_vectors(**args_dict, **kwargs) + return cast(ListResponse, result) @validate_and_convert_errors def list(self, **kwargs): diff --git a/pinecone/db_data/sparse_values_factory.py b/pinecone/db_data/sparse_values_factory.py index 5d07136eb..6139a62b6 100644 --- a/pinecone/db_data/sparse_values_factory.py +++ b/pinecone/db_data/sparse_values_factory.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import Union, Optional +from typing import Any from ..utils import convert_to_list @@ -19,14 +21,18 @@ class SparseValuesFactory: @staticmethod def build( - input: Optional[Union[SparseValues, OpenApiSparseValues, SparseVectorTypedDict]], - ) -> Optional[OpenApiSparseValues]: + input: (SparseValues | OpenApiSparseValues | SparseVectorTypedDict) | None, + ) -> OpenApiSparseValues | None: if input is None: return input if isinstance(input, OpenApiSparseValues): - return input + result_input: OpenApiSparseValues = input + return result_input if isinstance(input, SparseValues): - return OpenApiSparseValues(indices=input.indices, values=input.values) + result: OpenApiSparseValues = OpenApiSparseValues( + indices=input.indices, values=input.values + ) + return result if not isinstance(input, Mapping): raise SparseValuesDictionaryExpectedError(input) if not {"indices", "values"}.issubset(input): @@ -39,21 +45,22 @@ def build( raise ValueError("Sparse values indices and values must have the same length") try: - return OpenApiSparseValues(indices=indices, values=values) + result_dict: OpenApiSparseValues = OpenApiSparseValues(indices=indices, values=values) + return result_dict except TypeError as e: raise SparseValuesTypeError() from e @staticmethod - def _convert_to_list(input, expected_type): + def _convert_to_list(input: Any, expected_type: type) -> list[Any]: try: converted = convert_to_list(input) except TypeError as e: raise SparseValuesTypeError() from e SparseValuesFactory._validate_list_items_type(converted, expected_type) - return converted + return converted # type: ignore[no-any-return] @staticmethod - def _validate_list_items_type(input, expected_type): + def _validate_list_items_type(input: list[Any], expected_type: type) -> None: if len(input) > 0 and not isinstance(input[0], expected_type): raise SparseValuesTypeError() diff --git a/pinecone/db_data/vector_factory.py b/pinecone/db_data/vector_factory.py index 0738617fa..c93f23108 100644 --- a/pinecone/db_data/vector_factory.py +++ b/pinecone/db_data/vector_factory.py @@ -1,7 +1,9 @@ +from __future__ import annotations + import numbers from collections.abc import Iterable, Mapping -from typing import Union, Tuple +from typing import Tuple from ..utils import fix_tuple_length, convert_to_list, parse_non_empty_args from ..utils.constants import REQUIRED_VECTOR_FIELDS, OPTIONAL_VECTOR_FIELDS @@ -21,7 +23,7 @@ MetadataDictionaryExpectedError, ) -from .types import VectorTuple, VectorTypedDict +from .types import VectorTuple, VectorTupleWithMetadata, VectorTypedDict class VectorFactory: @@ -29,10 +31,12 @@ class VectorFactory: @staticmethod def build( - item: Union[OpenApiVector, VectorTuple, VectorTypedDict], check_type: bool = True + item: OpenApiVector | Vector | VectorTuple | VectorTupleWithMetadata | VectorTypedDict, + check_type: bool = True, ) -> OpenApiVector: if isinstance(item, OpenApiVector): - return item + result: OpenApiVector = item + return result elif isinstance(item, Vector): args = parse_non_empty_args( [ @@ -43,7 +47,8 @@ def build( ] ) - return OpenApiVector(**args) + vector_result: OpenApiVector = OpenApiVector(**args) + return vector_result elif isinstance(item, tuple): return VectorFactory._tuple_to_vector(item, check_type) elif isinstance(item, Mapping): @@ -100,7 +105,8 @@ def _dict_to_vector(item, check_type: bool) -> OpenApiVector: raise MetadataDictionaryExpectedError(item) try: - return OpenApiVector(**item, _check_type=check_type) + result: OpenApiVector = OpenApiVector(**item, _check_type=check_type) + return result except TypeError as e: if not isinstance(item["values"], Iterable) or not isinstance( item["values"].__iter__().__next__(), numbers.Real diff --git a/pinecone/grpc/channel_factory.py b/pinecone/grpc/channel_factory.py index 042d21dfe..c1d54a309 100644 --- a/pinecone/grpc/channel_factory.py +++ b/pinecone/grpc/channel_factory.py @@ -90,12 +90,18 @@ def create_channel(self, endpoint): if not self.grpc_client_config.secure: create_channel_fn = ( - grpc.aio.insecure_channel if self.use_asyncio else grpc.insecure_channel + grpc.aio.insecure_channel if self.use_asyncio else grpc.insecure_channel # type: ignore[attr-defined] ) channel = create_channel_fn(endpoint, options=options_tuple) else: channel_creds = self._build_channel_credentials() - create_channel_fn = grpc.aio.secure_channel if self.use_asyncio else grpc.secure_channel - channel = create_channel_fn(endpoint, credentials=channel_creds, options=options_tuple) + if self.use_asyncio: + channel = grpc.aio.secure_channel( # type: ignore[attr-defined] + endpoint, credentials=channel_creds, options=options_tuple + ) + else: + channel = grpc.secure_channel( + endpoint, credentials=channel_creds, options=options_tuple + ) return channel diff --git a/pinecone/grpc/future.py b/pinecone/grpc/future.py index 2aaf59ff9..8aa261e0b 100644 --- a/pinecone/grpc/future.py +++ b/pinecone/grpc/future.py @@ -106,4 +106,4 @@ def _wrap_rpc_exception(self, e): def __del__(self): self._grpc_future.cancel() - self = None # release the reference to the grpc future + # Note: self = None is not valid Python syntax and has no effect diff --git a/pinecone/grpc/grpc_runner.py b/pinecone/grpc/grpc_runner.py index e62c34a3a..9a1ac35a2 100644 --- a/pinecone/grpc/grpc_runner.py +++ b/pinecone/grpc/grpc_runner.py @@ -44,7 +44,7 @@ def run( """ @wraps(func) - def wrapped(): + def wrapped() -> Tuple[Any, Optional[Dict[str, str]]]: user_provided_metadata = metadata or {} _metadata = self._prepare_metadata(user_provided_metadata) try: @@ -107,7 +107,7 @@ async def run_asyncio( """ @wraps(func) - async def wrapped(): + async def wrapped() -> Tuple[Any, Optional[Dict[str, str]]]: user_provided_metadata = metadata or {} _metadata = self._prepare_metadata(user_provided_metadata) try: diff --git a/pinecone/grpc/index_grpc.py b/pinecone/grpc/index_grpc.py index 1b2be170b..dc9fad50d 100644 --- a/pinecone/grpc/index_grpc.py +++ b/pinecone/grpc/index_grpc.py @@ -1,5 +1,17 @@ import logging -from typing import Optional, Dict, Union, List, Tuple, Any, Iterable, cast, Literal +from typing import ( + Optional, + Dict, + Union, + List, + Tuple, + Any, + Iterable, + cast, + Literal, + Iterator, + TYPE_CHECKING, +) from google.protobuf import json_format @@ -24,13 +36,17 @@ from .sparse_values_factory import SparseValuesFactory from pinecone.core.openapi.db_data.models import ( - FetchResponse, - QueryResponse, IndexDescription as DescribeIndexStatsResponse, NamespaceDescription, ListNamespacesResponse, ) -from pinecone.db_data.dataclasses import FetchByMetadataResponse, UpdateResponse, UpsertResponse +from pinecone.db_data.dataclasses import ( + FetchByMetadataResponse, + UpdateResponse, + UpsertResponse, + FetchResponse, + QueryResponse, +) from pinecone.db_control.models.list_response import ListResponse as SimpleListResponse, Pagination from pinecone.core.grpc.protos.db_data_2025_10_pb2 import ( Vector as GRPCVector, @@ -43,7 +59,6 @@ UpdateRequest, ListRequest, DescribeIndexStatsRequest, - DeleteResponse, SparseValues as GRPCSparseValues, DescribeNamespaceRequest, DeleteNamespaceRequest, @@ -57,6 +72,9 @@ from pinecone.db_data.query_results_aggregator import QueryNamespacesResults, QueryResultsAggregator from .base import GRPCIndexBase from .future import PineconeGrpcFuture + +if TYPE_CHECKING: + from typing import Type from ..db_data.types import ( SparseVectorTypedDict, VectorTypedDict, @@ -83,7 +101,7 @@ class GRPCIndex(GRPCIndexBase): """A client for interacting with a Pinecone index via GRPC API.""" @property - def stub_class(self): + def stub_class(self) -> "Type[VectorServiceStub]": """:meta private:""" return VectorServiceStub @@ -217,7 +235,7 @@ def _upsert_batch( def upsert_from_dataframe( self, - df, + df: Any, namespace: str = "", batch_size: int = 500, use_async_requests: bool = True, @@ -246,7 +264,12 @@ def upsert_from_dataframe( pbar = tqdm(total=len(df), disable=not show_progress, desc="sending upsert requests") results = [] for chunk in self._iter_dataframe(df, batch_size=batch_size): - res = self.upsert(vectors=chunk, namespace=namespace, async_req=use_async_requests) + # Type cast: dataframe dicts match VectorTypedDict structure + res = self.upsert( + vectors=cast(List[VectorTypedDict], chunk), + namespace=namespace, + async_req=use_async_requests, + ) pbar.update(len(chunk)) results.append(res) @@ -279,7 +302,7 @@ def upsert_from_dataframe( return UpsertResponse(upserted_count=upserted_count, _response_info=response_info) @staticmethod - def _iter_dataframe(df, batch_size): + def _iter_dataframe(df: Any, batch_size: int) -> Iterator[List[Dict[str, Any]]]: for i in range(0, len(df), batch_size): batch = df.iloc[i : i + batch_size].to_dict(orient="records") yield batch @@ -292,7 +315,7 @@ def delete( filter: Optional[FilterTypedDict] = None, async_req: bool = False, **kwargs, - ) -> Union[DeleteResponse, PineconeGrpcFuture]: + ) -> Union[Dict[str, Any], PineconeGrpcFuture]: """ The Delete operation deletes vectors from the index, from a single namespace. No error raised if the vector id does not exist. @@ -540,7 +563,7 @@ def query( ] = None, async_req: Optional[bool] = False, **kwargs, - ) -> Union[QueryResponse, PineconeGrpcFuture]: + ) -> Union["QueryResponse", PineconeGrpcFuture]: """ The Query operation searches a namespace, using a query vector. It retrieves the ids of the most similar items in a namespace, along with their similarity scores. @@ -868,7 +891,7 @@ def list_paginated( namespace=response.namespace, vectors=response.vectors, pagination=pagination ) - def list(self, **kwargs): + def list(self, **kwargs) -> Iterator[List[str]]: """ The list operation accepts all of the same arguments as list_paginated, and returns a generator that yields a list of the matching vector ids in each page of results. It automatically handles pagination tokens on your diff --git a/pinecone/grpc/resources/vector_grpc.py b/pinecone/grpc/resources/vector_grpc.py index ab14a3aed..86629bc44 100644 --- a/pinecone/grpc/resources/vector_grpc.py +++ b/pinecone/grpc/resources/vector_grpc.py @@ -19,12 +19,14 @@ from ..vector_factory_grpc import VectorFactoryGRPC from ..sparse_values_factory import SparseValuesFactory -from pinecone.core.openapi.db_data.models import ( +from pinecone.core.openapi.db_data.models import IndexDescription as DescribeIndexStatsResponse +from pinecone.db_data.dataclasses import ( + FetchByMetadataResponse, + UpdateResponse, + UpsertResponse, FetchResponse, QueryResponse, - IndexDescription as DescribeIndexStatsResponse, ) -from pinecone.db_data.dataclasses import FetchByMetadataResponse, UpdateResponse, UpsertResponse from pinecone.db_control.models.list_response import ListResponse as SimpleListResponse, Pagination from pinecone.core.grpc.protos.db_data_2025_10_pb2 import ( Vector as GRPCVector, @@ -36,7 +38,6 @@ UpdateRequest, ListRequest, DescribeIndexStatsRequest, - DeleteResponse, SparseValues as GRPCSparseValues, ) from pinecone import Vector, SparseValues @@ -254,7 +255,7 @@ def delete( filter: Optional[FilterTypedDict] = None, async_req: bool = False, **kwargs, - ) -> Union[DeleteResponse, PineconeGrpcFuture]: + ) -> Union[Dict[str, Any], PineconeGrpcFuture]: """Delete vectors from the index. The Delete operation deletes vectors from the index, from a single namespace. @@ -493,7 +494,7 @@ def query( ] = None, async_req: Optional[bool] = False, **kwargs, - ) -> Union[QueryResponse, PineconeGrpcFuture]: + ) -> Union["QueryResponse", PineconeGrpcFuture]: """Query the index. The Query operation searches a namespace, using a query vector. It retrieves the diff --git a/pinecone/grpc/retry.py b/pinecone/grpc/retry.py index 556031efb..c0ff42f00 100644 --- a/pinecone/grpc/retry.py +++ b/pinecone/grpc/retry.py @@ -52,11 +52,13 @@ def __init__(self, retry_config: "RetryConfig"): def _is_retryable_error(self, response_or_error): """Determine if a response is a retryable error.""" - return ( - isinstance(response_or_error, grpc.RpcError) - and "_MultiThreadedRendezvous" not in response_or_error.__class__.__name__ - and response_or_error.code() in self.retryable_status - ) + if not isinstance(response_or_error, grpc.RpcError): + return False + if "_MultiThreadedRendezvous" in response_or_error.__class__.__name__: + return False + if self.retryable_status is None: + return False + return response_or_error.code() in self.retryable_status def _intercept_call(self, continuation, client_call_details, request_or_iterator): response = None diff --git a/pinecone/grpc/utils.py b/pinecone/grpc/utils.py index fcb2d70b1..afc80e91f 100644 --- a/pinecone/grpc/utils.py +++ b/pinecone/grpc/utils.py @@ -1,4 +1,4 @@ -from typing import Optional, Union, Dict +from typing import Optional, Union, Dict, Any from google.protobuf import json_format from google.protobuf.message import Message @@ -23,6 +23,7 @@ Pagination, QueryResponse, UpsertResponse, + UpdateResponse, ) from google.protobuf.struct_pb2 import Struct @@ -40,15 +41,20 @@ def dict_to_proto_struct(d: Optional[dict]) -> "Struct": return s -def parse_sparse_values(sparse_values: dict): - return ( +def parse_sparse_values(sparse_values: Optional[dict]) -> SparseValues: + from typing import cast + + result = ( SparseValues(indices=sparse_values["indices"], values=sparse_values["values"]) if sparse_values else SparseValues(indices=[], values=[]) ) + return cast(SparseValues, result) -def parse_fetch_response(response: Message, initial_metadata: Optional[Dict[str, str]] = None): +def parse_fetch_response( + response: Message, initial_metadata: Optional[Dict[str, str]] = None +) -> FetchResponse: json_response = json_format.MessageToDict(response) vd = {} @@ -78,18 +84,17 @@ def parse_fetch_response(response: Message, initial_metadata: Optional[Dict[str, metadata = initial_metadata or {} response_info = extract_response_info(metadata) + usage_obj = parse_usage(json_response.get("usage", {})) + usage_dict: Dict[str, int] = {"read_units": usage_obj.read_units} fetch_response = FetchResponse( - vectors=vd, - namespace=namespace, - usage=parse_usage(json_response.get("usage", {})), - _response_info=response_info, + vectors=vd, namespace=namespace, usage=usage_dict, _response_info=response_info ) return fetch_response def parse_fetch_by_metadata_response( response: Message, initial_metadata: Optional[Dict[str, str]] = None -): +) -> FetchByMetadataResponse: json_response = json_format.MessageToDict(response) vd = {} @@ -115,23 +120,28 @@ def parse_fetch_by_metadata_response( metadata = initial_metadata or {} response_info = extract_response_info(metadata) + usage_obj = parse_usage(json_response.get("usage", {})) + usage_dict: Dict[str, int] = {"read_units": usage_obj.read_units} fetch_by_metadata_response = FetchByMetadataResponse( vectors=vd, namespace=namespace, - usage=parse_usage(json_response.get("usage", {})), + usage=usage_dict, pagination=pagination, _response_info=response_info, ) return fetch_by_metadata_response -def parse_usage(usage: dict): - return Usage(read_units=int(usage.get("readUnits", 0))) +def parse_usage(usage: dict) -> Usage: + from typing import cast + + result = Usage(read_units=int(usage.get("readUnits", 0))) + return cast(Usage, result) def parse_upsert_response( response: Message, _check_type: bool = False, initial_metadata: Optional[Dict[str, str]] = None -): +) -> UpsertResponse: from pinecone.utils.response_info import extract_response_info json_response = json_format.MessageToDict(response) @@ -149,8 +159,7 @@ def parse_update_response( response: Union[dict, Message], _check_type: bool = False, initial_metadata: Optional[Dict[str, str]] = None, -): - from pinecone.db_data.dataclasses import UpdateResponse +) -> UpdateResponse: from pinecone.utils.response_info import extract_response_info from google.protobuf import json_format @@ -177,14 +186,14 @@ def parse_delete_response( response: Union[dict, Message], _check_type: bool = False, initial_metadata: Optional[Dict[str, str]] = None, -): +) -> Dict[str, Any]: from pinecone.utils.response_info import extract_response_info # Extract response info from initial metadata metadata = initial_metadata or {} response_info = extract_response_info(metadata) - result = {"_response_info": response_info} + result: Dict[str, Any] = {"_response_info": response_info} return result @@ -192,7 +201,7 @@ def parse_query_response( response: Union[dict, Message], _check_type: bool = False, initial_metadata: Optional[Dict[str, str]] = None, -): +) -> QueryResponse: if isinstance(response, Message): json_response = json_format.MessageToDict(response) else: @@ -229,7 +238,7 @@ def parse_query_response( return query_response -def parse_stats_response(response: dict): +def parse_stats_response(response: dict) -> "DescribeIndexStatsResponse": fullness = response.get("indexFullness", 0.0) total_vector_count = response.get("totalVectorCount", 0) # For sparse indexes, dimension is not present, so use None instead of 0 @@ -239,13 +248,16 @@ def parse_stats_response(response: dict): for key in summaries: vc = summaries[key].get("vectorCount", 0) namespace_summaries[key] = NamespaceSummary(vector_count=vc) - return DescribeIndexStatsResponse( + from typing import cast + + result = DescribeIndexStatsResponse( namespaces=namespace_summaries, dimension=dimension, index_fullness=fullness, total_vector_count=total_vector_count, _check_type=False, ) + return cast(DescribeIndexStatsResponse, result) def parse_namespace_description( @@ -276,7 +288,9 @@ def parse_namespace_description( response_info = extract_response_info(metadata) namespace_desc._response_info = response_info - return namespace_desc + from typing import cast + + return cast(NamespaceDescription, namespace_desc) def parse_list_namespaces_response(response: Message) -> ListNamespacesResponse: @@ -309,6 +323,9 @@ def parse_list_namespaces_response(response: Message) -> ListNamespacesResponse: ) total_count = json_response.get("totalCount") - return ListNamespacesResponse( + from typing import cast + + result = ListNamespacesResponse( namespaces=namespaces, pagination=pagination, total_count=total_count, _check_type=False ) + return cast(ListNamespacesResponse, result) diff --git a/pinecone/inference/inference_request_builder.py b/pinecone/inference/inference_request_builder.py index 3e10c1fec..24c842697 100644 --- a/pinecone/inference/inference_request_builder.py +++ b/pinecone/inference/inference_request_builder.py @@ -42,10 +42,14 @@ def embed_request( else: raise Exception("Invalid type for variable 'inputs'") + from typing import cast + if parameters: - return EmbedRequest(model=model, inputs=embeddings_inputs, parameters=parameters) + result = EmbedRequest(model=model, inputs=embeddings_inputs, parameters=parameters) + return cast(EmbedRequest, result) else: - return EmbedRequest(model=model, inputs=embeddings_inputs) + result = EmbedRequest(model=model, inputs=embeddings_inputs) + return cast(EmbedRequest, result) @staticmethod def rerank( @@ -84,4 +88,7 @@ def rerank( if parameters is not None: args["parameters"] = parameters - return RerankRequest(**args) + from typing import cast + + result = RerankRequest(**args) + return cast(RerankRequest, result) diff --git a/pinecone/openapi_support/api_version.py b/pinecone/openapi_support/api_version.py index c68138d9b..cc5b21d16 100644 --- a/pinecone/openapi_support/api_version.py +++ b/pinecone/openapi_support/api_version.py @@ -2,4 +2,4 @@ # Do not edit this file manually. API_VERSION = "2025-10" -APIS_REPO_SHA = "bbad89bd51d792534a9ba06a44ed1f2259f7f89f" +APIS_REPO_SHA = "d5ac93191def1d9666946d2c0e67edd3140b0f0d" diff --git a/pinecone/openapi_support/deserializer.py b/pinecone/openapi_support/deserializer.py index 0fee3b941..dcba8ff8e 100644 --- a/pinecone/openapi_support/deserializer.py +++ b/pinecone/openapi_support/deserializer.py @@ -1,8 +1,11 @@ import json import re +from typing import TypeVar, Type, Any, Union, Tuple from .model_utils import deserialize_file, file_type, validate_and_convert_types +T = TypeVar("T") + class Deserializer: @staticmethod @@ -17,7 +20,12 @@ def decode_response(response_type, response): response.data = response.data.decode(encoding) @staticmethod - def deserialize(response, response_type, config, _check_type): + def deserialize( + response: Any, + response_type: Union[Tuple[Type[T], ...], Tuple[Type[Any], ...]], + config: Any, + _check_type: bool, + ) -> Union[T, Any]: """Deserializes response into an object. :param response: RESTResponse object to be deserialized. diff --git a/pinecone/openapi_support/model_utils.py b/pinecone/openapi_support/model_utils.py index 54cd9068a..47a64f670 100644 --- a/pinecone/openapi_support/model_utils.py +++ b/pinecone/openapi_support/model_utils.py @@ -186,12 +186,13 @@ def __new__(cls, *args, **kwargs): return None if issubclass(cls, ModelComposed) and allows_single_value_input(cls): - model_kwargs = {} + model_kwargs: dict = {} oneof_instance = get_oneof_instance(cls, model_kwargs, kwargs, model_arg=arg) return oneof_instance visited_composed_classes = kwargs.get("_visited_composed_classes", ()) - if cls.discriminator is None or cls in visited_composed_classes: + discriminator = getattr(cls, "discriminator", None) # type: ignore[attr-defined] + if discriminator is None or cls in visited_composed_classes: # Use case 1: this openapi schema (cls) does not have a discriminator # Use case 2: we have already visited this class before and are sure that we # want to instantiate it this time. We have visited this class deserializing @@ -213,8 +214,9 @@ def __new__(cls, *args, **kwargs): # Get the name and value of the discriminator property. # The discriminator name is obtained from the discriminator meta-data # and the discriminator value is obtained from the input data. - discr_propertyname_py = list(cls.discriminator.keys())[0] - discr_propertyname_js = cls.attribute_map[discr_propertyname_py] + discr_propertyname_py = list(discriminator.keys())[0] + attribute_map = getattr(cls, "attribute_map", {}) # type: ignore[attr-defined] + discr_propertyname_js = attribute_map[discr_propertyname_py] if discr_propertyname_js in kwargs: discr_value = kwargs[discr_propertyname_js] elif discr_propertyname_py in kwargs: @@ -263,19 +265,20 @@ def __new__(cls, *args, **kwargs): return super(OpenApiModel, cls).__new__(cls) # Build a list containing all oneOf and anyOf descendants. - oneof_anyof_classes = None - if cls._composed_schemas is not None: - oneof_anyof_classes = cls._composed_schemas.get( - "oneOf", () - ) + cls._composed_schemas.get("anyOf", ()) + oneof_anyof_classes: tuple = () + composed_schemas = getattr(cls, "_composed_schemas", None) # type: ignore[attr-defined] + if composed_schemas is not None: + oneof_anyof_classes = composed_schemas.get("oneOf", ()) + composed_schemas.get( + "anyOf", () + ) oneof_anyof_child = new_cls in oneof_anyof_classes kwargs["_visited_composed_classes"] = visited_composed_classes + (cls,) - if cls._composed_schemas.get("allOf") and oneof_anyof_child: + if composed_schemas and composed_schemas.get("allOf") and oneof_anyof_child: # Validate that we can make self because when we make the # new_cls it will not include the allOf validations in self self_inst = super(OpenApiModel, cls).__new__(cls) - self_inst.__init__(*args, **kwargs) + self_inst.__init__(*args, **kwargs) # type: ignore[misc] new_inst = new_cls.__new__(new_cls, *args, **kwargs) new_inst.__init__(*args, **kwargs) @@ -295,12 +298,13 @@ def _new_from_openapi_data(cls, *args, **kwargs): return None if issubclass(cls, ModelComposed) and allows_single_value_input(cls): - model_kwargs = {} + model_kwargs: dict = {} oneof_instance = get_oneof_instance(cls, model_kwargs, kwargs, model_arg=arg) return oneof_instance visited_composed_classes = kwargs.get("_visited_composed_classes", ()) - if cls.discriminator is None or cls in visited_composed_classes: + discriminator = getattr(cls, "discriminator", None) # type: ignore[attr-defined] + if discriminator is None or cls in visited_composed_classes: # Use case 1: this openapi schema (cls) does not have a discriminator # Use case 2: we have already visited this class before and are sure that we # want to instantiate it this time. We have visited this class deserializing @@ -317,13 +321,14 @@ def _new_from_openapi_data(cls, *args, **kwargs): # through Animal's discriminator because we passed in # _visited_composed_classes = (Animal,) - return cls._from_openapi_data(*args, **kwargs) + return cls._from_openapi_data(*args, **kwargs) # type: ignore[attr-defined] # Get the name and value of the discriminator property. # The discriminator name is obtained from the discriminator meta-data # and the discriminator value is obtained from the input data. - discr_propertyname_py = list(cls.discriminator.keys())[0] - discr_propertyname_js = cls.attribute_map[discr_propertyname_py] + discr_propertyname_py = list(discriminator.keys())[0] + attribute_map = getattr(cls, "attribute_map", {}) # type: ignore[attr-defined] + discr_propertyname_js = attribute_map[discr_propertyname_py] if discr_propertyname_js in kwargs: discr_value = kwargs[discr_propertyname_js] elif discr_propertyname_py in kwargs: @@ -369,23 +374,24 @@ def _new_from_openapi_data(cls, *args, **kwargs): # but we know we know that we already have Dog # because it is in visited_composed_classes # so make Animal here - return cls._from_openapi_data(*args, **kwargs) + return cls._from_openapi_data(*args, **kwargs) # type: ignore[attr-defined] # Build a list containing all oneOf and anyOf descendants. - oneof_anyof_classes = None - if cls._composed_schemas is not None: - oneof_anyof_classes = cls._composed_schemas.get( - "oneOf", () - ) + cls._composed_schemas.get("anyOf", ()) + oneof_anyof_classes: tuple = () + composed_schemas = getattr(cls, "_composed_schemas", None) # type: ignore[attr-defined] + if composed_schemas is not None: + oneof_anyof_classes = composed_schemas.get("oneOf", ()) + composed_schemas.get( + "anyOf", () + ) oneof_anyof_child = new_cls in oneof_anyof_classes kwargs["_visited_composed_classes"] = visited_composed_classes + (cls,) - if cls._composed_schemas.get("allOf") and oneof_anyof_child: + if composed_schemas and composed_schemas.get("allOf") and oneof_anyof_child: # Validate that we can make self because when we make the # new_cls it will not include the allOf validations in self self_inst = cls._from_openapi_data(*args, **kwargs) # noqa: F841 - new_inst = new_cls._new_from_openapi_data(*args, **kwargs) + new_inst = new_cls._new_from_openapi_data(*args, **kwargs) # type: ignore[attr-defined] return new_inst @@ -1097,13 +1103,13 @@ def get_required_type_classes(required_types_mixed, spec_property_naming): for required_type in required_types_mixed: if isinstance(required_type, list): valid_classes.append(list) - child_req_types_by_current_type[list] = required_type + child_req_types_by_current_type[list] = required_type # type: ignore[index] elif isinstance(required_type, tuple): valid_classes.append(tuple) - child_req_types_by_current_type[tuple] = required_type + child_req_types_by_current_type[tuple] = required_type # type: ignore[index] elif isinstance(required_type, dict): valid_classes.append(dict) - child_req_types_by_current_type[dict] = required_type[str] + child_req_types_by_current_type[dict] = required_type[str] # type: ignore[index,assignment] else: valid_classes.extend(get_possible_classes(required_type, spec_property_naming)) return tuple(valid_classes), child_req_types_by_current_type @@ -1316,7 +1322,10 @@ def deserialize_file(response_data, configuration, content_disposition=None): os.remove(path) if content_disposition: - filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', content_disposition).group(1) + match = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', content_disposition) + if match is None: + raise ValueError("Could not extract filename from content_disposition") + filename = match.group(1) path = os.path.join(os.path.dirname(path), filename) with open(path, "wb") as f: diff --git a/pinecone/openapi_support/retry_aiohttp.py b/pinecone/openapi_support/retry_aiohttp.py index 2b3019e7e..9905ef8e0 100644 --- a/pinecone/openapi_support/retry_aiohttp.py +++ b/pinecone/openapi_support/retry_aiohttp.py @@ -41,4 +41,4 @@ def get_timeout( """Return timeout with exponential backoff.""" jitter = random.uniform(0, 0.1) timeout = self._start_timeout * (2 ** (attempt - 1)) - return min(timeout + jitter, self._max_timeout) + return float(min(timeout + jitter, self._max_timeout)) diff --git a/pinecone/pinecone.py b/pinecone/pinecone.py index 00fd4cfee..3fd018903 100644 --- a/pinecone/pinecone.py +++ b/pinecone/pinecone.py @@ -1,5 +1,5 @@ import logging -from typing import Optional, Dict, Union, TYPE_CHECKING, Any +from typing import Optional, Dict, Union, TYPE_CHECKING, Any, NoReturn from multiprocessing import cpu_count import warnings @@ -18,6 +18,8 @@ from pinecone.db_data import _Index as Index, _IndexAsyncio as IndexAsyncio from pinecone.db_control.index_host_store import IndexHostStore from pinecone.core.openapi.db_control.api.manage_indexes_api import ManageIndexesApi + from pinecone.inference import Inference + from pinecone.db_control import DBControl from pinecone.db_control.types import CreateIndexForModelEmbedTypedDict, ConfigureIndexEmbed from pinecone.db_control.models.serverless_spec import ( ReadCapacityDict, @@ -72,7 +74,7 @@ def __init__( additional_headers: Optional[Dict[str, str]] = {}, pool_threads: Optional[int] = None, **kwargs, - ): + ) -> None: """ The ``Pinecone`` class is the main entry point for interacting with Pinecone via this Python SDK. Instances of the ``Pinecone`` class are used to manage and interact with Pinecone resources such as @@ -247,16 +249,16 @@ def __init__( self._pool_threads = pool_threads """ :meta private: """ - self._inference = None # Lazy initialization + self._inference: Optional["Inference"] = None # Lazy initialization """ :meta private: """ - self._db_control = None # Lazy initialization + self._db_control: Optional["DBControl"] = None # Lazy initialization """ :meta private: """ super().__init__() # Initialize PluginAware @property - def inference(self): + def inference(self) -> "Inference": """ Inference is a namespace where an instance of the `pinecone.inference.Inference` class is lazily created and cached. """ @@ -271,7 +273,7 @@ def inference(self): return self._inference @property - def db(self): + def db(self) -> "DBControl": """ DBControl is a namespace where an instance of the `pinecone.db_control.DBControl` class is lazily created and cached. """ @@ -413,7 +415,7 @@ def create_index_from_backup( timeout=timeout, ) - def delete_index(self, name: str, timeout: Optional[int] = None): + def delete_index(self, name: str, timeout: Optional[int] = None) -> None: return self.db.index.delete(name=name, timeout=timeout) def list_indexes(self) -> "IndexList": @@ -441,7 +443,7 @@ def configure_index( "ReadCapacityDedicatedSpec", ] ] = None, - ): + ) -> None: return self.db.index.configure( name=name, replicas=replicas, @@ -461,8 +463,11 @@ def list_collections(self) -> "CollectionList": def delete_collection(self, name: str) -> None: return self.db.collection.delete(name=name) - def describe_collection(self, name: str): - return self.db.collection.describe(name=name) + def describe_collection(self, name: str) -> Dict[str, Any]: + from typing import cast + + result = self.db.collection.describe(name=name) + return cast(Dict[str, Any], result) @require_kwargs def create_backup( @@ -503,12 +508,12 @@ def describe_restore_job(self, *, job_id: str) -> "RestoreJobModel": return self.db.restore_job.describe(job_id=job_id) @staticmethod - def from_texts(*args, **kwargs): + def from_texts(*args: Any, **kwargs: Any) -> NoReturn: """:meta private:""" raise AttributeError(_build_langchain_attribute_error_message("from_texts")) @staticmethod - def from_documents(*args, **kwargs): + def from_documents(*args: Any, **kwargs: Any) -> NoReturn: """:meta private:""" raise AttributeError(_build_langchain_attribute_error_message("from_documents")) diff --git a/pinecone/pinecone_asyncio.py b/pinecone/pinecone_asyncio.py index 8d1ba548f..ab7345a40 100644 --- a/pinecone/pinecone_asyncio.py +++ b/pinecone/pinecone_asyncio.py @@ -1,6 +1,7 @@ import logging import warnings from typing import Optional, Dict, Union, TYPE_CHECKING, Any +from typing_extensions import Self from pinecone.config import PineconeConfig, ConfigBuilder @@ -12,6 +13,8 @@ if TYPE_CHECKING: from pinecone.db_control.types import ConfigureIndexEmbed, CreateIndexForModelEmbedTypedDict from pinecone.db_data import _IndexAsyncio + from pinecone.inference import AsyncioInference + from pinecone.db_control.db_control_asyncio import DBControlAsyncio from pinecone.db_control.enums import ( Metric, VectorType, @@ -87,7 +90,7 @@ def __init__( ssl_verify: Optional[bool] = None, additional_headers: Optional[Dict[str, str]] = {}, **kwargs, - ): + ) -> None: """ Initialize the ``PineconeAsyncio`` client. @@ -136,19 +139,22 @@ def __init__( self._openapi_config = ConfigBuilder.build_openapi_config(self._config, **kwargs) """ :meta private: """ - self._inference = None # Lazy initialization + self._inference: Optional["AsyncioInference"] = None # Lazy initialization """ :meta private: """ - self._db_control = None # Lazy initialization + self._db_control: Optional["DBControlAsyncio"] = None # Lazy initialization """ :meta private: """ - async def __aenter__(self): + async def __aenter__(self) -> Self: return self - async def __aexit__(self, exc_type, exc_value, traceback): + async def __aexit__( + self, exc_type: Optional[type], exc_value: Optional[BaseException], traceback: Optional[Any] + ) -> Optional[bool]: await self.close() + return None - async def close(self): + async def close(self) -> None: """Cleanup resources used by the Pinecone client. This method should be called when the client is no longer needed so that @@ -189,7 +195,7 @@ async def main(): await self.db._index_api.api_client.close() @property - def inference(self): + def inference(self) -> "AsyncioInference": """Dynamically create and cache the AsyncioInference instance.""" if self._inference is None: from pinecone.inference import AsyncioInference @@ -198,7 +204,7 @@ def inference(self): return self._inference @property - def db(self): + def db(self) -> "DBControlAsyncio": """ db is a namespace where an instance of the ``pinecone.db_control.DBControlAsyncio`` class is lazily created and cached. """ @@ -218,7 +224,10 @@ def index_host_store(self) -> "IndexHostStore": DeprecationWarning, stacklevel=2, ) - return self.db.index._index_host_store + # IndexResourceAsyncio doesn't have _index_host_store, access the singleton directly + from pinecone.db_control.index_host_store import IndexHostStore + + return IndexHostStore() @property def index_api(self) -> "AsyncioManageIndexesApi": @@ -312,7 +321,7 @@ async def create_index_from_backup( timeout=timeout, ) - async def delete_index(self, name: str, timeout: Optional[int] = None): + async def delete_index(self, name: str, timeout: Optional[int] = None) -> None: return await self.db.index.delete(name=name, timeout=timeout) async def list_indexes(self) -> "IndexList": @@ -340,7 +349,7 @@ async def configure_index( "ReadCapacityDedicatedSpec", ] ] = None, - ): + ) -> None: return await self.db.index.configure( name=name, replicas=replicas, @@ -351,16 +360,16 @@ async def configure_index( read_capacity=read_capacity, ) - async def create_collection(self, name: str, source: str): + async def create_collection(self, name: str, source: str) -> None: return await self.db.collection.create(name=name, source=source) async def list_collections(self) -> "CollectionList": return await self.db.collection.list() - async def delete_collection(self, name: str): + async def delete_collection(self, name: str) -> None: return await self.db.collection.delete(name=name) - async def describe_collection(self, name: str): + async def describe_collection(self, name: str) -> Dict[str, Any]: return await self.db.collection.describe(name=name) @require_kwargs diff --git a/pinecone/pinecone_interface_asyncio.py b/pinecone/pinecone_interface_asyncio.py index 3c344ffbb..cbbe52ad1 100644 --- a/pinecone/pinecone_interface_asyncio.py +++ b/pinecone/pinecone_interface_asyncio.py @@ -548,7 +548,7 @@ async def main(): pass @abstractmethod - def create_index_from_backup( + async def create_index_from_backup( self, *, name: str, diff --git a/pinecone/utils/check_kwargs.py b/pinecone/utils/check_kwargs.py index 17038b1ec..89d918df7 100644 --- a/pinecone/utils/check_kwargs.py +++ b/pinecone/utils/check_kwargs.py @@ -1,8 +1,11 @@ +from __future__ import annotations + import inspect import logging +from typing import Callable, Any -def check_kwargs(caller, given): +def check_kwargs(caller: Callable[..., Any], given: set[str]) -> None: argspec = inspect.getfullargspec(caller) diff = set(given).difference(argspec.args) if diff: diff --git a/pinecone/utils/error_handling.py b/pinecone/utils/error_handling.py index c18090eb2..bacc03b1f 100644 --- a/pinecone/utils/error_handling.py +++ b/pinecone/utils/error_handling.py @@ -1,5 +1,10 @@ import inspect from functools import wraps +from typing import TypeVar, Callable +from typing_extensions import ParamSpec + +P = ParamSpec("P") +R = TypeVar("R") class ProtocolError(Exception): @@ -8,9 +13,16 @@ class ProtocolError(Exception): pass -def validate_and_convert_errors(func): +def validate_and_convert_errors(func: Callable[P, R]) -> Callable[P, R]: + """ + Decorator that validates and converts urllib3 protocol errors to ProtocolError. + + :param func: The function to wrap + :return: The wrapped function with the same signature + """ + @wraps(func) - def inner_func(*args, **kwargs): + def inner_func(*args: P.args, **kwargs: P.kwargs) -> R: try: return func(*args, **kwargs) except Exception as e: @@ -31,5 +43,5 @@ def inner_func(*args, **kwargs): # Override signature sig = inspect.signature(func) - inner_func.__signature__ = sig + inner_func.__signature__ = sig # type: ignore[attr-defined] return inner_func diff --git a/pinecone/utils/lazy_imports.py b/pinecone/utils/lazy_imports.py index 6bb3d15b0..c48d33041 100644 --- a/pinecone/utils/lazy_imports.py +++ b/pinecone/utils/lazy_imports.py @@ -24,18 +24,18 @@ def __init__(self, original_module, lazy_imports): self._lazy_imports = lazy_imports self._loaded_attrs = {} - @property - def __doc__(self): - return self._original_module.__doc__ - - @property - def __dict__(self): - # Get the base dictionary from the original module - base_dict = self._original_module.__dict__.copy() - # Add lazy-loaded items - for name, value in self._loaded_attrs.items(): - base_dict[name] = value - return base_dict + def __getattribute__(self, name): + if name == "__doc__": + return object.__getattribute__(self, "_original_module").__doc__ + if name == "__dict__": + # Get the base dictionary from the original module + base_dict = object.__getattribute__(self, "_original_module").__dict__.copy() + # Add lazy-loaded items + loaded_attrs = object.__getattribute__(self, "_loaded_attrs") + for name, value in loaded_attrs.items(): + base_dict[name] = value + return base_dict + return object.__getattribute__(self, name) def __dir__(self): # Get the base directory listing from the original module diff --git a/pinecone/utils/require_kwargs.py b/pinecone/utils/require_kwargs.py index 9321f4689..1c2649aa8 100644 --- a/pinecone/utils/require_kwargs.py +++ b/pinecone/utils/require_kwargs.py @@ -1,10 +1,22 @@ import functools import inspect +from typing import TypeVar, Callable +from typing_extensions import ParamSpec +P = ParamSpec("P") +R = TypeVar("R") + + +def require_kwargs(func: Callable[P, R]) -> Callable[P, R]: + """ + Decorator that requires all arguments (except self) to be passed as keyword arguments. + + :param func: The function to wrap + :return: The wrapped function with the same signature + """ -def require_kwargs(func): @functools.wraps(func) - def wrapper(*args, **kwargs): + def wrapper(*args: P.args, **kwargs: P.kwargs) -> R: if len(args) > 1: # First arg is self param_names = list(inspect.signature(func).parameters.keys())[1:] # Skip self raise TypeError( diff --git a/tests/integration/grpc/db/data/test_query_future.py b/tests/integration/grpc/db/data/test_query_future.py index 09cd59104..f657aaf05 100644 --- a/tests/integration/grpc/db/data/test_query_future.py +++ b/tests/integration/grpc/db/data/test_query_future.py @@ -65,8 +65,7 @@ def poll_until_query_has_results( time_waited += wait_per_iteration raise TimeoutError( - f"Timeout waiting for query to return {expected_count} results " - f"after {time_waited} seconds" + f"Timeout waiting for query to return {expected_count} results after {time_waited} seconds" ) diff --git a/tests/integration/helpers/helpers.py b/tests/integration/helpers/helpers.py index f34ce36c0..b6b80cda6 100644 --- a/tests/integration/helpers/helpers.py +++ b/tests/integration/helpers/helpers.py @@ -178,8 +178,7 @@ def poll_until_lsn_reconciled( while not done: logger.debug( - f"Polling for LSN reconciliation. Target LSN: {target_lsn}, " - f"total time: {total_time}s" + f"Polling for LSN reconciliation. Target LSN: {target_lsn}, total time: {total_time}s" ) # Try query as a lightweight operation to check LSN From 382f1adb422e628ecd846303e0eb5c9cdf2c4878 Mon Sep 17 00:00:00 2001 From: Jen Hamon Date: Sun, 16 Nov 2025 21:16:41 -0500 Subject: [PATCH 2/7] Iterate --- mypy.ini | 8 ++++---- pinecone/grpc/channel_factory.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mypy.ini b/mypy.ini index ad6a34416..7193fcdf5 100644 --- a/mypy.ini +++ b/mypy.ini @@ -46,10 +46,10 @@ ignore_missing_imports = True [mypy-pinecone.utils.error_handling] ignore_missing_imports = True -[mypy-pinecone.grpc.retry] -ignore_missing_imports = True - -[mypy-pinecone.grpc.channel_factory] +# Handle grpc module - grpc is an optional dependency +# When grpc is not installed, ignore missing imports +# When grpc is installed with grpc-stubs, types are available +[mypy-pinecone.grpc.*] ignore_missing_imports = True [mypy-pinecone.openapi_support.retry_urllib3] diff --git a/pinecone/grpc/channel_factory.py b/pinecone/grpc/channel_factory.py index c1d54a309..d65675568 100644 --- a/pinecone/grpc/channel_factory.py +++ b/pinecone/grpc/channel_factory.py @@ -90,13 +90,13 @@ def create_channel(self, endpoint): if not self.grpc_client_config.secure: create_channel_fn = ( - grpc.aio.insecure_channel if self.use_asyncio else grpc.insecure_channel # type: ignore[attr-defined] + grpc.aio.insecure_channel if self.use_asyncio else grpc.insecure_channel ) channel = create_channel_fn(endpoint, options=options_tuple) else: channel_creds = self._build_channel_credentials() if self.use_asyncio: - channel = grpc.aio.secure_channel( # type: ignore[attr-defined] + channel = grpc.aio.secure_channel( endpoint, credentials=channel_creds, options=options_tuple ) else: From 08baf4d471a3a94520926134e607291a5f403cfe Mon Sep 17 00:00:00 2001 From: Jen Hamon Date: Sun, 16 Nov 2025 21:36:22 -0500 Subject: [PATCH 3/7] Iterate --- .../dataclasses/fetch_by_metadata_response.py | 3 ++- pinecone/db_data/dataclasses/fetch_response.py | 5 +++-- pinecone/grpc/utils.py | 14 ++++++++------ tests/integration/grpc/db/data/test_timeouts.py | 2 +- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/pinecone/db_data/dataclasses/fetch_by_metadata_response.py b/pinecone/db_data/dataclasses/fetch_by_metadata_response.py index 9783a4f01..bda7cf2a9 100644 --- a/pinecone/db_data/dataclasses/fetch_by_metadata_response.py +++ b/pinecone/db_data/dataclasses/fetch_by_metadata_response.py @@ -4,6 +4,7 @@ from .vector import Vector from .utils import DictLike from pinecone.utils.response_info import ResponseInfo +from pinecone.core.openapi.db_data.models import Usage @dataclass @@ -15,7 +16,7 @@ class Pagination(DictLike): class FetchByMetadataResponse(DictLike): namespace: str vectors: Dict[str, Vector] - usage: Dict[str, int] + usage: Optional[Usage] = None pagination: Optional[Pagination] = None _response_info: ResponseInfo = field( default_factory=lambda: cast(ResponseInfo, {"raw_headers": {}}), repr=True, compare=False diff --git a/pinecone/db_data/dataclasses/fetch_response.py b/pinecone/db_data/dataclasses/fetch_response.py index fef301b00..c6627bff8 100644 --- a/pinecone/db_data/dataclasses/fetch_response.py +++ b/pinecone/db_data/dataclasses/fetch_response.py @@ -1,16 +1,17 @@ from dataclasses import dataclass, field -from typing import Dict, cast +from typing import Dict, Optional, cast from .vector import Vector from .utils import DictLike from pinecone.utils.response_info import ResponseInfo +from pinecone.core.openapi.db_data.models import Usage @dataclass class FetchResponse(DictLike): namespace: str vectors: Dict[str, Vector] - usage: Dict[str, int] + usage: Optional[Usage] = None _response_info: ResponseInfo = field( default_factory=lambda: cast(ResponseInfo, {"raw_headers": {}}), repr=True, compare=False ) diff --git a/pinecone/grpc/utils.py b/pinecone/grpc/utils.py index afc80e91f..cf072e862 100644 --- a/pinecone/grpc/utils.py +++ b/pinecone/grpc/utils.py @@ -84,10 +84,11 @@ def parse_fetch_response( metadata = initial_metadata or {} response_info = extract_response_info(metadata) - usage_obj = parse_usage(json_response.get("usage", {})) - usage_dict: Dict[str, int] = {"read_units": usage_obj.read_units} + usage = None + if json_response.get("usage"): + usage = parse_usage(json_response.get("usage", {})) fetch_response = FetchResponse( - vectors=vd, namespace=namespace, usage=usage_dict, _response_info=response_info + vectors=vd, namespace=namespace, usage=usage, _response_info=response_info ) return fetch_response @@ -120,12 +121,13 @@ def parse_fetch_by_metadata_response( metadata = initial_metadata or {} response_info = extract_response_info(metadata) - usage_obj = parse_usage(json_response.get("usage", {})) - usage_dict: Dict[str, int] = {"read_units": usage_obj.read_units} + usage = None + if json_response.get("usage"): + usage = parse_usage(json_response.get("usage", {})) fetch_by_metadata_response = FetchByMetadataResponse( vectors=vd, namespace=namespace, - usage=usage_dict, + usage=usage, pagination=pagination, _response_info=response_info, ) diff --git a/tests/integration/grpc/db/data/test_timeouts.py b/tests/integration/grpc/db/data/test_timeouts.py index a2cdbc9b3..ca51b2354 100644 --- a/tests/integration/grpc/db/data/test_timeouts.py +++ b/tests/integration/grpc/db/data/test_timeouts.py @@ -412,5 +412,5 @@ def test_fetch_with_default_timeout(self, local_idx: GRPCIndex): assert result.vectors["1"].id == "1" assert result.vectors["2"].id == "2" assert result.vectors["3"].id == "3" - assert result.usage.read_units == 1 + assert result.usage["read_units"] == 1 assert result.namespace == "testnamespace" From 64a778972149690d791802dc74e533e225a74605 Mon Sep 17 00:00:00 2001 From: Jen Hamon Date: Mon, 17 Nov 2025 00:33:01 -0500 Subject: [PATCH 4/7] More types --- mypy.ini | 16 ++--- pinecone/openapi_support/api_client.py | 5 +- pinecone/openapi_support/api_client_utils.py | 4 +- .../openapi_support/asyncio_api_client.py | 20 +++++-- pinecone/openapi_support/endpoint_utils.py | 2 +- pinecone/openapi_support/model_utils.py | 58 ++++++++++++------- pinecone/openapi_support/rest_aiohttp.py | 2 +- pinecone/openapi_support/rest_urllib3.py | 1 + pinecone/openapi_support/serializer.py | 8 ++- 9 files changed, 78 insertions(+), 38 deletions(-) diff --git a/mypy.ini b/mypy.ini index 7193fcdf5..e0f14aab6 100644 --- a/mypy.ini +++ b/mypy.ini @@ -15,9 +15,8 @@ strict_equality = True [mypy-pinecone.core.*] ignore_errors = True -# Ignore openapi_support - uses dynamic attributes that mypy can't fully type-check -[mypy-pinecone.openapi_support.*] -ignore_errors = True +# openapi_support uses dynamic attributes but we try to type-check it +# Some errors may need type: ignore comments for truly dynamic behavior # Per-module options for gradual rollout: # These can be enabled module by module as types are added @@ -46,10 +45,10 @@ ignore_missing_imports = True [mypy-pinecone.utils.error_handling] ignore_missing_imports = True -# Handle grpc module - grpc is an optional dependency -# When grpc is not installed, ignore missing imports -# When grpc is installed with grpc-stubs, types are available -[mypy-pinecone.grpc.*] +[mypy-pinecone.grpc.retry] +ignore_missing_imports = True + +[mypy-pinecone.grpc.channel_factory] ignore_missing_imports = True [mypy-pinecone.openapi_support.retry_urllib3] @@ -58,5 +57,8 @@ ignore_missing_imports = True [mypy-pinecone.openapi_support.retry_aiohttp] ignore_missing_imports = True +[mypy-pinecone.openapi_support.rest_aiohttp] +ignore_missing_imports = True + [mypy-aiohttp_retry.*] ignore_missing_imports = True diff --git a/pinecone/openapi_support/api_client.py b/pinecone/openapi_support/api_client.py index d9a21278b..654687a7f 100644 --- a/pinecone/openapi_support/api_client.py +++ b/pinecone/openapi_support/api_client.py @@ -197,7 +197,7 @@ def __call_api( response=response_data, response_type=response_type, config=self.configuration, - _check_type=_check_type, + _check_type=_check_type if _check_type is not None else True, ) else: return_data = None @@ -214,7 +214,8 @@ def __call_api( if isinstance(return_data, dict): return_data["_response_info"] = response_info else: - return_data._response_info = response_info # type: ignore + # Dynamic attribute assignment on OpenAPI models + setattr(return_data, "_response_info", response_info) if _return_http_data_only: return return_data diff --git a/pinecone/openapi_support/api_client_utils.py b/pinecone/openapi_support/api_client_utils.py index b6a736d36..456926a24 100644 --- a/pinecone/openapi_support/api_client_utils.py +++ b/pinecone/openapi_support/api_client_utils.py @@ -109,7 +109,9 @@ def parameters_to_multipart(params, collection_types): :param dict collection_types: Parameter collection types :return: Parameters as list of tuple or urllib3.fields.RequestField """ - new_params = [] + from typing import Union + + new_params: list[Union[RequestField, tuple[Any, Any]]] = [] if collection_types is None: collection_types = dict for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 diff --git a/pinecone/openapi_support/asyncio_api_client.py b/pinecone/openapi_support/asyncio_api_client.py index 92050d72c..9ea812ad5 100644 --- a/pinecone/openapi_support/asyncio_api_client.py +++ b/pinecone/openapi_support/asyncio_api_client.py @@ -161,7 +161,10 @@ async def __call_api( if response_type: Deserializer.decode_response(response_type=response_type, response=response_data) return_data = Deserializer.deserialize( - response_data, response_type, self.configuration, _check_type + response_data, + response_type, + self.configuration, + _check_type if _check_type is not None else True, ) else: return_data = None @@ -178,7 +181,8 @@ async def __call_api( if isinstance(return_data, dict): return_data["_response_info"] = response_info else: - return_data._response_info = response_info # type: ignore + # Dynamic attribute assignment on OpenAPI models + setattr(return_data, "_response_info", response_info) if _return_http_data_only: return return_data @@ -192,7 +196,9 @@ def parameters_to_multipart(self, params, collection_types): :param dict collection_types: Parameter collection types :return: Parameters as list of tuple or urllib3.fields.RequestField """ - new_params = [] + from typing import Union + + new_params: list[Union[RequestField, tuple[Any, Any]]] = [] if collection_types is None: collection_types = dict for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 @@ -374,4 +380,10 @@ async def request( def get_file_data_and_close_file(file_instance: io.IOBase) -> bytes: file_data = file_instance.read() file_instance.close() - return file_data + if isinstance(file_data, bytes): + return file_data + # If read() returns str, encode it + if isinstance(file_data, str): + return file_data.encode("utf-8") + # Fallback: convert to bytes + return bytes(file_data) if file_data is not None else b"" diff --git a/pinecone/openapi_support/endpoint_utils.py b/pinecone/openapi_support/endpoint_utils.py index 867232b68..0e0d2e7a7 100644 --- a/pinecone/openapi_support/endpoint_utils.py +++ b/pinecone/openapi_support/endpoint_utils.py @@ -158,7 +158,7 @@ def raise_if_invalid_inputs( config: Configuration, params_map: EndpointParamsMapDict, allowed_values: AllowedValuesDict, - validations: PropertyValidationTypedDict, + validations: Dict[Tuple[str], PropertyValidationTypedDict], openapi_types: OpenapiTypesDictType, kwargs: Dict[str, Any], ) -> None: diff --git a/pinecone/openapi_support/model_utils.py b/pinecone/openapi_support/model_utils.py index 47a64f670..5c18d22e8 100644 --- a/pinecone/openapi_support/model_utils.py +++ b/pinecone/openapi_support/model_utils.py @@ -191,7 +191,7 @@ def __new__(cls, *args, **kwargs): return oneof_instance visited_composed_classes = kwargs.get("_visited_composed_classes", ()) - discriminator = getattr(cls, "discriminator", None) # type: ignore[attr-defined] + discriminator = getattr(cls, "discriminator", None) if discriminator is None or cls in visited_composed_classes: # Use case 1: this openapi schema (cls) does not have a discriminator # Use case 2: we have already visited this class before and are sure that we @@ -215,7 +215,7 @@ def __new__(cls, *args, **kwargs): # The discriminator name is obtained from the discriminator meta-data # and the discriminator value is obtained from the input data. discr_propertyname_py = list(discriminator.keys())[0] - attribute_map = getattr(cls, "attribute_map", {}) # type: ignore[attr-defined] + attribute_map = getattr(cls, "attribute_map", {}) discr_propertyname_js = attribute_map[discr_propertyname_py] if discr_propertyname_js in kwargs: discr_value = kwargs[discr_propertyname_js] @@ -266,7 +266,7 @@ def __new__(cls, *args, **kwargs): # Build a list containing all oneOf and anyOf descendants. oneof_anyof_classes: tuple = () - composed_schemas = getattr(cls, "_composed_schemas", None) # type: ignore[attr-defined] + composed_schemas = getattr(cls, "_composed_schemas", None) if composed_schemas is not None: oneof_anyof_classes = composed_schemas.get("oneOf", ()) + composed_schemas.get( "anyOf", () @@ -303,7 +303,7 @@ def _new_from_openapi_data(cls, *args, **kwargs): return oneof_instance visited_composed_classes = kwargs.get("_visited_composed_classes", ()) - discriminator = getattr(cls, "discriminator", None) # type: ignore[attr-defined] + discriminator = getattr(cls, "discriminator", None) if discriminator is None or cls in visited_composed_classes: # Use case 1: this openapi schema (cls) does not have a discriminator # Use case 2: we have already visited this class before and are sure that we @@ -327,7 +327,7 @@ def _new_from_openapi_data(cls, *args, **kwargs): # The discriminator name is obtained from the discriminator meta-data # and the discriminator value is obtained from the input data. discr_propertyname_py = list(discriminator.keys())[0] - attribute_map = getattr(cls, "attribute_map", {}) # type: ignore[attr-defined] + attribute_map = getattr(cls, "attribute_map", {}) discr_propertyname_js = attribute_map[discr_propertyname_py] if discr_propertyname_js in kwargs: discr_value = kwargs[discr_propertyname_js] @@ -378,7 +378,7 @@ def _new_from_openapi_data(cls, *args, **kwargs): # Build a list containing all oneOf and anyOf descendants. oneof_anyof_classes: tuple = () - composed_schemas = getattr(cls, "_composed_schemas", None) # type: ignore[attr-defined] + composed_schemas = getattr(cls, "_composed_schemas", None) if composed_schemas is not None: oneof_anyof_classes = composed_schemas.get("oneOf", ()) + composed_schemas.get( "anyOf", () @@ -389,9 +389,9 @@ def _new_from_openapi_data(cls, *args, **kwargs): if composed_schemas and composed_schemas.get("allOf") and oneof_anyof_child: # Validate that we can make self because when we make the # new_cls it will not include the allOf validations in self - self_inst = cls._from_openapi_data(*args, **kwargs) # noqa: F841 + self_inst = cls._from_openapi_data(*args, **kwargs) # type: ignore[attr-defined] # noqa: F841 - new_inst = new_cls._new_from_openapi_data(*args, **kwargs) # type: ignore[attr-defined] + new_inst = new_cls._new_from_openapi_data(*args, **kwargs) return new_inst @@ -793,18 +793,28 @@ def check_allowed_values(allowed_values, input_variable_path, input_values): """ these_allowed_values = list(allowed_values[input_variable_path].values()) if isinstance(input_values, list) and not set(input_values).issubset(set(these_allowed_values)): - invalid_values = (", ".join(map(str, set(input_values) - set(these_allowed_values))),) + invalid_values_tuple = (", ".join(map(str, set(input_values) - set(these_allowed_values))),) raise PineconeApiValueError( "Invalid values for `%s` [%s], must be a subset of [%s]" - % (input_variable_path[0], invalid_values, ", ".join(map(str, these_allowed_values))) + % ( + input_variable_path[0], + invalid_values_tuple, + ", ".join(map(str, these_allowed_values)), + ) ) elif isinstance(input_values, dict) and not set(input_values.keys()).issubset( set(these_allowed_values) ): - invalid_values = ", ".join(map(str, set(input_values.keys()) - set(these_allowed_values))) + invalid_values_str: str = ", ".join( + map(str, set(input_values.keys()) - set(these_allowed_values)) + ) raise PineconeApiValueError( "Invalid keys in `%s` [%s], must be a subset of [%s]" - % (input_variable_path[0], invalid_values, ", ".join(map(str, these_allowed_values))) + % ( + input_variable_path[0], + invalid_values_str, + ", ".join(map(str, these_allowed_values)), + ) ) elif not isinstance(input_values, (list, dict)) and input_values not in these_allowed_values: raise PineconeApiValueError( @@ -1097,19 +1107,21 @@ def get_required_type_classes(required_types_mixed, spec_property_naming): child_types_mixed (list/dict/tuple): describes the valid child types """ - valid_classes = [] - child_req_types_by_current_type = {} + from typing import Any, Type + + valid_classes: list[Type[Any]] = [] + child_req_types_by_current_type: dict[Type[Any], Any] = {} for required_type in required_types_mixed: if isinstance(required_type, list): valid_classes.append(list) - child_req_types_by_current_type[list] = required_type # type: ignore[index] + child_req_types_by_current_type[list] = required_type elif isinstance(required_type, tuple): valid_classes.append(tuple) - child_req_types_by_current_type[tuple] = required_type # type: ignore[index] + child_req_types_by_current_type[tuple] = required_type elif isinstance(required_type, dict): valid_classes.append(dict) - child_req_types_by_current_type[dict] = required_type[str] # type: ignore[index,assignment] + child_req_types_by_current_type[dict] = required_type[str] else: valid_classes.extend(get_possible_classes(required_type, spec_property_naming)) return tuple(valid_classes), child_req_types_by_current_type @@ -1334,8 +1346,8 @@ def deserialize_file(response_data, configuration, content_disposition=None): response_data = response_data.encode("utf-8") f.write(response_data) - f = open(path, "rb") - return f + file_handle: io.BufferedReader = open(path, "rb") + return file_handle def attempt_convert_item( @@ -1593,7 +1605,9 @@ def model_to_dict(model_instance, serialize=True): serialize (bool): if True, the keys in the dict will be values from attribute_map """ - result = {} + from typing import Any + + result: dict[str, Any] = {} model_instances = [model_instance] if hasattr(model_instance, "_composed_schemas") and model_instance._composed_schemas: @@ -1809,7 +1823,9 @@ def get_anyof_instances(self, model_args, constant_args): Returns anyof_instances (list) """ - anyof_instances = [] + from typing import Any + + anyof_instances: list[Any] = [] if len(self._composed_schemas["anyOf"]) == 0: return anyof_instances diff --git a/pinecone/openapi_support/rest_aiohttp.py b/pinecone/openapi_support/rest_aiohttp.py index 8b84e850a..568f40941 100644 --- a/pinecone/openapi_support/rest_aiohttp.py +++ b/pinecone/openapi_support/rest_aiohttp.py @@ -8,7 +8,7 @@ class AiohttpRestClient(RestClientInterface): def __init__(self, configuration: Configuration) -> None: try: - import aiohttp + import aiohttp # type: ignore[import-not-found] from aiohttp_retry import RetryClient from .retry_aiohttp import JitterRetry except ImportError: diff --git a/pinecone/openapi_support/rest_urllib3.py b/pinecone/openapi_support/rest_urllib3.py index e25d80a00..f68341e55 100644 --- a/pinecone/openapi_support/rest_urllib3.py +++ b/pinecone/openapi_support/rest_urllib3.py @@ -178,6 +178,7 @@ def request( content_type = headers.get("Content-Type", "").lower() if content_type == "" or ("json" in content_type): + request_body: str | bytes | None = None if body is None: request_body = None else: diff --git a/pinecone/openapi_support/serializer.py b/pinecone/openapi_support/serializer.py index fa59396ae..52bf5ecda 100644 --- a/pinecone/openapi_support/serializer.py +++ b/pinecone/openapi_support/serializer.py @@ -12,7 +12,13 @@ class Serializer: def get_file_data_and_close_file(file_instance: io.IOBase) -> bytes: file_data = file_instance.read() file_instance.close() - return file_data + if isinstance(file_data, bytes): + return file_data + # If read() returns str, encode it + if isinstance(file_data, str): + return file_data.encode("utf-8") + # Fallback: convert to bytes + return bytes(file_data) if file_data is not None else b"" @classmethod def sanitize_for_serialization(cls, obj) -> Any: From 12363e9b0e34e1471b52d14364389f9cff7ec1be Mon Sep 17 00:00:00 2001 From: Jen Hamon Date: Mon, 17 Nov 2025 01:02:04 -0500 Subject: [PATCH 5/7] Removing exceptions from mypy.ini --- mypy.ini | 30 ------------------------------ pinecone/db_data/index_asyncio.py | 2 +- 2 files changed, 1 insertion(+), 31 deletions(-) diff --git a/mypy.ini b/mypy.ini index e0f14aab6..0012d28c6 100644 --- a/mypy.ini +++ b/mypy.ini @@ -15,12 +15,6 @@ strict_equality = True [mypy-pinecone.core.*] ignore_errors = True -# openapi_support uses dynamic attributes but we try to type-check it -# Some errors may need type: ignore comments for truly dynamic behavior - -# Per-module options for gradual rollout: -# These can be enabled module by module as types are added - [mypy-google.api.*] ignore_missing_imports = True @@ -36,29 +30,5 @@ ignore_missing_imports = True [mypy-grpc.*] ignore_missing_imports = True -# Suppress "Library stubs not installed" errors for modules that have -# type stubs available but may not be installed in all environments -# Note: These should be installed via `uv sync --extra types` for development -[mypy-pinecone.utils.tqdm] -ignore_missing_imports = True - -[mypy-pinecone.utils.error_handling] -ignore_missing_imports = True - -[mypy-pinecone.grpc.retry] -ignore_missing_imports = True - -[mypy-pinecone.grpc.channel_factory] -ignore_missing_imports = True - -[mypy-pinecone.openapi_support.retry_urllib3] -ignore_missing_imports = True - -[mypy-pinecone.openapi_support.retry_aiohttp] -ignore_missing_imports = True - -[mypy-pinecone.openapi_support.rest_aiohttp] -ignore_missing_imports = True - [mypy-aiohttp_retry.*] ignore_missing_imports = True diff --git a/pinecone/db_data/index_asyncio.py b/pinecone/db_data/index_asyncio.py index ebf20a013..4d18e97e4 100644 --- a/pinecone/db_data/index_asyncio.py +++ b/pinecone/db_data/index_asyncio.py @@ -918,7 +918,7 @@ async def delete_namespace(self, namespace: str, **kwargs) -> Dict[str, Any]: @validate_and_convert_errors @require_kwargs - async def list_namespaces( # type: ignore[override] + async def list_namespaces( # type: ignore[override, misc] # mypy limitation: async generators in abstract methods self, limit: Optional[int] = None, **kwargs ) -> AsyncIterator[ListNamespacesResponse]: async for namespace in self.namespace.list(limit=limit, **kwargs): From cfd202fd757a27b51c3c1d1a3f847a61a8c6e40c Mon Sep 17 00:00:00 2001 From: Jen Hamon Date: Mon, 17 Nov 2025 02:02:49 -0500 Subject: [PATCH 6/7] More types --- codegen/build-oas.sh | 54 + codegen/python-oas-templates | 2 +- mypy.ini | 10 +- pinecone/core/openapi/admin/__init__.py | 14 +- .../core/openapi/admin/api/api_keys_api.py | 884 +++-- .../openapi/admin/api/organizations_api.py | 679 ++-- .../core/openapi/admin/api/projects_api.py | 846 +++-- pinecone/core/openapi/admin/apis/__init__.py | 1 + pinecone/core/openapi/admin/model/api_key.py | 133 +- .../admin/model/api_key_with_secret.py | 131 +- .../admin/model/create_api_key_request.py | 127 +- .../admin/model/create_project_request.py | 131 +- .../openapi/admin/model/error_response.py | 131 +- .../admin/model/error_response_error.py | 133 +- .../admin/model/list_api_keys_response.py | 127 +- .../core/openapi/admin/model/organization.py | 151 +- .../openapi/admin/model/organization_list.py | 127 +- pinecone/core/openapi/admin/model/project.py | 158 +- .../core/openapi/admin/model/project_list.py | 127 +- .../admin/model/update_api_key_request.py | 127 +- .../model/update_organization_request.py | 123 +- .../admin/model/update_project_request.py | 131 +- pinecone/core/openapi/db_control/__init__.py | 14 +- .../db_control/api/manage_indexes_api.py | 3157 +++++++++++------ .../core/openapi/db_control/apis/__init__.py | 1 + .../openapi/db_control/model/backup_list.py | 134 +- .../openapi/db_control/model/backup_model.py | 208 +- .../db_control/model/backup_model_schema.py | 131 +- .../model/backup_model_schema_fields.py | 121 +- .../core/openapi/db_control/model/byoc.py | 127 +- .../openapi/db_control/model/byoc_spec.py | 131 +- .../db_control/model/collection_list.py | 127 +- .../db_control/model/collection_model.py | 143 +- .../model/configure_index_request.py | 146 +- .../model/configure_index_request_embed.py | 145 +- .../db_control/model/create_backup_request.py | 125 +- .../model/create_collection_request.py | 127 +- .../model/create_index_for_model_request.py | 170 +- .../create_index_for_model_request_embed.py | 153 +- .../model/create_index_from_backup_request.py | 137 +- .../create_index_from_backup_response.py | 125 +- .../db_control/model/create_index_request.py | 161 +- .../db_control/model/error_response.py | 131 +- .../db_control/model/error_response_error.py | 133 +- .../openapi/db_control/model/index_list.py | 127 +- .../openapi/db_control/model/index_model.py | 188 +- .../db_control/model/index_model_status.py | 125 +- .../openapi/db_control/model/index_spec.py | 187 +- .../openapi/db_control/model/index_tags.py | 121 +- .../db_control/model/model_index_embed.py | 159 +- .../db_control/model/pagination_response.py | 121 +- .../openapi/db_control/model/pod_based.py | 127 +- .../core/openapi/db_control/model/pod_spec.py | 168 +- .../model/pod_spec_metadata_config.py | 121 +- .../openapi/db_control/model/read_capacity.py | 194 +- .../model/read_capacity_dedicated_config.py | 135 +- .../model/read_capacity_dedicated_spec.py | 135 +- .../read_capacity_dedicated_spec_response.py | 140 +- .../model/read_capacity_on_demand_spec.py | 119 +- .../read_capacity_on_demand_spec_response.py | 129 +- .../model/read_capacity_response.py | 201 +- .../db_control/model/read_capacity_status.py | 133 +- .../db_control/model/restore_job_list.py | 134 +- .../db_control/model/restore_job_model.py | 175 +- .../db_control/model/scaling_config_manual.py | 130 +- .../openapi/db_control/model/serverless.py | 127 +- .../db_control/model/serverless_spec.py | 146 +- .../model/serverless_spec_response.py | 146 +- .../openapi/db_control/models/__init__.py | 44 +- pinecone/core/openapi/db_data/__init__.py | 14 +- .../db_data/api/bulk_operations_api.py | 750 ++-- .../db_data/api/namespace_operations_api.py | 730 ++-- .../db_data/api/vector_operations_api.py | 1835 ++++++---- .../core/openapi/db_data/apis/__init__.py | 1 + .../db_data/model/create_namespace_request.py | 135 +- .../model/create_namespace_request_schema.py | 131 +- .../create_namespace_request_schema_fields.py | 121 +- .../openapi/db_data/model/delete_request.py | 139 +- .../model/describe_index_stats_request.py | 125 +- .../model/fetch_by_metadata_request.py | 138 +- .../model/fetch_by_metadata_response.py | 145 +- .../openapi/db_data/model/fetch_response.py | 138 +- pinecone/core/openapi/db_data/model/hit.py | 133 +- .../db_data/model/import_error_mode.py | 121 +- .../openapi/db_data/model/import_model.py | 156 +- .../db_data/model/index_description.py | 155 +- .../db_data/model/list_imports_response.py | 134 +- .../core/openapi/db_data/model/list_item.py | 121 +- .../db_data/model/list_namespaces_response.py | 138 +- .../openapi/db_data/model/list_response.py | 145 +- .../db_data/model/namespace_description.py | 150 +- .../namespace_description_indexed_fields.py | 121 +- .../db_data/model/namespace_summary.py | 121 +- .../core/openapi/db_data/model/pagination.py | 121 +- .../openapi/db_data/model/protobuf_any.py | 125 +- .../openapi/db_data/model/query_request.py | 178 +- .../openapi/db_data/model/query_response.py | 145 +- .../openapi/db_data/model/query_vector.py | 152 +- .../core/openapi/db_data/model/rpc_status.py | 135 +- .../openapi/db_data/model/scored_vector.py | 149 +- .../db_data/model/search_match_terms.py | 125 +- .../db_data/model/search_records_request.py | 148 +- .../model/search_records_request_query.py | 161 +- .../model/search_records_request_rerank.py | 141 +- .../db_data/model/search_records_response.py | 138 +- .../model/search_records_response_result.py | 127 +- .../db_data/model/search_records_vector.py | 135 +- .../openapi/db_data/model/search_usage.py | 138 +- .../db_data/model/single_query_results.py | 131 +- .../openapi/db_data/model/sparse_values.py | 128 +- .../db_data/model/start_import_request.py | 141 +- .../db_data/model/start_import_response.py | 123 +- .../openapi/db_data/model/update_request.py | 164 +- .../openapi/db_data/model/update_response.py | 121 +- .../openapi/db_data/model/upsert_record.py | 121 +- .../openapi/db_data/model/upsert_request.py | 133 +- .../openapi/db_data/model/upsert_response.py | 121 +- pinecone/core/openapi/db_data/model/usage.py | 121 +- pinecone/core/openapi/db_data/model/vector.py | 148 +- .../openapi/db_data/model/vector_values.py | 111 +- .../core/openapi/db_data/models/__init__.py | 28 +- pinecone/core/openapi/inference/__init__.py | 14 +- .../openapi/inference/api/inference_api.py | 690 ++-- .../core/openapi/inference/apis/__init__.py | 1 + .../inference/model/dense_embedding.py | 125 +- .../core/openapi/inference/model/document.py | 123 +- .../openapi/inference/model/embed_request.py | 139 +- .../inference/model/embed_request_inputs.py | 121 +- .../core/openapi/inference/model/embedding.py | 191 +- .../inference/model/embeddings_list.py | 142 +- .../inference/model/embeddings_list_usage.py | 122 +- .../openapi/inference/model/error_response.py | 131 +- .../inference/model/error_response_error.py | 133 +- .../openapi/inference/model/model_info.py | 200 +- .../inference/model/model_info_list.py | 127 +- .../model/model_info_supported_metrics.py | 109 +- .../model/model_info_supported_parameter.py | 153 +- .../inference/model/ranked_document.py | 135 +- .../openapi/inference/model/rerank_request.py | 155 +- .../openapi/inference/model/rerank_result.py | 138 +- .../inference/model/rerank_result_usage.py | 122 +- .../inference/model/sparse_embedding.py | 137 +- .../core/openapi/inference/models/__init__.py | 8 +- pinecone/core/openapi/oauth/__init__.py | 14 +- pinecone/core/openapi/oauth/api/o_auth_api.py | 180 +- pinecone/core/openapi/oauth/apis/__init__.py | 1 + .../openapi/oauth/model/error_response.py | 125 +- .../core/openapi/oauth/model/token_request.py | 137 +- .../openapi/oauth/model/token_response.py | 133 +- 149 files changed, 15642 insertions(+), 11496 deletions(-) diff --git a/codegen/build-oas.sh b/codegen/build-oas.sh index e627b2d9e..f1fc1842e 100755 --- a/codegen/build-oas.sh +++ b/codegen/build-oas.sh @@ -86,6 +86,60 @@ generate_client() { sed -i '' "s/bool, date, datetime, dict, float, int, list, str, none_type/bool, dict, float, int, list, str, none_type/g" "$file" done + # Fix invalid dict type annotations in return types and casts + # Replace {str: (bool, dict, float, int, list, str, none_type)} with Dict[str, Any] + find "${build_dir}" -name "*.py" | while IFS= read -r file; do + # Need to escape the braces and parentheses for sed + sed -i '' 's/{str: (bool, dict, float, int, list, str, none_type)}/Dict[str, Any]/g' "$file" + done + + # Remove globals() assignments from TYPE_CHECKING blocks + # These should only be in lazy_import() functions, not in TYPE_CHECKING blocks + find "${build_dir}" -name "*.py" | while IFS= read -r file; do + python3 < APIKeyWithSecret | ApplyResult[APIKeyWithSecret]: """Create an API key # noqa: E501 @@ -94,56 +92,85 @@ 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['project_id'] = \ + project_id + kwargs['create_api_key_request'] = \ + create_api_key_request + return cast(APIKeyWithSecret | ApplyResult[APIKeyWithSecret], self.call_with_http_info(**kwargs)) self.create_api_key = _Endpoint( settings={ - "response_type": (APIKeyWithSecret,), - "auth": ["BearerAuth"], - "endpoint_path": "/admin/projects/{project_id}/api-keys", - "operation_id": "create_api_key", - "http_method": "POST", - "servers": None, + 'response_type': (APIKeyWithSecret,), + 'auth': [ + 'BearerAuth' + ], + 'endpoint_path': '/admin/projects/{project_id}/api-keys', + 'operation_id': 'create_api_key', + 'http_method': 'POST', + 'servers': None, }, params_map={ - "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": [], + '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': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_pinecone_api_version": (str,), - "project_id": (str,), - "create_api_key_request": (CreateAPIKeyRequest,), + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'x_pinecone_api_version': + (str,), + 'project_id': + (str,), + 'create_api_key_request': + (CreateAPIKeyRequest,), }, - "attribute_map": { - "x_pinecone_api_version": "X-Pinecone-Api-Version", - "project_id": "project_id", + '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", + 'location_map': { + 'x_pinecone_api_version': 'header', + 'project_id': 'path', + 'create_api_key_request': 'body', }, - "collection_format_map": {}, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__create_api_key, + callable=__create_api_key ) def __delete_api_key( self, api_key_id, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict, + **kwargs: ExtraOpenApiKwargsTypedDict ) -> None: """Delete an API key # noqa: E501 @@ -182,47 +209,76 @@ def __delete_api_key( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['api_key_id'] = \ + api_key_id + return cast(None, self.call_with_http_info(**kwargs)) self.delete_api_key = _Endpoint( settings={ - "response_type": None, - "auth": ["BearerAuth"], - "endpoint_path": "/admin/api-keys/{api_key_id}", - "operation_id": "delete_api_key", - "http_method": "DELETE", - "servers": None, + 'response_type': None, + 'auth': [ + 'BearerAuth' + ], + 'endpoint_path': '/admin/api-keys/{api_key_id}', + 'operation_id': 'delete_api_key', + 'http_method': 'DELETE', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "api_key_id"], - "required": ["x_pinecone_api_version", "api_key_id"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'api_key_id', + ], + 'required': [ + 'x_pinecone_api_version', + 'api_key_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "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", + 'validations': { + }, + 'allowed_values': { + }, + '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": {}, + 'location_map': { + 'x_pinecone_api_version': 'header', + 'api_key_id': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], }, - headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__delete_api_key, + callable=__delete_api_key ) def __fetch_api_key( self, api_key_id, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict, + **kwargs: ExtraOpenApiKwargsTypedDict ) -> APIKey | ApplyResult[APIKey]: """Get API key details # noqa: E501 @@ -261,47 +317,76 @@ def __fetch_api_key( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['api_key_id'] = \ + api_key_id + return cast(APIKey | ApplyResult[APIKey], self.call_with_http_info(**kwargs)) self.fetch_api_key = _Endpoint( settings={ - "response_type": (APIKey,), - "auth": ["BearerAuth"], - "endpoint_path": "/admin/api-keys/{api_key_id}", - "operation_id": "fetch_api_key", - "http_method": "GET", - "servers": None, + 'response_type': (APIKey,), + 'auth': [ + 'BearerAuth' + ], + 'endpoint_path': '/admin/api-keys/{api_key_id}', + 'operation_id': 'fetch_api_key', + 'http_method': 'GET', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "api_key_id"], - "required": ["x_pinecone_api_version", "api_key_id"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'api_key_id', + ], + 'required': [ + 'x_pinecone_api_version', + 'api_key_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "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", + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'x_pinecone_api_version': + (str,), + 'api_key_id': + (str,), }, - "location_map": {"x_pinecone_api_version": "header", "api_key_id": "path"}, - "collection_format_map": {}, + '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': [], }, - headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__fetch_api_key, + callable=__fetch_api_key ) def __list_project_api_keys( self, project_id, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict, + **kwargs: ExtraOpenApiKwargsTypedDict ) -> ListApiKeysResponse | ApplyResult[ListApiKeysResponse]: """List API keys # noqa: E501 @@ -340,40 +425,69 @@ def __list_project_api_keys( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['project_id'] = \ + project_id + return cast(ListApiKeysResponse | ApplyResult[ListApiKeysResponse], self.call_with_http_info(**kwargs)) self.list_project_api_keys = _Endpoint( settings={ - "response_type": (ListApiKeysResponse,), - "auth": ["BearerAuth"], - "endpoint_path": "/admin/projects/{project_id}/api-keys", - "operation_id": "list_project_api_keys", - "http_method": "GET", - "servers": None, + 'response_type': (ListApiKeysResponse,), + 'auth': [ + 'BearerAuth' + ], + 'endpoint_path': '/admin/projects/{project_id}/api-keys', + 'operation_id': 'list_project_api_keys', + 'http_method': 'GET', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "project_id"], - "required": ["x_pinecone_api_version", "project_id"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'project_id', + ], + 'required': [ + 'x_pinecone_api_version', + 'project_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": {"x_pinecone_api_version": (str,), "project_id": (str,)}, - "attribute_map": { - "x_pinecone_api_version": "X-Pinecone-Api-Version", - "project_id": "project_id", + 'validations': { + }, + 'allowed_values': { }, - "location_map": {"x_pinecone_api_version": "header", "project_id": "path"}, - "collection_format_map": {}, + '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': [], }, - headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__list_project_api_keys, + callable=__list_project_api_keys ) def __update_api_key( @@ -381,7 +495,7 @@ def __update_api_key( api_key_id, update_api_key_request, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict, + **kwargs: ExtraOpenApiKwargsTypedDict ) -> APIKey | ApplyResult[APIKey]: """Update an API key # noqa: E501 @@ -421,52 +535,82 @@ def __update_api_key( 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) + 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 cast(APIKey | ApplyResult[APIKey], 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, + '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": [], + '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,), + 'validations': { }, - "attribute_map": { - "x_pinecone_api_version": "X-Pinecone-Api-Version", - "api_key_id": "api_key_id", + 'allowed_values': { }, - "location_map": { - "x_pinecone_api_version": "header", - "api_key_id": "path", - "update_api_key_request": "body", + 'openapi_types': { + 'x_pinecone_api_version': + (str,), + 'api_key_id': + (str,), + 'update_api_key_request': + (UpdateAPIKeyRequest,), }, - "collection_format_map": {}, + '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' + ] }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__update_api_key, + callable=__update_api_key ) + class AsyncioAPIKeysApi: """NOTE: This class is @generated using OpenAPI @@ -479,7 +623,11 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client async def __create_api_key( - self, project_id, create_api_key_request, x_pinecone_api_version="2025-10", **kwargs + self, + project_id, + create_api_key_request, + x_pinecone_api_version="2025-10", + **kwargs ) -> APIKeyWithSecret: """Create an API key # noqa: E501 @@ -512,53 +660,85 @@ async def __create_api_key( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['project_id'] = \ + project_id + kwargs['create_api_key_request'] = \ + create_api_key_request + return cast(APIKeyWithSecret, await self.call_with_http_info(**kwargs)) self.create_api_key = _AsyncioEndpoint( settings={ - "response_type": (APIKeyWithSecret,), - "auth": ["BearerAuth"], - "endpoint_path": "/admin/projects/{project_id}/api-keys", - "operation_id": "create_api_key", - "http_method": "POST", - "servers": None, + 'response_type': (APIKeyWithSecret,), + 'auth': [ + 'BearerAuth' + ], + 'endpoint_path': '/admin/projects/{project_id}/api-keys', + 'operation_id': 'create_api_key', + 'http_method': 'POST', + 'servers': None, }, params_map={ - "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": [], + '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': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_pinecone_api_version": (str,), - "project_id": (str,), - "create_api_key_request": (CreateAPIKeyRequest,), + 'validations': { }, - "attribute_map": { - "x_pinecone_api_version": "X-Pinecone-Api-Version", - "project_id": "project_id", + 'allowed_values': { }, - "location_map": { - "x_pinecone_api_version": "header", - "project_id": "path", - "create_api_key_request": "body", + 'openapi_types': { + 'x_pinecone_api_version': + (str,), + 'project_id': + (str,), + 'create_api_key_request': + (CreateAPIKeyRequest,), }, - "collection_format_map": {}, + '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' + ] }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__create_api_key, + callable=__create_api_key ) async def __delete_api_key( - self, api_key_id, x_pinecone_api_version="2025-10", **kwargs + self, + api_key_id, + x_pinecone_api_version="2025-10", + **kwargs ) -> None: """Delete an API key # noqa: E501 @@ -590,44 +770,76 @@ async def __delete_api_key( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['api_key_id'] = \ + api_key_id + return cast(None, await self.call_with_http_info(**kwargs)) self.delete_api_key = _AsyncioEndpoint( settings={ - "response_type": None, - "auth": ["BearerAuth"], - "endpoint_path": "/admin/api-keys/{api_key_id}", - "operation_id": "delete_api_key", - "http_method": "DELETE", - "servers": None, + 'response_type': None, + 'auth': [ + 'BearerAuth' + ], + 'endpoint_path': '/admin/api-keys/{api_key_id}', + 'operation_id': 'delete_api_key', + 'http_method': 'DELETE', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "api_key_id"], - "required": ["x_pinecone_api_version", "api_key_id"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'api_key_id', + ], + 'required': [ + 'x_pinecone_api_version', + 'api_key_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "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", + 'validations': { + }, + 'allowed_values': { }, - "location_map": {"x_pinecone_api_version": "header", "api_key_id": "path"}, - "collection_format_map": {}, + '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': [], }, - headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__delete_api_key, + callable=__delete_api_key ) async def __fetch_api_key( - self, api_key_id, x_pinecone_api_version="2025-10", **kwargs + self, + api_key_id, + x_pinecone_api_version="2025-10", + **kwargs ) -> APIKey: """Get API key details # noqa: E501 @@ -659,44 +871,76 @@ async def __fetch_api_key( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['api_key_id'] = \ + api_key_id + return cast(APIKey, await self.call_with_http_info(**kwargs)) self.fetch_api_key = _AsyncioEndpoint( settings={ - "response_type": (APIKey,), - "auth": ["BearerAuth"], - "endpoint_path": "/admin/api-keys/{api_key_id}", - "operation_id": "fetch_api_key", - "http_method": "GET", - "servers": None, + 'response_type': (APIKey,), + 'auth': [ + 'BearerAuth' + ], + 'endpoint_path': '/admin/api-keys/{api_key_id}', + 'operation_id': 'fetch_api_key', + 'http_method': 'GET', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "api_key_id"], - "required": ["x_pinecone_api_version", "api_key_id"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'api_key_id', + ], + 'required': [ + 'x_pinecone_api_version', + 'api_key_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "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", + 'validations': { + }, + 'allowed_values': { }, - "location_map": {"x_pinecone_api_version": "header", "api_key_id": "path"}, - "collection_format_map": {}, + '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': [], }, - headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__fetch_api_key, + callable=__fetch_api_key ) async def __list_project_api_keys( - self, project_id, x_pinecone_api_version="2025-10", **kwargs + self, + project_id, + x_pinecone_api_version="2025-10", + **kwargs ) -> ListApiKeysResponse: """List API keys # noqa: E501 @@ -728,44 +972,77 @@ async def __list_project_api_keys( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['project_id'] = \ + project_id + return cast(ListApiKeysResponse, await self.call_with_http_info(**kwargs)) self.list_project_api_keys = _AsyncioEndpoint( settings={ - "response_type": (ListApiKeysResponse,), - "auth": ["BearerAuth"], - "endpoint_path": "/admin/projects/{project_id}/api-keys", - "operation_id": "list_project_api_keys", - "http_method": "GET", - "servers": None, + 'response_type': (ListApiKeysResponse,), + 'auth': [ + 'BearerAuth' + ], + 'endpoint_path': '/admin/projects/{project_id}/api-keys', + 'operation_id': 'list_project_api_keys', + 'http_method': 'GET', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "project_id"], - "required": ["x_pinecone_api_version", "project_id"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'project_id', + ], + 'required': [ + 'x_pinecone_api_version', + 'project_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": {"x_pinecone_api_version": (str,), "project_id": (str,)}, - "attribute_map": { - "x_pinecone_api_version": "X-Pinecone-Api-Version", - "project_id": "project_id", + 'validations': { + }, + 'allowed_values': { }, - "location_map": {"x_pinecone_api_version": "header", "project_id": "path"}, - "collection_format_map": {}, + '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': [], }, - headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__list_project_api_keys, + callable=__list_project_api_keys ) async def __update_api_key( - self, api_key_id, update_api_key_request, x_pinecone_api_version="2025-10", **kwargs + self, + api_key_id, + update_api_key_request, + x_pinecone_api_version="2025-10", + **kwargs ) -> APIKey: """Update an API key # noqa: E501 @@ -798,47 +1075,76 @@ async def __update_api_key( 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) + 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 cast(APIKey, 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, + '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": [], + '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,), + 'validations': { }, - "attribute_map": { - "x_pinecone_api_version": "X-Pinecone-Api-Version", - "api_key_id": "api_key_id", + 'allowed_values': { }, - "location_map": { - "x_pinecone_api_version": "header", - "api_key_id": "path", - "update_api_key_request": "body", + 'openapi_types': { + 'x_pinecone_api_version': + (str,), + 'api_key_id': + (str,), + 'update_api_key_request': + (UpdateAPIKeyRequest,), }, - "collection_format_map": {}, + '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' + ] }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__update_api_key, + callable=__update_api_key ) diff --git a/pinecone/core/openapi/admin/api/organizations_api.py b/pinecone/core/openapi/admin/api/organizations_api.py index f1d393e2a..7a6ecc0b7 100644 --- a/pinecone/core/openapi/admin/api/organizations_api.py +++ b/pinecone/core/openapi/admin/api/organizations_api.py @@ -1,26 +1,24 @@ """ -Pinecone Admin API + Pinecone Admin API -Provides an API for managing a Pinecone organization and its resources. # noqa: E501 + Provides an API for managing a Pinecone organization and its resources. # noqa: E501 -This file is @generated using OpenAPI. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from __future__ import annotations -from typing import TYPE_CHECKING +from typing import TYPE_CHECKING, Any, Dict, cast if TYPE_CHECKING: from multiprocessing.pool import ApplyResult from pinecone.openapi_support import ApiClient, AsyncioApiClient -from pinecone.openapi_support.endpoint_utils import ( - ExtraOpenApiKwargsTypedDict, - KwargsWithOpenApiKwargDefaultsTypedDict, -) +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 @@ -28,7 +26,7 @@ datetime, file_type, none_type, - validate_and_convert_types, + validate_and_convert_types ) from pinecone.core.openapi.admin.model.error_response import ErrorResponse from pinecone.core.openapi.admin.model.organization import Organization @@ -51,7 +49,7 @@ def __delete_organization( self, organization_id, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict, + **kwargs: ExtraOpenApiKwargsTypedDict ) -> None: """Delete an organization # noqa: E501 @@ -90,47 +88,76 @@ def __delete_organization( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['organization_id'] = \ + organization_id + return cast(None, 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, + '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": [], + '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", + 'validations': { }, - "location_map": {"x_pinecone_api_version": "header", "organization_id": "path"}, - "collection_format_map": {}, + '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': [], }, - headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__delete_organization, + callable=__delete_organization ) def __fetch_organization( self, organization_id, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict, + **kwargs: ExtraOpenApiKwargsTypedDict ) -> Organization | ApplyResult[Organization]: """Get organization details # noqa: E501 @@ -169,44 +196,75 @@ def __fetch_organization( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['organization_id'] = \ + organization_id + return cast(Organization | ApplyResult[Organization], 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, + '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": [], + '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", + 'validations': { + }, + 'allowed_values': { }, - "location_map": {"x_pinecone_api_version": "header", "organization_id": "path"}, - "collection_format_map": {}, + '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': [], }, - headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__fetch_organization, + callable=__fetch_organization ) def __list_organizations( - self, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict + self, + x_pinecone_api_version="2025-10", + **kwargs: ExtraOpenApiKwargsTypedDict ) -> OrganizationList | ApplyResult[OrganizationList]: """List organizations # noqa: E501 @@ -244,36 +302,61 @@ def __list_organizations( thread. """ kwargs = self._process_openapi_kwargs(kwargs) - kwargs["x_pinecone_api_version"] = x_pinecone_api_version - return self.call_with_http_info(**kwargs) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + return cast(OrganizationList | ApplyResult[OrganizationList], 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, + '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": [], + '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": []}, + '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, + callable=__list_organizations ) def __update_organization( @@ -281,7 +364,7 @@ def __update_organization( organization_id, update_organization_request, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict, + **kwargs: ExtraOpenApiKwargsTypedDict ) -> Organization | ApplyResult[Organization]: """Update an organization # noqa: E501 @@ -321,56 +404,82 @@ def __update_organization( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['organization_id'] = \ + organization_id + kwargs['update_organization_request'] = \ + update_organization_request + return cast(Organization | ApplyResult[Organization], 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, + '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", + 'all': [ + 'x_pinecone_api_version', + 'organization_id', + 'update_organization_request', + ], + 'required': [ + 'x_pinecone_api_version', + 'organization_id', + 'update_organization_request', ], - "nullable": [], - "enum": [], - "validation": [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_pinecone_api_version": (str,), - "organization_id": (str,), - "update_organization_request": (UpdateOrganizationRequest,), + 'validations': { + }, + 'allowed_values': { }, - "attribute_map": { - "x_pinecone_api_version": "X-Pinecone-Api-Version", - "organization_id": "organization_id", + 'openapi_types': { + 'x_pinecone_api_version': + (str,), + 'organization_id': + (str,), + 'update_organization_request': + (UpdateOrganizationRequest,), }, - "location_map": { - "x_pinecone_api_version": "header", - "organization_id": "path", - "update_organization_request": "body", + 'attribute_map': { + 'x_pinecone_api_version': 'X-Pinecone-Api-Version', + 'organization_id': 'organization_id', }, - "collection_format_map": {}, + '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' + ] }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__update_organization, + callable=__update_organization ) + class AsyncioOrganizationsApi: """NOTE: This class is @generated using OpenAPI @@ -383,7 +492,10 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client async def __delete_organization( - self, organization_id, x_pinecone_api_version="2025-10", **kwargs + self, + organization_id, + x_pinecone_api_version="2025-10", + **kwargs ) -> None: """Delete an organization # noqa: E501 @@ -415,44 +527,76 @@ async def __delete_organization( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['organization_id'] = \ + organization_id + return cast(None, 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, + '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": [], + '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", + 'validations': { + }, + 'allowed_values': { }, - "location_map": {"x_pinecone_api_version": "header", "organization_id": "path"}, - "collection_format_map": {}, + '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': [], }, - headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__delete_organization, + callable=__delete_organization ) async def __fetch_organization( - self, organization_id, x_pinecone_api_version="2025-10", **kwargs + self, + organization_id, + x_pinecone_api_version="2025-10", + **kwargs ) -> Organization: """Get organization details # noqa: E501 @@ -484,44 +628,75 @@ async def __fetch_organization( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['organization_id'] = \ + organization_id + return cast(Organization, 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, + '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": [], + '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", + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'x_pinecone_api_version': + (str,), + 'organization_id': + (str,), }, - "location_map": {"x_pinecone_api_version": "header", "organization_id": "path"}, - "collection_format_map": {}, + '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': [], }, - headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__fetch_organization, + callable=__fetch_organization ) async def __list_organizations( - self, x_pinecone_api_version="2025-10", **kwargs + self, + x_pinecone_api_version="2025-10", + **kwargs ) -> OrganizationList: """List organizations # noqa: E501 @@ -552,36 +727,61 @@ async def __list_organizations( OrganizationList """ self._process_openapi_kwargs(kwargs) - kwargs["x_pinecone_api_version"] = x_pinecone_api_version - return await self.call_with_http_info(**kwargs) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + return cast(OrganizationList, 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, + '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": [], + '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": []}, + '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, + callable=__list_organizations ) async def __update_organization( @@ -589,7 +789,7 @@ async def __update_organization( organization_id, update_organization_request, x_pinecone_api_version="2025-10", - **kwargs, + **kwargs ) -> Organization: """Update an organization # noqa: E501 @@ -622,51 +822,76 @@ async def __update_organization( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['organization_id'] = \ + organization_id + kwargs['update_organization_request'] = \ + update_organization_request + return cast(Organization, 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, + '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", + 'all': [ + 'x_pinecone_api_version', + 'organization_id', + 'update_organization_request', + ], + 'required': [ + 'x_pinecone_api_version', + 'organization_id', + 'update_organization_request', ], - "nullable": [], - "enum": [], - "validation": [], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_pinecone_api_version": (str,), - "organization_id": (str,), - "update_organization_request": (UpdateOrganizationRequest,), + 'validations': { + }, + 'allowed_values': { }, - "attribute_map": { - "x_pinecone_api_version": "X-Pinecone-Api-Version", - "organization_id": "organization_id", + 'openapi_types': { + 'x_pinecone_api_version': + (str,), + 'organization_id': + (str,), + 'update_organization_request': + (UpdateOrganizationRequest,), }, - "location_map": { - "x_pinecone_api_version": "header", - "organization_id": "path", - "update_organization_request": "body", + 'attribute_map': { + 'x_pinecone_api_version': 'X-Pinecone-Api-Version', + 'organization_id': 'organization_id', }, - "collection_format_map": {}, + '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' + ] }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__update_organization, + callable=__update_organization ) diff --git a/pinecone/core/openapi/admin/api/projects_api.py b/pinecone/core/openapi/admin/api/projects_api.py index 4d2c18d46..3d46f8939 100644 --- a/pinecone/core/openapi/admin/api/projects_api.py +++ b/pinecone/core/openapi/admin/api/projects_api.py @@ -1,26 +1,24 @@ """ -Pinecone Admin API + Pinecone Admin API -Provides an API for managing a Pinecone organization and its resources. # noqa: E501 + Provides an API for managing a Pinecone organization and its resources. # noqa: E501 -This file is @generated using OpenAPI. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from __future__ import annotations -from typing import TYPE_CHECKING +from typing import TYPE_CHECKING, Any, Dict, cast if TYPE_CHECKING: from multiprocessing.pool import ApplyResult from pinecone.openapi_support import ApiClient, AsyncioApiClient -from pinecone.openapi_support.endpoint_utils import ( - ExtraOpenApiKwargsTypedDict, - KwargsWithOpenApiKwargDefaultsTypedDict, -) +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 @@ -28,7 +26,7 @@ datetime, file_type, none_type, - validate_and_convert_types, + validate_and_convert_types ) from pinecone.core.openapi.admin.model.create_project_request import CreateProjectRequest from pinecone.core.openapi.admin.model.error_response import ErrorResponse @@ -52,7 +50,7 @@ def __create_project( self, create_project_request, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict, + **kwargs: ExtraOpenApiKwargsTypedDict ) -> Project | ApplyResult[Project]: """Create a new project # noqa: E501 @@ -91,50 +89,77 @@ def __create_project( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['create_project_request'] = \ + create_project_request + return cast(Project | ApplyResult[Project], self.call_with_http_info(**kwargs)) self.create_project = _Endpoint( settings={ - "response_type": (Project,), - "auth": ["BearerAuth"], - "endpoint_path": "/admin/projects", - "operation_id": "create_project", - "http_method": "POST", - "servers": None, + 'response_type': (Project,), + 'auth': [ + 'BearerAuth' + ], + 'endpoint_path': '/admin/projects', + 'operation_id': 'create_project', + 'http_method': 'POST', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "create_project_request"], - "required": ["x_pinecone_api_version", "create_project_request"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'create_project_request', + ], + 'required': [ + 'x_pinecone_api_version', + 'create_project_request', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_pinecone_api_version": (str,), - "create_project_request": (CreateProjectRequest,), + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'x_pinecone_api_version': + (str,), + 'create_project_request': + (CreateProjectRequest,), + }, + 'attribute_map': { + 'x_pinecone_api_version': 'X-Pinecone-Api-Version', }, - "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, - "location_map": { - "x_pinecone_api_version": "header", - "create_project_request": "body", + 'location_map': { + 'x_pinecone_api_version': 'header', + 'create_project_request': 'body', }, - "collection_format_map": {}, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__create_project, + callable=__create_project ) def __delete_project( self, project_id, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict, + **kwargs: ExtraOpenApiKwargsTypedDict ) -> None: """Delete a project # noqa: E501 @@ -173,47 +198,76 @@ def __delete_project( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['project_id'] = \ + project_id + return cast(None, self.call_with_http_info(**kwargs)) self.delete_project = _Endpoint( settings={ - "response_type": None, - "auth": ["BearerAuth"], - "endpoint_path": "/admin/projects/{project_id}", - "operation_id": "delete_project", - "http_method": "DELETE", - "servers": None, + 'response_type': None, + 'auth': [ + 'BearerAuth' + ], + 'endpoint_path': '/admin/projects/{project_id}', + 'operation_id': 'delete_project', + 'http_method': 'DELETE', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "project_id"], - "required": ["x_pinecone_api_version", "project_id"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'project_id', + ], + 'required': [ + 'x_pinecone_api_version', + 'project_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": {"x_pinecone_api_version": (str,), "project_id": (str,)}, - "attribute_map": { - "x_pinecone_api_version": "X-Pinecone-Api-Version", - "project_id": "project_id", + 'validations': { + }, + 'allowed_values': { + }, + '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": {}, + 'location_map': { + 'x_pinecone_api_version': 'header', + 'project_id': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], }, - headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__delete_project, + callable=__delete_project ) def __fetch_project( self, project_id, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict, + **kwargs: ExtraOpenApiKwargsTypedDict ) -> Project | ApplyResult[Project]: """Get project details # noqa: E501 @@ -252,44 +306,75 @@ def __fetch_project( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['project_id'] = \ + project_id + return cast(Project | ApplyResult[Project], self.call_with_http_info(**kwargs)) self.fetch_project = _Endpoint( settings={ - "response_type": (Project,), - "auth": ["BearerAuth"], - "endpoint_path": "/admin/projects/{project_id}", - "operation_id": "fetch_project", - "http_method": "GET", - "servers": None, + 'response_type': (Project,), + 'auth': [ + 'BearerAuth' + ], + 'endpoint_path': '/admin/projects/{project_id}', + 'operation_id': 'fetch_project', + 'http_method': 'GET', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "project_id"], - "required": ["x_pinecone_api_version", "project_id"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'project_id', + ], + 'required': [ + 'x_pinecone_api_version', + 'project_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": {"x_pinecone_api_version": (str,), "project_id": (str,)}, - "attribute_map": { - "x_pinecone_api_version": "X-Pinecone-Api-Version", - "project_id": "project_id", + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'x_pinecone_api_version': + (str,), + 'project_id': + (str,), }, - "location_map": {"x_pinecone_api_version": "header", "project_id": "path"}, - "collection_format_map": {}, + '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': [], }, - headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__fetch_project, + callable=__fetch_project ) def __list_projects( - self, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict + self, + x_pinecone_api_version="2025-10", + **kwargs: ExtraOpenApiKwargsTypedDict ) -> ProjectList | ApplyResult[ProjectList]: """List projects # noqa: E501 @@ -327,36 +412,61 @@ def __list_projects( thread. """ kwargs = self._process_openapi_kwargs(kwargs) - kwargs["x_pinecone_api_version"] = x_pinecone_api_version - return self.call_with_http_info(**kwargs) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + return cast(ProjectList | ApplyResult[ProjectList], self.call_with_http_info(**kwargs)) self.list_projects = _Endpoint( settings={ - "response_type": (ProjectList,), - "auth": ["BearerAuth"], - "endpoint_path": "/admin/projects", - "operation_id": "list_projects", - "http_method": "GET", - "servers": None, + 'response_type': (ProjectList,), + 'auth': [ + 'BearerAuth' + ], + 'endpoint_path': '/admin/projects', + 'operation_id': 'list_projects', + 'http_method': 'GET', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version"], - "required": ["x_pinecone_api_version"], - "nullable": [], - "enum": [], - "validation": [], + '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": []}, + '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_projects, + callable=__list_projects ) def __update_project( @@ -364,7 +474,7 @@ def __update_project( project_id, update_project_request, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict, + **kwargs: ExtraOpenApiKwargsTypedDict ) -> Project | ApplyResult[Project]: """Update a project # noqa: E501 @@ -404,52 +514,82 @@ 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['project_id'] = \ + project_id + kwargs['update_project_request'] = \ + update_project_request + return cast(Project | ApplyResult[Project], self.call_with_http_info(**kwargs)) self.update_project = _Endpoint( settings={ - "response_type": (Project,), - "auth": ["BearerAuth"], - "endpoint_path": "/admin/projects/{project_id}", - "operation_id": "update_project", - "http_method": "PATCH", - "servers": None, + 'response_type': (Project,), + 'auth': [ + 'BearerAuth' + ], + 'endpoint_path': '/admin/projects/{project_id}', + 'operation_id': 'update_project', + 'http_method': 'PATCH', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "project_id", "update_project_request"], - "required": ["x_pinecone_api_version", "project_id", "update_project_request"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'project_id', + 'update_project_request', + ], + 'required': [ + 'x_pinecone_api_version', + 'project_id', + 'update_project_request', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_pinecone_api_version": (str,), - "project_id": (str,), - "update_project_request": (UpdateProjectRequest,), + 'validations': { + }, + 'allowed_values': { }, - "attribute_map": { - "x_pinecone_api_version": "X-Pinecone-Api-Version", - "project_id": "project_id", + 'openapi_types': { + 'x_pinecone_api_version': + (str,), + 'project_id': + (str,), + 'update_project_request': + (UpdateProjectRequest,), }, - "location_map": { - "x_pinecone_api_version": "header", - "project_id": "path", - "update_project_request": "body", + 'attribute_map': { + 'x_pinecone_api_version': 'X-Pinecone-Api-Version', + 'project_id': 'project_id', }, - "collection_format_map": {}, + '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' + ] }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__update_project, + callable=__update_project ) + class AsyncioProjectsApi: """NOTE: This class is @generated using OpenAPI @@ -462,7 +602,10 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client async def __create_project( - self, create_project_request, x_pinecone_api_version="2025-10", **kwargs + self, + create_project_request, + x_pinecone_api_version="2025-10", + **kwargs ) -> Project: """Create a new project # noqa: E501 @@ -494,47 +637,77 @@ async def __create_project( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['create_project_request'] = \ + create_project_request + return cast(Project, await self.call_with_http_info(**kwargs)) self.create_project = _AsyncioEndpoint( settings={ - "response_type": (Project,), - "auth": ["BearerAuth"], - "endpoint_path": "/admin/projects", - "operation_id": "create_project", - "http_method": "POST", - "servers": None, + 'response_type': (Project,), + 'auth': [ + 'BearerAuth' + ], + 'endpoint_path': '/admin/projects', + 'operation_id': 'create_project', + 'http_method': 'POST', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "create_project_request"], - "required": ["x_pinecone_api_version", "create_project_request"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'create_project_request', + ], + 'required': [ + 'x_pinecone_api_version', + 'create_project_request', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_pinecone_api_version": (str,), - "create_project_request": (CreateProjectRequest,), + 'validations': { + }, + 'allowed_values': { + }, + '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", + 'attribute_map': { + 'x_pinecone_api_version': 'X-Pinecone-Api-Version', }, - "collection_format_map": {}, + 'location_map': { + 'x_pinecone_api_version': 'header', + 'create_project_request': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__create_project, + callable=__create_project ) async def __delete_project( - self, project_id, x_pinecone_api_version="2025-10", **kwargs + self, + project_id, + x_pinecone_api_version="2025-10", + **kwargs ) -> None: """Delete a project # noqa: E501 @@ -566,44 +739,76 @@ async def __delete_project( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['project_id'] = \ + project_id + return cast(None, await self.call_with_http_info(**kwargs)) self.delete_project = _AsyncioEndpoint( settings={ - "response_type": None, - "auth": ["BearerAuth"], - "endpoint_path": "/admin/projects/{project_id}", - "operation_id": "delete_project", - "http_method": "DELETE", - "servers": None, + 'response_type': None, + 'auth': [ + 'BearerAuth' + ], + 'endpoint_path': '/admin/projects/{project_id}', + 'operation_id': 'delete_project', + 'http_method': 'DELETE', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "project_id"], - "required": ["x_pinecone_api_version", "project_id"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'project_id', + ], + 'required': [ + 'x_pinecone_api_version', + 'project_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": {"x_pinecone_api_version": (str,), "project_id": (str,)}, - "attribute_map": { - "x_pinecone_api_version": "X-Pinecone-Api-Version", - "project_id": "project_id", + 'validations': { + }, + 'allowed_values': { + }, + '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', }, - "location_map": {"x_pinecone_api_version": "header", "project_id": "path"}, - "collection_format_map": {}, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], }, - headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__delete_project, + callable=__delete_project ) async def __fetch_project( - self, project_id, x_pinecone_api_version="2025-10", **kwargs + self, + project_id, + x_pinecone_api_version="2025-10", + **kwargs ) -> Project: """Get project details # noqa: E501 @@ -635,43 +840,76 @@ async def __fetch_project( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['project_id'] = \ + project_id + return cast(Project, await self.call_with_http_info(**kwargs)) self.fetch_project = _AsyncioEndpoint( settings={ - "response_type": (Project,), - "auth": ["BearerAuth"], - "endpoint_path": "/admin/projects/{project_id}", - "operation_id": "fetch_project", - "http_method": "GET", - "servers": None, + 'response_type': (Project,), + 'auth': [ + 'BearerAuth' + ], + 'endpoint_path': '/admin/projects/{project_id}', + 'operation_id': 'fetch_project', + 'http_method': 'GET', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "project_id"], - "required": ["x_pinecone_api_version", "project_id"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'project_id', + ], + 'required': [ + 'x_pinecone_api_version', + 'project_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": {"x_pinecone_api_version": (str,), "project_id": (str,)}, - "attribute_map": { - "x_pinecone_api_version": "X-Pinecone-Api-Version", - "project_id": "project_id", + 'validations': { + }, + 'allowed_values': { + }, + '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', }, - "location_map": {"x_pinecone_api_version": "header", "project_id": "path"}, - "collection_format_map": {}, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], }, - headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__fetch_project, + callable=__fetch_project ) - async def __list_projects(self, x_pinecone_api_version="2025-10", **kwargs) -> ProjectList: + async def __list_projects( + self, + x_pinecone_api_version="2025-10", + **kwargs + ) -> ProjectList: """List projects # noqa: E501 List all projects in an organization. # noqa: E501 @@ -701,40 +939,69 @@ async def __list_projects(self, x_pinecone_api_version="2025-10", **kwargs) -> P ProjectList """ self._process_openapi_kwargs(kwargs) - kwargs["x_pinecone_api_version"] = x_pinecone_api_version - return await self.call_with_http_info(**kwargs) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + return cast(ProjectList, await self.call_with_http_info(**kwargs)) self.list_projects = _AsyncioEndpoint( settings={ - "response_type": (ProjectList,), - "auth": ["BearerAuth"], - "endpoint_path": "/admin/projects", - "operation_id": "list_projects", - "http_method": "GET", - "servers": None, + 'response_type': (ProjectList,), + 'auth': [ + 'BearerAuth' + ], + 'endpoint_path': '/admin/projects', + 'operation_id': 'list_projects', + 'http_method': 'GET', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version"], - "required": ["x_pinecone_api_version"], - "nullable": [], - "enum": [], - "validation": [], + '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": []}, + '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_projects, + callable=__list_projects ) async def __update_project( - self, project_id, update_project_request, x_pinecone_api_version="2025-10", **kwargs + self, + project_id, + update_project_request, + x_pinecone_api_version="2025-10", + **kwargs ) -> Project: """Update a project # noqa: E501 @@ -767,47 +1034,76 @@ async def __update_project( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['project_id'] = \ + project_id + kwargs['update_project_request'] = \ + update_project_request + return cast(Project, await self.call_with_http_info(**kwargs)) self.update_project = _AsyncioEndpoint( settings={ - "response_type": (Project,), - "auth": ["BearerAuth"], - "endpoint_path": "/admin/projects/{project_id}", - "operation_id": "update_project", - "http_method": "PATCH", - "servers": None, + 'response_type': (Project,), + 'auth': [ + 'BearerAuth' + ], + 'endpoint_path': '/admin/projects/{project_id}', + 'operation_id': 'update_project', + 'http_method': 'PATCH', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "project_id", "update_project_request"], - "required": ["x_pinecone_api_version", "project_id", "update_project_request"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'project_id', + 'update_project_request', + ], + 'required': [ + 'x_pinecone_api_version', + 'project_id', + 'update_project_request', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_pinecone_api_version": (str,), - "project_id": (str,), - "update_project_request": (UpdateProjectRequest,), + 'validations': { + }, + 'allowed_values': { }, - "attribute_map": { - "x_pinecone_api_version": "X-Pinecone-Api-Version", - "project_id": "project_id", + 'openapi_types': { + 'x_pinecone_api_version': + (str,), + 'project_id': + (str,), + 'update_project_request': + (UpdateProjectRequest,), }, - "location_map": { - "x_pinecone_api_version": "header", - "project_id": "path", - "update_project_request": "body", + 'attribute_map': { + 'x_pinecone_api_version': 'X-Pinecone-Api-Version', + 'project_id': 'project_id', }, - "collection_format_map": {}, + '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' + ] }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__update_project, + callable=__update_project ) diff --git a/pinecone/core/openapi/admin/apis/__init__.py b/pinecone/core/openapi/admin/apis/__init__.py index 2e2b8c23d..1c7223890 100644 --- a/pinecone/core/openapi/admin/apis/__init__.py +++ b/pinecone/core/openapi/admin/apis/__init__.py @@ -1,3 +1,4 @@ + # flake8: noqa # Import all APIs into this package. diff --git a/pinecone/core/openapi/admin/model/api_key.py b/pinecone/core/openapi/admin/model/api_key.py index 4ebc545b8..aa4a293a9 100644 --- a/pinecone/core/openapi/admin/model/api_key.py +++ b/pinecone/core/openapi/admin/model/api_key.py @@ -1,14 +1,15 @@ """ -Pinecone Admin API + Pinecone Admin API -Provides an API for managing a Pinecone organization and its resources. # noqa: E501 + Provides an API for managing a Pinecone organization and its resources. # noqa: E501 -This file is @generated using OpenAPI. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -27,6 +28,7 @@ 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 @@ -59,9 +61,11 @@ class APIKey(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -69,7 +73,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 """ - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -84,26 +88,28 @@ def openapi_types(cls): and the value is attribute type. """ return { - "id": (str,), # noqa: E501 - "name": (str,), # noqa: E501 - "project_id": (str,), # noqa: E501 - "roles": ([str],), # noqa: E501 + 'id': (str,), # noqa: E501 + 'name': (str,), # noqa: E501 + 'project_id': (str,), # noqa: E501 + 'roles': ([str],), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "id": "id", # noqa: E501 - "name": "name", # noqa: E501 - "project_id": "project_id", # noqa: E501 - "roles": "roles", # noqa: E501 + 'id': 'id', # noqa: E501 + 'name': 'name', # noqa: E501 + 'project_id': 'project_id', # noqa: E501 + 'roles': 'roles', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of APIKey. @@ -113,7 +119,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -159,20 +168,22 @@ def _from_openapi_data(cls: Type[T], id, name, project_id, roles, *args, **kwarg _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", ()) + _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__), + "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__,), ) @@ -191,29 +202,25 @@ def _from_openapi_data(cls: Type[T], id, name, project_id, roles, *args, **kwarg self.project_id = project_id self.roles = roles for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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, project_id, roles, *args, **kwargs) -> None: # noqa: E501 @@ -259,17 +266,19 @@ def __init__(self, id, name, project_id, roles, *args, **kwargs) -> None: # noq """ _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", ()) + _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__), + "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__,), ) @@ -288,17 +297,13 @@ def __init__(self, id, name, project_id, roles, *args, **kwargs) -> None: # noq self.project_id = project_id self.roles = roles for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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/api_key_with_secret.py b/pinecone/core/openapi/admin/model/api_key_with_secret.py index a009a2690..bfaf75ab2 100644 --- a/pinecone/core/openapi/admin/model/api_key_with_secret.py +++ b/pinecone/core/openapi/admin/model/api_key_with_secret.py @@ -1,14 +1,15 @@ """ -Pinecone Admin API + Pinecone Admin API -Provides an API for managing a Pinecone organization and its resources. # noqa: E501 + Provides an API for managing a Pinecone organization and its resources. # noqa: E501 -This file is @generated using OpenAPI. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,11 +27,14 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): +if TYPE_CHECKING: from pinecone.core.openapi.admin.model.api_key import APIKey - globals()["APIKey"] = APIKey +def lazy_import(): + from pinecone.core.openapi.admin.model.api_key import APIKey + globals()['APIKey'] = APIKey from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -65,9 +69,11 @@ class APIKeyWithSecret(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -76,7 +82,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -92,22 +98,24 @@ def openapi_types(cls): """ lazy_import() return { - "key": (APIKey,), # noqa: E501 - "value": (str,), # noqa: E501 + 'key': (APIKey,), # noqa: E501 + 'value': (str,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "key": "key", # noqa: E501 - "value": "value", # noqa: E501 + 'key': 'key', # noqa: E501 + 'value': 'value', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of APIKeyWithSecret. @@ -117,7 +125,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -161,20 +172,22 @@ def _from_openapi_data(cls: Type[T], key, value, *args, **kwargs) -> T: # noqa: _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", ()) + _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__), + "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__,), ) @@ -191,29 +204,25 @@ def _from_openapi_data(cls: Type[T], key, value, *args, **kwargs) -> T: # noqa: self.key = key self.value = value for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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, key, value, *args, **kwargs) -> None: # noqa: E501 @@ -257,17 +266,19 @@ def __init__(self, key, value, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -284,17 +295,13 @@ def __init__(self, key, value, *args, **kwargs) -> None: # noqa: E501 self.key = key self.value = value for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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/create_api_key_request.py b/pinecone/core/openapi/admin/model/create_api_key_request.py index 1b1a0c372..2c996d88c 100644 --- a/pinecone/core/openapi/admin/model/create_api_key_request.py +++ b/pinecone/core/openapi/admin/model/create_api_key_request.py @@ -1,14 +1,15 @@ """ -Pinecone Admin API + Pinecone Admin API -Provides an API for managing a Pinecone organization and its resources. # noqa: E501 + Provides an API for managing a Pinecone organization and its resources. # noqa: E501 -This file is @generated using OpenAPI. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -27,6 +28,7 @@ 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 @@ -59,10 +61,14 @@ class CreateAPIKeyRequest(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ("name",): {"max_length": 80, "min_length": 1} + ('name',): { + 'max_length': 80, + 'min_length': 1, + }, } @cached_class_property @@ -71,7 +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 """ - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -86,22 +92,24 @@ def openapi_types(cls): and the value is attribute type. """ return { - "name": (str,), # noqa: E501 - "roles": ([str],), # noqa: E501 + '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 + 'name': 'name', # noqa: E501 + 'roles': 'roles', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of CreateAPIKeyRequest. @@ -111,7 +119,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -155,20 +166,22 @@ def _from_openapi_data(cls: Type[T], name, *args, **kwargs) -> T: # noqa: E501 roles ([str]): The roles to create the API key with. Default is `[\"ProjectEditor\"]`. [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", ()) + _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__), + "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__,), ) @@ -184,29 +197,25 @@ def _from_openapi_data(cls: Type[T], name, *args, **kwargs) -> T: # noqa: E501 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 - ): + 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", - ] - ) + 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 @@ -250,17 +259,19 @@ def __init__(self, name, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -276,17 +287,13 @@ def __init__(self, name, *args, **kwargs) -> None: # noqa: E501 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 - ): + 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." - ) + 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/create_project_request.py b/pinecone/core/openapi/admin/model/create_project_request.py index 93d2e8a52..09cd8b80f 100644 --- a/pinecone/core/openapi/admin/model/create_project_request.py +++ b/pinecone/core/openapi/admin/model/create_project_request.py @@ -1,14 +1,15 @@ """ -Pinecone Admin API + Pinecone Admin API -Provides an API for managing a Pinecone organization and its resources. # noqa: E501 + Provides an API for managing a Pinecone organization and its resources. # noqa: E501 -This file is @generated using OpenAPI. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -27,6 +28,7 @@ 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 @@ -59,10 +61,14 @@ class CreateProjectRequest(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ("name",): {"max_length": 512, "min_length": 1} + ('name',): { + 'max_length': 512, + 'min_length': 1, + }, } @cached_class_property @@ -71,7 +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 """ - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -86,24 +92,26 @@ def openapi_types(cls): and the value is attribute type. """ return { - "name": (str,), # noqa: E501 - "max_pods": (int,), # noqa: E501 - "force_encryption_with_cmek": (bool,), # noqa: E501 + 'name': (str,), # noqa: E501 + 'max_pods': (int,), # noqa: E501 + 'force_encryption_with_cmek': (bool,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "name": "name", # noqa: E501 - "max_pods": "max_pods", # noqa: E501 - "force_encryption_with_cmek": "force_encryption_with_cmek", # noqa: E501 + 'name': 'name', # noqa: E501 + 'max_pods': 'max_pods', # noqa: E501 + 'force_encryption_with_cmek': 'force_encryption_with_cmek', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of CreateProjectRequest. @@ -113,7 +121,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -158,20 +169,22 @@ def _from_openapi_data(cls: Type[T], name, *args, **kwargs) -> T: # noqa: E501 force_encryption_with_cmek (bool): Whether to force encryption with a customer-managed encryption key (CMEK). Default is `false`. [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", ()) + _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__), + "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__,), ) @@ -187,29 +200,25 @@ def _from_openapi_data(cls: Type[T], name, *args, **kwargs) -> T: # noqa: E501 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 - ): + 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", - ] - ) + 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 @@ -254,17 +263,19 @@ def __init__(self, name, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -280,17 +291,13 @@ def __init__(self, name, *args, **kwargs) -> None: # noqa: E501 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 - ): + 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." - ) + 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/error_response.py b/pinecone/core/openapi/admin/model/error_response.py index 107a3ac2f..3637e05ad 100644 --- a/pinecone/core/openapi/admin/model/error_response.py +++ b/pinecone/core/openapi/admin/model/error_response.py @@ -1,14 +1,15 @@ """ -Pinecone Admin API + Pinecone Admin API -Provides an API for managing a Pinecone organization and its resources. # noqa: E501 + Provides an API for managing a Pinecone organization and its resources. # noqa: E501 -This file is @generated using OpenAPI. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,11 +27,14 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): +if TYPE_CHECKING: from pinecone.core.openapi.admin.model.error_response_error import ErrorResponseError - globals()["ErrorResponseError"] = ErrorResponseError +def lazy_import(): + from pinecone.core.openapi.admin.model.error_response_error import ErrorResponseError + globals()['ErrorResponseError'] = ErrorResponseError from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -65,9 +69,11 @@ class ErrorResponse(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -76,7 +82,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -92,22 +98,24 @@ def openapi_types(cls): """ lazy_import() return { - "status": (int,), # noqa: E501 - "error": (ErrorResponseError,), # noqa: E501 + 'status': (int,), # noqa: E501 + 'error': (ErrorResponseError,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "status": "status", # noqa: E501 - "error": "error", # noqa: E501 + 'status': 'status', # noqa: E501 + 'error': 'error', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ErrorResponse. @@ -117,7 +125,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -161,20 +172,22 @@ def _from_openapi_data(cls: Type[T], status, error, *args, **kwargs) -> T: # no _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", ()) + _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__), + "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__,), ) @@ -191,29 +204,25 @@ def _from_openapi_data(cls: Type[T], status, error, *args, **kwargs) -> T: # no self.status = status self.error = error for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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, status, error, *args, **kwargs) -> None: # noqa: E501 @@ -257,17 +266,19 @@ def __init__(self, status, error, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -284,17 +295,13 @@ def __init__(self, status, error, *args, **kwargs) -> None: # noqa: E501 self.status = status self.error = error for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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/error_response_error.py b/pinecone/core/openapi/admin/model/error_response_error.py index 89eb7c22b..2016eab99 100644 --- a/pinecone/core/openapi/admin/model/error_response_error.py +++ b/pinecone/core/openapi/admin/model/error_response_error.py @@ -1,14 +1,15 @@ """ -Pinecone Admin API + Pinecone Admin API -Provides an API for managing a Pinecone organization and its resources. # noqa: E501 + Provides an API for managing a Pinecone organization and its resources. # noqa: E501 -This file is @generated using OpenAPI. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -27,6 +28,7 @@ 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 @@ -59,9 +61,11 @@ class ErrorResponseError(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -69,7 +73,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 """ - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -84,24 +88,26 @@ def openapi_types(cls): and the value is attribute type. """ return { - "code": (str,), # noqa: E501 - "message": (str,), # noqa: E501 - "details": ({str: (bool, dict, float, int, list, str, none_type)},), # noqa: E501 + 'code': (str,), # noqa: E501 + 'message': (str,), # noqa: E501 + 'details': (Dict[str, Any],), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "code": "code", # noqa: E501 - "message": "message", # noqa: E501 - "details": "details", # noqa: E501 + 'code': 'code', # noqa: E501 + 'message': 'message', # noqa: E501 + 'details': 'details', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ErrorResponseError. @@ -111,7 +117,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -153,23 +162,25 @@ def _from_openapi_data(cls: Type[T], code, message, *args, **kwargs) -> T: # no Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - details ({str: (bool, dict, float, int, list, str, none_type)}): Additional information about the error. This field is not guaranteed to be present. [optional] # noqa: E501 + details (Dict[str, Any]): Additional information about the error. This field is not guaranteed to be present. [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", ()) + _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__), + "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__,), ) @@ -186,29 +197,25 @@ def _from_openapi_data(cls: Type[T], code, message, *args, **kwargs) -> T: # no self.code = code self.message = message for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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, code, message, *args, **kwargs) -> None: # noqa: E501 @@ -249,21 +256,23 @@ def __init__(self, code, message, *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,) - details ({str: (bool, dict, float, int, list, str, none_type)}): Additional information about the error. This field is not guaranteed to be present. [optional] # noqa: E501 + details (Dict[str, Any]): Additional information about the error. This field is not guaranteed to be present. [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", ()) + _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__), + "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__,), ) @@ -280,17 +289,13 @@ def __init__(self, code, message, *args, **kwargs) -> None: # noqa: E501 self.code = code self.message = message for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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/list_api_keys_response.py b/pinecone/core/openapi/admin/model/list_api_keys_response.py index 7ea374573..1ffa01217 100644 --- a/pinecone/core/openapi/admin/model/list_api_keys_response.py +++ b/pinecone/core/openapi/admin/model/list_api_keys_response.py @@ -1,14 +1,15 @@ """ -Pinecone Admin API + Pinecone Admin API -Provides an API for managing a Pinecone organization and its resources. # noqa: E501 + Provides an API for managing a Pinecone organization and its resources. # noqa: E501 -This file is @generated using OpenAPI. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,11 +27,14 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): +if TYPE_CHECKING: from pinecone.core.openapi.admin.model.api_key import APIKey - globals()["APIKey"] = APIKey +def lazy_import(): + from pinecone.core.openapi.admin.model.api_key import APIKey + globals()['APIKey'] = APIKey from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -65,9 +69,11 @@ class ListApiKeysResponse(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -76,7 +82,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -92,20 +98,22 @@ def openapi_types(cls): """ lazy_import() return { - "data": ([APIKey],) # noqa: E501 + 'data': ([APIKey],), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "data": "data" # noqa: E501 + 'data': 'data', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ListApiKeysResponse. @@ -115,7 +123,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -158,20 +169,22 @@ def _from_openapi_data(cls: Type[T], data, *args, **kwargs) -> T: # noqa: E501 _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", ()) + _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__), + "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__,), ) @@ -187,29 +200,25 @@ def _from_openapi_data(cls: Type[T], data, *args, **kwargs) -> T: # noqa: E501 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 - ): + 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", - ] - ) + 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 @@ -252,17 +261,19 @@ def __init__(self, data, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -278,17 +289,13 @@ def __init__(self, data, *args, **kwargs) -> None: # noqa: E501 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 - ): + 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." - ) + 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.py b/pinecone/core/openapi/admin/model/organization.py index 418e86a0e..6d12eb263 100644 --- a/pinecone/core/openapi/admin/model/organization.py +++ b/pinecone/core/openapi/admin/model/organization.py @@ -1,14 +1,15 @@ """ -Pinecone Admin API + Pinecone Admin API -Provides an API for managing a Pinecone organization and its resources. # noqa: E501 + Provides an API for managing a Pinecone organization and its resources. # noqa: E501 -This file is @generated using OpenAPI. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -27,6 +28,7 @@ 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 @@ -59,10 +61,14 @@ class Organization(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ("name",): {"max_length": 512, "min_length": 1} + ('name',): { + 'max_length': 512, + 'min_length': 1, + }, } @cached_class_property @@ -71,7 +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 """ - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -86,30 +92,32 @@ def openapi_types(cls): 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 + '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 + '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([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of Organization. @@ -119,13 +127,14 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @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 + 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: @@ -169,20 +178,22 @@ def _from_openapi_data( _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", ()) + _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__), + "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__,), ) @@ -203,34 +214,28 @@ def _from_openapi_data( 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 - ): + 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", - ] - ) + 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 + def __init__(self, id, name, plan, payment_status, created_at, support_tier, *args, **kwargs) -> None: # noqa: E501 """Organization - a model defined in OpenAPI Args: @@ -275,17 +280,19 @@ def __init__( """ _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", ()) + _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__), + "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__,), ) @@ -306,17 +313,13 @@ def __init__( 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 - ): + 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." - ) + 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 index c2912659c..59d3503bd 100644 --- a/pinecone/core/openapi/admin/model/organization_list.py +++ b/pinecone/core/openapi/admin/model/organization_list.py @@ -1,14 +1,15 @@ """ -Pinecone Admin API + Pinecone Admin API -Provides an API for managing a Pinecone organization and its resources. # noqa: E501 + Provides an API for managing a Pinecone organization and its resources. # noqa: E501 -This file is @generated using OpenAPI. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,11 +27,14 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): +if TYPE_CHECKING: from pinecone.core.openapi.admin.model.organization import Organization - globals()["Organization"] = Organization +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 @@ -65,9 +69,11 @@ class OrganizationList(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -76,7 +82,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -92,20 +98,22 @@ def openapi_types(cls): """ lazy_import() return { - "data": ([Organization],) # noqa: E501 + 'data': ([Organization],), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "data": "data" # noqa: E501 + 'data': 'data', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of OrganizationList. @@ -115,7 +123,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -158,20 +169,22 @@ def _from_openapi_data(cls: Type[T], data, *args, **kwargs) -> T: # noqa: E501 _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", ()) + _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__), + "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__,), ) @@ -187,29 +200,25 @@ def _from_openapi_data(cls: Type[T], data, *args, **kwargs) -> T: # noqa: E501 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 - ): + 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", - ] - ) + 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 @@ -252,17 +261,19 @@ def __init__(self, data, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -278,17 +289,13 @@ def __init__(self, data, *args, **kwargs) -> None: # noqa: E501 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 - ): + 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." - ) + 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 5f9128d2f..b24ee1151 100644 --- a/pinecone/core/openapi/admin/model/project.py +++ b/pinecone/core/openapi/admin/model/project.py @@ -1,14 +1,15 @@ """ -Pinecone Admin API + Pinecone Admin API -Provides an API for managing a Pinecone organization and its resources. # noqa: E501 + Provides an API for managing a Pinecone organization and its resources. # noqa: E501 -This file is @generated using OpenAPI. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -27,6 +28,7 @@ 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 @@ -59,10 +61,14 @@ class Project(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ("name",): {"max_length": 512, "min_length": 1} + ('name',): { + 'max_length': 512, + 'min_length': 1, + }, } @cached_class_property @@ -71,7 +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 """ - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -86,30 +92,32 @@ def openapi_types(cls): and the value is attribute type. """ return { - "id": (str,), # noqa: E501 - "name": (str,), # noqa: E501 - "max_pods": (int,), # noqa: E501 - "force_encryption_with_cmek": (bool,), # noqa: E501 - "organization_id": (str,), # noqa: E501 - "created_at": (datetime,), # noqa: E501 + 'id': (str,), # noqa: E501 + 'name': (str,), # noqa: E501 + 'max_pods': (int,), # noqa: E501 + 'force_encryption_with_cmek': (bool,), # noqa: E501 + 'organization_id': (str,), # noqa: E501 + 'created_at': (datetime,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "id": "id", # noqa: E501 - "name": "name", # noqa: E501 - "max_pods": "max_pods", # noqa: E501 - "force_encryption_with_cmek": "force_encryption_with_cmek", # noqa: E501 - "organization_id": "organization_id", # noqa: E501 - "created_at": "created_at", # noqa: E501 + 'id': 'id', # noqa: E501 + 'name': 'name', # noqa: E501 + 'max_pods': 'max_pods', # noqa: E501 + 'force_encryption_with_cmek': 'force_encryption_with_cmek', # noqa: E501 + 'organization_id': 'organization_id', # noqa: E501 + 'created_at': 'created_at', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of Project. @@ -119,20 +127,14 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args - def _from_openapi_data( - cls: Type[T], - id, - name, - max_pods, - force_encryption_with_cmek, - organization_id, - *args, - **kwargs, - ) -> T: # noqa: E501 + def _from_openapi_data(cls: Type[T], id, name, max_pods, force_encryption_with_cmek, organization_id, *args, **kwargs) -> T: # noqa: E501 """Project - a model defined in OpenAPI Args: @@ -176,20 +178,22 @@ def _from_openapi_data( created_at (datetime): The date and time when the project was created. [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", ()) + _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__), + "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__,), ) @@ -209,34 +213,28 @@ def _from_openapi_data( self.force_encryption_with_cmek = force_encryption_with_cmek self.organization_id = organization_id for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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, max_pods, force_encryption_with_cmek, organization_id, *args, **kwargs - ) -> None: # noqa: E501 + def __init__(self, id, name, max_pods, force_encryption_with_cmek, organization_id, *args, **kwargs) -> None: # noqa: E501 """Project - a model defined in OpenAPI Args: @@ -281,17 +279,19 @@ def __init__( """ _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", ()) + _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__), + "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__,), ) @@ -311,17 +311,13 @@ def __init__( self.force_encryption_with_cmek = force_encryption_with_cmek self.organization_id = organization_id for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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_list.py b/pinecone/core/openapi/admin/model/project_list.py index 77dc486e8..82d704915 100644 --- a/pinecone/core/openapi/admin/model/project_list.py +++ b/pinecone/core/openapi/admin/model/project_list.py @@ -1,14 +1,15 @@ """ -Pinecone Admin API + Pinecone Admin API -Provides an API for managing a Pinecone organization and its resources. # noqa: E501 + Provides an API for managing a Pinecone organization and its resources. # noqa: E501 -This file is @generated using OpenAPI. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,11 +27,14 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): +if TYPE_CHECKING: from pinecone.core.openapi.admin.model.project import Project - globals()["Project"] = Project +def lazy_import(): + from pinecone.core.openapi.admin.model.project import Project + globals()['Project'] = Project from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -65,9 +69,11 @@ class ProjectList(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -76,7 +82,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -92,20 +98,22 @@ def openapi_types(cls): """ lazy_import() return { - "data": ([Project],) # noqa: E501 + 'data': ([Project],), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "data": "data" # noqa: E501 + 'data': 'data', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ProjectList. @@ -115,7 +123,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -158,20 +169,22 @@ def _from_openapi_data(cls: Type[T], data, *args, **kwargs) -> T: # noqa: E501 _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", ()) + _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__), + "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__,), ) @@ -187,29 +200,25 @@ def _from_openapi_data(cls: Type[T], data, *args, **kwargs) -> T: # noqa: E501 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 - ): + 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", - ] - ) + 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 @@ -252,17 +261,19 @@ def __init__(self, data, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -278,17 +289,13 @@ def __init__(self, data, *args, **kwargs) -> None: # noqa: E501 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 - ): + 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." - ) + 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_api_key_request.py b/pinecone/core/openapi/admin/model/update_api_key_request.py index c2cd1b6ec..40d84c342 100644 --- a/pinecone/core/openapi/admin/model/update_api_key_request.py +++ b/pinecone/core/openapi/admin/model/update_api_key_request.py @@ -1,14 +1,15 @@ """ -Pinecone Admin API + Pinecone Admin API -Provides an API for managing a Pinecone organization and its resources. # noqa: E501 + Provides an API for managing a Pinecone organization and its resources. # noqa: E501 -This file is @generated using OpenAPI. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -27,6 +28,7 @@ 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 @@ -59,10 +61,14 @@ class UpdateAPIKeyRequest(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ("name",): {"max_length": 80, "min_length": 1} + ('name',): { + 'max_length': 80, + 'min_length': 1, + }, } @cached_class_property @@ -71,7 +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 """ - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -86,22 +92,24 @@ def openapi_types(cls): and the value is attribute type. """ return { - "name": (str,), # noqa: E501 - "roles": ([str],), # noqa: E501 + '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 + 'name': 'name', # noqa: E501 + 'roles': 'roles', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of UpdateAPIKeyRequest. @@ -111,7 +119,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -153,20 +164,22 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # 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", ()) + _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__), + "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__,), ) @@ -181,29 +194,25 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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 @@ -245,17 +254,19 @@ def __init__(self, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -270,17 +281,13 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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 index f17163a54..fdb30eef6 100644 --- a/pinecone/core/openapi/admin/model/update_organization_request.py +++ b/pinecone/core/openapi/admin/model/update_organization_request.py @@ -1,14 +1,15 @@ """ -Pinecone Admin API + Pinecone Admin API -Provides an API for managing a Pinecone organization and its resources. # noqa: E501 + Provides an API for managing a Pinecone organization and its resources. # noqa: E501 -This file is @generated using OpenAPI. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -27,6 +28,7 @@ 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 @@ -59,10 +61,14 @@ class UpdateOrganizationRequest(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ("name",): {"max_length": 512, "min_length": 1} + ('name',): { + 'max_length': 512, + 'min_length': 1, + }, } @cached_class_property @@ -71,7 +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 """ - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -86,20 +92,22 @@ def openapi_types(cls): and the value is attribute type. """ return { - "name": (str,) # noqa: E501 + 'name': (str,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "name": "name" # noqa: E501 + 'name': 'name', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of UpdateOrganizationRequest. @@ -109,7 +117,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -150,20 +161,22 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 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", ()) + _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__), + "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__,), ) @@ -178,29 +191,25 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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 @@ -241,17 +250,19 @@ def __init__(self, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -266,17 +277,13 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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 2bab05cb3..0af2a3496 100644 --- a/pinecone/core/openapi/admin/model/update_project_request.py +++ b/pinecone/core/openapi/admin/model/update_project_request.py @@ -1,14 +1,15 @@ """ -Pinecone Admin API + Pinecone Admin API -Provides an API for managing a Pinecone organization and its resources. # noqa: E501 + Provides an API for managing a Pinecone organization and its resources. # noqa: E501 -This file is @generated using OpenAPI. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -27,6 +28,7 @@ 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 @@ -59,10 +61,14 @@ class UpdateProjectRequest(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ("name",): {"max_length": 512, "min_length": 1} + ('name',): { + 'max_length': 512, + 'min_length': 1, + }, } @cached_class_property @@ -71,7 +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 """ - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -86,24 +92,26 @@ def openapi_types(cls): and the value is attribute type. """ return { - "name": (str,), # noqa: E501 - "max_pods": (int,), # noqa: E501 - "force_encryption_with_cmek": (bool,), # noqa: E501 + 'name': (str,), # noqa: E501 + 'max_pods': (int,), # noqa: E501 + 'force_encryption_with_cmek': (bool,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "name": "name", # noqa: E501 - "max_pods": "max_pods", # noqa: E501 - "force_encryption_with_cmek": "force_encryption_with_cmek", # noqa: E501 + 'name': 'name', # noqa: E501 + 'max_pods': 'max_pods', # noqa: E501 + 'force_encryption_with_cmek': 'force_encryption_with_cmek', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of UpdateProjectRequest. @@ -113,7 +121,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -156,20 +167,22 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 force_encryption_with_cmek (bool): Whether to force encryption with a customer-managed encryption key (CMEK). Once enabled, CMEK encryption cannot be disabled. [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", ()) + _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__), + "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__,), ) @@ -184,29 +197,25 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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 @@ -249,17 +258,19 @@ def __init__(self, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -274,17 +285,13 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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/__init__.py b/pinecone/core/openapi/db_control/__init__.py index 52fc459de..905704fc1 100644 --- a/pinecone/core/openapi/db_control/__init__.py +++ b/pinecone/core/openapi/db_control/__init__.py @@ -1,16 +1,17 @@ # flake8: noqa """ -Pinecone Control Plane API + Pinecone Control Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + __version__ = "1.0.0" # import ApiClient @@ -26,5 +27,4 @@ from pinecone.openapi_support.exceptions import PineconeApiValueError from pinecone.openapi_support.exceptions import PineconeApiKeyError from pinecone.openapi_support.exceptions import PineconeApiException - -API_VERSION = "2025-10" +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 8d6ad8d02..3e5d2e891 100644 --- a/pinecone/core/openapi/db_control/api/manage_indexes_api.py +++ b/pinecone/core/openapi/db_control/api/manage_indexes_api.py @@ -1,26 +1,24 @@ """ -Pinecone Control Plane API + Pinecone Control Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from __future__ import annotations -from typing import TYPE_CHECKING +from typing import TYPE_CHECKING, Any, Dict, cast if TYPE_CHECKING: from multiprocessing.pool import ApplyResult from pinecone.openapi_support import ApiClient, AsyncioApiClient -from pinecone.openapi_support.endpoint_utils import ( - ExtraOpenApiKwargsTypedDict, - KwargsWithOpenApiKwargDefaultsTypedDict, -) +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 @@ -28,7 +26,7 @@ datetime, file_type, none_type, - validate_and_convert_types, + validate_and_convert_types ) from pinecone.core.openapi.db_control.model.backup_list import BackupList from pinecone.core.openapi.db_control.model.backup_model import BackupModel @@ -37,15 +35,9 @@ from pinecone.core.openapi.db_control.model.configure_index_request import ConfigureIndexRequest from pinecone.core.openapi.db_control.model.create_backup_request import CreateBackupRequest from pinecone.core.openapi.db_control.model.create_collection_request import CreateCollectionRequest -from pinecone.core.openapi.db_control.model.create_index_for_model_request import ( - CreateIndexForModelRequest, -) -from pinecone.core.openapi.db_control.model.create_index_from_backup_request import ( - CreateIndexFromBackupRequest, -) -from pinecone.core.openapi.db_control.model.create_index_from_backup_response import ( - CreateIndexFromBackupResponse, -) +from pinecone.core.openapi.db_control.model.create_index_for_model_request import CreateIndexForModelRequest +from pinecone.core.openapi.db_control.model.create_index_from_backup_request import CreateIndexFromBackupRequest +from pinecone.core.openapi.db_control.model.create_index_from_backup_response import CreateIndexFromBackupResponse from pinecone.core.openapi.db_control.model.create_index_request import CreateIndexRequest from pinecone.core.openapi.db_control.model.error_response import ErrorResponse from pinecone.core.openapi.db_control.model.index_list import IndexList @@ -70,7 +62,7 @@ def __configure_index( index_name, configure_index_request, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict, + **kwargs: ExtraOpenApiKwargsTypedDict ) -> IndexModel | ApplyResult[IndexModel]: """Configure an index # noqa: E501 @@ -110,49 +102,78 @@ 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['index_name'] = \ + index_name + kwargs['configure_index_request'] = \ + configure_index_request + return cast(IndexModel | ApplyResult[IndexModel], self.call_with_http_info(**kwargs)) self.configure_index = _Endpoint( settings={ - "response_type": (IndexModel,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/indexes/{index_name}", - "operation_id": "configure_index", - "http_method": "PATCH", - "servers": None, + 'response_type': (IndexModel,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/indexes/{index_name}', + 'operation_id': 'configure_index', + 'http_method': 'PATCH', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "index_name", "configure_index_request"], - "required": ["x_pinecone_api_version", "index_name", "configure_index_request"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'index_name', + 'configure_index_request', + ], + 'required': [ + 'x_pinecone_api_version', + 'index_name', + 'configure_index_request', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_pinecone_api_version": (str,), - "index_name": (str,), - "configure_index_request": (ConfigureIndexRequest,), + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'x_pinecone_api_version': + (str,), + 'index_name': + (str,), + 'configure_index_request': + (ConfigureIndexRequest,), }, - "attribute_map": { - "x_pinecone_api_version": "X-Pinecone-Api-Version", - "index_name": "index_name", + '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", + 'location_map': { + 'x_pinecone_api_version': 'header', + 'index_name': 'path', + 'configure_index_request': 'body', }, - "collection_format_map": {}, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__configure_index, + callable=__configure_index ) def __create_backup( @@ -160,7 +181,7 @@ def __create_backup( index_name, create_backup_request, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict, + **kwargs: ExtraOpenApiKwargsTypedDict ) -> BackupModel | ApplyResult[BackupModel]: """Create a backup of an index # noqa: E501 @@ -200,56 +221,85 @@ 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['index_name'] = \ + index_name + kwargs['create_backup_request'] = \ + create_backup_request + return cast(BackupModel | ApplyResult[BackupModel], self.call_with_http_info(**kwargs)) self.create_backup = _Endpoint( settings={ - "response_type": (BackupModel,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/indexes/{index_name}/backups", - "operation_id": "create_backup", - "http_method": "POST", - "servers": None, + 'response_type': (BackupModel,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/indexes/{index_name}/backups', + 'operation_id': 'create_backup', + 'http_method': 'POST', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "index_name", "create_backup_request"], - "required": ["x_pinecone_api_version", "index_name", "create_backup_request"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'index_name', + 'create_backup_request', + ], + 'required': [ + 'x_pinecone_api_version', + 'index_name', + 'create_backup_request', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_pinecone_api_version": (str,), - "index_name": (str,), - "create_backup_request": (CreateBackupRequest,), + 'validations': { }, - "attribute_map": { - "x_pinecone_api_version": "X-Pinecone-Api-Version", - "index_name": "index_name", + 'allowed_values': { }, - "location_map": { - "x_pinecone_api_version": "header", - "index_name": "path", - "create_backup_request": "body", + 'openapi_types': { + 'x_pinecone_api_version': + (str,), + 'index_name': + (str,), + 'create_backup_request': + (CreateBackupRequest,), }, - "collection_format_map": {}, + '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' + ] }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__create_backup, + callable=__create_backup ) def __create_collection( self, create_collection_request, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict, + **kwargs: ExtraOpenApiKwargsTypedDict ) -> CollectionModel | ApplyResult[CollectionModel]: """Create a collection # noqa: E501 @@ -288,50 +338,77 @@ 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['create_collection_request'] = \ + create_collection_request + return cast(CollectionModel | ApplyResult[CollectionModel], self.call_with_http_info(**kwargs)) self.create_collection = _Endpoint( settings={ - "response_type": (CollectionModel,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/collections", - "operation_id": "create_collection", - "http_method": "POST", - "servers": None, + 'response_type': (CollectionModel,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/collections', + 'operation_id': 'create_collection', + 'http_method': 'POST', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "create_collection_request"], - "required": ["x_pinecone_api_version", "create_collection_request"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'create_collection_request', + ], + 'required': [ + 'x_pinecone_api_version', + 'create_collection_request', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_pinecone_api_version": (str,), - "create_collection_request": (CreateCollectionRequest,), + 'validations': { + }, + 'allowed_values': { + }, + '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", + 'attribute_map': { + 'x_pinecone_api_version': 'X-Pinecone-Api-Version', }, - "collection_format_map": {}, + 'location_map': { + 'x_pinecone_api_version': 'header', + 'create_collection_request': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__create_collection, + callable=__create_collection ) def __create_index( self, create_index_request, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict, + **kwargs: ExtraOpenApiKwargsTypedDict ) -> IndexModel | ApplyResult[IndexModel]: """Create an index # noqa: E501 @@ -370,50 +447,77 @@ def __create_index( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['create_index_request'] = \ + create_index_request + return cast(IndexModel | ApplyResult[IndexModel], self.call_with_http_info(**kwargs)) self.create_index = _Endpoint( settings={ - "response_type": (IndexModel,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/indexes", - "operation_id": "create_index", - "http_method": "POST", - "servers": None, + 'response_type': (IndexModel,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/indexes', + 'operation_id': 'create_index', + 'http_method': 'POST', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "create_index_request"], - "required": ["x_pinecone_api_version", "create_index_request"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'create_index_request', + ], + 'required': [ + 'x_pinecone_api_version', + 'create_index_request', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_pinecone_api_version": (str,), - "create_index_request": (CreateIndexRequest,), + 'validations': { }, - "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, - "location_map": { - "x_pinecone_api_version": "header", - "create_index_request": "body", + 'allowed_values': { }, - "collection_format_map": {}, + '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' + ] }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__create_index, + callable=__create_index ) def __create_index_for_model( self, create_index_for_model_request, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict, + **kwargs: ExtraOpenApiKwargsTypedDict ) -> IndexModel | ApplyResult[IndexModel]: """Create an index with integrated embedding # noqa: E501 @@ -452,43 +556,70 @@ 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['create_index_for_model_request'] = \ + create_index_for_model_request + return cast(IndexModel | ApplyResult[IndexModel], self.call_with_http_info(**kwargs)) self.create_index_for_model = _Endpoint( settings={ - "response_type": (IndexModel,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/indexes/create-for-model", - "operation_id": "create_index_for_model", - "http_method": "POST", - "servers": None, + 'response_type': (IndexModel,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/indexes/create-for-model', + 'operation_id': 'create_index_for_model', + 'http_method': 'POST', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "create_index_for_model_request"], - "required": ["x_pinecone_api_version", "create_index_for_model_request"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'create_index_for_model_request', + ], + 'required': [ + 'x_pinecone_api_version', + 'create_index_for_model_request', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_pinecone_api_version": (str,), - "create_index_for_model_request": (CreateIndexForModelRequest,), + 'validations': { + }, + 'allowed_values': { }, - "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, - "location_map": { - "x_pinecone_api_version": "header", - "create_index_for_model_request": "body", + 'openapi_types': { + 'x_pinecone_api_version': + (str,), + 'create_index_for_model_request': + (CreateIndexForModelRequest,), }, - "collection_format_map": {}, + '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' + ] }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__create_index_for_model, + callable=__create_index_for_model ) def __create_index_from_backup_operation( @@ -496,7 +627,7 @@ def __create_index_from_backup_operation( backup_id, create_index_from_backup_request, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict, + **kwargs: ExtraOpenApiKwargsTypedDict ) -> CreateIndexFromBackupResponse | ApplyResult[CreateIndexFromBackupResponse]: """Create an index from a backup # noqa: E501 @@ -536,57 +667,85 @@ 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) + 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 cast(CreateIndexFromBackupResponse | ApplyResult[CreateIndexFromBackupResponse], self.call_with_http_info(**kwargs)) self.create_index_from_backup_operation = _Endpoint( settings={ - "response_type": (CreateIndexFromBackupResponse,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/backups/{backup_id}/create-index", - "operation_id": "create_index_from_backup_operation", - "http_method": "POST", - "servers": None, + 'response_type': (CreateIndexFromBackupResponse,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/backups/{backup_id}/create-index', + 'operation_id': 'create_index_from_backup_operation', + 'http_method': 'POST', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "backup_id", "create_index_from_backup_request"], - "required": [ - "x_pinecone_api_version", - "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': [ ], - "nullable": [], - "enum": [], - "validation": [], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_pinecone_api_version": (str,), - "backup_id": (str,), - "create_index_from_backup_request": (CreateIndexFromBackupRequest,), + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'x_pinecone_api_version': + (str,), + 'backup_id': + (str,), + 'create_index_from_backup_request': + (CreateIndexFromBackupRequest,), }, - "attribute_map": { - "x_pinecone_api_version": "X-Pinecone-Api-Version", - "backup_id": "backup_id", + '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", + 'location_map': { + 'x_pinecone_api_version': 'header', + 'backup_id': 'path', + 'create_index_from_backup_request': 'body', }, - "collection_format_map": {}, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__create_index_from_backup_operation, + callable=__create_index_from_backup_operation ) def __delete_backup( - self, backup_id, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict + self, + backup_id, + x_pinecone_api_version="2025-10", + **kwargs: ExtraOpenApiKwargsTypedDict ) -> None: """Delete a backup # noqa: E501 @@ -625,47 +784,76 @@ def __delete_backup( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['backup_id'] = \ + backup_id + return cast(None, self.call_with_http_info(**kwargs)) self.delete_backup = _Endpoint( settings={ - "response_type": None, - "auth": ["ApiKeyAuth"], - "endpoint_path": "/backups/{backup_id}", - "operation_id": "delete_backup", - "http_method": "DELETE", - "servers": None, + 'response_type': None, + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/backups/{backup_id}', + 'operation_id': 'delete_backup', + 'http_method': 'DELETE', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "backup_id"], - "required": ["x_pinecone_api_version", "backup_id"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'backup_id', + ], + 'required': [ + 'x_pinecone_api_version', + 'backup_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": {"x_pinecone_api_version": (str,), "backup_id": (str,)}, - "attribute_map": { - "x_pinecone_api_version": "X-Pinecone-Api-Version", - "backup_id": "backup_id", + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'x_pinecone_api_version': + (str,), + 'backup_id': + (str,), }, - "location_map": {"x_pinecone_api_version": "header", "backup_id": "path"}, - "collection_format_map": {}, + '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': [], }, - headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__delete_backup, + callable=__delete_backup ) def __delete_collection( self, collection_name, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict, + **kwargs: ExtraOpenApiKwargsTypedDict ) -> None: """Delete a collection # noqa: E501 @@ -704,47 +892,76 @@ def __delete_collection( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['collection_name'] = \ + collection_name + return cast(None, self.call_with_http_info(**kwargs)) self.delete_collection = _Endpoint( settings={ - "response_type": None, - "auth": ["ApiKeyAuth"], - "endpoint_path": "/collections/{collection_name}", - "operation_id": "delete_collection", - "http_method": "DELETE", - "servers": None, + 'response_type': None, + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/collections/{collection_name}', + 'operation_id': 'delete_collection', + 'http_method': 'DELETE', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "collection_name"], - "required": ["x_pinecone_api_version", "collection_name"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'collection_name', + ], + 'required': [ + 'x_pinecone_api_version', + 'collection_name', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": {"x_pinecone_api_version": (str,), "collection_name": (str,)}, - "attribute_map": { - "x_pinecone_api_version": "X-Pinecone-Api-Version", - "collection_name": "collection_name", + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'x_pinecone_api_version': + (str,), + 'collection_name': + (str,), }, - "location_map": {"x_pinecone_api_version": "header", "collection_name": "path"}, - "collection_format_map": {}, + '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': [], }, - headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__delete_collection, + callable=__delete_collection ) def __delete_index( self, index_name, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict, + **kwargs: ExtraOpenApiKwargsTypedDict ) -> None: """Delete an index # noqa: E501 @@ -783,44 +1000,76 @@ def __delete_index( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['index_name'] = \ + index_name + return cast(None, self.call_with_http_info(**kwargs)) self.delete_index = _Endpoint( settings={ - "response_type": None, - "auth": ["ApiKeyAuth"], - "endpoint_path": "/indexes/{index_name}", - "operation_id": "delete_index", - "http_method": "DELETE", - "servers": None, + 'response_type': None, + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/indexes/{index_name}', + 'operation_id': 'delete_index', + 'http_method': 'DELETE', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "index_name"], - "required": ["x_pinecone_api_version", "index_name"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'index_name', + ], + 'required': [ + 'x_pinecone_api_version', + 'index_name', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": {"x_pinecone_api_version": (str,), "index_name": (str,)}, - "attribute_map": { - "x_pinecone_api_version": "X-Pinecone-Api-Version", - "index_name": "index_name", + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'x_pinecone_api_version': + (str,), + 'index_name': + (str,), }, - "location_map": {"x_pinecone_api_version": "header", "index_name": "path"}, - "collection_format_map": {}, + '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': [], }, - headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__delete_index, + callable=__delete_index ) def __describe_backup( - self, backup_id, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict + self, + backup_id, + x_pinecone_api_version="2025-10", + **kwargs: ExtraOpenApiKwargsTypedDict ) -> BackupModel | ApplyResult[BackupModel]: """Describe a backup # noqa: E501 @@ -859,47 +1108,76 @@ def __describe_backup( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['backup_id'] = \ + backup_id + return cast(BackupModel | ApplyResult[BackupModel], self.call_with_http_info(**kwargs)) self.describe_backup = _Endpoint( settings={ - "response_type": (BackupModel,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/backups/{backup_id}", - "operation_id": "describe_backup", - "http_method": "GET", - "servers": None, + 'response_type': (BackupModel,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/backups/{backup_id}', + 'operation_id': 'describe_backup', + 'http_method': 'GET', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "backup_id"], - "required": ["x_pinecone_api_version", "backup_id"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'backup_id', + ], + 'required': [ + 'x_pinecone_api_version', + 'backup_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": {"x_pinecone_api_version": (str,), "backup_id": (str,)}, - "attribute_map": { - "x_pinecone_api_version": "X-Pinecone-Api-Version", - "backup_id": "backup_id", + 'validations': { + }, + 'allowed_values': { + }, + '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": {}, + 'location_map': { + 'x_pinecone_api_version': 'header', + 'backup_id': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], }, - headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__describe_backup, + callable=__describe_backup ) def __describe_collection( self, collection_name, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict, + **kwargs: ExtraOpenApiKwargsTypedDict ) -> CollectionModel | ApplyResult[CollectionModel]: """Describe a collection # noqa: E501 @@ -938,47 +1216,76 @@ def __describe_collection( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['collection_name'] = \ + collection_name + return cast(CollectionModel | ApplyResult[CollectionModel], self.call_with_http_info(**kwargs)) self.describe_collection = _Endpoint( settings={ - "response_type": (CollectionModel,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/collections/{collection_name}", - "operation_id": "describe_collection", - "http_method": "GET", - "servers": None, + 'response_type': (CollectionModel,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/collections/{collection_name}', + 'operation_id': 'describe_collection', + 'http_method': 'GET', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "collection_name"], - "required": ["x_pinecone_api_version", "collection_name"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'collection_name', + ], + 'required': [ + 'x_pinecone_api_version', + 'collection_name', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": {"x_pinecone_api_version": (str,), "collection_name": (str,)}, - "attribute_map": { - "x_pinecone_api_version": "X-Pinecone-Api-Version", - "collection_name": "collection_name", + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'x_pinecone_api_version': + (str,), + 'collection_name': + (str,), }, - "location_map": {"x_pinecone_api_version": "header", "collection_name": "path"}, - "collection_format_map": {}, + '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': [], }, - headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__describe_collection, + callable=__describe_collection ) def __describe_index( self, index_name, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict, + **kwargs: ExtraOpenApiKwargsTypedDict ) -> IndexModel | ApplyResult[IndexModel]: """Describe an index # noqa: E501 @@ -1017,44 +1324,76 @@ def __describe_index( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['index_name'] = \ + index_name + return cast(IndexModel | ApplyResult[IndexModel], self.call_with_http_info(**kwargs)) self.describe_index = _Endpoint( settings={ - "response_type": (IndexModel,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/indexes/{index_name}", - "operation_id": "describe_index", - "http_method": "GET", - "servers": None, + 'response_type': (IndexModel,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/indexes/{index_name}', + 'operation_id': 'describe_index', + 'http_method': 'GET', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "index_name"], - "required": ["x_pinecone_api_version", "index_name"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'index_name', + ], + 'required': [ + 'x_pinecone_api_version', + 'index_name', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": {"x_pinecone_api_version": (str,), "index_name": (str,)}, - "attribute_map": { - "x_pinecone_api_version": "X-Pinecone-Api-Version", - "index_name": "index_name", + 'validations': { + }, + 'allowed_values': { + }, + '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": {}, + 'location_map': { + 'x_pinecone_api_version': 'header', + 'index_name': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], }, - headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__describe_index, + callable=__describe_index ) def __describe_restore_job( - self, job_id, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict + self, + job_id, + x_pinecone_api_version="2025-10", + **kwargs: ExtraOpenApiKwargsTypedDict ) -> RestoreJobModel | ApplyResult[RestoreJobModel]: """Describe a restore job # noqa: E501 @@ -1093,44 +1432,75 @@ def __describe_restore_job( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['job_id'] = \ + job_id + return cast(RestoreJobModel | ApplyResult[RestoreJobModel], self.call_with_http_info(**kwargs)) self.describe_restore_job = _Endpoint( settings={ - "response_type": (RestoreJobModel,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/restore-jobs/{job_id}", - "operation_id": "describe_restore_job", - "http_method": "GET", - "servers": None, + 'response_type': (RestoreJobModel,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/restore-jobs/{job_id}', + 'operation_id': 'describe_restore_job', + 'http_method': 'GET', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "job_id"], - "required": ["x_pinecone_api_version", "job_id"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'job_id', + ], + 'required': [ + 'x_pinecone_api_version', + 'job_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": {"x_pinecone_api_version": (str,), "job_id": (str,)}, - "attribute_map": { - "x_pinecone_api_version": "X-Pinecone-Api-Version", - "job_id": "job_id", + 'validations': { + }, + 'allowed_values': { }, - "location_map": {"x_pinecone_api_version": "header", "job_id": "path"}, - "collection_format_map": {}, + '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': [], }, - headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__describe_restore_job, + callable=__describe_restore_job ) def __list_collections( - self, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict + self, + x_pinecone_api_version="2025-10", + **kwargs: ExtraOpenApiKwargsTypedDict ) -> CollectionList | ApplyResult[CollectionList]: """List collections # noqa: E501 @@ -1168,43 +1538,68 @@ def __list_collections( thread. """ kwargs = self._process_openapi_kwargs(kwargs) - kwargs["x_pinecone_api_version"] = x_pinecone_api_version - return self.call_with_http_info(**kwargs) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + return cast(CollectionList | ApplyResult[CollectionList], self.call_with_http_info(**kwargs)) self.list_collections = _Endpoint( settings={ - "response_type": (CollectionList,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/collections", - "operation_id": "list_collections", - "http_method": "GET", - "servers": None, + 'response_type': (CollectionList,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/collections', + 'operation_id': 'list_collections', + 'http_method': 'GET', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version"], - "required": ["x_pinecone_api_version"], - "nullable": [], - "enum": [], - "validation": [], + '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": []}, + '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_collections, + callable=__list_collections ) def __list_index_backups( self, index_name, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict, + **kwargs: ExtraOpenApiKwargsTypedDict ) -> BackupList | ApplyResult[BackupList]: """List backups for an index # noqa: E501 @@ -1245,56 +1640,91 @@ def __list_index_backups( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['index_name'] = \ + index_name + return cast(BackupList | ApplyResult[BackupList], self.call_with_http_info(**kwargs)) self.list_index_backups = _Endpoint( settings={ - "response_type": (BackupList,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/indexes/{index_name}/backups", - "operation_id": "list_index_backups", - "http_method": "GET", - "servers": None, + 'response_type': (BackupList,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/indexes/{index_name}/backups', + 'operation_id': 'list_index_backups', + 'http_method': 'GET', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "index_name", "limit", "pagination_token"], - "required": ["x_pinecone_api_version", "index_name"], - "nullable": [], - "enum": [], - "validation": ["limit"], + 'all': [ + 'x_pinecone_api_version', + 'index_name', + 'limit', + 'pagination_token', + ], + 'required': [ + 'x_pinecone_api_version', + 'index_name', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + 'limit', + ] }, root_map={ - "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", - }, - "collection_format_map": {}, - }, - headers_map={"accept": ["application/json"], "content_type": []}, + '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', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, api_client=api_client, - callable=__list_index_backups, + callable=__list_index_backups ) def __list_indexes( - self, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict + self, + x_pinecone_api_version="2025-10", + **kwargs: ExtraOpenApiKwargsTypedDict ) -> IndexList | ApplyResult[IndexList]: """List indexes # noqa: E501 @@ -1332,40 +1762,67 @@ def __list_indexes( thread. """ kwargs = self._process_openapi_kwargs(kwargs) - kwargs["x_pinecone_api_version"] = x_pinecone_api_version - return self.call_with_http_info(**kwargs) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + return cast(IndexList | ApplyResult[IndexList], self.call_with_http_info(**kwargs)) self.list_indexes = _Endpoint( settings={ - "response_type": (IndexList,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/indexes", - "operation_id": "list_indexes", - "http_method": "GET", - "servers": None, + 'response_type': (IndexList,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/indexes', + 'operation_id': 'list_indexes', + 'http_method': 'GET', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version"], - "required": ["x_pinecone_api_version"], - "nullable": [], - "enum": [], - "validation": [], + '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": []}, + '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_indexes, + callable=__list_indexes ) def __list_project_backups( - self, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict + self, + x_pinecone_api_version="2025-10", + **kwargs: ExtraOpenApiKwargsTypedDict ) -> BackupList | ApplyResult[BackupList]: """List backups for all indexes in a project # noqa: E501 @@ -1405,52 +1862,83 @@ def __list_project_backups( thread. """ kwargs = self._process_openapi_kwargs(kwargs) - kwargs["x_pinecone_api_version"] = x_pinecone_api_version - return self.call_with_http_info(**kwargs) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + return cast(BackupList | ApplyResult[BackupList], self.call_with_http_info(**kwargs)) self.list_project_backups = _Endpoint( settings={ - "response_type": (BackupList,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/backups", - "operation_id": "list_project_backups", - "http_method": "GET", - "servers": None, + 'response_type': (BackupList,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/backups', + 'operation_id': 'list_project_backups', + 'http_method': 'GET', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "limit", "pagination_token"], - "required": ["x_pinecone_api_version"], - "nullable": [], - "enum": [], - "validation": ["limit"], + 'all': [ + 'x_pinecone_api_version', + 'limit', + 'pagination_token', + ], + 'required': [ + 'x_pinecone_api_version', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + 'limit', + ] }, root_map={ - "validations": {("limit",): {"inclusive_maximum": 100, "inclusive_minimum": 1}}, - "allowed_values": {}, - "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": []}, + 'validations': { + ('limit',): { + + 'inclusive_maximum': 100, + 'inclusive_minimum': 1, + }, + }, + 'allowed_values': { + }, + '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': [], + }, api_client=api_client, - callable=__list_project_backups, + callable=__list_project_backups ) def __list_restore_jobs( - self, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict + self, + x_pinecone_api_version="2025-10", + **kwargs: ExtraOpenApiKwargsTypedDict ) -> RestoreJobList | ApplyResult[RestoreJobList]: """List restore jobs # noqa: E501 @@ -1490,51 +1978,81 @@ def __list_restore_jobs( thread. """ kwargs = self._process_openapi_kwargs(kwargs) - kwargs["x_pinecone_api_version"] = x_pinecone_api_version - return self.call_with_http_info(**kwargs) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + return cast(RestoreJobList | ApplyResult[RestoreJobList], self.call_with_http_info(**kwargs)) self.list_restore_jobs = _Endpoint( settings={ - "response_type": (RestoreJobList,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/restore-jobs", - "operation_id": "list_restore_jobs", - "http_method": "GET", - "servers": None, + 'response_type': (RestoreJobList,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/restore-jobs', + 'operation_id': 'list_restore_jobs', + 'http_method': 'GET', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "limit", "pagination_token"], - "required": ["x_pinecone_api_version"], - "nullable": [], - "enum": [], - "validation": ["limit"], + 'all': [ + 'x_pinecone_api_version', + 'limit', + 'pagination_token', + ], + 'required': [ + 'x_pinecone_api_version', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + 'limit', + ] }, root_map={ - "validations": {("limit",): {"inclusive_maximum": 100, "inclusive_minimum": 1}}, - "allowed_values": {}, - "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": []}, + 'validations': { + ('limit',): { + + 'inclusive_maximum': 100, + 'inclusive_minimum': 1, + }, + }, + 'allowed_values': { + }, + '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': [], + }, api_client=api_client, - callable=__list_restore_jobs, + callable=__list_restore_jobs ) + class AsyncioManageIndexesApi: """NOTE: This class is @generated using OpenAPI @@ -1547,7 +2065,11 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client async def __configure_index( - self, index_name, configure_index_request, x_pinecone_api_version="2025-10", **kwargs + self, + index_name, + configure_index_request, + x_pinecone_api_version="2025-10", + **kwargs ) -> IndexModel: """Configure an index # noqa: E501 @@ -1580,53 +2102,86 @@ async def __configure_index( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['index_name'] = \ + index_name + kwargs['configure_index_request'] = \ + configure_index_request + return cast(IndexModel, await self.call_with_http_info(**kwargs)) self.configure_index = _AsyncioEndpoint( settings={ - "response_type": (IndexModel,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/indexes/{index_name}", - "operation_id": "configure_index", - "http_method": "PATCH", - "servers": None, + 'response_type': (IndexModel,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/indexes/{index_name}', + 'operation_id': 'configure_index', + 'http_method': 'PATCH', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "index_name", "configure_index_request"], - "required": ["x_pinecone_api_version", "index_name", "configure_index_request"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'index_name', + 'configure_index_request', + ], + 'required': [ + 'x_pinecone_api_version', + 'index_name', + 'configure_index_request', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_pinecone_api_version": (str,), - "index_name": (str,), - "configure_index_request": (ConfigureIndexRequest,), + 'validations': { + }, + 'allowed_values': { }, - "attribute_map": { - "x_pinecone_api_version": "X-Pinecone-Api-Version", - "index_name": "index_name", + 'openapi_types': { + 'x_pinecone_api_version': + (str,), + 'index_name': + (str,), + 'configure_index_request': + (ConfigureIndexRequest,), }, - "location_map": { - "x_pinecone_api_version": "header", - "index_name": "path", - "configure_index_request": "body", + 'attribute_map': { + 'x_pinecone_api_version': 'X-Pinecone-Api-Version', + 'index_name': 'index_name', }, - "collection_format_map": {}, + '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' + ] }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__configure_index, + callable=__configure_index ) async def __create_backup( - self, index_name, create_backup_request, x_pinecone_api_version="2025-10", **kwargs + self, + index_name, + create_backup_request, + x_pinecone_api_version="2025-10", + **kwargs ) -> BackupModel: """Create a backup of an index # noqa: E501 @@ -1659,53 +2214,85 @@ async def __create_backup( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['index_name'] = \ + index_name + kwargs['create_backup_request'] = \ + create_backup_request + return cast(BackupModel, await self.call_with_http_info(**kwargs)) self.create_backup = _AsyncioEndpoint( settings={ - "response_type": (BackupModel,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/indexes/{index_name}/backups", - "operation_id": "create_backup", - "http_method": "POST", - "servers": None, + 'response_type': (BackupModel,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/indexes/{index_name}/backups', + 'operation_id': 'create_backup', + 'http_method': 'POST', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "index_name", "create_backup_request"], - "required": ["x_pinecone_api_version", "index_name", "create_backup_request"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'index_name', + 'create_backup_request', + ], + 'required': [ + 'x_pinecone_api_version', + 'index_name', + 'create_backup_request', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_pinecone_api_version": (str,), - "index_name": (str,), - "create_backup_request": (CreateBackupRequest,), + 'validations': { + }, + 'allowed_values': { }, - "attribute_map": { - "x_pinecone_api_version": "X-Pinecone-Api-Version", - "index_name": "index_name", + 'openapi_types': { + 'x_pinecone_api_version': + (str,), + 'index_name': + (str,), + 'create_backup_request': + (CreateBackupRequest,), }, - "location_map": { - "x_pinecone_api_version": "header", - "index_name": "path", - "create_backup_request": "body", + 'attribute_map': { + 'x_pinecone_api_version': 'X-Pinecone-Api-Version', + 'index_name': 'index_name', }, - "collection_format_map": {}, + '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' + ] }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__create_backup, + callable=__create_backup ) async def __create_collection( - self, create_collection_request, x_pinecone_api_version="2025-10", **kwargs + self, + create_collection_request, + x_pinecone_api_version="2025-10", + **kwargs ) -> CollectionModel: """Create a collection # noqa: E501 @@ -1737,47 +2324,77 @@ async def __create_collection( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['create_collection_request'] = \ + create_collection_request + return cast(CollectionModel, await self.call_with_http_info(**kwargs)) self.create_collection = _AsyncioEndpoint( settings={ - "response_type": (CollectionModel,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/collections", - "operation_id": "create_collection", - "http_method": "POST", - "servers": None, + 'response_type': (CollectionModel,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/collections', + 'operation_id': 'create_collection', + 'http_method': 'POST', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "create_collection_request"], - "required": ["x_pinecone_api_version", "create_collection_request"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'create_collection_request', + ], + 'required': [ + 'x_pinecone_api_version', + 'create_collection_request', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_pinecone_api_version": (str,), - "create_collection_request": (CreateCollectionRequest,), + 'validations': { + }, + 'allowed_values': { + }, + '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", + 'attribute_map': { + 'x_pinecone_api_version': 'X-Pinecone-Api-Version', }, - "collection_format_map": {}, + 'location_map': { + 'x_pinecone_api_version': 'header', + 'create_collection_request': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__create_collection, + callable=__create_collection ) async def __create_index( - self, create_index_request, x_pinecone_api_version="2025-10", **kwargs + self, + create_index_request, + x_pinecone_api_version="2025-10", + **kwargs ) -> IndexModel: """Create an index # noqa: E501 @@ -1809,47 +2426,77 @@ async def __create_index( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['create_index_request'] = \ + create_index_request + return cast(IndexModel, await self.call_with_http_info(**kwargs)) self.create_index = _AsyncioEndpoint( settings={ - "response_type": (IndexModel,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/indexes", - "operation_id": "create_index", - "http_method": "POST", - "servers": None, + 'response_type': (IndexModel,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/indexes', + 'operation_id': 'create_index', + 'http_method': 'POST', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "create_index_request"], - "required": ["x_pinecone_api_version", "create_index_request"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'create_index_request', + ], + 'required': [ + 'x_pinecone_api_version', + 'create_index_request', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_pinecone_api_version": (str,), - "create_index_request": (CreateIndexRequest,), + 'validations': { }, - "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, - "location_map": { - "x_pinecone_api_version": "header", - "create_index_request": "body", + 'allowed_values': { }, - "collection_format_map": {}, + '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' + ] }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__create_index, + callable=__create_index ) async def __create_index_for_model( - self, create_index_for_model_request, x_pinecone_api_version="2025-10", **kwargs + self, + create_index_for_model_request, + x_pinecone_api_version="2025-10", + **kwargs ) -> IndexModel: """Create an index with integrated embedding # noqa: E501 @@ -1881,43 +2528,70 @@ async def __create_index_for_model( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['create_index_for_model_request'] = \ + create_index_for_model_request + return cast(IndexModel, await self.call_with_http_info(**kwargs)) self.create_index_for_model = _AsyncioEndpoint( settings={ - "response_type": (IndexModel,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/indexes/create-for-model", - "operation_id": "create_index_for_model", - "http_method": "POST", - "servers": None, + 'response_type': (IndexModel,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/indexes/create-for-model', + 'operation_id': 'create_index_for_model', + 'http_method': 'POST', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "create_index_for_model_request"], - "required": ["x_pinecone_api_version", "create_index_for_model_request"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'create_index_for_model_request', + ], + 'required': [ + 'x_pinecone_api_version', + 'create_index_for_model_request', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_pinecone_api_version": (str,), - "create_index_for_model_request": (CreateIndexForModelRequest,), + 'validations': { + }, + 'allowed_values': { + }, + '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", + 'attribute_map': { + 'x_pinecone_api_version': 'X-Pinecone-Api-Version', }, - "collection_format_map": {}, + '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' + ] }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__create_index_for_model, + callable=__create_index_for_model ) async def __create_index_from_backup_operation( @@ -1925,7 +2599,7 @@ async def __create_index_from_backup_operation( backup_id, create_index_from_backup_request, x_pinecone_api_version="2025-10", - **kwargs, + **kwargs ) -> CreateIndexFromBackupResponse: """Create an index from a backup # noqa: E501 @@ -1958,57 +2632,85 @@ 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) + 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 cast(CreateIndexFromBackupResponse, await self.call_with_http_info(**kwargs)) self.create_index_from_backup_operation = _AsyncioEndpoint( settings={ - "response_type": (CreateIndexFromBackupResponse,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/backups/{backup_id}/create-index", - "operation_id": "create_index_from_backup_operation", - "http_method": "POST", - "servers": None, + 'response_type': (CreateIndexFromBackupResponse,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/backups/{backup_id}/create-index', + 'operation_id': 'create_index_from_backup_operation', + 'http_method': 'POST', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "backup_id", "create_index_from_backup_request"], - "required": [ - "x_pinecone_api_version", - "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': [ ], - "nullable": [], - "enum": [], - "validation": [], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_pinecone_api_version": (str,), - "backup_id": (str,), - "create_index_from_backup_request": (CreateIndexFromBackupRequest,), + 'validations': { }, - "attribute_map": { - "x_pinecone_api_version": "X-Pinecone-Api-Version", - "backup_id": "backup_id", + 'allowed_values': { }, - "location_map": { - "x_pinecone_api_version": "header", - "backup_id": "path", - "create_index_from_backup_request": "body", + 'openapi_types': { + 'x_pinecone_api_version': + (str,), + 'backup_id': + (str,), + 'create_index_from_backup_request': + (CreateIndexFromBackupRequest,), }, - "collection_format_map": {}, + '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' + ] }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__create_index_from_backup_operation, + callable=__create_index_from_backup_operation ) async def __delete_backup( - self, backup_id, x_pinecone_api_version="2025-10", **kwargs + self, + backup_id, + x_pinecone_api_version="2025-10", + **kwargs ) -> None: """Delete a backup # noqa: E501 @@ -2040,44 +2742,76 @@ async def __delete_backup( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['backup_id'] = \ + backup_id + return cast(None, await self.call_with_http_info(**kwargs)) self.delete_backup = _AsyncioEndpoint( settings={ - "response_type": None, - "auth": ["ApiKeyAuth"], - "endpoint_path": "/backups/{backup_id}", - "operation_id": "delete_backup", - "http_method": "DELETE", - "servers": None, + 'response_type': None, + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/backups/{backup_id}', + 'operation_id': 'delete_backup', + 'http_method': 'DELETE', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "backup_id"], - "required": ["x_pinecone_api_version", "backup_id"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'backup_id', + ], + 'required': [ + 'x_pinecone_api_version', + 'backup_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": {"x_pinecone_api_version": (str,), "backup_id": (str,)}, - "attribute_map": { - "x_pinecone_api_version": "X-Pinecone-Api-Version", - "backup_id": "backup_id", + 'validations': { + }, + 'allowed_values': { + }, + '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": {}, + 'location_map': { + 'x_pinecone_api_version': 'header', + 'backup_id': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], }, - headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__delete_backup, + callable=__delete_backup ) async def __delete_collection( - self, collection_name, x_pinecone_api_version="2025-10", **kwargs + self, + collection_name, + x_pinecone_api_version="2025-10", + **kwargs ) -> None: """Delete a collection # noqa: E501 @@ -2109,44 +2843,76 @@ async def __delete_collection( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['collection_name'] = \ + collection_name + return cast(None, await self.call_with_http_info(**kwargs)) self.delete_collection = _AsyncioEndpoint( settings={ - "response_type": None, - "auth": ["ApiKeyAuth"], - "endpoint_path": "/collections/{collection_name}", - "operation_id": "delete_collection", - "http_method": "DELETE", - "servers": None, + 'response_type': None, + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/collections/{collection_name}', + 'operation_id': 'delete_collection', + 'http_method': 'DELETE', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "collection_name"], - "required": ["x_pinecone_api_version", "collection_name"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'collection_name', + ], + 'required': [ + 'x_pinecone_api_version', + 'collection_name', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": {"x_pinecone_api_version": (str,), "collection_name": (str,)}, - "attribute_map": { - "x_pinecone_api_version": "X-Pinecone-Api-Version", - "collection_name": "collection_name", + 'validations': { }, - "location_map": {"x_pinecone_api_version": "header", "collection_name": "path"}, - "collection_format_map": {}, + 'allowed_values': { + }, + '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': [], }, - headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__delete_collection, + callable=__delete_collection ) async def __delete_index( - self, index_name, x_pinecone_api_version="2025-10", **kwargs + self, + index_name, + x_pinecone_api_version="2025-10", + **kwargs ) -> None: """Delete an index # noqa: E501 @@ -2178,44 +2944,76 @@ async def __delete_index( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['index_name'] = \ + index_name + return cast(None, await self.call_with_http_info(**kwargs)) self.delete_index = _AsyncioEndpoint( settings={ - "response_type": None, - "auth": ["ApiKeyAuth"], - "endpoint_path": "/indexes/{index_name}", - "operation_id": "delete_index", - "http_method": "DELETE", - "servers": None, + 'response_type': None, + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/indexes/{index_name}', + 'operation_id': 'delete_index', + 'http_method': 'DELETE', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "index_name"], - "required": ["x_pinecone_api_version", "index_name"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'index_name', + ], + 'required': [ + 'x_pinecone_api_version', + 'index_name', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": {"x_pinecone_api_version": (str,), "index_name": (str,)}, - "attribute_map": { - "x_pinecone_api_version": "X-Pinecone-Api-Version", - "index_name": "index_name", + 'validations': { + }, + 'allowed_values': { }, - "location_map": {"x_pinecone_api_version": "header", "index_name": "path"}, - "collection_format_map": {}, + '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': [], }, - headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__delete_index, + callable=__delete_index ) async def __describe_backup( - self, backup_id, x_pinecone_api_version="2025-10", **kwargs + self, + backup_id, + x_pinecone_api_version="2025-10", + **kwargs ) -> BackupModel: """Describe a backup # noqa: E501 @@ -2247,44 +3045,76 @@ async def __describe_backup( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['backup_id'] = \ + backup_id + return cast(BackupModel, await self.call_with_http_info(**kwargs)) self.describe_backup = _AsyncioEndpoint( settings={ - "response_type": (BackupModel,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/backups/{backup_id}", - "operation_id": "describe_backup", - "http_method": "GET", - "servers": None, + 'response_type': (BackupModel,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/backups/{backup_id}', + 'operation_id': 'describe_backup', + 'http_method': 'GET', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "backup_id"], - "required": ["x_pinecone_api_version", "backup_id"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'backup_id', + ], + 'required': [ + 'x_pinecone_api_version', + 'backup_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": {"x_pinecone_api_version": (str,), "backup_id": (str,)}, - "attribute_map": { - "x_pinecone_api_version": "X-Pinecone-Api-Version", - "backup_id": "backup_id", + 'validations': { + }, + 'allowed_values': { }, - "location_map": {"x_pinecone_api_version": "header", "backup_id": "path"}, - "collection_format_map": {}, + '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': [], }, - headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__describe_backup, + callable=__describe_backup ) async def __describe_collection( - self, collection_name, x_pinecone_api_version="2025-10", **kwargs + self, + collection_name, + x_pinecone_api_version="2025-10", + **kwargs ) -> CollectionModel: """Describe a collection # noqa: E501 @@ -2316,44 +3146,76 @@ async def __describe_collection( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['collection_name'] = \ + collection_name + return cast(CollectionModel, await self.call_with_http_info(**kwargs)) self.describe_collection = _AsyncioEndpoint( settings={ - "response_type": (CollectionModel,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/collections/{collection_name}", - "operation_id": "describe_collection", - "http_method": "GET", - "servers": None, + 'response_type': (CollectionModel,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/collections/{collection_name}', + 'operation_id': 'describe_collection', + 'http_method': 'GET', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "collection_name"], - "required": ["x_pinecone_api_version", "collection_name"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'collection_name', + ], + 'required': [ + 'x_pinecone_api_version', + 'collection_name', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": {"x_pinecone_api_version": (str,), "collection_name": (str,)}, - "attribute_map": { - "x_pinecone_api_version": "X-Pinecone-Api-Version", - "collection_name": "collection_name", + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'x_pinecone_api_version': + (str,), + 'collection_name': + (str,), }, - "location_map": {"x_pinecone_api_version": "header", "collection_name": "path"}, - "collection_format_map": {}, + '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': [], }, - headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__describe_collection, + callable=__describe_collection ) async def __describe_index( - self, index_name, x_pinecone_api_version="2025-10", **kwargs + self, + index_name, + x_pinecone_api_version="2025-10", + **kwargs ) -> IndexModel: """Describe an index # noqa: E501 @@ -2385,44 +3247,76 @@ async def __describe_index( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['index_name'] = \ + index_name + return cast(IndexModel, await self.call_with_http_info(**kwargs)) self.describe_index = _AsyncioEndpoint( settings={ - "response_type": (IndexModel,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/indexes/{index_name}", - "operation_id": "describe_index", - "http_method": "GET", - "servers": None, + 'response_type': (IndexModel,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/indexes/{index_name}', + 'operation_id': 'describe_index', + 'http_method': 'GET', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "index_name"], - "required": ["x_pinecone_api_version", "index_name"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'index_name', + ], + 'required': [ + 'x_pinecone_api_version', + 'index_name', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": {"x_pinecone_api_version": (str,), "index_name": (str,)}, - "attribute_map": { - "x_pinecone_api_version": "X-Pinecone-Api-Version", - "index_name": "index_name", + 'validations': { + }, + 'allowed_values': { + }, + '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": {}, + 'location_map': { + 'x_pinecone_api_version': 'header', + 'index_name': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], }, - headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__describe_index, + callable=__describe_index ) async def __describe_restore_job( - self, job_id, x_pinecone_api_version="2025-10", **kwargs + self, + job_id, + x_pinecone_api_version="2025-10", + **kwargs ) -> RestoreJobModel: """Describe a restore job # noqa: E501 @@ -2454,44 +3348,75 @@ async def __describe_restore_job( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['job_id'] = \ + job_id + return cast(RestoreJobModel, await self.call_with_http_info(**kwargs)) self.describe_restore_job = _AsyncioEndpoint( settings={ - "response_type": (RestoreJobModel,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/restore-jobs/{job_id}", - "operation_id": "describe_restore_job", - "http_method": "GET", - "servers": None, + 'response_type': (RestoreJobModel,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/restore-jobs/{job_id}', + 'operation_id': 'describe_restore_job', + 'http_method': 'GET', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "job_id"], - "required": ["x_pinecone_api_version", "job_id"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'job_id', + ], + 'required': [ + 'x_pinecone_api_version', + 'job_id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": {"x_pinecone_api_version": (str,), "job_id": (str,)}, - "attribute_map": { - "x_pinecone_api_version": "X-Pinecone-Api-Version", - "job_id": "job_id", + 'validations': { + }, + 'allowed_values': { }, - "location_map": {"x_pinecone_api_version": "header", "job_id": "path"}, - "collection_format_map": {}, + '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': [], }, - headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__describe_restore_job, + callable=__describe_restore_job ) async def __list_collections( - self, x_pinecone_api_version="2025-10", **kwargs + self, + x_pinecone_api_version="2025-10", + **kwargs ) -> CollectionList: """List collections # noqa: E501 @@ -2522,40 +3447,68 @@ async def __list_collections( CollectionList """ self._process_openapi_kwargs(kwargs) - kwargs["x_pinecone_api_version"] = x_pinecone_api_version - return await self.call_with_http_info(**kwargs) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + return cast(CollectionList, await self.call_with_http_info(**kwargs)) self.list_collections = _AsyncioEndpoint( settings={ - "response_type": (CollectionList,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/collections", - "operation_id": "list_collections", - "http_method": "GET", - "servers": None, + 'response_type': (CollectionList,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/collections', + 'operation_id': 'list_collections', + 'http_method': 'GET', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version"], - "required": ["x_pinecone_api_version"], - "nullable": [], - "enum": [], - "validation": [], + '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": []}, + '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_collections, + callable=__list_collections ) async def __list_index_backups( - self, index_name, x_pinecone_api_version="2025-10", **kwargs + self, + index_name, + x_pinecone_api_version="2025-10", + **kwargs ) -> BackupList: """List backups for an index # noqa: E501 @@ -2589,55 +3542,92 @@ async def __list_index_backups( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['index_name'] = \ + index_name + return cast(BackupList, await self.call_with_http_info(**kwargs)) self.list_index_backups = _AsyncioEndpoint( settings={ - "response_type": (BackupList,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/indexes/{index_name}/backups", - "operation_id": "list_index_backups", - "http_method": "GET", - "servers": None, + 'response_type': (BackupList,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/indexes/{index_name}/backups', + 'operation_id': 'list_index_backups', + 'http_method': 'GET', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "index_name", "limit", "pagination_token"], - "required": ["x_pinecone_api_version", "index_name"], - "nullable": [], - "enum": [], - "validation": ["limit"], + 'all': [ + 'x_pinecone_api_version', + 'index_name', + 'limit', + 'pagination_token', + ], + 'required': [ + 'x_pinecone_api_version', + 'index_name', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + 'limit', + ] }, root_map={ - "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", - }, - "collection_format_map": {}, - }, - headers_map={"accept": ["application/json"], "content_type": []}, + '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', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, api_client=api_client, - callable=__list_index_backups, + callable=__list_index_backups ) - async def __list_indexes(self, x_pinecone_api_version="2025-10", **kwargs) -> IndexList: + async def __list_indexes( + self, + x_pinecone_api_version="2025-10", + **kwargs + ) -> IndexList: """List indexes # noqa: E501 List all indexes in a project. # noqa: E501 @@ -2667,40 +3657,67 @@ async def __list_indexes(self, x_pinecone_api_version="2025-10", **kwargs) -> In IndexList """ self._process_openapi_kwargs(kwargs) - kwargs["x_pinecone_api_version"] = x_pinecone_api_version - return await self.call_with_http_info(**kwargs) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + return cast(IndexList, await self.call_with_http_info(**kwargs)) self.list_indexes = _AsyncioEndpoint( settings={ - "response_type": (IndexList,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/indexes", - "operation_id": "list_indexes", - "http_method": "GET", - "servers": None, + 'response_type': (IndexList,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/indexes', + 'operation_id': 'list_indexes', + 'http_method': 'GET', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version"], - "required": ["x_pinecone_api_version"], - "nullable": [], - "enum": [], - "validation": [], + '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": []}, + '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_indexes, + callable=__list_indexes ) async def __list_project_backups( - self, x_pinecone_api_version="2025-10", **kwargs + self, + x_pinecone_api_version="2025-10", + **kwargs ) -> BackupList: """List backups for all indexes in a project # noqa: E501 @@ -2733,52 +3750,83 @@ async def __list_project_backups( BackupList """ self._process_openapi_kwargs(kwargs) - kwargs["x_pinecone_api_version"] = x_pinecone_api_version - return await self.call_with_http_info(**kwargs) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + return cast(BackupList, await self.call_with_http_info(**kwargs)) self.list_project_backups = _AsyncioEndpoint( settings={ - "response_type": (BackupList,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/backups", - "operation_id": "list_project_backups", - "http_method": "GET", - "servers": None, + 'response_type': (BackupList,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/backups', + 'operation_id': 'list_project_backups', + 'http_method': 'GET', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "limit", "pagination_token"], - "required": ["x_pinecone_api_version"], - "nullable": [], - "enum": [], - "validation": ["limit"], + 'all': [ + 'x_pinecone_api_version', + 'limit', + 'pagination_token', + ], + 'required': [ + 'x_pinecone_api_version', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + 'limit', + ] }, root_map={ - "validations": {("limit",): {"inclusive_maximum": 100, "inclusive_minimum": 1}}, - "allowed_values": {}, - "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": []}, + 'validations': { + ('limit',): { + + 'inclusive_maximum': 100, + 'inclusive_minimum': 1, + }, + }, + 'allowed_values': { + }, + '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': [], + }, api_client=api_client, - callable=__list_project_backups, + callable=__list_project_backups ) async def __list_restore_jobs( - self, x_pinecone_api_version="2025-10", **kwargs + self, + x_pinecone_api_version="2025-10", + **kwargs ) -> RestoreJobList: """List restore jobs # noqa: E501 @@ -2811,46 +3859,75 @@ async def __list_restore_jobs( RestoreJobList """ self._process_openapi_kwargs(kwargs) - kwargs["x_pinecone_api_version"] = x_pinecone_api_version - return await self.call_with_http_info(**kwargs) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + return cast(RestoreJobList, await self.call_with_http_info(**kwargs)) self.list_restore_jobs = _AsyncioEndpoint( settings={ - "response_type": (RestoreJobList,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/restore-jobs", - "operation_id": "list_restore_jobs", - "http_method": "GET", - "servers": None, + 'response_type': (RestoreJobList,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/restore-jobs', + 'operation_id': 'list_restore_jobs', + 'http_method': 'GET', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "limit", "pagination_token"], - "required": ["x_pinecone_api_version"], - "nullable": [], - "enum": [], - "validation": ["limit"], + 'all': [ + 'x_pinecone_api_version', + 'limit', + 'pagination_token', + ], + 'required': [ + 'x_pinecone_api_version', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + 'limit', + ] }, root_map={ - "validations": {("limit",): {"inclusive_maximum": 100, "inclusive_minimum": 1}}, - "allowed_values": {}, - "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": []}, + 'validations': { + ('limit',): { + + 'inclusive_maximum': 100, + 'inclusive_minimum': 1, + }, + }, + 'allowed_values': { + }, + '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': [], + }, api_client=api_client, - callable=__list_restore_jobs, + callable=__list_restore_jobs ) diff --git a/pinecone/core/openapi/db_control/apis/__init__.py b/pinecone/core/openapi/db_control/apis/__init__.py index c82584141..40d74ba49 100644 --- a/pinecone/core/openapi/db_control/apis/__init__.py +++ b/pinecone/core/openapi/db_control/apis/__init__.py @@ -1,3 +1,4 @@ + # flake8: noqa # Import all APIs into this package. diff --git a/pinecone/core/openapi/db_control/model/backup_list.py b/pinecone/core/openapi/db_control/model/backup_list.py index 550b4e3b0..f79592958 100644 --- a/pinecone/core/openapi/db_control/model/backup_list.py +++ b/pinecone/core/openapi/db_control/model/backup_list.py @@ -1,14 +1,15 @@ """ -Pinecone Control Plane API + Pinecone Control Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,13 +27,17 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): +if TYPE_CHECKING: from pinecone.core.openapi.db_control.model.backup_model import BackupModel from pinecone.core.openapi.db_control.model.pagination_response import PaginationResponse - globals()["BackupModel"] = BackupModel - globals()["PaginationResponse"] = PaginationResponse +def lazy_import(): + from pinecone.core.openapi.db_control.model.backup_model import BackupModel + from pinecone.core.openapi.db_control.model.pagination_response import PaginationResponse + globals()['BackupModel'] = BackupModel + globals()['PaginationResponse'] = PaginationResponse from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -67,9 +72,11 @@ class BackupList(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -78,7 +85,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -94,22 +101,24 @@ def openapi_types(cls): """ lazy_import() return { - "data": ([BackupModel],), # noqa: E501 - "pagination": (PaginationResponse,), # noqa: E501 + 'data': ([BackupModel],), # noqa: E501 + 'pagination': (PaginationResponse,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "data": "data", # noqa: E501 - "pagination": "pagination", # noqa: E501 + 'data': 'data', # noqa: E501 + 'pagination': 'pagination', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of BackupList. @@ -119,7 +128,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -161,20 +173,22 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 pagination (PaginationResponse): [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", ()) + _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__), + "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__,), ) @@ -189,29 +203,25 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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 @@ -253,17 +263,19 @@ def __init__(self, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -278,17 +290,13 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/pinecone/core/openapi/db_control/model/backup_model.py b/pinecone/core/openapi/db_control/model/backup_model.py index 245821dfb..b9385568c 100644 --- a/pinecone/core/openapi/db_control/model/backup_model.py +++ b/pinecone/core/openapi/db_control/model/backup_model.py @@ -1,14 +1,15 @@ """ -Pinecone Control Plane API + Pinecone Control Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,13 +27,17 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): +if TYPE_CHECKING: 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 +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 from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -67,10 +72,14 @@ class BackupModel(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ("dimension",): {"inclusive_maximum": 20000, "inclusive_minimum": 1} + ('dimension',): { + 'inclusive_maximum': 20000, + 'inclusive_minimum': 1, + }, } @cached_class_property @@ -80,7 +89,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -96,50 +105,52 @@ def openapi_types(cls): """ lazy_import() return { - "backup_id": (str,), # noqa: E501 - "source_index_name": (str,), # noqa: E501 - "source_index_id": (str,), # noqa: E501 - "status": (str,), # noqa: E501 - "cloud": (str,), # noqa: E501 - "region": (str,), # noqa: E501 - "name": (str,), # noqa: E501 - "description": (str,), # noqa: E501 - "dimension": (int,), # noqa: E501 - "metric": (str,), # noqa: E501 - "schema": (BackupModelSchema,), # noqa: E501 - "record_count": (int,), # noqa: E501 - "namespace_count": (int,), # noqa: E501 - "size_bytes": (int,), # noqa: E501 - "tags": (IndexTags,), # noqa: E501 - "created_at": (str,), # noqa: E501 + 'backup_id': (str,), # noqa: E501 + 'source_index_name': (str,), # noqa: E501 + 'source_index_id': (str,), # noqa: E501 + 'status': (str,), # noqa: E501 + 'cloud': (str,), # noqa: E501 + 'region': (str,), # noqa: E501 + 'name': (str,), # noqa: E501 + 'description': (str,), # noqa: E501 + 'dimension': (int,), # noqa: E501 + 'metric': (str,), # noqa: E501 + 'schema': (BackupModelSchema,), # noqa: E501 + 'record_count': (int,), # noqa: E501 + 'namespace_count': (int,), # noqa: E501 + 'size_bytes': (int,), # noqa: E501 + 'tags': (IndexTags,), # noqa: E501 + 'created_at': (str,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "backup_id": "backup_id", # noqa: E501 - "source_index_name": "source_index_name", # noqa: E501 - "source_index_id": "source_index_id", # noqa: E501 - "status": "status", # noqa: E501 - "cloud": "cloud", # noqa: E501 - "region": "region", # noqa: E501 - "name": "name", # noqa: E501 - "description": "description", # noqa: E501 - "dimension": "dimension", # noqa: E501 - "metric": "metric", # noqa: E501 - "schema": "schema", # noqa: E501 - "record_count": "record_count", # noqa: E501 - "namespace_count": "namespace_count", # noqa: E501 - "size_bytes": "size_bytes", # noqa: E501 - "tags": "tags", # noqa: E501 - "created_at": "created_at", # noqa: E501 + 'backup_id': 'backup_id', # noqa: E501 + 'source_index_name': 'source_index_name', # noqa: E501 + 'source_index_id': 'source_index_id', # noqa: E501 + 'status': 'status', # noqa: E501 + 'cloud': 'cloud', # noqa: E501 + 'region': 'region', # noqa: E501 + 'name': 'name', # noqa: E501 + 'description': 'description', # noqa: E501 + 'dimension': 'dimension', # noqa: E501 + 'metric': 'metric', # noqa: E501 + 'schema': 'schema', # noqa: E501 + 'record_count': 'record_count', # noqa: E501 + 'namespace_count': 'namespace_count', # noqa: E501 + 'size_bytes': 'size_bytes', # noqa: E501 + 'tags': 'tags', # noqa: E501 + 'created_at': 'created_at', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of BackupModel. @@ -149,21 +160,14 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args - def _from_openapi_data( - cls: Type[T], - backup_id, - source_index_name, - source_index_id, - status, - cloud, - region, - *args, - **kwargs, - ) -> T: # noqa: E501 + def _from_openapi_data(cls: Type[T], backup_id, source_index_name, source_index_id, status, cloud, region, *args, **kwargs) -> T: # noqa: E501 """BackupModel - a model defined in OpenAPI Args: @@ -217,20 +221,22 @@ def _from_openapi_data( created_at (str): Timestamp when the backup was created. [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", ()) + _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__), + "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__,), ) @@ -251,34 +257,28 @@ def _from_openapi_data( self.cloud = cloud self.region = region for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + 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", - ] - ) + 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, backup_id, source_index_name, source_index_id, status, cloud, region, *args, **kwargs - ) -> None: # noqa: E501 + def __init__(self, backup_id, source_index_name, source_index_id, status, cloud, region, *args, **kwargs) -> None: # noqa: E501 """BackupModel - a model defined in OpenAPI Args: @@ -333,17 +333,19 @@ def __init__( """ _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", ()) + _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__), + "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__,), ) @@ -364,17 +366,13 @@ def __init__( self.cloud = cloud self.region = region for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + 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." - ) + raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/pinecone/core/openapi/db_control/model/backup_model_schema.py b/pinecone/core/openapi/db_control/model/backup_model_schema.py index f0d386577..a15d0e063 100644 --- a/pinecone/core/openapi/db_control/model/backup_model_schema.py +++ b/pinecone/core/openapi/db_control/model/backup_model_schema.py @@ -1,14 +1,15 @@ """ -Pinecone Control Plane API + Pinecone Control Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,13 +27,14 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): - from pinecone.core.openapi.db_control.model.backup_model_schema_fields import ( - BackupModelSchemaFields, - ) +if TYPE_CHECKING: + from pinecone.core.openapi.db_control.model.backup_model_schema_fields import BackupModelSchemaFields - globals()["BackupModelSchemaFields"] = BackupModelSchemaFields +def lazy_import(): + from pinecone.core.openapi.db_control.model.backup_model_schema_fields import BackupModelSchemaFields + globals()['BackupModelSchemaFields'] = BackupModelSchemaFields from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -67,9 +69,11 @@ class BackupModelSchema(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -78,7 +82,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -94,20 +98,22 @@ def openapi_types(cls): """ lazy_import() return { - "fields": ({str: (BackupModelSchemaFields,)},) # noqa: E501 + 'fields': ({str: (BackupModelSchemaFields,)},), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "fields": "fields" # noqa: E501 + 'fields': 'fields', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of BackupModelSchema. @@ -117,7 +123,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -160,20 +169,22 @@ def _from_openapi_data(cls: Type[T], fields, *args, **kwargs) -> T: # noqa: E50 _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", ()) + _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__), + "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__,), ) @@ -189,29 +200,25 @@ def _from_openapi_data(cls: Type[T], fields, *args, **kwargs) -> T: # noqa: E50 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 - ): + 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", - ] - ) + 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 @@ -254,17 +261,19 @@ def __init__(self, fields, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -280,17 +289,13 @@ def __init__(self, fields, *args, **kwargs) -> None: # noqa: E501 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 - ): + 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." - ) + raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/pinecone/core/openapi/db_control/model/backup_model_schema_fields.py b/pinecone/core/openapi/db_control/model/backup_model_schema_fields.py index cde8ec5a9..552aed875 100644 --- a/pinecone/core/openapi/db_control/model/backup_model_schema_fields.py +++ b/pinecone/core/openapi/db_control/model/backup_model_schema_fields.py @@ -1,14 +1,15 @@ """ -Pinecone Control Plane API + Pinecone Control Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -27,6 +28,7 @@ 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 @@ -59,9 +61,11 @@ class BackupModelSchemaFields(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -69,7 +73,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 """ - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -84,20 +88,22 @@ def openapi_types(cls): and the value is attribute type. """ return { - "filterable": (bool,) # noqa: E501 + 'filterable': (bool,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "filterable": "filterable" # noqa: E501 + 'filterable': 'filterable', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of BackupModelSchemaFields. @@ -107,7 +113,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -148,20 +157,22 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 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", ()) + _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__), + "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__,), ) @@ -176,29 +187,25 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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 @@ -239,17 +246,19 @@ def __init__(self, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -264,17 +273,13 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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 index 582b92864..d2faf8ad8 100644 --- a/pinecone/core/openapi/db_control/model/byoc.py +++ b/pinecone/core/openapi/db_control/model/byoc.py @@ -1,14 +1,15 @@ """ -Pinecone Control Plane API + Pinecone Control Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,11 +27,14 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): +if TYPE_CHECKING: from pinecone.core.openapi.db_control.model.byoc_spec import ByocSpec - globals()["ByocSpec"] = ByocSpec +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 @@ -65,9 +69,11 @@ class BYOC(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -76,7 +82,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -92,20 +98,22 @@ def openapi_types(cls): """ lazy_import() return { - "byoc": (ByocSpec,) # noqa: E501 + 'byoc': (ByocSpec,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "byoc": "byoc" # noqa: E501 + 'byoc': 'byoc', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of BYOC. @@ -115,7 +123,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -158,20 +169,22 @@ def _from_openapi_data(cls: Type[T], byoc, *args, **kwargs) -> T: # noqa: E501 _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", ()) + _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__), + "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__,), ) @@ -187,29 +200,25 @@ def _from_openapi_data(cls: Type[T], byoc, *args, **kwargs) -> T: # noqa: E501 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 - ): + 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", - ] - ) + 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 @@ -252,17 +261,19 @@ def __init__(self, byoc, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -278,17 +289,13 @@ def __init__(self, byoc, *args, **kwargs) -> None: # noqa: E501 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 - ): + 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." - ) + 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 9563109cc..963b1fcbf 100644 --- a/pinecone/core/openapi/db_control/model/byoc_spec.py +++ b/pinecone/core/openapi/db_control/model/byoc_spec.py @@ -1,14 +1,15 @@ """ -Pinecone Control Plane API + Pinecone Control Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,11 +27,14 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): +if TYPE_CHECKING: from pinecone.core.openapi.db_control.model.backup_model_schema import BackupModelSchema - globals()["BackupModelSchema"] = BackupModelSchema +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 @@ -65,9 +69,11 @@ class ByocSpec(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -76,7 +82,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -92,22 +98,24 @@ def openapi_types(cls): """ lazy_import() return { - "environment": (str,), # noqa: E501 - "schema": (BackupModelSchema,), # noqa: E501 + 'environment': (str,), # noqa: E501 + 'schema': (BackupModelSchema,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "environment": "environment", # noqa: E501 - "schema": "schema", # noqa: E501 + 'environment': 'environment', # noqa: E501 + 'schema': 'schema', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ByocSpec. @@ -117,7 +125,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -161,20 +172,22 @@ def _from_openapi_data(cls: Type[T], environment, *args, **kwargs) -> T: # noqa 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", ()) + _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__), + "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__,), ) @@ -190,29 +203,25 @@ def _from_openapi_data(cls: Type[T], environment, *args, **kwargs) -> T: # noqa self.environment = environment for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + 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", - ] - ) + 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, environment, *args, **kwargs) -> None: # noqa: E501 @@ -256,17 +265,19 @@ def __init__(self, environment, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -282,17 +293,13 @@ def __init__(self, environment, *args, **kwargs) -> None: # noqa: E501 self.environment = environment for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + 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." - ) + 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/collection_list.py b/pinecone/core/openapi/db_control/model/collection_list.py index 39a366e52..ce05419eb 100644 --- a/pinecone/core/openapi/db_control/model/collection_list.py +++ b/pinecone/core/openapi/db_control/model/collection_list.py @@ -1,14 +1,15 @@ """ -Pinecone Control Plane API + Pinecone Control Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,11 +27,14 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): +if TYPE_CHECKING: from pinecone.core.openapi.db_control.model.collection_model import CollectionModel - globals()["CollectionModel"] = CollectionModel +def lazy_import(): + from pinecone.core.openapi.db_control.model.collection_model import CollectionModel + globals()['CollectionModel'] = CollectionModel from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -65,9 +69,11 @@ class CollectionList(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -76,7 +82,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -92,20 +98,22 @@ def openapi_types(cls): """ lazy_import() return { - "collections": ([CollectionModel],) # noqa: E501 + 'collections': ([CollectionModel],), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "collections": "collections" # noqa: E501 + 'collections': 'collections', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of CollectionList. @@ -115,7 +123,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -156,20 +167,22 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 collections ([CollectionModel]): List of collections in the project [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", ()) + _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__), + "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__,), ) @@ -184,29 +197,25 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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 @@ -247,17 +256,19 @@ def __init__(self, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -272,17 +283,13 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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/collection_model.py b/pinecone/core/openapi/db_control/model/collection_model.py index 20e72a00a..101e30495 100644 --- a/pinecone/core/openapi/db_control/model/collection_model.py +++ b/pinecone/core/openapi/db_control/model/collection_model.py @@ -1,14 +1,15 @@ """ -Pinecone Control Plane API + Pinecone Control Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -27,6 +28,7 @@ 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 @@ -59,10 +61,14 @@ class CollectionModel(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ("dimension",): {"inclusive_maximum": 20000, "inclusive_minimum": 1} + ('dimension',): { + 'inclusive_maximum': 20000, + 'inclusive_minimum': 1, + }, } @cached_class_property @@ -71,7 +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 """ - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -86,30 +92,32 @@ def openapi_types(cls): and the value is attribute type. """ return { - "name": (str,), # noqa: E501 - "status": (str,), # noqa: E501 - "environment": (str,), # noqa: E501 - "size": (int,), # noqa: E501 - "dimension": (int,), # noqa: E501 - "vector_count": (int,), # noqa: E501 + 'name': (str,), # noqa: E501 + 'status': (str,), # noqa: E501 + 'environment': (str,), # noqa: E501 + 'size': (int,), # noqa: E501 + 'dimension': (int,), # noqa: E501 + 'vector_count': (int,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "name": "name", # noqa: E501 - "status": "status", # noqa: E501 - "environment": "environment", # noqa: E501 - "size": "size", # noqa: E501 - "dimension": "dimension", # noqa: E501 - "vector_count": "vector_count", # noqa: E501 + 'name': 'name', # noqa: E501 + 'status': 'status', # noqa: E501 + 'environment': 'environment', # noqa: E501 + 'size': 'size', # noqa: E501 + 'dimension': 'dimension', # noqa: E501 + 'vector_count': 'vector_count', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of CollectionModel. @@ -119,7 +127,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -167,20 +178,22 @@ def _from_openapi_data(cls: Type[T], name, status, environment, *args, **kwargs) vector_count (int): The number of records stored in the collection. [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", ()) + _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__), + "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__,), ) @@ -198,29 +211,25 @@ def _from_openapi_data(cls: Type[T], name, status, environment, *args, **kwargs) self.status = status self.environment = environment for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + 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", - ] - ) + 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, status, environment, *args, **kwargs) -> None: # noqa: E501 @@ -268,17 +277,19 @@ def __init__(self, name, status, environment, *args, **kwargs) -> None: # noqa: """ _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", ()) + _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__), + "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__,), ) @@ -296,17 +307,13 @@ def __init__(self, name, status, environment, *args, **kwargs) -> None: # noqa: self.status = status self.environment = environment for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + 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." - ) + 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/configure_index_request.py b/pinecone/core/openapi/db_control/model/configure_index_request.py index 9a0848bce..7e653299d 100644 --- a/pinecone/core/openapi/db_control/model/configure_index_request.py +++ b/pinecone/core/openapi/db_control/model/configure_index_request.py @@ -1,14 +1,15 @@ """ -Pinecone Control Plane API + Pinecone Control Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,15 +27,17 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): - from pinecone.core.openapi.db_control.model.configure_index_request_embed import ( - ConfigureIndexRequestEmbed, - ) +if TYPE_CHECKING: + from pinecone.core.openapi.db_control.model.configure_index_request_embed import ConfigureIndexRequestEmbed from pinecone.core.openapi.db_control.model.index_tags import IndexTags - globals()["ConfigureIndexRequestEmbed"] = ConfigureIndexRequestEmbed - globals()["IndexTags"] = IndexTags +def lazy_import(): + from pinecone.core.openapi.db_control.model.configure_index_request_embed import ConfigureIndexRequestEmbed + from pinecone.core.openapi.db_control.model.index_tags import IndexTags + globals()['ConfigureIndexRequestEmbed'] = ConfigureIndexRequestEmbed + globals()['IndexTags'] = IndexTags from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -69,9 +72,11 @@ class ConfigureIndexRequest(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -80,7 +85,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -96,26 +101,28 @@ def openapi_types(cls): """ lazy_import() return { - "spec": (dict,), # noqa: E501 - "deletion_protection": (str,), # noqa: E501 - "tags": (IndexTags,), # noqa: E501 - "embed": (ConfigureIndexRequestEmbed,), # noqa: E501 + 'spec': (dict,), # noqa: E501 + 'deletion_protection': (str,), # noqa: E501 + 'tags': (IndexTags,), # noqa: E501 + 'embed': (ConfigureIndexRequestEmbed,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "spec": "spec", # noqa: E501 - "deletion_protection": "deletion_protection", # noqa: E501 - "tags": "tags", # noqa: E501 - "embed": "embed", # noqa: E501 + 'spec': 'spec', # noqa: E501 + 'deletion_protection': 'deletion_protection', # noqa: E501 + 'tags': 'tags', # noqa: E501 + 'embed': 'embed', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ConfigureIndexRequest. @@ -125,7 +132,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -169,20 +179,22 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 embed (ConfigureIndexRequestEmbed): [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", ()) + _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__), + "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__,), ) @@ -197,29 +209,25 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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 @@ -263,17 +271,19 @@ def __init__(self, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -288,17 +298,13 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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/configure_index_request_embed.py b/pinecone/core/openapi/db_control/model/configure_index_request_embed.py index 88ab1d7fb..fdd231b39 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 @@ -1,14 +1,15 @@ """ -Pinecone Control Plane API + Pinecone Control Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -27,6 +28,7 @@ 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 @@ -59,9 +61,11 @@ class ConfigureIndexRequestEmbed(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -69,7 +73,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 """ - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -84,26 +88,28 @@ def openapi_types(cls): and the value is attribute type. """ return { - "model": (str,), # noqa: E501 - "field_map": ({str: (bool, dict, float, int, list, str, none_type)},), # noqa: E501 - "read_parameters": ({str: (bool, dict, float, int, list, str, none_type)},), # noqa: E501 - "write_parameters": ({str: (bool, dict, float, int, list, str, none_type)},), # noqa: E501 + 'model': (str,), # noqa: E501 + 'field_map': (Dict[str, Any],), # noqa: E501 + 'read_parameters': (Dict[str, Any],), # noqa: E501 + 'write_parameters': (Dict[str, Any],), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "model": "model", # noqa: E501 - "field_map": "field_map", # noqa: E501 - "read_parameters": "read_parameters", # noqa: E501 - "write_parameters": "write_parameters", # noqa: E501 + 'model': 'model', # noqa: E501 + 'field_map': 'field_map', # noqa: E501 + 'read_parameters': 'read_parameters', # noqa: E501 + 'write_parameters': 'write_parameters', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ConfigureIndexRequestEmbed. @@ -113,7 +119,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -152,25 +161,27 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 through its discriminator because we passed in _visited_composed_classes = (Animal,) model (str): The name of the embedding model to use with the index. The index dimension and model dimension must match, and the index similarity metric must be supported by the model. The index embedding model cannot be changed once set. [optional] # 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 will be embedded. [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 + field_map (Dict[str, Any]): Identifies the name of the text field from your document model that will be embedded. [optional] # noqa: E501 + read_parameters (Dict[str, Any]): The read parameters for the embedding model. [optional] # noqa: E501 + write_parameters (Dict[str, Any]): The write parameters for the embedding model. [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", ()) + _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__), + "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__,), ) @@ -185,29 +196,25 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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 @@ -245,23 +252,25 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 through its discriminator because we passed in _visited_composed_classes = (Animal,) model (str): The name of the embedding model to use with the index. The index dimension and model dimension must match, and the index similarity metric must be supported by the model. The index embedding model cannot be changed once set. [optional] # 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 will be embedded. [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 + field_map (Dict[str, Any]): Identifies the name of the text field from your document model that will be embedded. [optional] # noqa: E501 + read_parameters (Dict[str, Any]): The read parameters for the embedding model. [optional] # noqa: E501 + write_parameters (Dict[str, Any]): The write parameters for the embedding model. [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", ()) + _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__), + "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__,), ) @@ -276,17 +285,13 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/pinecone/core/openapi/db_control/model/create_backup_request.py b/pinecone/core/openapi/db_control/model/create_backup_request.py index 6aa071db5..fbad231fd 100644 --- a/pinecone/core/openapi/db_control/model/create_backup_request.py +++ b/pinecone/core/openapi/db_control/model/create_backup_request.py @@ -1,14 +1,15 @@ """ -Pinecone Control Plane API + Pinecone Control Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -27,6 +28,7 @@ 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 @@ -59,9 +61,11 @@ class CreateBackupRequest(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -69,7 +73,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 """ - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -84,22 +88,24 @@ def openapi_types(cls): and the value is attribute type. """ return { - "name": (str,), # noqa: E501 - "description": (str,), # noqa: E501 + 'name': (str,), # noqa: E501 + 'description': (str,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "name": "name", # noqa: E501 - "description": "description", # noqa: E501 + 'name': 'name', # noqa: E501 + 'description': 'description', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of CreateBackupRequest. @@ -109,7 +115,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -151,20 +160,22 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 description (str): A description of the backup. [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", ()) + _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__), + "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__,), ) @@ -179,29 +190,25 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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 @@ -243,17 +250,19 @@ def __init__(self, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -268,17 +277,13 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/pinecone/core/openapi/db_control/model/create_collection_request.py b/pinecone/core/openapi/db_control/model/create_collection_request.py index 89decafc4..ae8cf420f 100644 --- a/pinecone/core/openapi/db_control/model/create_collection_request.py +++ b/pinecone/core/openapi/db_control/model/create_collection_request.py @@ -1,14 +1,15 @@ """ -Pinecone Control Plane API + Pinecone Control Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -27,6 +28,7 @@ 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 @@ -59,10 +61,14 @@ class CreateCollectionRequest(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ("name",): {"max_length": 45, "min_length": 1} + ('name',): { + 'max_length': 45, + 'min_length': 1, + }, } @cached_class_property @@ -71,7 +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 """ - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -86,22 +92,24 @@ def openapi_types(cls): and the value is attribute type. """ return { - "name": (str,), # noqa: E501 - "source": (str,), # noqa: E501 + 'name': (str,), # noqa: E501 + 'source': (str,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "name": "name", # noqa: E501 - "source": "source", # noqa: E501 + 'name': 'name', # noqa: E501 + 'source': 'source', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of CreateCollectionRequest. @@ -111,7 +119,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -155,20 +166,22 @@ def _from_openapi_data(cls: Type[T], name, source, *args, **kwargs) -> T: # noq _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", ()) + _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__), + "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__,), ) @@ -185,29 +198,25 @@ def _from_openapi_data(cls: Type[T], name, source, *args, **kwargs) -> T: # noq self.name = name self.source = source for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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, source, *args, **kwargs) -> None: # noqa: E501 @@ -251,17 +260,19 @@ def __init__(self, name, source, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -278,17 +289,13 @@ def __init__(self, name, source, *args, **kwargs) -> None: # noqa: E501 self.name = name self.source = source for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/pinecone/core/openapi/db_control/model/create_index_for_model_request.py b/pinecone/core/openapi/db_control/model/create_index_for_model_request.py index 76d917383..d98bdb7ea 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 @@ -1,14 +1,15 @@ """ -Pinecone Control Plane API + Pinecone Control Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,19 +27,23 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): +if TYPE_CHECKING: 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.create_index_for_model_request_embed import CreateIndexForModelRequestEmbed 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()["IndexTags"] = IndexTags - globals()["ReadCapacity"] = ReadCapacity +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.index_tags import IndexTags + from pinecone.core.openapi.db_control.model.read_capacity import ReadCapacity + globals()['BackupModelSchema'] = BackupModelSchema + globals()['CreateIndexForModelRequestEmbed'] = CreateIndexForModelRequestEmbed + globals()['IndexTags'] = IndexTags + globals()['ReadCapacity'] = ReadCapacity from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -73,10 +78,14 @@ class CreateIndexForModelRequest(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ("name",): {"max_length": 45, "min_length": 1} + ('name',): { + 'max_length': 45, + 'min_length': 1, + }, } @cached_class_property @@ -86,7 +95,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -102,34 +111,36 @@ def openapi_types(cls): """ lazy_import() return { - "name": (str,), # noqa: E501 - "cloud": (str,), # noqa: E501 - "region": (str,), # noqa: E501 - "embed": (CreateIndexForModelRequestEmbed,), # noqa: E501 - "deletion_protection": (str,), # noqa: E501 - "tags": (IndexTags,), # noqa: E501 - "schema": (BackupModelSchema,), # noqa: E501 - "read_capacity": (ReadCapacity,), # noqa: E501 + 'name': (str,), # noqa: E501 + 'cloud': (str,), # noqa: E501 + 'region': (str,), # noqa: E501 + 'embed': (CreateIndexForModelRequestEmbed,), # noqa: E501 + 'deletion_protection': (str,), # noqa: E501 + 'tags': (IndexTags,), # noqa: E501 + 'schema': (BackupModelSchema,), # noqa: E501 + 'read_capacity': (ReadCapacity,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "name": "name", # noqa: E501 - "cloud": "cloud", # noqa: E501 - "region": "region", # noqa: E501 - "embed": "embed", # noqa: E501 - "deletion_protection": "deletion_protection", # noqa: E501 - "tags": "tags", # noqa: E501 - "schema": "schema", # noqa: E501 - "read_capacity": "read_capacity", # noqa: E501 + 'name': 'name', # noqa: E501 + 'cloud': 'cloud', # noqa: E501 + 'region': 'region', # noqa: E501 + '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([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of CreateIndexForModelRequest. @@ -139,7 +150,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -189,20 +203,22 @@ def _from_openapi_data(cls: Type[T], name, cloud, region, embed, *args, **kwargs read_capacity (ReadCapacity): [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", ()) + _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__), + "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__,), ) @@ -221,29 +237,25 @@ def _from_openapi_data(cls: Type[T], name, cloud, region, embed, *args, **kwargs self.region = region self.embed = embed for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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, cloud, region, embed, *args, **kwargs) -> None: # noqa: E501 @@ -293,17 +305,19 @@ def __init__(self, name, cloud, region, embed, *args, **kwargs) -> None: # noqa """ _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", ()) + _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__), + "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__,), ) @@ -322,17 +336,13 @@ def __init__(self, name, cloud, region, embed, *args, **kwargs) -> None: # noqa self.region = region self.embed = embed for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/pinecone/core/openapi/db_control/model/create_index_for_model_request_embed.py b/pinecone/core/openapi/db_control/model/create_index_for_model_request_embed.py index 1596a3c5f..8920b6432 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 @@ -1,14 +1,15 @@ """ -Pinecone Control Plane API + Pinecone Control Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -27,6 +28,7 @@ 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 @@ -59,9 +61,11 @@ class CreateIndexForModelRequestEmbed(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -69,7 +73,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 """ - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -84,30 +88,32 @@ def openapi_types(cls): and the value is attribute type. """ return { - "model": (str,), # noqa: E501 - "field_map": ({str: (bool, dict, float, int, list, str, none_type)},), # noqa: E501 - "metric": (str,), # noqa: E501 - "dimension": (int,), # noqa: E501 - "read_parameters": ({str: (bool, dict, float, int, list, str, none_type)},), # noqa: E501 - "write_parameters": ({str: (bool, dict, float, int, list, str, none_type)},), # noqa: E501 + 'model': (str,), # noqa: E501 + 'field_map': (Dict[str, Any],), # noqa: E501 + 'metric': (str,), # noqa: E501 + 'dimension': (int,), # noqa: E501 + 'read_parameters': (Dict[str, Any],), # noqa: E501 + 'write_parameters': (Dict[str, Any],), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "model": "model", # noqa: E501 - "field_map": "field_map", # noqa: E501 - "metric": "metric", # noqa: E501 - "dimension": "dimension", # noqa: E501 - "read_parameters": "read_parameters", # noqa: E501 - "write_parameters": "write_parameters", # noqa: E501 + 'model': 'model', # noqa: E501 + 'field_map': 'field_map', # noqa: E501 + 'metric': 'metric', # noqa: E501 + 'dimension': 'dimension', # noqa: E501 + 'read_parameters': 'read_parameters', # noqa: E501 + 'write_parameters': 'write_parameters', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of CreateIndexForModelRequestEmbed. @@ -117,7 +123,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -126,7 +135,7 @@ def _from_openapi_data(cls: Type[T], model, field_map, *args, **kwargs) -> T: # Args: model (str): The name of the embedding model to use for the index. - field_map ({str: (bool, dict, float, int, list, str, none_type)}): Identifies the name of the text field from your document model that will be embedded. + field_map (Dict[str, Any]): Identifies the name of the text field from your document model that will be embedded. Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -161,24 +170,26 @@ def _from_openapi_data(cls: Type[T], model, field_map, *args, **kwargs) -> T: # _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. 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 + read_parameters (Dict[str, Any]): The read parameters for the embedding model. [optional] # noqa: E501 + write_parameters (Dict[str, Any]): The write parameters for the embedding model. [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", ()) + _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__), + "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__,), ) @@ -195,29 +206,25 @@ def _from_openapi_data(cls: Type[T], model, field_map, *args, **kwargs) -> T: # self.model = model self.field_map = field_map for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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, model, field_map, *args, **kwargs) -> None: # noqa: E501 @@ -225,7 +232,7 @@ def __init__(self, model, field_map, *args, **kwargs) -> None: # noqa: E501 Args: model (str): The name of the embedding model to use for the index. - field_map ({str: (bool, dict, float, int, list, str, none_type)}): Identifies the name of the text field from your document model that will be embedded. + field_map (Dict[str, Any]): Identifies the name of the text field from your document model that will be embedded. Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -260,22 +267,24 @@ def __init__(self, model, field_map, *args, **kwargs) -> None: # noqa: E501 _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. 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 + read_parameters (Dict[str, Any]): The read parameters for the embedding model. [optional] # noqa: E501 + write_parameters (Dict[str, Any]): The write parameters for the embedding model. [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", ()) + _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__), + "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__,), ) @@ -292,17 +301,13 @@ def __init__(self, model, field_map, *args, **kwargs) -> None: # noqa: E501 self.model = model self.field_map = field_map for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/pinecone/core/openapi/db_control/model/create_index_from_backup_request.py b/pinecone/core/openapi/db_control/model/create_index_from_backup_request.py index f423bf004..d15afbdcf 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 @@ -1,14 +1,15 @@ """ -Pinecone Control Plane API + Pinecone Control Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,11 +27,14 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): +if TYPE_CHECKING: from pinecone.core.openapi.db_control.model.index_tags import IndexTags - globals()["IndexTags"] = IndexTags +def lazy_import(): + from pinecone.core.openapi.db_control.model.index_tags import IndexTags + globals()['IndexTags'] = IndexTags from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -65,10 +69,14 @@ class CreateIndexFromBackupRequest(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ("name",): {"max_length": 45, "min_length": 1} + ('name',): { + 'max_length': 45, + 'min_length': 1, + }, } @cached_class_property @@ -78,7 +86,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -94,24 +102,26 @@ def openapi_types(cls): """ lazy_import() return { - "name": (str,), # noqa: E501 - "tags": (IndexTags,), # noqa: E501 - "deletion_protection": (str,), # noqa: E501 + 'name': (str,), # noqa: E501 + 'tags': (IndexTags,), # noqa: E501 + 'deletion_protection': (str,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "name": "name", # noqa: E501 - "tags": "tags", # noqa: E501 - "deletion_protection": "deletion_protection", # noqa: E501 + 'name': 'name', # noqa: E501 + 'tags': 'tags', # noqa: E501 + 'deletion_protection': 'deletion_protection', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of CreateIndexFromBackupRequest. @@ -121,7 +131,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -166,20 +179,22 @@ def _from_openapi_data(cls: Type[T], name, *args, **kwargs) -> T: # 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) - _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", ()) + _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__), + "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__,), ) @@ -195,29 +210,25 @@ def _from_openapi_data(cls: Type[T], name, *args, **kwargs) -> T: # noqa: E501 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 - ): + 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", - ] - ) + 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 @@ -262,17 +273,19 @@ def __init__(self, name, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -288,17 +301,13 @@ def __init__(self, name, *args, **kwargs) -> None: # noqa: E501 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 - ): + 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." - ) + raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/pinecone/core/openapi/db_control/model/create_index_from_backup_response.py b/pinecone/core/openapi/db_control/model/create_index_from_backup_response.py index 42655b049..877002e54 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 @@ -1,14 +1,15 @@ """ -Pinecone Control Plane API + Pinecone Control Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -27,6 +28,7 @@ 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 @@ -59,9 +61,11 @@ class CreateIndexFromBackupResponse(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -69,7 +73,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 """ - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -84,22 +88,24 @@ def openapi_types(cls): and the value is attribute type. """ return { - "restore_job_id": (str,), # noqa: E501 - "index_id": (str,), # noqa: E501 + 'restore_job_id': (str,), # noqa: E501 + 'index_id': (str,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "restore_job_id": "restore_job_id", # noqa: E501 - "index_id": "index_id", # noqa: E501 + 'restore_job_id': 'restore_job_id', # noqa: E501 + 'index_id': 'index_id', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of CreateIndexFromBackupResponse. @@ -109,7 +115,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -153,20 +162,22 @@ def _from_openapi_data(cls: Type[T], restore_job_id, index_id, *args, **kwargs) _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", ()) + _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__), + "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__,), ) @@ -183,29 +194,25 @@ def _from_openapi_data(cls: Type[T], restore_job_id, index_id, *args, **kwargs) self.restore_job_id = restore_job_id self.index_id = index_id for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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, restore_job_id, index_id, *args, **kwargs) -> None: # noqa: E501 @@ -249,17 +256,19 @@ def __init__(self, restore_job_id, index_id, *args, **kwargs) -> None: # noqa: """ _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", ()) + _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__), + "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__,), ) @@ -276,17 +285,13 @@ def __init__(self, restore_job_id, index_id, *args, **kwargs) -> None: # noqa: self.restore_job_id = restore_job_id self.index_id = index_id for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/pinecone/core/openapi/db_control/model/create_index_request.py b/pinecone/core/openapi/db_control/model/create_index_request.py index c43cc4bc8..e90bd7eff 100644 --- a/pinecone/core/openapi/db_control/model/create_index_request.py +++ b/pinecone/core/openapi/db_control/model/create_index_request.py @@ -1,14 +1,15 @@ """ -Pinecone Control Plane API + Pinecone Control Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,13 +27,17 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): +if TYPE_CHECKING: from pinecone.core.openapi.db_control.model.index_spec import IndexSpec from pinecone.core.openapi.db_control.model.index_tags import IndexTags - globals()["IndexSpec"] = IndexSpec - globals()["IndexTags"] = IndexTags +def lazy_import(): + from pinecone.core.openapi.db_control.model.index_spec import IndexSpec + from pinecone.core.openapi.db_control.model.index_tags import IndexTags + globals()['IndexSpec'] = IndexSpec + globals()['IndexTags'] = IndexTags from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -67,11 +72,18 @@ class CreateIndexRequest(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ("name",): {"max_length": 45, "min_length": 1}, - ("dimension",): {"inclusive_maximum": 20000, "inclusive_minimum": 1}, + ('name',): { + 'max_length': 45, + 'min_length': 1, + }, + ('dimension',): { + 'inclusive_maximum': 20000, + 'inclusive_minimum': 1, + }, } @cached_class_property @@ -81,7 +93,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -97,32 +109,34 @@ def openapi_types(cls): """ lazy_import() return { - "name": (str,), # noqa: E501 - "spec": (IndexSpec,), # noqa: E501 - "dimension": (int,), # noqa: E501 - "metric": (str,), # noqa: E501 - "deletion_protection": (str,), # noqa: E501 - "tags": (IndexTags,), # noqa: E501 - "vector_type": (str,), # noqa: E501 + 'name': (str,), # noqa: E501 + 'spec': (IndexSpec,), # noqa: E501 + 'dimension': (int,), # noqa: E501 + 'metric': (str,), # noqa: E501 + 'deletion_protection': (str,), # noqa: E501 + 'tags': (IndexTags,), # noqa: E501 + 'vector_type': (str,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "name": "name", # noqa: E501 - "spec": "spec", # noqa: E501 - "dimension": "dimension", # noqa: E501 - "metric": "metric", # noqa: E501 - "deletion_protection": "deletion_protection", # noqa: E501 - "tags": "tags", # noqa: E501 - "vector_type": "vector_type", # noqa: E501 + 'name': 'name', # noqa: E501 + 'spec': 'spec', # noqa: E501 + 'dimension': 'dimension', # noqa: E501 + 'metric': 'metric', # noqa: E501 + 'deletion_protection': 'deletion_protection', # noqa: E501 + 'tags': 'tags', # noqa: E501 + 'vector_type': 'vector_type', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of CreateIndexRequest. @@ -132,7 +146,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -181,20 +198,22 @@ def _from_openapi_data(cls: Type[T], name, spec, *args, **kwargs) -> T: # noqa: 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 """ - _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", ()) + _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__), + "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__,), ) @@ -211,29 +230,25 @@ def _from_openapi_data(cls: Type[T], name, spec, *args, **kwargs) -> T: # noqa: self.name = name self.spec = spec for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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, spec, *args, **kwargs) -> None: # noqa: E501 @@ -282,17 +297,19 @@ def __init__(self, name, spec, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -309,17 +326,13 @@ def __init__(self, name, spec, *args, **kwargs) -> None: # noqa: E501 self.name = name self.spec = spec for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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/error_response.py b/pinecone/core/openapi/db_control/model/error_response.py index 4ef4eb266..b0996f847 100644 --- a/pinecone/core/openapi/db_control/model/error_response.py +++ b/pinecone/core/openapi/db_control/model/error_response.py @@ -1,14 +1,15 @@ """ -Pinecone Control Plane API + Pinecone Control Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,11 +27,14 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): +if TYPE_CHECKING: from pinecone.core.openapi.db_control.model.error_response_error import ErrorResponseError - globals()["ErrorResponseError"] = ErrorResponseError +def lazy_import(): + from pinecone.core.openapi.db_control.model.error_response_error import ErrorResponseError + globals()['ErrorResponseError'] = ErrorResponseError from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -65,9 +69,11 @@ class ErrorResponse(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -76,7 +82,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -92,22 +98,24 @@ def openapi_types(cls): """ lazy_import() return { - "status": (int,), # noqa: E501 - "error": (ErrorResponseError,), # noqa: E501 + 'status': (int,), # noqa: E501 + 'error': (ErrorResponseError,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "status": "status", # noqa: E501 - "error": "error", # noqa: E501 + 'status': 'status', # noqa: E501 + 'error': 'error', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ErrorResponse. @@ -117,7 +125,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -161,20 +172,22 @@ def _from_openapi_data(cls: Type[T], status, error, *args, **kwargs) -> T: # no _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", ()) + _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__), + "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__,), ) @@ -191,29 +204,25 @@ def _from_openapi_data(cls: Type[T], status, error, *args, **kwargs) -> T: # no self.status = status self.error = error for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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, status, error, *args, **kwargs) -> None: # noqa: E501 @@ -257,17 +266,19 @@ def __init__(self, status, error, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -284,17 +295,13 @@ def __init__(self, status, error, *args, **kwargs) -> None: # noqa: E501 self.status = status self.error = error for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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/error_response_error.py b/pinecone/core/openapi/db_control/model/error_response_error.py index 8a6447e09..ace4a86de 100644 --- a/pinecone/core/openapi/db_control/model/error_response_error.py +++ b/pinecone/core/openapi/db_control/model/error_response_error.py @@ -1,14 +1,15 @@ """ -Pinecone Control Plane API + Pinecone Control Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -27,6 +28,7 @@ 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 @@ -59,9 +61,11 @@ class ErrorResponseError(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -69,7 +73,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 """ - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -84,24 +88,26 @@ def openapi_types(cls): and the value is attribute type. """ return { - "code": (str,), # noqa: E501 - "message": (str,), # noqa: E501 - "details": ({str: (bool, dict, float, int, list, str, none_type)},), # noqa: E501 + 'code': (str,), # noqa: E501 + 'message': (str,), # noqa: E501 + 'details': (Dict[str, Any],), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "code": "code", # noqa: E501 - "message": "message", # noqa: E501 - "details": "details", # noqa: E501 + 'code': 'code', # noqa: E501 + 'message': 'message', # noqa: E501 + 'details': 'details', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ErrorResponseError. @@ -111,7 +117,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -153,23 +162,25 @@ def _from_openapi_data(cls: Type[T], code, message, *args, **kwargs) -> T: # no Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - details ({str: (bool, dict, float, int, list, str, none_type)}): Additional information about the error. This field is not guaranteed to be present. [optional] # noqa: E501 + details (Dict[str, Any]): Additional information about the error. This field is not guaranteed to be present. [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", ()) + _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__), + "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__,), ) @@ -186,29 +197,25 @@ def _from_openapi_data(cls: Type[T], code, message, *args, **kwargs) -> T: # no self.code = code self.message = message for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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, code, message, *args, **kwargs) -> None: # noqa: E501 @@ -249,21 +256,23 @@ def __init__(self, code, message, *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,) - details ({str: (bool, dict, float, int, list, str, none_type)}): Additional information about the error. This field is not guaranteed to be present. [optional] # noqa: E501 + details (Dict[str, Any]): Additional information about the error. This field is not guaranteed to be present. [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", ()) + _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__), + "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__,), ) @@ -280,17 +289,13 @@ def __init__(self, code, message, *args, **kwargs) -> None: # noqa: E501 self.code = code self.message = message for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/pinecone/core/openapi/db_control/model/index_list.py b/pinecone/core/openapi/db_control/model/index_list.py index db71f2ce9..298fdc33b 100644 --- a/pinecone/core/openapi/db_control/model/index_list.py +++ b/pinecone/core/openapi/db_control/model/index_list.py @@ -1,14 +1,15 @@ """ -Pinecone Control Plane API + Pinecone Control Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,11 +27,14 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): +if TYPE_CHECKING: from pinecone.core.openapi.db_control.model.index_model import IndexModel - globals()["IndexModel"] = IndexModel +def lazy_import(): + from pinecone.core.openapi.db_control.model.index_model import IndexModel + globals()['IndexModel'] = IndexModel from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -65,9 +69,11 @@ class IndexList(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -76,7 +82,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -92,20 +98,22 @@ def openapi_types(cls): """ lazy_import() return { - "indexes": ([IndexModel],) # noqa: E501 + 'indexes': ([IndexModel],), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "indexes": "indexes" # noqa: E501 + 'indexes': 'indexes', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of IndexList. @@ -115,7 +123,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -156,20 +167,22 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 indexes ([IndexModel]): List of indexes in the project [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", ()) + _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__), + "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__,), ) @@ -184,29 +197,25 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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 @@ -247,17 +256,19 @@ def __init__(self, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -272,17 +283,13 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/pinecone/core/openapi/db_control/model/index_model.py b/pinecone/core/openapi/db_control/model/index_model.py index 50fbd16b2..81b1bd544 100644 --- a/pinecone/core/openapi/db_control/model/index_model.py +++ b/pinecone/core/openapi/db_control/model/index_model.py @@ -1,14 +1,15 @@ """ -Pinecone Control Plane API + Pinecone Control Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,15 +27,20 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): +if TYPE_CHECKING: 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()["IndexModelStatus"] = IndexModelStatus - globals()["IndexTags"] = IndexTags - globals()["ModelIndexEmbed"] = ModelIndexEmbed +def lazy_import(): + 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()['IndexModelStatus'] = IndexModelStatus + globals()['IndexTags'] = IndexTags + globals()['ModelIndexEmbed'] = ModelIndexEmbed from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -69,11 +75,18 @@ class IndexModel(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ("name",): {"max_length": 45, "min_length": 1}, - ("dimension",): {"inclusive_maximum": 20000, "inclusive_minimum": 1}, + ('name',): { + 'max_length': 45, + 'min_length': 1, + }, + ('dimension',): { + 'inclusive_maximum': 20000, + 'inclusive_minimum': 1, + }, } @cached_class_property @@ -83,7 +96,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -99,40 +112,42 @@ def openapi_types(cls): """ lazy_import() return { - "name": (str,), # noqa: E501 - "metric": (str,), # noqa: E501 - "host": (str,), # 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 - "private_host": (str,), # noqa: E501 - "deletion_protection": (str,), # noqa: E501 - "tags": (IndexTags,), # noqa: E501 - "embed": (ModelIndexEmbed,), # noqa: E501 + 'name': (str,), # noqa: E501 + 'metric': (str,), # noqa: E501 + 'host': (str,), # noqa: E501 + 'spec': (Dict[str, Any],), # noqa: E501 + 'status': (IndexModelStatus,), # noqa: E501 + 'vector_type': (str,), # noqa: E501 + 'dimension': (int,), # noqa: E501 + 'private_host': (str,), # noqa: E501 + 'deletion_protection': (str,), # noqa: E501 + 'tags': (IndexTags,), # noqa: E501 + 'embed': (ModelIndexEmbed,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "name": "name", # noqa: E501 - "metric": "metric", # noqa: E501 - "host": "host", # noqa: E501 - "spec": "spec", # noqa: E501 - "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 + 'name': 'name', # noqa: E501 + 'metric': 'metric', # noqa: E501 + 'host': 'host', # noqa: E501 + 'spec': 'spec', # noqa: E501 + '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 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of IndexModel. @@ -142,7 +157,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -153,7 +171,7 @@ def _from_openapi_data(cls: Type[T], name, metric, host, spec, status, *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'. Possible values: `cosine`, `euclidean`, or `dotproduct`. host (str): The URL address where the index is hosted. - spec ({str: (bool, dict, float, int, list, str, none_type)}): The spec object defines how the index should be deployed. + spec (Dict[str, Any]): The spec object defines how the index should be deployed. status (IndexModelStatus): Keyword Args: @@ -195,21 +213,23 @@ def _from_openapi_data(cls: Type[T], name, metric, host, spec, status, *args, ** embed (ModelIndexEmbed): [optional] # noqa: E501 """ - vector_type = kwargs.get("vector_type", "dense") - _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", ()) + vector_type = kwargs.get('vector_type', "dense") + _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__), + "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__,), ) @@ -230,29 +250,25 @@ def _from_openapi_data(cls: Type[T], name, metric, host, spec, status, *args, ** self.status = status self.vector_type = vector_type for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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, metric, host, spec, status, *args, **kwargs) -> None: # noqa: E501 @@ -262,7 +278,7 @@ def __init__(self, name, metric, host, spec, status, *args, **kwargs) -> None: 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'. Possible values: `cosine`, `euclidean`, or `dotproduct`. host (str): The URL address where the index is hosted. - spec ({str: (bool, dict, float, int, list, str, none_type)}): The spec object defines how the index should be deployed. + spec (Dict[str, Any]): The spec object defines how the index should be deployed. status (IndexModelStatus): Keyword Args: @@ -304,19 +320,21 @@ def __init__(self, name, metric, host, spec, status, *args, **kwargs) -> None: embed (ModelIndexEmbed): [optional] # noqa: E501 """ - vector_type = kwargs.get("vector_type", "dense") + vector_type = kwargs.get('vector_type', "dense") _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", ()) + _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__), + "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__,), ) @@ -337,17 +355,13 @@ def __init__(self, name, metric, host, spec, status, *args, **kwargs) -> None: self.status = status self.vector_type = vector_type for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/pinecone/core/openapi/db_control/model/index_model_status.py b/pinecone/core/openapi/db_control/model/index_model_status.py index aff29b628..0d011a531 100644 --- a/pinecone/core/openapi/db_control/model/index_model_status.py +++ b/pinecone/core/openapi/db_control/model/index_model_status.py @@ -1,14 +1,15 @@ """ -Pinecone Control Plane API + Pinecone Control Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -27,6 +28,7 @@ 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 @@ -59,9 +61,11 @@ class IndexModelStatus(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -69,7 +73,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 """ - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -84,22 +88,24 @@ def openapi_types(cls): and the value is attribute type. """ return { - "ready": (bool,), # noqa: E501 - "state": (str,), # noqa: E501 + 'ready': (bool,), # noqa: E501 + 'state': (str,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "ready": "ready", # noqa: E501 - "state": "state", # noqa: E501 + 'ready': 'ready', # noqa: E501 + 'state': 'state', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of IndexModelStatus. @@ -109,7 +115,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -153,20 +162,22 @@ def _from_openapi_data(cls: Type[T], ready, state, *args, **kwargs) -> T: # noq _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", ()) + _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__), + "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__,), ) @@ -183,29 +194,25 @@ def _from_openapi_data(cls: Type[T], ready, state, *args, **kwargs) -> T: # noq self.ready = ready 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 - ): + 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", - ] - ) + 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, ready, state, *args, **kwargs) -> None: # noqa: E501 @@ -249,17 +256,19 @@ def __init__(self, ready, state, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -276,17 +285,13 @@ def __init__(self, ready, state, *args, **kwargs) -> None: # noqa: E501 self.ready = ready 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 - ): + 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." - ) + raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/pinecone/core/openapi/db_control/model/index_spec.py b/pinecone/core/openapi/db_control/model/index_spec.py index ac7cf2a4f..70d102c9a 100644 --- a/pinecone/core/openapi/db_control/model/index_spec.py +++ b/pinecone/core/openapi/db_control/model/index_spec.py @@ -1,14 +1,15 @@ """ -Pinecone Control Plane API + Pinecone Control Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,8 +27,9 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): +if TYPE_CHECKING: 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 @@ -35,12 +37,19 @@ def lazy_import(): 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 +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 from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -75,9 +84,11 @@ class IndexSpec(ModelComposed): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -86,7 +97,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -102,22 +113,24 @@ def openapi_types(cls): """ lazy_import() return { - "serverless": (ServerlessSpec,), # noqa: E501 - "pod": (PodSpec,), # noqa: E501 - "byoc": (ByocSpec,), # noqa: E501 + 'serverless': (ServerlessSpec,), # noqa: E501 + 'pod': (PodSpec,), # noqa: E501 + 'byoc': (ByocSpec,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "serverless": "serverless", # noqa: E501 - "pod": "pod", # noqa: E501 - "byoc": "byoc", # noqa: E501 + 'serverless': 'serverless', # noqa: E501 + 'pod': 'pod', # noqa: E501 + 'byoc': 'byoc', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) @classmethod @convert_js_args_to_python_args @@ -160,18 +173,20 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 byoc (ByocSpec): [optional] # noqa: E501 """ - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) self = super(OpenApiModel, cls).__new__(cls) if args: raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % (args, self.__class__.__name__), + "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__,), ) @@ -184,46 +199,43 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 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, + '_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) + 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 - ): + 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", - ] - ) + 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 @@ -265,18 +277,20 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 byoc (ByocSpec): [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", ()) + _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__), + "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__,), ) @@ -291,36 +305,33 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 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, + '_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) + 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 - ): + 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." - ) + 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 + def _composed_schemas(): # 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 @@ -329,4 +340,14 @@ def _composed_schemas(): # type: ignore # classes don't exist yet because their module has not finished # loading lazy_import() - return {"anyOf": [], "allOf": [], "oneOf": [BYOC, PodBased, Serverless]} + 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 61f3060a8..5a78e612a 100644 --- a/pinecone/core/openapi/db_control/model/index_tags.py +++ b/pinecone/core/openapi/db_control/model/index_tags.py @@ -1,14 +1,15 @@ """ -Pinecone Control Plane API + Pinecone Control Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -27,6 +28,7 @@ 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 @@ -59,9 +61,11 @@ class IndexTags(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -83,17 +87,21 @@ def openapi_types(cls): openapi_types (dict): The key is attribute name and the value is attribute type. """ - return {} + return { + } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = {} - read_only_vars: Set[str] = set([]) + attribute_map: Dict[str, str] = { + } + + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of IndexTags. @@ -103,7 +111,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -143,20 +154,22 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 _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", ()) + _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__), + "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__,), ) @@ -171,29 +184,25 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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 @@ -233,17 +242,19 @@ def __init__(self, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -258,17 +269,13 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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/model_index_embed.py b/pinecone/core/openapi/db_control/model/model_index_embed.py index b860c6db5..f54a764bf 100644 --- a/pinecone/core/openapi/db_control/model/model_index_embed.py +++ b/pinecone/core/openapi/db_control/model/model_index_embed.py @@ -1,14 +1,15 @@ """ -Pinecone Control Plane API + Pinecone Control Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -27,6 +28,7 @@ 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 @@ -59,10 +61,14 @@ class ModelIndexEmbed(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ("dimension",): {"inclusive_maximum": 20000, "inclusive_minimum": 1} + ('dimension',): { + 'inclusive_maximum': 20000, + 'inclusive_minimum': 1, + }, } @cached_class_property @@ -71,7 +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 """ - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -86,32 +92,34 @@ def openapi_types(cls): and the value is attribute type. """ return { - "model": (str,), # noqa: E501 - "metric": (str,), # noqa: E501 - "dimension": (int,), # noqa: E501 - "vector_type": (str,), # noqa: E501 - "field_map": ({str: (bool, dict, float, int, list, str, none_type)},), # noqa: E501 - "read_parameters": ({str: (bool, dict, float, int, list, str, none_type)},), # noqa: E501 - "write_parameters": ({str: (bool, dict, float, int, list, str, none_type)},), # noqa: E501 + 'model': (str,), # noqa: E501 + 'metric': (str,), # noqa: E501 + 'dimension': (int,), # noqa: E501 + 'vector_type': (str,), # noqa: E501 + 'field_map': (Dict[str, Any],), # noqa: E501 + 'read_parameters': (Dict[str, Any],), # noqa: E501 + 'write_parameters': (Dict[str, Any],), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "model": "model", # noqa: E501 - "metric": "metric", # noqa: E501 - "dimension": "dimension", # noqa: E501 - "vector_type": "vector_type", # noqa: E501 - "field_map": "field_map", # noqa: E501 - "read_parameters": "read_parameters", # noqa: E501 - "write_parameters": "write_parameters", # noqa: E501 + 'model': 'model', # noqa: E501 + 'metric': 'metric', # noqa: E501 + 'dimension': 'dimension', # noqa: E501 + 'vector_type': 'vector_type', # noqa: E501 + 'field_map': 'field_map', # noqa: E501 + 'read_parameters': 'read_parameters', # noqa: E501 + 'write_parameters': 'write_parameters', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ModelIndexEmbed. @@ -121,7 +129,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -165,25 +176,27 @@ def _from_openapi_data(cls: Type[T], model, *args, **kwargs) -> T: # 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 - 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 + field_map (Dict[str, Any]): Identifies the name of the text field from your document model that is embedded. [optional] # noqa: E501 + read_parameters (Dict[str, Any]): The read parameters for the embedding model. [optional] # noqa: E501 + write_parameters (Dict[str, Any]): The write parameters for the embedding model. [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", ()) + _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__), + "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__,), ) @@ -199,29 +212,25 @@ def _from_openapi_data(cls: Type[T], model, *args, **kwargs) -> T: # noqa: E501 self.model = model for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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, model, *args, **kwargs) -> None: # noqa: E501 @@ -264,23 +273,25 @@ def __init__(self, model, *args, **kwargs) -> None: # 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 - 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 + field_map (Dict[str, Any]): Identifies the name of the text field from your document model that is embedded. [optional] # noqa: E501 + read_parameters (Dict[str, Any]): The read parameters for the embedding model. [optional] # noqa: E501 + write_parameters (Dict[str, Any]): The write parameters for the embedding model. [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", ()) + _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__), + "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__,), ) @@ -296,17 +307,13 @@ def __init__(self, model, *args, **kwargs) -> None: # noqa: E501 self.model = model for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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/pagination_response.py b/pinecone/core/openapi/db_control/model/pagination_response.py index fdabb8dfa..dabf238e6 100644 --- a/pinecone/core/openapi/db_control/model/pagination_response.py +++ b/pinecone/core/openapi/db_control/model/pagination_response.py @@ -1,14 +1,15 @@ """ -Pinecone Control Plane API + Pinecone Control Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -27,6 +28,7 @@ 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 @@ -59,9 +61,11 @@ class PaginationResponse(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -69,7 +73,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 """ - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -84,20 +88,22 @@ def openapi_types(cls): and the value is attribute type. """ return { - "next": (str,) # noqa: E501 + 'next': (str,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "next": "next" # noqa: E501 + 'next': 'next', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of PaginationResponse. @@ -107,7 +113,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -150,20 +159,22 @@ def _from_openapi_data(cls: Type[T], next, *args, **kwargs) -> T: # noqa: E501 _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", ()) + _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__), + "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__,), ) @@ -179,29 +190,25 @@ def _from_openapi_data(cls: Type[T], next, *args, **kwargs) -> T: # noqa: E501 self.next = next for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + 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", - ] - ) + 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, next, *args, **kwargs) -> None: # noqa: E501 @@ -244,17 +251,19 @@ def __init__(self, next, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -270,17 +279,13 @@ def __init__(self, next, *args, **kwargs) -> None: # noqa: E501 self.next = next for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + 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." - ) + 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/pod_based.py b/pinecone/core/openapi/db_control/model/pod_based.py index 13df8964a..f1c33498d 100644 --- a/pinecone/core/openapi/db_control/model/pod_based.py +++ b/pinecone/core/openapi/db_control/model/pod_based.py @@ -1,14 +1,15 @@ """ -Pinecone Control Plane API + Pinecone Control Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,11 +27,14 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): +if TYPE_CHECKING: from pinecone.core.openapi.db_control.model.pod_spec import PodSpec - globals()["PodSpec"] = PodSpec +def lazy_import(): + from pinecone.core.openapi.db_control.model.pod_spec import PodSpec + globals()['PodSpec'] = PodSpec from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -65,9 +69,11 @@ class PodBased(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -76,7 +82,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -92,20 +98,22 @@ def openapi_types(cls): """ lazy_import() return { - "pod": (PodSpec,) # noqa: E501 + 'pod': (PodSpec,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "pod": "pod" # noqa: E501 + 'pod': 'pod', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of PodBased. @@ -115,7 +123,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -158,20 +169,22 @@ def _from_openapi_data(cls: Type[T], pod, *args, **kwargs) -> T: # noqa: E501 _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", ()) + _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__), + "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__,), ) @@ -187,29 +200,25 @@ def _from_openapi_data(cls: Type[T], pod, *args, **kwargs) -> T: # noqa: E501 self.pod = pod for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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, pod, *args, **kwargs) -> None: # noqa: E501 @@ -252,17 +261,19 @@ def __init__(self, pod, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -278,17 +289,13 @@ def __init__(self, pod, *args, **kwargs) -> None: # noqa: E501 self.pod = pod for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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/pod_spec.py b/pinecone/core/openapi/db_control/model/pod_spec.py index c401b050a..489a87e89 100644 --- a/pinecone/core/openapi/db_control/model/pod_spec.py +++ b/pinecone/core/openapi/db_control/model/pod_spec.py @@ -1,14 +1,15 @@ """ -Pinecone Control Plane API + Pinecone Control Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,13 +27,14 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): - from pinecone.core.openapi.db_control.model.pod_spec_metadata_config import ( - PodSpecMetadataConfig, - ) +if TYPE_CHECKING: + from pinecone.core.openapi.db_control.model.pod_spec_metadata_config import PodSpecMetadataConfig - globals()["PodSpecMetadataConfig"] = PodSpecMetadataConfig +def lazy_import(): + from pinecone.core.openapi.db_control.model.pod_spec_metadata_config import PodSpecMetadataConfig + globals()['PodSpecMetadataConfig'] = PodSpecMetadataConfig from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -67,12 +69,19 @@ class PodSpec(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ("replicas",): {"inclusive_minimum": 1}, - ("shards",): {"inclusive_minimum": 1}, - ("pods",): {"inclusive_minimum": 1}, + ('replicas',): { + 'inclusive_minimum': 1, + }, + ('shards',): { + 'inclusive_minimum': 1, + }, + ('pods',): { + 'inclusive_minimum': 1, + }, } @cached_class_property @@ -82,7 +91,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -98,32 +107,34 @@ def openapi_types(cls): """ lazy_import() return { - "environment": (str,), # noqa: E501 - "pod_type": (str,), # noqa: E501 - "replicas": (int,), # noqa: E501 - "shards": (int,), # noqa: E501 - "pods": (int,), # noqa: E501 - "metadata_config": (PodSpecMetadataConfig,), # noqa: E501 - "source_collection": (str,), # noqa: E501 + 'environment': (str,), # noqa: E501 + 'pod_type': (str,), # noqa: E501 + 'replicas': (int,), # noqa: E501 + 'shards': (int,), # noqa: E501 + 'pods': (int,), # noqa: E501 + 'metadata_config': (PodSpecMetadataConfig,), # noqa: E501 + 'source_collection': (str,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "environment": "environment", # noqa: E501 - "pod_type": "pod_type", # noqa: E501 - "replicas": "replicas", # noqa: E501 - "shards": "shards", # noqa: E501 - "pods": "pods", # noqa: E501 - "metadata_config": "metadata_config", # noqa: E501 - "source_collection": "source_collection", # noqa: E501 + 'environment': 'environment', # noqa: E501 + 'pod_type': 'pod_type', # noqa: E501 + 'replicas': 'replicas', # noqa: E501 + 'shards': 'shards', # noqa: E501 + 'pods': 'pods', # noqa: E501 + 'metadata_config': 'metadata_config', # noqa: E501 + 'source_collection': 'source_collection', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of PodSpec. @@ -133,7 +144,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -182,21 +196,23 @@ def _from_openapi_data(cls: Type[T], environment, *args, **kwargs) -> T: # noqa source_collection (str): The name of the collection to be used as the source for the index. [optional] # noqa: E501 """ - pod_type = kwargs.get("pod_type", "p1.x1") - _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", ()) + pod_type = kwargs.get('pod_type', "p1.x1") + _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__), + "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__,), ) @@ -213,29 +229,25 @@ def _from_openapi_data(cls: Type[T], environment, *args, **kwargs) -> T: # noqa self.environment = environment self.pod_type = pod_type for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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, environment, *args, **kwargs) -> None: # noqa: E501 @@ -283,19 +295,21 @@ def __init__(self, environment, *args, **kwargs) -> None: # noqa: E501 source_collection (str): The name of the collection to be used as the source for the index. [optional] # noqa: E501 """ - pod_type = kwargs.get("pod_type", "p1.x1") + pod_type = kwargs.get('pod_type', "p1.x1") _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", ()) + _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__), + "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__,), ) @@ -312,17 +326,13 @@ def __init__(self, environment, *args, **kwargs) -> None: # noqa: E501 self.environment = environment self.pod_type = pod_type for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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/pod_spec_metadata_config.py b/pinecone/core/openapi/db_control/model/pod_spec_metadata_config.py index 9ce33ee3e..fd3c7289d 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 @@ -1,14 +1,15 @@ """ -Pinecone Control Plane API + Pinecone Control Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -27,6 +28,7 @@ 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 @@ -59,9 +61,11 @@ class PodSpecMetadataConfig(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -69,7 +73,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 """ - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -84,20 +88,22 @@ def openapi_types(cls): and the value is attribute type. """ return { - "indexed": ([str],) # noqa: E501 + 'indexed': ([str],), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "indexed": "indexed" # noqa: E501 + 'indexed': 'indexed', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of PodSpecMetadataConfig. @@ -107,7 +113,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -148,20 +157,22 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 indexed ([str]): By default, all metadata is indexed; to change this behavior, use this property to specify an array of metadata fields that should be indexed. [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", ()) + _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__), + "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__,), ) @@ -176,29 +187,25 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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 @@ -239,17 +246,19 @@ def __init__(self, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -264,17 +273,13 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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.py b/pinecone/core/openapi/db_control/model/read_capacity.py index 4b773a4f8..ab45a53f1 100644 --- a/pinecone/core/openapi/db_control/model/read_capacity.py +++ b/pinecone/core/openapi/db_control/model/read_capacity.py @@ -1,14 +1,15 @@ """ -Pinecone Control Plane API + Pinecone Control Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,21 +27,20 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -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, - ) +if TYPE_CHECKING: + 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 +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 @@ -75,9 +75,11 @@ class ReadCapacity(ModelComposed): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -86,7 +88,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -102,29 +104,30 @@ def openapi_types(cls): """ lazy_import() return { - "mode": (str,), # noqa: E501 - "dedicated": (ReadCapacityDedicatedConfig,), # noqa: E501 + '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, + 'Dedicated': ReadCapacityDedicatedSpec, + 'OnDemand': ReadCapacityOnDemandSpec, + 'ReadCapacityDedicatedSpec': ReadCapacityDedicatedSpec, + 'ReadCapacityOnDemandSpec': ReadCapacityOnDemandSpec, } if not val: return None - return {"mode": val} + return {'mode': val} attribute_map: Dict[str, str] = { - "mode": "mode", # noqa: E501 - "dedicated": "dedicated", # noqa: E501 + 'mode': 'mode', # noqa: E501 + 'dedicated': 'dedicated', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) @classmethod @convert_js_args_to_python_args @@ -166,18 +169,20 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # 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", ()) + _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__), + "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__,), ) @@ -190,46 +195,43 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 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, + '_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) + 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 - ): + 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", - ] - ) + 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 @@ -270,18 +272,20 @@ def __init__(self, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -296,36 +300,33 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 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, + '_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) + 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 - ): + 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." - ) + 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 + def _composed_schemas(): # 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 @@ -335,7 +336,12 @@ def _composed_schemas(): # type: ignore # loading lazy_import() return { - "anyOf": [], - "allOf": [], - "oneOf": [ReadCapacityDedicatedSpec, ReadCapacityOnDemandSpec], + '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 index 371fed24a..0f5e838e8 100644 --- a/pinecone/core/openapi/db_control/model/read_capacity_dedicated_config.py +++ b/pinecone/core/openapi/db_control/model/read_capacity_dedicated_config.py @@ -1,14 +1,15 @@ """ -Pinecone Control Plane API + Pinecone Control Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,11 +27,14 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): +if TYPE_CHECKING: from pinecone.core.openapi.db_control.model.scaling_config_manual import ScalingConfigManual - globals()["ScalingConfigManual"] = ScalingConfigManual +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 @@ -65,9 +69,11 @@ class ReadCapacityDedicatedConfig(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -76,7 +82,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -92,24 +98,26 @@ def openapi_types(cls): """ lazy_import() return { - "node_type": (str,), # noqa: E501 - "scaling": (str,), # noqa: E501 - "manual": (ScalingConfigManual,), # noqa: E501 + '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 + 'node_type': 'node_type', # noqa: E501 + 'scaling': 'scaling', # noqa: E501 + 'manual': 'manual', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ReadCapacityDedicatedConfig. @@ -119,7 +127,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -164,20 +175,22 @@ def _from_openapi_data(cls: Type[T], node_type, scaling, *args, **kwargs) -> T: 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", ()) + _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__), + "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__,), ) @@ -194,29 +207,25 @@ def _from_openapi_data(cls: Type[T], node_type, scaling, *args, **kwargs) -> T: 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 - ): + 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", - ] - ) + 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 @@ -261,17 +270,19 @@ def __init__(self, node_type, scaling, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -288,17 +299,13 @@ def __init__(self, node_type, scaling, *args, **kwargs) -> None: # noqa: E501 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 - ): + 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." - ) + 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 index df34bf63e..848455ac6 100644 --- a/pinecone/core/openapi/db_control/model/read_capacity_dedicated_spec.py +++ b/pinecone/core/openapi/db_control/model/read_capacity_dedicated_spec.py @@ -1,14 +1,15 @@ """ -Pinecone Control Plane API + Pinecone Control Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,13 +27,14 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): - from pinecone.core.openapi.db_control.model.read_capacity_dedicated_config import ( - ReadCapacityDedicatedConfig, - ) +if TYPE_CHECKING: + from pinecone.core.openapi.db_control.model.read_capacity_dedicated_config import ReadCapacityDedicatedConfig - globals()["ReadCapacityDedicatedConfig"] = ReadCapacityDedicatedConfig +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 @@ -67,9 +69,11 @@ class ReadCapacityDedicatedSpec(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -78,7 +82,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -94,22 +98,24 @@ def openapi_types(cls): """ lazy_import() return { - "mode": (str,), # noqa: E501 - "dedicated": (ReadCapacityDedicatedConfig,), # noqa: E501 + '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 + 'mode': 'mode', # noqa: E501 + 'dedicated': 'dedicated', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ReadCapacityDedicatedSpec. @@ -119,7 +125,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -163,20 +172,22 @@ def _from_openapi_data(cls: Type[T], mode, dedicated, *args, **kwargs) -> T: # _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", ()) + _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__), + "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__,), ) @@ -193,29 +204,25 @@ def _from_openapi_data(cls: Type[T], mode, dedicated, *args, **kwargs) -> T: # 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 - ): + 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", - ] - ) + 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 @@ -259,17 +266,19 @@ def __init__(self, mode, dedicated, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -286,17 +295,13 @@ def __init__(self, mode, dedicated, *args, **kwargs) -> None: # noqa: E501 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 - ): + 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." - ) + 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 index 9c74257e0..266ced578 100644 --- 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 @@ -1,14 +1,15 @@ """ -Pinecone Control Plane API + Pinecone Control Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,15 +27,17 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): - from pinecone.core.openapi.db_control.model.read_capacity_dedicated_config import ( - ReadCapacityDedicatedConfig, - ) +if TYPE_CHECKING: + 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 +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 @@ -69,9 +72,11 @@ class ReadCapacityDedicatedSpecResponse(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } additional_properties_type = None @@ -89,24 +94,26 @@ def openapi_types(cls): """ lazy_import() return { - "mode": (str,), # noqa: E501 - "dedicated": (ReadCapacityDedicatedConfig,), # noqa: E501 - "status": (ReadCapacityStatus,), # noqa: E501 + '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 + 'mode': 'mode', # noqa: E501 + 'dedicated': 'dedicated', # noqa: E501 + 'status': 'status', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ReadCapacityDedicatedSpecResponse. @@ -116,7 +123,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -161,20 +171,22 @@ def _from_openapi_data(cls: Type[T], mode, dedicated, status, *args, **kwargs) - _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", ()) + _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__), + "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__,), ) @@ -192,29 +204,25 @@ def _from_openapi_data(cls: Type[T], mode, dedicated, status, *args, **kwargs) - 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 - ): + 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", - ] - ) + 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 @@ -259,17 +267,19 @@ def __init__(self, mode, dedicated, status, *args, **kwargs) -> None: # noqa: E """ _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", ()) + _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__), + "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__,), ) @@ -287,17 +297,13 @@ def __init__(self, mode, dedicated, status, *args, **kwargs) -> None: # noqa: E 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 - ): + 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." - ) + 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 index 15e0907ed..4d54fadc3 100644 --- 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 @@ -1,14 +1,15 @@ """ -Pinecone Control Plane API + Pinecone Control Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -27,6 +28,7 @@ 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 @@ -59,9 +61,11 @@ class ReadCapacityOnDemandSpec(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } additional_properties_type = None @@ -78,20 +82,22 @@ def openapi_types(cls): and the value is attribute type. """ return { - "mode": (str,) # noqa: E501 + 'mode': (str,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "mode": "mode" # noqa: E501 + 'mode': 'mode', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ReadCapacityOnDemandSpec. @@ -101,7 +107,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -144,20 +153,22 @@ def _from_openapi_data(cls: Type[T], mode, *args, **kwargs) -> T: # noqa: E501 _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", ()) + _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__), + "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__,), ) @@ -173,29 +184,25 @@ def _from_openapi_data(cls: Type[T], mode, *args, **kwargs) -> T: # noqa: E501 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 - ): + 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", - ] - ) + 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 @@ -238,17 +245,19 @@ def __init__(self, mode, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -264,17 +273,13 @@ def __init__(self, mode, *args, **kwargs) -> None: # noqa: E501 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 - ): + 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." - ) + 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 index e1ce9d7fc..8ede2531f 100644 --- 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 @@ -1,14 +1,15 @@ """ -Pinecone Control Plane API + Pinecone Control Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,11 +27,14 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): +if TYPE_CHECKING: from pinecone.core.openapi.db_control.model.read_capacity_status import ReadCapacityStatus - globals()["ReadCapacityStatus"] = ReadCapacityStatus +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 @@ -65,9 +69,11 @@ class ReadCapacityOnDemandSpecResponse(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } additional_properties_type = None @@ -85,22 +91,24 @@ def openapi_types(cls): """ lazy_import() return { - "mode": (str,), # noqa: E501 - "status": (ReadCapacityStatus,), # noqa: E501 + '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 + 'mode': 'mode', # noqa: E501 + 'status': 'status', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ReadCapacityOnDemandSpecResponse. @@ -110,7 +118,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -154,20 +165,22 @@ def _from_openapi_data(cls: Type[T], mode, status, *args, **kwargs) -> T: # noq _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", ()) + _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__), + "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__,), ) @@ -184,29 +197,25 @@ def _from_openapi_data(cls: Type[T], mode, status, *args, **kwargs) -> T: # noq 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 - ): + 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", - ] - ) + 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 @@ -250,17 +259,19 @@ def __init__(self, mode, status, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -277,17 +288,13 @@ def __init__(self, mode, status, *args, **kwargs) -> None: # noqa: E501 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 - ): + 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." - ) + 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 index 6d5047e17..b072f9816 100644 --- a/pinecone/core/openapi/db_control/model/read_capacity_response.py +++ b/pinecone/core/openapi/db_control/model/read_capacity_response.py @@ -1,14 +1,15 @@ """ -Pinecone Control Plane API + Pinecone Control Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,23 +27,23 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -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, - ) +if TYPE_CHECKING: + 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 +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 @@ -77,9 +78,11 @@ class ReadCapacityResponse(ModelComposed): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -88,7 +91,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -104,31 +107,32 @@ def openapi_types(cls): """ lazy_import() return { - "mode": (str,), # noqa: E501 - "status": (ReadCapacityStatus,), # noqa: E501 - "dedicated": (ReadCapacityDedicatedConfig,), # noqa: E501 + '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, + 'Dedicated': ReadCapacityDedicatedSpecResponse, + 'OnDemand': ReadCapacityOnDemandSpecResponse, + 'ReadCapacityDedicatedSpecResponse': ReadCapacityDedicatedSpecResponse, + 'ReadCapacityOnDemandSpecResponse': ReadCapacityOnDemandSpecResponse, } if not val: return None - return {"mode": val} + return {'mode': val} attribute_map: Dict[str, str] = { - "mode": "mode", # noqa: E501 - "status": "status", # noqa: E501 - "dedicated": "dedicated", # noqa: E501 + 'mode': 'mode', # noqa: E501 + 'status': 'status', # noqa: E501 + 'dedicated': 'dedicated', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) @classmethod @convert_js_args_to_python_args @@ -171,18 +175,20 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # 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", ()) + _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__), + "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__,), ) @@ -195,46 +201,43 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 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, + '_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) + 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 - ): + 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", - ] - ) + 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 @@ -276,18 +279,20 @@ def __init__(self, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -302,36 +307,33 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 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, + '_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) + 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 - ): + 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." - ) + 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 + def _composed_schemas(): # 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 @@ -341,7 +343,12 @@ def _composed_schemas(): # type: ignore # loading lazy_import() return { - "anyOf": [], - "allOf": [], - "oneOf": [ReadCapacityDedicatedSpecResponse, ReadCapacityOnDemandSpecResponse], + '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 index 40ea91cc0..40ad7790a 100644 --- a/pinecone/core/openapi/db_control/model/read_capacity_status.py +++ b/pinecone/core/openapi/db_control/model/read_capacity_status.py @@ -1,14 +1,15 @@ """ -Pinecone Control Plane API + Pinecone Control Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -27,6 +28,7 @@ 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 @@ -59,9 +61,11 @@ class ReadCapacityStatus(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -69,7 +73,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 """ - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -84,26 +88,28 @@ def openapi_types(cls): 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 + '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 + '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([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ReadCapacityStatus. @@ -113,7 +119,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -159,20 +168,22 @@ def _from_openapi_data(cls: Type[T], state, *args, **kwargs) -> T: # 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", ()) + _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__), + "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__,), ) @@ -188,29 +199,25 @@ def _from_openapi_data(cls: Type[T], state, *args, **kwargs) -> T: # noqa: E501 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 - ): + 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", - ] - ) + 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 @@ -256,17 +263,19 @@ def __init__(self, state, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -282,17 +291,13 @@ def __init__(self, state, *args, **kwargs) -> None: # noqa: E501 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 - ): + 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." - ) + 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 5d1121128..64e77cc71 100644 --- a/pinecone/core/openapi/db_control/model/restore_job_list.py +++ b/pinecone/core/openapi/db_control/model/restore_job_list.py @@ -1,14 +1,15 @@ """ -Pinecone Control Plane API + Pinecone Control Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,13 +27,17 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): +if TYPE_CHECKING: from pinecone.core.openapi.db_control.model.pagination_response import PaginationResponse from pinecone.core.openapi.db_control.model.restore_job_model import RestoreJobModel - globals()["PaginationResponse"] = PaginationResponse - globals()["RestoreJobModel"] = RestoreJobModel +def lazy_import(): + from pinecone.core.openapi.db_control.model.pagination_response import PaginationResponse + from pinecone.core.openapi.db_control.model.restore_job_model import RestoreJobModel + globals()['PaginationResponse'] = PaginationResponse + globals()['RestoreJobModel'] = RestoreJobModel from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -67,9 +72,11 @@ class RestoreJobList(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -78,7 +85,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -94,22 +101,24 @@ def openapi_types(cls): """ lazy_import() return { - "data": ([RestoreJobModel],), # noqa: E501 - "pagination": (PaginationResponse,), # noqa: E501 + 'data': ([RestoreJobModel],), # noqa: E501 + 'pagination': (PaginationResponse,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "data": "data", # noqa: E501 - "pagination": "pagination", # noqa: E501 + 'data': 'data', # noqa: E501 + 'pagination': 'pagination', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of RestoreJobList. @@ -119,7 +128,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -163,20 +175,22 @@ def _from_openapi_data(cls: Type[T], data, *args, **kwargs) -> T: # noqa: E501 pagination (PaginationResponse): [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", ()) + _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__), + "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__,), ) @@ -192,29 +206,25 @@ def _from_openapi_data(cls: Type[T], data, *args, **kwargs) -> T: # noqa: E501 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 - ): + 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", - ] - ) + 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 @@ -258,17 +268,19 @@ def __init__(self, data, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -284,17 +296,13 @@ def __init__(self, data, *args, **kwargs) -> None: # noqa: E501 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 - ): + 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." - ) + raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/pinecone/core/openapi/db_control/model/restore_job_model.py b/pinecone/core/openapi/db_control/model/restore_job_model.py index 857feb17c..2abbefd0c 100644 --- a/pinecone/core/openapi/db_control/model/restore_job_model.py +++ b/pinecone/core/openapi/db_control/model/restore_job_model.py @@ -1,14 +1,15 @@ """ -Pinecone Control Plane API + Pinecone Control Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -27,6 +28,7 @@ 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 @@ -59,10 +61,14 @@ class RestoreJobModel(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ("percent_complete",): {"inclusive_maximum": 100.0, "inclusive_minimum": 0.0} + ('percent_complete',): { + 'inclusive_maximum': 100.0, + 'inclusive_minimum': 0.0, + }, } @cached_class_property @@ -71,7 +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 """ - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -86,34 +92,36 @@ def openapi_types(cls): and the value is attribute type. """ return { - "restore_job_id": (str,), # noqa: E501 - "backup_id": (str,), # noqa: E501 - "target_index_name": (str,), # noqa: E501 - "target_index_id": (str,), # noqa: E501 - "status": (str,), # noqa: E501 - "created_at": (datetime,), # noqa: E501 - "completed_at": (datetime,), # noqa: E501 - "percent_complete": (float,), # noqa: E501 + 'restore_job_id': (str,), # noqa: E501 + 'backup_id': (str,), # noqa: E501 + 'target_index_name': (str,), # noqa: E501 + 'target_index_id': (str,), # noqa: E501 + 'status': (str,), # noqa: E501 + 'created_at': (datetime,), # noqa: E501 + 'completed_at': (datetime,), # noqa: E501 + 'percent_complete': (float,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "restore_job_id": "restore_job_id", # noqa: E501 - "backup_id": "backup_id", # noqa: E501 - "target_index_name": "target_index_name", # noqa: E501 - "target_index_id": "target_index_id", # noqa: E501 - "status": "status", # noqa: E501 - "created_at": "created_at", # noqa: E501 - "completed_at": "completed_at", # noqa: E501 - "percent_complete": "percent_complete", # noqa: E501 + 'restore_job_id': 'restore_job_id', # noqa: E501 + 'backup_id': 'backup_id', # noqa: E501 + 'target_index_name': 'target_index_name', # noqa: E501 + 'target_index_id': 'target_index_id', # noqa: E501 + 'status': 'status', # noqa: E501 + 'created_at': 'created_at', # noqa: E501 + 'completed_at': 'completed_at', # noqa: E501 + 'percent_complete': 'percent_complete', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of RestoreJobModel. @@ -123,21 +131,14 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args - def _from_openapi_data( - cls: Type[T], - restore_job_id, - backup_id, - target_index_name, - target_index_id, - status, - created_at, - *args, - **kwargs, - ) -> T: # noqa: E501 + def _from_openapi_data(cls: Type[T], restore_job_id, backup_id, target_index_name, target_index_id, status, created_at, *args, **kwargs) -> T: # noqa: E501 """RestoreJobModel - a model defined in OpenAPI Args: @@ -183,20 +184,22 @@ def _from_openapi_data( percent_complete (float): The progress made by the restore job out of 100 [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", ()) + _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__), + "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__,), ) @@ -217,42 +220,28 @@ def _from_openapi_data( self.status = status self.created_at = created_at for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + 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", - ] - ) + 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, - restore_job_id, - backup_id, - target_index_name, - target_index_id, - status, - created_at, - *args, - **kwargs, - ) -> None: # noqa: E501 + def __init__(self, restore_job_id, backup_id, target_index_name, target_index_id, status, created_at, *args, **kwargs) -> None: # noqa: E501 """RestoreJobModel - a model defined in OpenAPI Args: @@ -299,17 +288,19 @@ def __init__( """ _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", ()) + _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__), + "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__,), ) @@ -330,17 +321,13 @@ def __init__( self.status = status self.created_at = created_at for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + 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." - ) + 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/scaling_config_manual.py b/pinecone/core/openapi/db_control/model/scaling_config_manual.py index 069ccfd7f..4e1f3f925 100644 --- a/pinecone/core/openapi/db_control/model/scaling_config_manual.py +++ b/pinecone/core/openapi/db_control/model/scaling_config_manual.py @@ -1,14 +1,15 @@ """ -Pinecone Control Plane API + Pinecone Control Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -27,6 +28,7 @@ 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 @@ -59,11 +61,16 @@ class ScalingConfigManual(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ("replicas",): {"inclusive_minimum": 0}, - ("shards",): {"inclusive_minimum": 1}, + ('replicas',): { + 'inclusive_minimum': 0, + }, + ('shards',): { + 'inclusive_minimum': 1, + }, } @cached_class_property @@ -72,7 +79,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 """ - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -87,22 +94,24 @@ def openapi_types(cls): and the value is attribute type. """ return { - "replicas": (int,), # noqa: E501 - "shards": (int,), # noqa: E501 + 'replicas': (int,), # noqa: E501 + 'shards': (int,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "replicas": "replicas", # noqa: E501 - "shards": "shards", # noqa: E501 + 'replicas': 'replicas', # noqa: E501 + 'shards': 'shards', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ScalingConfigManual. @@ -112,7 +121,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -156,20 +168,22 @@ def _from_openapi_data(cls: Type[T], replicas, shards, *args, **kwargs) -> T: # _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", ()) + _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__), + "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__,), ) @@ -186,29 +200,25 @@ def _from_openapi_data(cls: Type[T], replicas, shards, *args, **kwargs) -> T: # self.replicas = replicas self.shards = shards for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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, replicas, shards, *args, **kwargs) -> None: # noqa: E501 @@ -252,17 +262,19 @@ def __init__(self, replicas, shards, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -279,17 +291,13 @@ def __init__(self, replicas, shards, *args, **kwargs) -> None: # noqa: E501 self.replicas = replicas self.shards = shards for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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.py b/pinecone/core/openapi/db_control/model/serverless.py index 3dce85d9a..936f08b7d 100644 --- a/pinecone/core/openapi/db_control/model/serverless.py +++ b/pinecone/core/openapi/db_control/model/serverless.py @@ -1,14 +1,15 @@ """ -Pinecone Control Plane API + Pinecone Control Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,11 +27,14 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): +if TYPE_CHECKING: from pinecone.core.openapi.db_control.model.serverless_spec import ServerlessSpec - globals()["ServerlessSpec"] = ServerlessSpec +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 @@ -65,9 +69,11 @@ class Serverless(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -76,7 +82,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -92,20 +98,22 @@ def openapi_types(cls): """ lazy_import() return { - "serverless": (ServerlessSpec,) # noqa: E501 + 'serverless': (ServerlessSpec,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "serverless": "serverless" # noqa: E501 + 'serverless': 'serverless', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of Serverless. @@ -115,7 +123,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -158,20 +169,22 @@ def _from_openapi_data(cls: Type[T], serverless, *args, **kwargs) -> T: # noqa: _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", ()) + _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__), + "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__,), ) @@ -187,29 +200,25 @@ def _from_openapi_data(cls: Type[T], serverless, *args, **kwargs) -> T: # noqa: 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 - ): + 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", - ] - ) + 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 @@ -252,17 +261,19 @@ def __init__(self, serverless, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -278,17 +289,13 @@ def __init__(self, serverless, *args, **kwargs) -> None: # noqa: E501 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 - ): + 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." - ) + 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 dc549ed8d..0408039b2 100644 --- a/pinecone/core/openapi/db_control/model/serverless_spec.py +++ b/pinecone/core/openapi/db_control/model/serverless_spec.py @@ -1,14 +1,15 @@ """ -Pinecone Control Plane API + Pinecone Control Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,13 +27,17 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): +if TYPE_CHECKING: 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 +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 @@ -67,9 +72,11 @@ class ServerlessSpec(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -78,7 +85,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -94,28 +101,30 @@ def openapi_types(cls): """ 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 + '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 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 + '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([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ServerlessSpec. @@ -125,7 +134,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -172,20 +184,22 @@ def _from_openapi_data(cls: Type[T], cloud, region, *args, **kwargs) -> T: # no 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", ()) + _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__), + "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__,), ) @@ -202,29 +216,25 @@ def _from_openapi_data(cls: Type[T], cloud, region, *args, **kwargs) -> T: # no self.cloud = cloud self.region = region for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + 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", - ] - ) + 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, *args, **kwargs) -> None: # noqa: E501 @@ -271,17 +281,19 @@ def __init__(self, cloud, region, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -298,17 +310,13 @@ def __init__(self, cloud, region, *args, **kwargs) -> None: # noqa: E501 self.cloud = cloud self.region = region for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + 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." - ) + 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_response.py b/pinecone/core/openapi/db_control/model/serverless_spec_response.py index 55197559d..9bdf96653 100644 --- a/pinecone/core/openapi/db_control/model/serverless_spec_response.py +++ b/pinecone/core/openapi/db_control/model/serverless_spec_response.py @@ -1,14 +1,15 @@ """ -Pinecone Control Plane API + Pinecone Control Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,13 +27,17 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): +if TYPE_CHECKING: 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 +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 @@ -67,9 +72,11 @@ class ServerlessSpecResponse(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -78,7 +85,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -94,28 +101,30 @@ def openapi_types(cls): """ 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 + '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 + '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([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ServerlessSpecResponse. @@ -125,7 +134,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -172,20 +184,22 @@ def _from_openapi_data(cls: Type[T], cloud, region, read_capacity, *args, **kwar 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", ()) + _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__), + "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__,), ) @@ -203,29 +217,25 @@ def _from_openapi_data(cls: Type[T], cloud, region, read_capacity, *args, **kwar 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 - ): + 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", - ] - ) + 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 @@ -272,17 +282,19 @@ def __init__(self, cloud, region, read_capacity, *args, **kwargs) -> None: # no """ _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", ()) + _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__), + "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__,), ) @@ -300,17 +312,13 @@ def __init__(self, cloud, region, read_capacity, *args, **kwargs) -> None: # no 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 - ): + 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." - ) + 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 774a057e6..56e5cd212 100644 --- a/pinecone/core/openapi/db_control/models/__init__.py +++ b/pinecone/core/openapi/db_control/models/__init__.py @@ -13,30 +13,18 @@ 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.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 from pinecone.core.openapi.db_control.model.configure_index_request import ConfigureIndexRequest -from pinecone.core.openapi.db_control.model.configure_index_request_embed import ( - ConfigureIndexRequestEmbed, -) +from pinecone.core.openapi.db_control.model.configure_index_request_embed import ConfigureIndexRequestEmbed from pinecone.core.openapi.db_control.model.create_backup_request import CreateBackupRequest from pinecone.core.openapi.db_control.model.create_collection_request import CreateCollectionRequest -from pinecone.core.openapi.db_control.model.create_index_for_model_request import ( - CreateIndexForModelRequest, -) -from pinecone.core.openapi.db_control.model.create_index_for_model_request_embed import ( - CreateIndexForModelRequestEmbed, -) -from pinecone.core.openapi.db_control.model.create_index_from_backup_request import ( - CreateIndexFromBackupRequest, -) -from pinecone.core.openapi.db_control.model.create_index_from_backup_response import ( - CreateIndexFromBackupResponse, -) +from pinecone.core.openapi.db_control.model.create_index_for_model_request import CreateIndexForModelRequest +from pinecone.core.openapi.db_control.model.create_index_for_model_request_embed import CreateIndexForModelRequestEmbed +from pinecone.core.openapi.db_control.model.create_index_from_backup_request import CreateIndexFromBackupRequest +from pinecone.core.openapi.db_control.model.create_index_from_backup_response import CreateIndexFromBackupResponse from pinecone.core.openapi.db_control.model.create_index_request import CreateIndexRequest from pinecone.core.openapi.db_control.model.error_response import ErrorResponse from pinecone.core.openapi.db_control.model.error_response_error import ErrorResponseError @@ -51,21 +39,11 @@ 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_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 diff --git a/pinecone/core/openapi/db_data/__init__.py b/pinecone/core/openapi/db_data/__init__.py index eb475f54e..84761eb70 100644 --- a/pinecone/core/openapi/db_data/__init__.py +++ b/pinecone/core/openapi/db_data/__init__.py @@ -1,16 +1,17 @@ # flake8: noqa """ -Pinecone Data Plane API + Pinecone Data Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + __version__ = "1.0.0" # import ApiClient @@ -26,5 +27,4 @@ from pinecone.openapi_support.exceptions import PineconeApiValueError from pinecone.openapi_support.exceptions import PineconeApiKeyError from pinecone.openapi_support.exceptions import PineconeApiException - -API_VERSION = "2025-10" +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 ab7c22d9d..d313f9e6c 100644 --- a/pinecone/core/openapi/db_data/api/bulk_operations_api.py +++ b/pinecone/core/openapi/db_data/api/bulk_operations_api.py @@ -1,26 +1,24 @@ """ -Pinecone Data Plane API + Pinecone Data Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from __future__ import annotations -from typing import TYPE_CHECKING +from typing import TYPE_CHECKING, Any, Dict, cast if TYPE_CHECKING: from multiprocessing.pool import ApplyResult from pinecone.openapi_support import ApiClient, AsyncioApiClient -from pinecone.openapi_support.endpoint_utils import ( - ExtraOpenApiKwargsTypedDict, - KwargsWithOpenApiKwargDefaultsTypedDict, -) +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 @@ -28,7 +26,7 @@ datetime, file_type, none_type, - validate_and_convert_types, + validate_and_convert_types ) from pinecone.core.openapi.db_data.model.import_model import ImportModel from pinecone.core.openapi.db_data.model.list_imports_response import ListImportsResponse @@ -49,10 +47,11 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client def __cancel_bulk_import( - self, id, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict - ) -> {str: (bool, dict, float, int, list, str, none_type)} | ApplyResult[ - {str: (bool, dict, float, int, list, str, none_type)} - ]: + self, + id, + x_pinecone_api_version="2025-10", + **kwargs: ExtraOpenApiKwargsTypedDict + ) -> Dict[str, Any] | ApplyResult[Dict[str, Any]]: """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 @@ -85,46 +84,86 @@ def __cancel_bulk_import( async_req (bool): execute request asynchronously Returns: - {str: (bool, dict, float, int, list, str, none_type)} + Dict[str, Any] 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["id"] = id - return self.call_with_http_info(**kwargs) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['id'] = \ + id + return cast(Dict[str, Any] | ApplyResult[Dict[str, Any]], self.call_with_http_info(**kwargs)) self.cancel_bulk_import = _Endpoint( settings={ - "response_type": ({str: (bool, dict, float, int, list, str, none_type)},), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/bulk/imports/{id}", - "operation_id": "cancel_bulk_import", - "http_method": "DELETE", - "servers": None, + 'response_type': (Dict[str, Any],), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/bulk/imports/{id}', + 'operation_id': 'cancel_bulk_import', + 'http_method': 'DELETE', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "id"], - "required": ["x_pinecone_api_version", "id"], - "nullable": [], - "enum": [], - "validation": ["id"], + 'all': [ + 'x_pinecone_api_version', + 'id', + ], + 'required': [ + 'x_pinecone_api_version', + 'id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + 'id', + ] }, root_map={ - "validations": {("id",): {"max_length": 1000, "min_length": 1}}, - "allowed_values": {}, - "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": []}, + 'validations': { + ('id',): { + 'max_length': 1000, + 'min_length': 1, + }, + }, + 'allowed_values': { + }, + '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': [], + }, api_client=api_client, - callable=__cancel_bulk_import, + callable=__cancel_bulk_import ) def __describe_bulk_import( - self, id, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict + self, + id, + x_pinecone_api_version="2025-10", + **kwargs: ExtraOpenApiKwargsTypedDict ) -> ImportModel | ApplyResult[ImportModel]: """Describe an import # noqa: E501 @@ -163,41 +202,80 @@ def __describe_bulk_import( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['id'] = \ + id + return cast(ImportModel | ApplyResult[ImportModel], self.call_with_http_info(**kwargs)) self.describe_bulk_import = _Endpoint( settings={ - "response_type": (ImportModel,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/bulk/imports/{id}", - "operation_id": "describe_bulk_import", - "http_method": "GET", - "servers": None, + 'response_type': (ImportModel,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/bulk/imports/{id}', + 'operation_id': 'describe_bulk_import', + 'http_method': 'GET', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "id"], - "required": ["x_pinecone_api_version", "id"], - "nullable": [], - "enum": [], - "validation": ["id"], + 'all': [ + 'x_pinecone_api_version', + 'id', + ], + 'required': [ + 'x_pinecone_api_version', + 'id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + 'id', + ] }, root_map={ - "validations": {("id",): {"max_length": 1000, "min_length": 1}}, - "allowed_values": {}, - "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": []}, + 'validations': { + ('id',): { + 'max_length': 1000, + 'min_length': 1, + }, + }, + 'allowed_values': { + }, + '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': [], + }, api_client=api_client, - callable=__describe_bulk_import, + callable=__describe_bulk_import ) def __list_bulk_imports( - self, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict + self, + x_pinecone_api_version="2025-10", + **kwargs: ExtraOpenApiKwargsTypedDict ) -> ListImportsResponse | ApplyResult[ListImportsResponse]: """List imports # noqa: E501 @@ -237,55 +315,84 @@ def __list_bulk_imports( thread. """ kwargs = self._process_openapi_kwargs(kwargs) - kwargs["x_pinecone_api_version"] = x_pinecone_api_version - return self.call_with_http_info(**kwargs) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + return cast(ListImportsResponse | ApplyResult[ListImportsResponse], self.call_with_http_info(**kwargs)) self.list_bulk_imports = _Endpoint( settings={ - "response_type": (ListImportsResponse,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/bulk/imports", - "operation_id": "list_bulk_imports", - "http_method": "GET", - "servers": None, + 'response_type': (ListImportsResponse,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/bulk/imports', + 'operation_id': 'list_bulk_imports', + 'http_method': 'GET', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "limit", "pagination_token"], - "required": ["x_pinecone_api_version"], - "nullable": [], - "enum": [], - "validation": ["limit"], + 'all': [ + 'x_pinecone_api_version', + 'limit', + 'pagination_token', + ], + 'required': [ + 'x_pinecone_api_version', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + 'limit', + ] }, root_map={ - "validations": {("limit",): {"inclusive_maximum": 100, "inclusive_minimum": 1}}, - "allowed_values": {}, - "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": []}, + 'validations': { + ('limit',): { + + 'inclusive_maximum': 100, + 'inclusive_minimum': 1, + }, + }, + 'allowed_values': { + }, + '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': [], + }, api_client=api_client, - callable=__list_bulk_imports, + callable=__list_bulk_imports ) def __start_bulk_import( self, start_import_request, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict, + **kwargs: ExtraOpenApiKwargsTypedDict ) -> StartImportResponse | ApplyResult[StartImportResponse]: """Start import # noqa: E501 @@ -324,46 +431,74 @@ def __start_bulk_import( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['start_import_request'] = \ + start_import_request + return cast(StartImportResponse | ApplyResult[StartImportResponse], self.call_with_http_info(**kwargs)) self.start_bulk_import = _Endpoint( settings={ - "response_type": (StartImportResponse,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/bulk/imports", - "operation_id": "start_bulk_import", - "http_method": "POST", - "servers": None, + 'response_type': (StartImportResponse,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/bulk/imports', + 'operation_id': 'start_bulk_import', + 'http_method': 'POST', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "start_import_request"], - "required": ["x_pinecone_api_version", "start_import_request"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'start_import_request', + ], + 'required': [ + 'x_pinecone_api_version', + 'start_import_request', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_pinecone_api_version": (str,), - "start_import_request": (StartImportRequest,), + 'validations': { + }, + 'allowed_values': { }, - "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, - "location_map": { - "x_pinecone_api_version": "header", - "start_import_request": "body", + 'openapi_types': { + 'x_pinecone_api_version': + (str,), + 'start_import_request': + (StartImportRequest,), }, - "collection_format_map": {}, + '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' + ] }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__start_bulk_import, + callable=__start_bulk_import ) + class AsyncioBulkOperationsApi: """NOTE: This class is @generated using OpenAPI @@ -376,8 +511,11 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client async def __cancel_bulk_import( - self, id, x_pinecone_api_version="2025-10", **kwargs - ) -> {str: (bool, dict, float, int, list, str, none_type)}: + self, + id, + x_pinecone_api_version="2025-10", + **kwargs + ) -> Dict[str, Any]: """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 @@ -405,44 +543,84 @@ async def __cancel_bulk_import( Default is True. Returns: - {str: (bool, dict, float, int, list, str, none_type)} + Dict[str, Any] """ 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['id'] = \ + id + return cast(Dict[str, Any], await self.call_with_http_info(**kwargs)) self.cancel_bulk_import = _AsyncioEndpoint( settings={ - "response_type": ({str: (bool, dict, float, int, list, str, none_type)},), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/bulk/imports/{id}", - "operation_id": "cancel_bulk_import", - "http_method": "DELETE", - "servers": None, + 'response_type': (Dict[str, Any],), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/bulk/imports/{id}', + 'operation_id': 'cancel_bulk_import', + 'http_method': 'DELETE', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "id"], - "required": ["x_pinecone_api_version", "id"], - "nullable": [], - "enum": [], - "validation": ["id"], + 'all': [ + 'x_pinecone_api_version', + 'id', + ], + 'required': [ + 'x_pinecone_api_version', + 'id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + 'id', + ] }, root_map={ - "validations": {("id",): {"max_length": 1000, "min_length": 1}}, - "allowed_values": {}, - "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": []}, + 'validations': { + ('id',): { + 'max_length': 1000, + 'min_length': 1, + }, + }, + 'allowed_values': { + }, + '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': [], + }, api_client=api_client, - callable=__cancel_bulk_import, + callable=__cancel_bulk_import ) async def __describe_bulk_import( - self, id, x_pinecone_api_version="2025-10", **kwargs + self, + id, + x_pinecone_api_version="2025-10", + **kwargs ) -> ImportModel: """Describe an import # noqa: E501 @@ -474,41 +652,80 @@ async def __describe_bulk_import( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['id'] = \ + id + return cast(ImportModel, await self.call_with_http_info(**kwargs)) self.describe_bulk_import = _AsyncioEndpoint( settings={ - "response_type": (ImportModel,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/bulk/imports/{id}", - "operation_id": "describe_bulk_import", - "http_method": "GET", - "servers": None, + 'response_type': (ImportModel,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/bulk/imports/{id}', + 'operation_id': 'describe_bulk_import', + 'http_method': 'GET', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "id"], - "required": ["x_pinecone_api_version", "id"], - "nullable": [], - "enum": [], - "validation": ["id"], + 'all': [ + 'x_pinecone_api_version', + 'id', + ], + 'required': [ + 'x_pinecone_api_version', + 'id', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + 'id', + ] }, root_map={ - "validations": {("id",): {"max_length": 1000, "min_length": 1}}, - "allowed_values": {}, - "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": []}, + 'validations': { + ('id',): { + 'max_length': 1000, + 'min_length': 1, + }, + }, + 'allowed_values': { + }, + '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': [], + }, api_client=api_client, - callable=__describe_bulk_import, + callable=__describe_bulk_import ) async def __list_bulk_imports( - self, x_pinecone_api_version="2025-10", **kwargs + self, + x_pinecone_api_version="2025-10", + **kwargs ) -> ListImportsResponse: """List imports # noqa: E501 @@ -541,52 +758,84 @@ async def __list_bulk_imports( ListImportsResponse """ self._process_openapi_kwargs(kwargs) - kwargs["x_pinecone_api_version"] = x_pinecone_api_version - return await self.call_with_http_info(**kwargs) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + return cast(ListImportsResponse, await self.call_with_http_info(**kwargs)) self.list_bulk_imports = _AsyncioEndpoint( settings={ - "response_type": (ListImportsResponse,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/bulk/imports", - "operation_id": "list_bulk_imports", - "http_method": "GET", - "servers": None, + 'response_type': (ListImportsResponse,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/bulk/imports', + 'operation_id': 'list_bulk_imports', + 'http_method': 'GET', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "limit", "pagination_token"], - "required": ["x_pinecone_api_version"], - "nullable": [], - "enum": [], - "validation": ["limit"], + 'all': [ + 'x_pinecone_api_version', + 'limit', + 'pagination_token', + ], + 'required': [ + 'x_pinecone_api_version', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + 'limit', + ] }, root_map={ - "validations": {("limit",): {"inclusive_maximum": 100, "inclusive_minimum": 1}}, - "allowed_values": {}, - "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": []}, + 'validations': { + ('limit',): { + + 'inclusive_maximum': 100, + 'inclusive_minimum': 1, + }, + }, + 'allowed_values': { + }, + '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': [], + }, api_client=api_client, - callable=__list_bulk_imports, + callable=__list_bulk_imports ) async def __start_bulk_import( - self, start_import_request, x_pinecone_api_version="2025-10", **kwargs + self, + start_import_request, + x_pinecone_api_version="2025-10", + **kwargs ) -> StartImportResponse: """Start import # noqa: E501 @@ -618,41 +867,68 @@ async def __start_bulk_import( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['start_import_request'] = \ + start_import_request + return cast(StartImportResponse, await self.call_with_http_info(**kwargs)) self.start_bulk_import = _AsyncioEndpoint( settings={ - "response_type": (StartImportResponse,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/bulk/imports", - "operation_id": "start_bulk_import", - "http_method": "POST", - "servers": None, + 'response_type': (StartImportResponse,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/bulk/imports', + 'operation_id': 'start_bulk_import', + 'http_method': 'POST', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "start_import_request"], - "required": ["x_pinecone_api_version", "start_import_request"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'start_import_request', + ], + 'required': [ + 'x_pinecone_api_version', + 'start_import_request', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_pinecone_api_version": (str,), - "start_import_request": (StartImportRequest,), + 'validations': { }, - "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, - "location_map": { - "x_pinecone_api_version": "header", - "start_import_request": "body", + 'allowed_values': { }, - "collection_format_map": {}, + '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' + ] }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__start_bulk_import, + callable=__start_bulk_import ) 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 60bedcb4c..e9e007989 100644 --- a/pinecone/core/openapi/db_data/api/namespace_operations_api.py +++ b/pinecone/core/openapi/db_data/api/namespace_operations_api.py @@ -1,26 +1,24 @@ """ -Pinecone Data Plane API + Pinecone Data Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from __future__ import annotations -from typing import TYPE_CHECKING +from typing import TYPE_CHECKING, Any, Dict, cast if TYPE_CHECKING: from multiprocessing.pool import ApplyResult from pinecone.openapi_support import ApiClient, AsyncioApiClient -from pinecone.openapi_support.endpoint_utils import ( - ExtraOpenApiKwargsTypedDict, - KwargsWithOpenApiKwargDefaultsTypedDict, -) +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 @@ -28,7 +26,7 @@ datetime, file_type, none_type, - validate_and_convert_types, + 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 @@ -51,7 +49,7 @@ def __create_namespace( self, create_namespace_request, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict, + **kwargs: ExtraOpenApiKwargsTypedDict ) -> NamespaceDescription | ApplyResult[NamespaceDescription]: """Create a namespace # noqa: E501 @@ -90,50 +88,78 @@ def __create_namespace( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['create_namespace_request'] = \ + create_namespace_request + return cast(NamespaceDescription | ApplyResult[NamespaceDescription], 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, + '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": [], + '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,), + '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", + 'attribute_map': { + 'x_pinecone_api_version': 'X-Pinecone-Api-Version', }, - "collection_format_map": {}, + 'location_map': { + 'x_pinecone_api_version': 'header', + 'create_namespace_request': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__create_namespace, + callable=__create_namespace ) def __delete_namespace( - self, namespace, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict - ) -> {str: (bool, dict, float, int, list, str, none_type)} | ApplyResult[ - {str: (bool, dict, float, int, list, str, none_type)} - ]: + self, + namespace, + x_pinecone_api_version="2025-10", + **kwargs: ExtraOpenApiKwargsTypedDict + ) -> Dict[str, Any] | ApplyResult[Dict[str, Any]]: """Delete a namespace # 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 @@ -166,49 +192,81 @@ def __delete_namespace( async_req (bool): execute request asynchronously Returns: - {str: (bool, dict, float, int, list, str, none_type)} + Dict[str, Any] 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["namespace"] = namespace - return self.call_with_http_info(**kwargs) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['namespace'] = \ + namespace + return cast(Dict[str, Any] | ApplyResult[Dict[str, Any]], self.call_with_http_info(**kwargs)) self.delete_namespace = _Endpoint( settings={ - "response_type": ({str: (bool, dict, float, int, list, str, none_type)},), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/namespaces/{namespace}", - "operation_id": "delete_namespace", - "http_method": "DELETE", - "servers": None, + 'response_type': (Dict[str, Any],), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/namespaces/{namespace}', + 'operation_id': 'delete_namespace', + 'http_method': 'DELETE', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "namespace"], - "required": ["x_pinecone_api_version", "namespace"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'namespace', + ], + 'required': [ + 'x_pinecone_api_version', + 'namespace', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": {"x_pinecone_api_version": (str,), "namespace": (str,)}, - "attribute_map": { - "x_pinecone_api_version": "X-Pinecone-Api-Version", - "namespace": "namespace", + 'validations': { }, - "location_map": {"x_pinecone_api_version": "header", "namespace": "path"}, - "collection_format_map": {}, + 'allowed_values': { + }, + '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': [], }, - headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__delete_namespace, + callable=__delete_namespace ) def __describe_namespace( - self, namespace, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict + self, + namespace, + x_pinecone_api_version="2025-10", + **kwargs: ExtraOpenApiKwargsTypedDict ) -> NamespaceDescription | ApplyResult[NamespaceDescription]: """Describe a namespace # noqa: E501 @@ -247,44 +305,75 @@ def __describe_namespace( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['namespace'] = \ + namespace + return cast(NamespaceDescription | ApplyResult[NamespaceDescription], self.call_with_http_info(**kwargs)) self.describe_namespace = _Endpoint( settings={ - "response_type": (NamespaceDescription,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/namespaces/{namespace}", - "operation_id": "describe_namespace", - "http_method": "GET", - "servers": None, + 'response_type': (NamespaceDescription,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/namespaces/{namespace}', + 'operation_id': 'describe_namespace', + 'http_method': 'GET', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "namespace"], - "required": ["x_pinecone_api_version", "namespace"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'namespace', + ], + 'required': [ + 'x_pinecone_api_version', + 'namespace', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": {"x_pinecone_api_version": (str,), "namespace": (str,)}, - "attribute_map": { - "x_pinecone_api_version": "X-Pinecone-Api-Version", - "namespace": "namespace", + 'validations': { }, - "location_map": {"x_pinecone_api_version": "header", "namespace": "path"}, - "collection_format_map": {}, + 'allowed_values': { + }, + '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': [], }, - headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__describe_namespace, + callable=__describe_namespace ) def __list_namespaces_operation( - self, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict + self, + x_pinecone_api_version="2025-10", + **kwargs: ExtraOpenApiKwargsTypedDict ) -> ListNamespacesResponse | ApplyResult[ListNamespacesResponse]: """List namespaces # noqa: E501 @@ -325,54 +414,80 @@ def __list_namespaces_operation( thread. """ kwargs = self._process_openapi_kwargs(kwargs) - kwargs["x_pinecone_api_version"] = x_pinecone_api_version - return self.call_with_http_info(**kwargs) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + return cast(ListNamespacesResponse | ApplyResult[ListNamespacesResponse], self.call_with_http_info(**kwargs)) self.list_namespaces_operation = _Endpoint( settings={ - "response_type": (ListNamespacesResponse,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/namespaces", - "operation_id": "list_namespaces_operation", - "http_method": "GET", - "servers": None, + 'response_type': (ListNamespacesResponse,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/namespaces', + 'operation_id': 'list_namespaces_operation', + 'http_method': 'GET', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "limit", "pagination_token", "prefix"], - "required": ["x_pinecone_api_version"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'limit', + 'pagination_token', + 'prefix', + ], + 'required': [ + 'x_pinecone_api_version', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "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": []}, + 'validations': { + }, + 'allowed_values': { + }, + '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': [], + }, api_client=api_client, - callable=__list_namespaces_operation, + callable=__list_namespaces_operation ) + class AsyncioNamespaceOperationsApi: """NOTE: This class is @generated using OpenAPI @@ -385,7 +500,10 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client async def __create_namespace( - self, create_namespace_request, x_pinecone_api_version="2025-10", **kwargs + self, + create_namespace_request, + x_pinecone_api_version="2025-10", + **kwargs ) -> NamespaceDescription: """Create a namespace # noqa: E501 @@ -417,48 +535,78 @@ async def __create_namespace( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['create_namespace_request'] = \ + create_namespace_request + return cast(NamespaceDescription, 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, + '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": [], + '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,), + 'validations': { + }, + 'allowed_values': { }, - "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, - "location_map": { - "x_pinecone_api_version": "header", - "create_namespace_request": "body", + 'openapi_types': { + 'x_pinecone_api_version': + (str,), + 'create_namespace_request': + (CreateNamespaceRequest,), }, - "collection_format_map": {}, + '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' + ] }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__create_namespace, + callable=__create_namespace ) async def __delete_namespace( - self, namespace, x_pinecone_api_version="2025-10", **kwargs - ) -> {str: (bool, dict, float, int, list, str, none_type)}: + self, + namespace, + x_pinecone_api_version="2025-10", + **kwargs + ) -> Dict[str, Any]: """Delete a namespace # 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 @@ -486,47 +634,79 @@ async def __delete_namespace( Default is True. Returns: - {str: (bool, dict, float, int, list, str, none_type)} + Dict[str, Any] """ 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['namespace'] = \ + namespace + return cast(Dict[str, Any], await self.call_with_http_info(**kwargs)) self.delete_namespace = _AsyncioEndpoint( settings={ - "response_type": ({str: (bool, dict, float, int, list, str, none_type)},), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/namespaces/{namespace}", - "operation_id": "delete_namespace", - "http_method": "DELETE", - "servers": None, + 'response_type': (Dict[str, Any],), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/namespaces/{namespace}', + 'operation_id': 'delete_namespace', + 'http_method': 'DELETE', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "namespace"], - "required": ["x_pinecone_api_version", "namespace"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'namespace', + ], + 'required': [ + 'x_pinecone_api_version', + 'namespace', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": {"x_pinecone_api_version": (str,), "namespace": (str,)}, - "attribute_map": { - "x_pinecone_api_version": "X-Pinecone-Api-Version", - "namespace": "namespace", + 'validations': { + }, + 'allowed_values': { + }, + '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": {}, + 'location_map': { + 'x_pinecone_api_version': 'header', + 'namespace': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], }, - headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__delete_namespace, + callable=__delete_namespace ) async def __describe_namespace( - self, namespace, x_pinecone_api_version="2025-10", **kwargs + self, + namespace, + x_pinecone_api_version="2025-10", + **kwargs ) -> NamespaceDescription: """Describe a namespace # noqa: E501 @@ -558,44 +738,75 @@ async def __describe_namespace( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['namespace'] = \ + namespace + return cast(NamespaceDescription, await self.call_with_http_info(**kwargs)) self.describe_namespace = _AsyncioEndpoint( settings={ - "response_type": (NamespaceDescription,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/namespaces/{namespace}", - "operation_id": "describe_namespace", - "http_method": "GET", - "servers": None, + 'response_type': (NamespaceDescription,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/namespaces/{namespace}', + 'operation_id': 'describe_namespace', + 'http_method': 'GET', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "namespace"], - "required": ["x_pinecone_api_version", "namespace"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'namespace', + ], + 'required': [ + 'x_pinecone_api_version', + 'namespace', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": {"x_pinecone_api_version": (str,), "namespace": (str,)}, - "attribute_map": { - "x_pinecone_api_version": "X-Pinecone-Api-Version", - "namespace": "namespace", + 'validations': { + }, + 'allowed_values': { + }, + '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": {}, + 'location_map': { + 'x_pinecone_api_version': 'header', + 'namespace': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], }, - headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__describe_namespace, + callable=__describe_namespace ) async def __list_namespaces_operation( - self, x_pinecone_api_version="2025-10", **kwargs + self, + x_pinecone_api_version="2025-10", + **kwargs ) -> ListNamespacesResponse: """List namespaces # noqa: E501 @@ -629,49 +840,74 @@ async def __list_namespaces_operation( ListNamespacesResponse """ self._process_openapi_kwargs(kwargs) - kwargs["x_pinecone_api_version"] = x_pinecone_api_version - return await self.call_with_http_info(**kwargs) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + return cast(ListNamespacesResponse, await self.call_with_http_info(**kwargs)) self.list_namespaces_operation = _AsyncioEndpoint( settings={ - "response_type": (ListNamespacesResponse,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/namespaces", - "operation_id": "list_namespaces_operation", - "http_method": "GET", - "servers": None, + 'response_type': (ListNamespacesResponse,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/namespaces', + 'operation_id': 'list_namespaces_operation', + 'http_method': 'GET', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "limit", "pagination_token", "prefix"], - "required": ["x_pinecone_api_version"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'limit', + 'pagination_token', + 'prefix', + ], + 'required': [ + 'x_pinecone_api_version', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "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": []}, + 'validations': { + }, + 'allowed_values': { + }, + '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': [], + }, api_client=api_client, - callable=__list_namespaces_operation, + callable=__list_namespaces_operation ) 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 1cefc5e83..e925b794b 100644 --- a/pinecone/core/openapi/db_data/api/vector_operations_api.py +++ b/pinecone/core/openapi/db_data/api/vector_operations_api.py @@ -1,26 +1,24 @@ """ -Pinecone Data Plane API + Pinecone Data Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from __future__ import annotations -from typing import TYPE_CHECKING +from typing import TYPE_CHECKING, Any, Dict, cast if TYPE_CHECKING: from multiprocessing.pool import ApplyResult from pinecone.openapi_support import ApiClient, AsyncioApiClient -from pinecone.openapi_support.endpoint_utils import ( - ExtraOpenApiKwargsTypedDict, - KwargsWithOpenApiKwargDefaultsTypedDict, -) +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 @@ -28,12 +26,10 @@ datetime, file_type, none_type, - validate_and_convert_types, + validate_and_convert_types ) 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.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 @@ -66,10 +62,8 @@ def __delete_vectors( self, delete_request, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict, - ) -> {str: (bool, dict, float, int, list, str, none_type)} | ApplyResult[ - {str: (bool, dict, float, int, list, str, none_type)} - ]: + **kwargs: ExtraOpenApiKwargsTypedDict + ) -> Dict[str, Any] | ApplyResult[Dict[str, Any]]: """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 @@ -102,52 +96,82 @@ def __delete_vectors( async_req (bool): execute request asynchronously Returns: - {str: (bool, dict, float, int, list, str, none_type)} + Dict[str, Any] 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["delete_request"] = delete_request - return self.call_with_http_info(**kwargs) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['delete_request'] = \ + delete_request + return cast(Dict[str, Any] | ApplyResult[Dict[str, Any]], self.call_with_http_info(**kwargs)) self.delete_vectors = _Endpoint( settings={ - "response_type": ({str: (bool, dict, float, int, list, str, none_type)},), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/vectors/delete", - "operation_id": "delete_vectors", - "http_method": "POST", - "servers": None, + 'response_type': (Dict[str, Any],), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/vectors/delete', + 'operation_id': 'delete_vectors', + 'http_method': 'POST', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "delete_request"], - "required": ["x_pinecone_api_version", "delete_request"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'delete_request', + ], + 'required': [ + 'x_pinecone_api_version', + 'delete_request', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_pinecone_api_version": (str,), - "delete_request": (DeleteRequest,), + 'validations': { }, - "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, - "location_map": {"x_pinecone_api_version": "header", "delete_request": "body"}, - "collection_format_map": {}, + 'allowed_values': { + }, + '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' + ] }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__delete_vectors, + callable=__delete_vectors ) def __describe_index_stats( self, describe_index_stats_request, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict, + **kwargs: ExtraOpenApiKwargsTypedDict ) -> IndexDescription | ApplyResult[IndexDescription]: """Get index stats # noqa: E501 @@ -186,47 +210,77 @@ 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['describe_index_stats_request'] = \ + describe_index_stats_request + return cast(IndexDescription | ApplyResult[IndexDescription], self.call_with_http_info(**kwargs)) self.describe_index_stats = _Endpoint( settings={ - "response_type": (IndexDescription,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/describe_index_stats", - "operation_id": "describe_index_stats", - "http_method": "POST", - "servers": None, + 'response_type': (IndexDescription,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/describe_index_stats', + 'operation_id': 'describe_index_stats', + 'http_method': 'POST', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "describe_index_stats_request"], - "required": ["x_pinecone_api_version", "describe_index_stats_request"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'describe_index_stats_request', + ], + 'required': [ + 'x_pinecone_api_version', + 'describe_index_stats_request', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_pinecone_api_version": (str,), - "describe_index_stats_request": (DescribeIndexStatsRequest,), + 'validations': { + }, + 'allowed_values': { }, - "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, - "location_map": { - "x_pinecone_api_version": "header", - "describe_index_stats_request": "body", + 'openapi_types': { + 'x_pinecone_api_version': + (str,), + 'describe_index_stats_request': + (DescribeIndexStatsRequest,), }, - "collection_format_map": {}, + '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' + ] }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__describe_index_stats, + callable=__describe_index_stats ) def __fetch_vectors( - self, ids, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict + self, + ids, + x_pinecone_api_version="2025-10", + **kwargs: ExtraOpenApiKwargsTypedDict ) -> FetchResponse | ApplyResult[FetchResponse]: """Fetch vectors # noqa: E501 @@ -266,56 +320,82 @@ def __fetch_vectors( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['ids'] = \ + ids + return cast(FetchResponse | ApplyResult[FetchResponse], self.call_with_http_info(**kwargs)) self.fetch_vectors = _Endpoint( settings={ - "response_type": (FetchResponse,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/vectors/fetch", - "operation_id": "fetch_vectors", - "http_method": "GET", - "servers": None, + 'response_type': (FetchResponse,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/vectors/fetch', + 'operation_id': 'fetch_vectors', + 'http_method': 'GET', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "ids", "namespace"], - "required": ["x_pinecone_api_version", "ids"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'ids', + 'namespace', + ], + 'required': [ + 'x_pinecone_api_version', + 'ids', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "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": []}, + 'validations': { + }, + 'allowed_values': { + }, + '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': [], + }, api_client=api_client, - callable=__fetch_vectors, + callable=__fetch_vectors ) def __fetch_vectors_by_metadata( self, fetch_by_metadata_request, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict, + **kwargs: ExtraOpenApiKwargsTypedDict ) -> FetchByMetadataResponse | ApplyResult[FetchByMetadataResponse]: """Fetch vectors by metadata # noqa: E501 @@ -354,47 +434,76 @@ def __fetch_vectors_by_metadata( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['fetch_by_metadata_request'] = \ + fetch_by_metadata_request + return cast(FetchByMetadataResponse | ApplyResult[FetchByMetadataResponse], self.call_with_http_info(**kwargs)) self.fetch_vectors_by_metadata = _Endpoint( settings={ - "response_type": (FetchByMetadataResponse,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/vectors/fetch_by_metadata", - "operation_id": "fetch_vectors_by_metadata", - "http_method": "POST", - "servers": None, + 'response_type': (FetchByMetadataResponse,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/vectors/fetch_by_metadata', + 'operation_id': 'fetch_vectors_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": [], + '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,), + 'validations': { }, - "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, - "location_map": { - "x_pinecone_api_version": "header", - "fetch_by_metadata_request": "body", + 'allowed_values': { }, - "collection_format_map": {}, + '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' + ] }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__fetch_vectors_by_metadata, + callable=__fetch_vectors_by_metadata ) def __list_vectors( - self, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict + self, + x_pinecone_api_version="2025-10", + **kwargs: ExtraOpenApiKwargsTypedDict ) -> ListResponse | ApplyResult[ListResponse]: """List vector IDs # noqa: E501 @@ -436,67 +545,88 @@ def __list_vectors( thread. """ kwargs = self._process_openapi_kwargs(kwargs) - kwargs["x_pinecone_api_version"] = x_pinecone_api_version - return self.call_with_http_info(**kwargs) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + return cast(ListResponse | ApplyResult[ListResponse], self.call_with_http_info(**kwargs)) self.list_vectors = _Endpoint( settings={ - "response_type": (ListResponse,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/vectors/list", - "operation_id": "list_vectors", - "http_method": "GET", - "servers": None, + 'response_type': (ListResponse,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/vectors/list', + 'operation_id': 'list_vectors', + 'http_method': 'GET', + 'servers': None, }, params_map={ - "all": [ - "x_pinecone_api_version", - "prefix", - "limit", - "pagination_token", - "namespace", - ], - "required": ["x_pinecone_api_version"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'prefix', + 'limit', + 'pagination_token', + 'namespace', + ], + 'required': [ + 'x_pinecone_api_version', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "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", - "namespace": "query", - }, - "collection_format_map": {}, - }, - headers_map={"accept": ["application/json"], "content_type": []}, + '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', + 'namespace': 'query', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, api_client=api_client, - callable=__list_vectors, + callable=__list_vectors ) def __query_vectors( self, query_request, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict, + **kwargs: ExtraOpenApiKwargsTypedDict ) -> QueryResponse | ApplyResult[QueryResponse]: """Search with a vector # noqa: E501 @@ -535,40 +665,70 @@ def __query_vectors( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['query_request'] = \ + query_request + return cast(QueryResponse | ApplyResult[QueryResponse], self.call_with_http_info(**kwargs)) self.query_vectors = _Endpoint( settings={ - "response_type": (QueryResponse,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/query", - "operation_id": "query_vectors", - "http_method": "POST", - "servers": None, + 'response_type': (QueryResponse,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/query', + 'operation_id': 'query_vectors', + 'http_method': 'POST', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "query_request"], - "required": ["x_pinecone_api_version", "query_request"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'query_request', + ], + 'required': [ + 'x_pinecone_api_version', + 'query_request', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_pinecone_api_version": (str,), - "query_request": (QueryRequest,), + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'x_pinecone_api_version': + (str,), + 'query_request': + (QueryRequest,), + }, + 'attribute_map': { + 'x_pinecone_api_version': 'X-Pinecone-Api-Version', }, - "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, - "location_map": {"x_pinecone_api_version": "header", "query_request": "body"}, - "collection_format_map": {}, + 'location_map': { + 'x_pinecone_api_version': 'header', + 'query_request': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__query_vectors, + callable=__query_vectors ) def __search_records_namespace( @@ -576,7 +736,7 @@ def __search_records_namespace( namespace, search_records_request, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict, + **kwargs: ExtraOpenApiKwargsTypedDict ) -> SearchRecordsResponse | ApplyResult[SearchRecordsResponse]: """Search with text # noqa: E501 @@ -616,56 +776,85 @@ 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['namespace'] = \ + namespace + kwargs['search_records_request'] = \ + search_records_request + return cast(SearchRecordsResponse | ApplyResult[SearchRecordsResponse], self.call_with_http_info(**kwargs)) self.search_records_namespace = _Endpoint( settings={ - "response_type": (SearchRecordsResponse,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/records/namespaces/{namespace}/search", - "operation_id": "search_records_namespace", - "http_method": "POST", - "servers": None, + 'response_type': (SearchRecordsResponse,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/records/namespaces/{namespace}/search', + 'operation_id': 'search_records_namespace', + 'http_method': 'POST', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "namespace", "search_records_request"], - "required": ["x_pinecone_api_version", "namespace", "search_records_request"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'namespace', + 'search_records_request', + ], + 'required': [ + 'x_pinecone_api_version', + 'namespace', + 'search_records_request', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_pinecone_api_version": (str,), - "namespace": (str,), - "search_records_request": (SearchRecordsRequest,), + 'validations': { }, - "attribute_map": { - "x_pinecone_api_version": "X-Pinecone-Api-Version", - "namespace": "namespace", + 'allowed_values': { }, - "location_map": { - "x_pinecone_api_version": "header", - "namespace": "path", - "search_records_request": "body", + 'openapi_types': { + 'x_pinecone_api_version': + (str,), + 'namespace': + (str,), + 'search_records_request': + (SearchRecordsRequest,), }, - "collection_format_map": {}, + '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' + ] }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__search_records_namespace, + callable=__search_records_namespace ) def __update_vector( self, update_request, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict, + **kwargs: ExtraOpenApiKwargsTypedDict ) -> UpdateResponse | ApplyResult[UpdateResponse]: """Update a vector # noqa: E501 @@ -704,40 +893,70 @@ def __update_vector( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['update_request'] = \ + update_request + return cast(UpdateResponse | ApplyResult[UpdateResponse], self.call_with_http_info(**kwargs)) self.update_vector = _Endpoint( settings={ - "response_type": (UpdateResponse,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/vectors/update", - "operation_id": "update_vector", - "http_method": "POST", - "servers": None, + 'response_type': (UpdateResponse,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/vectors/update', + 'operation_id': 'update_vector', + 'http_method': 'POST', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "update_request"], - "required": ["x_pinecone_api_version", "update_request"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'update_request', + ], + 'required': [ + 'x_pinecone_api_version', + 'update_request', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_pinecone_api_version": (str,), - "update_request": (UpdateRequest,), + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'x_pinecone_api_version': + (str,), + 'update_request': + (UpdateRequest,), + }, + 'attribute_map': { + 'x_pinecone_api_version': 'X-Pinecone-Api-Version', }, - "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, - "location_map": {"x_pinecone_api_version": "header", "update_request": "body"}, - "collection_format_map": {}, + 'location_map': { + 'x_pinecone_api_version': 'header', + 'update_request': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__update_vector, + callable=__update_vector ) def __upsert_records_namespace( @@ -745,7 +964,7 @@ def __upsert_records_namespace( namespace, upsert_record, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict, + **kwargs: ExtraOpenApiKwargsTypedDict ) -> None: """Upsert text # noqa: E501 @@ -785,56 +1004,85 @@ 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['namespace'] = \ + namespace + kwargs['upsert_record'] = \ + upsert_record + return cast(None, self.call_with_http_info(**kwargs)) self.upsert_records_namespace = _Endpoint( settings={ - "response_type": None, - "auth": ["ApiKeyAuth"], - "endpoint_path": "/records/namespaces/{namespace}/upsert", - "operation_id": "upsert_records_namespace", - "http_method": "POST", - "servers": None, + 'response_type': None, + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/records/namespaces/{namespace}/upsert', + 'operation_id': 'upsert_records_namespace', + 'http_method': 'POST', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "namespace", "upsert_record"], - "required": ["x_pinecone_api_version", "namespace", "upsert_record"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'namespace', + 'upsert_record', + ], + 'required': [ + 'x_pinecone_api_version', + 'namespace', + 'upsert_record', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_pinecone_api_version": (str,), - "namespace": (str,), - "upsert_record": ([UpsertRecord],), + 'validations': { }, - "attribute_map": { - "x_pinecone_api_version": "X-Pinecone-Api-Version", - "namespace": "namespace", + 'allowed_values': { }, - "location_map": { - "x_pinecone_api_version": "header", - "namespace": "path", - "upsert_record": "body", + 'openapi_types': { + 'x_pinecone_api_version': + (str,), + 'namespace': + (str,), + 'upsert_record': + ([UpsertRecord],), }, - "collection_format_map": {}, + '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' + ] }, - headers_map={"accept": ["application/json"], "content_type": ["application/x-ndjson"]}, api_client=api_client, - callable=__upsert_records_namespace, + callable=__upsert_records_namespace ) def __upsert_vectors( self, upsert_request, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict, + **kwargs: ExtraOpenApiKwargsTypedDict ) -> UpsertResponse | ApplyResult[UpsertResponse]: """Upsert vectors # noqa: E501 @@ -873,43 +1121,74 @@ def __upsert_vectors( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['upsert_request'] = \ + upsert_request + return cast(UpsertResponse | ApplyResult[UpsertResponse], self.call_with_http_info(**kwargs)) self.upsert_vectors = _Endpoint( settings={ - "response_type": (UpsertResponse,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/vectors/upsert", - "operation_id": "upsert_vectors", - "http_method": "POST", - "servers": None, + 'response_type': (UpsertResponse,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/vectors/upsert', + 'operation_id': 'upsert_vectors', + 'http_method': 'POST', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "upsert_request"], - "required": ["x_pinecone_api_version", "upsert_request"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'upsert_request', + ], + 'required': [ + 'x_pinecone_api_version', + 'upsert_request', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_pinecone_api_version": (str,), - "upsert_request": (UpsertRequest,), + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'x_pinecone_api_version': + (str,), + 'upsert_request': + (UpsertRequest,), + }, + 'attribute_map': { + 'x_pinecone_api_version': 'X-Pinecone-Api-Version', }, - "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, - "location_map": {"x_pinecone_api_version": "header", "upsert_request": "body"}, - "collection_format_map": {}, + 'location_map': { + 'x_pinecone_api_version': 'header', + 'upsert_request': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__upsert_vectors, + callable=__upsert_vectors ) + class AsyncioVectorOperationsApi: """NOTE: This class is @generated using OpenAPI @@ -922,8 +1201,11 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client async def __delete_vectors( - self, delete_request, x_pinecone_api_version="2025-10", **kwargs - ) -> {str: (bool, dict, float, int, list, str, none_type)}: + self, + delete_request, + x_pinecone_api_version="2025-10", + **kwargs + ) -> Dict[str, Any]: """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 @@ -951,47 +1233,80 @@ async def __delete_vectors( Default is True. Returns: - {str: (bool, dict, float, int, list, str, none_type)} + Dict[str, Any] """ 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['delete_request'] = \ + delete_request + return cast(Dict[str, Any], await self.call_with_http_info(**kwargs)) self.delete_vectors = _AsyncioEndpoint( settings={ - "response_type": ({str: (bool, dict, float, int, list, str, none_type)},), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/vectors/delete", - "operation_id": "delete_vectors", - "http_method": "POST", - "servers": None, + 'response_type': (Dict[str, Any],), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/vectors/delete', + 'operation_id': 'delete_vectors', + 'http_method': 'POST', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "delete_request"], - "required": ["x_pinecone_api_version", "delete_request"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'delete_request', + ], + 'required': [ + 'x_pinecone_api_version', + 'delete_request', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_pinecone_api_version": (str,), - "delete_request": (DeleteRequest,), + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'x_pinecone_api_version': + (str,), + 'delete_request': + (DeleteRequest,), + }, + 'attribute_map': { + 'x_pinecone_api_version': 'X-Pinecone-Api-Version', }, - "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, - "location_map": {"x_pinecone_api_version": "header", "delete_request": "body"}, - "collection_format_map": {}, + 'location_map': { + 'x_pinecone_api_version': 'header', + 'delete_request': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__delete_vectors, + callable=__delete_vectors ) async def __describe_index_stats( - self, describe_index_stats_request, x_pinecone_api_version="2025-10", **kwargs + self, + describe_index_stats_request, + x_pinecone_api_version="2025-10", + **kwargs ) -> IndexDescription: """Get index stats # noqa: E501 @@ -1023,47 +1338,77 @@ async def __describe_index_stats( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['describe_index_stats_request'] = \ + describe_index_stats_request + return cast(IndexDescription, await self.call_with_http_info(**kwargs)) self.describe_index_stats = _AsyncioEndpoint( settings={ - "response_type": (IndexDescription,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/describe_index_stats", - "operation_id": "describe_index_stats", - "http_method": "POST", - "servers": None, + 'response_type': (IndexDescription,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/describe_index_stats', + 'operation_id': 'describe_index_stats', + 'http_method': 'POST', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "describe_index_stats_request"], - "required": ["x_pinecone_api_version", "describe_index_stats_request"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'describe_index_stats_request', + ], + 'required': [ + 'x_pinecone_api_version', + 'describe_index_stats_request', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_pinecone_api_version": (str,), - "describe_index_stats_request": (DescribeIndexStatsRequest,), + 'validations': { + }, + 'allowed_values': { }, - "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, - "location_map": { - "x_pinecone_api_version": "header", - "describe_index_stats_request": "body", + 'openapi_types': { + 'x_pinecone_api_version': + (str,), + 'describe_index_stats_request': + (DescribeIndexStatsRequest,), }, - "collection_format_map": {}, + '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' + ] }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__describe_index_stats, + callable=__describe_index_stats ) async def __fetch_vectors( - self, ids, x_pinecone_api_version="2025-10", **kwargs + self, + ids, + x_pinecone_api_version="2025-10", + **kwargs ) -> FetchResponse: """Fetch vectors # noqa: E501 @@ -1096,53 +1441,82 @@ async def __fetch_vectors( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['ids'] = \ + ids + return cast(FetchResponse, await self.call_with_http_info(**kwargs)) self.fetch_vectors = _AsyncioEndpoint( settings={ - "response_type": (FetchResponse,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/vectors/fetch", - "operation_id": "fetch_vectors", - "http_method": "GET", - "servers": None, + 'response_type': (FetchResponse,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/vectors/fetch', + 'operation_id': 'fetch_vectors', + 'http_method': 'GET', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "ids", "namespace"], - "required": ["x_pinecone_api_version", "ids"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'ids', + 'namespace', + ], + 'required': [ + 'x_pinecone_api_version', + 'ids', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "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": []}, + 'validations': { + }, + 'allowed_values': { + }, + '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': [], + }, api_client=api_client, - callable=__fetch_vectors, + callable=__fetch_vectors ) async def __fetch_vectors_by_metadata( - self, fetch_by_metadata_request, x_pinecone_api_version="2025-10", **kwargs + self, + fetch_by_metadata_request, + x_pinecone_api_version="2025-10", + **kwargs ) -> FetchByMetadataResponse: """Fetch vectors by metadata # noqa: E501 @@ -1174,46 +1548,77 @@ async def __fetch_vectors_by_metadata( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['fetch_by_metadata_request'] = \ + fetch_by_metadata_request + return cast(FetchByMetadataResponse, await self.call_with_http_info(**kwargs)) self.fetch_vectors_by_metadata = _AsyncioEndpoint( settings={ - "response_type": (FetchByMetadataResponse,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/vectors/fetch_by_metadata", - "operation_id": "fetch_vectors_by_metadata", - "http_method": "POST", - "servers": None, + 'response_type': (FetchByMetadataResponse,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/vectors/fetch_by_metadata', + 'operation_id': 'fetch_vectors_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": [], + '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,), + 'validations': { + }, + 'allowed_values': { }, - "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, - "location_map": { - "x_pinecone_api_version": "header", - "fetch_by_metadata_request": "body", + 'openapi_types': { + 'x_pinecone_api_version': + (str,), + 'fetch_by_metadata_request': + (FetchByMetadataRequest,), }, - "collection_format_map": {}, + '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' + ] }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__fetch_vectors_by_metadata, + callable=__fetch_vectors_by_metadata ) - async def __list_vectors(self, x_pinecone_api_version="2025-10", **kwargs) -> ListResponse: + async def __list_vectors( + self, + x_pinecone_api_version="2025-10", + **kwargs + ) -> ListResponse: """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 @@ -1247,64 +1652,88 @@ async def __list_vectors(self, x_pinecone_api_version="2025-10", **kwargs) -> Li ListResponse """ self._process_openapi_kwargs(kwargs) - kwargs["x_pinecone_api_version"] = x_pinecone_api_version - return await self.call_with_http_info(**kwargs) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + return cast(ListResponse, await self.call_with_http_info(**kwargs)) self.list_vectors = _AsyncioEndpoint( settings={ - "response_type": (ListResponse,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/vectors/list", - "operation_id": "list_vectors", - "http_method": "GET", - "servers": None, + 'response_type': (ListResponse,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/vectors/list', + 'operation_id': 'list_vectors', + 'http_method': 'GET', + 'servers': None, }, params_map={ - "all": [ - "x_pinecone_api_version", - "prefix", - "limit", - "pagination_token", - "namespace", - ], - "required": ["x_pinecone_api_version"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'prefix', + 'limit', + 'pagination_token', + 'namespace', + ], + 'required': [ + 'x_pinecone_api_version', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "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", - "namespace": "query", - }, - "collection_format_map": {}, - }, - headers_map={"accept": ["application/json"], "content_type": []}, + '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', + 'namespace': 'query', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], + }, api_client=api_client, - callable=__list_vectors, + callable=__list_vectors ) async def __query_vectors( - self, query_request, x_pinecone_api_version="2025-10", **kwargs + self, + query_request, + x_pinecone_api_version="2025-10", + **kwargs ) -> QueryResponse: """Search with a vector # noqa: E501 @@ -1336,44 +1765,78 @@ async def __query_vectors( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['query_request'] = \ + query_request + return cast(QueryResponse, await self.call_with_http_info(**kwargs)) self.query_vectors = _AsyncioEndpoint( settings={ - "response_type": (QueryResponse,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/query", - "operation_id": "query_vectors", - "http_method": "POST", - "servers": None, + 'response_type': (QueryResponse,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/query', + 'operation_id': 'query_vectors', + 'http_method': 'POST', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "query_request"], - "required": ["x_pinecone_api_version", "query_request"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'query_request', + ], + 'required': [ + 'x_pinecone_api_version', + 'query_request', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_pinecone_api_version": (str,), - "query_request": (QueryRequest,), + 'validations': { + }, + 'allowed_values': { }, - "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, - "location_map": {"x_pinecone_api_version": "header", "query_request": "body"}, - "collection_format_map": {}, + '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' + ] }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__query_vectors, + callable=__query_vectors ) async def __search_records_namespace( - self, namespace, search_records_request, x_pinecone_api_version="2025-10", **kwargs + self, + namespace, + search_records_request, + x_pinecone_api_version="2025-10", + **kwargs ) -> SearchRecordsResponse: """Search with text # noqa: E501 @@ -1406,53 +1869,85 @@ async def __search_records_namespace( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['namespace'] = \ + namespace + kwargs['search_records_request'] = \ + search_records_request + return cast(SearchRecordsResponse, await self.call_with_http_info(**kwargs)) self.search_records_namespace = _AsyncioEndpoint( settings={ - "response_type": (SearchRecordsResponse,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/records/namespaces/{namespace}/search", - "operation_id": "search_records_namespace", - "http_method": "POST", - "servers": None, + 'response_type': (SearchRecordsResponse,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/records/namespaces/{namespace}/search', + 'operation_id': 'search_records_namespace', + 'http_method': 'POST', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "namespace", "search_records_request"], - "required": ["x_pinecone_api_version", "namespace", "search_records_request"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'namespace', + 'search_records_request', + ], + 'required': [ + 'x_pinecone_api_version', + 'namespace', + 'search_records_request', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_pinecone_api_version": (str,), - "namespace": (str,), - "search_records_request": (SearchRecordsRequest,), + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'x_pinecone_api_version': + (str,), + 'namespace': + (str,), + 'search_records_request': + (SearchRecordsRequest,), }, - "attribute_map": { - "x_pinecone_api_version": "X-Pinecone-Api-Version", - "namespace": "namespace", + '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", + 'location_map': { + 'x_pinecone_api_version': 'header', + 'namespace': 'path', + 'search_records_request': 'body', }, - "collection_format_map": {}, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__search_records_namespace, + callable=__search_records_namespace ) async def __update_vector( - self, update_request, x_pinecone_api_version="2025-10", **kwargs + self, + update_request, + x_pinecone_api_version="2025-10", + **kwargs ) -> UpdateResponse: """Update a vector # noqa: E501 @@ -1484,44 +1979,78 @@ async def __update_vector( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['update_request'] = \ + update_request + return cast(UpdateResponse, await self.call_with_http_info(**kwargs)) self.update_vector = _AsyncioEndpoint( settings={ - "response_type": (UpdateResponse,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/vectors/update", - "operation_id": "update_vector", - "http_method": "POST", - "servers": None, + 'response_type': (UpdateResponse,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/vectors/update', + 'operation_id': 'update_vector', + 'http_method': 'POST', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "update_request"], - "required": ["x_pinecone_api_version", "update_request"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'update_request', + ], + 'required': [ + 'x_pinecone_api_version', + 'update_request', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_pinecone_api_version": (str,), - "update_request": (UpdateRequest,), + 'validations': { + }, + 'allowed_values': { + }, + '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": {}, + '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' + ] }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__update_vector, + callable=__update_vector ) async def __upsert_records_namespace( - self, namespace, upsert_record, x_pinecone_api_version="2025-10", **kwargs + self, + namespace, + upsert_record, + x_pinecone_api_version="2025-10", + **kwargs ) -> None: """Upsert text # noqa: E501 @@ -1554,53 +2083,85 @@ async def __upsert_records_namespace( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['namespace'] = \ + namespace + kwargs['upsert_record'] = \ + upsert_record + return cast(None, await self.call_with_http_info(**kwargs)) self.upsert_records_namespace = _AsyncioEndpoint( settings={ - "response_type": None, - "auth": ["ApiKeyAuth"], - "endpoint_path": "/records/namespaces/{namespace}/upsert", - "operation_id": "upsert_records_namespace", - "http_method": "POST", - "servers": None, + 'response_type': None, + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/records/namespaces/{namespace}/upsert', + 'operation_id': 'upsert_records_namespace', + 'http_method': 'POST', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "namespace", "upsert_record"], - "required": ["x_pinecone_api_version", "namespace", "upsert_record"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'namespace', + 'upsert_record', + ], + 'required': [ + 'x_pinecone_api_version', + 'namespace', + 'upsert_record', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_pinecone_api_version": (str,), - "namespace": (str,), - "upsert_record": ([UpsertRecord],), + 'validations': { + }, + 'allowed_values': { }, - "attribute_map": { - "x_pinecone_api_version": "X-Pinecone-Api-Version", - "namespace": "namespace", + 'openapi_types': { + 'x_pinecone_api_version': + (str,), + 'namespace': + (str,), + 'upsert_record': + ([UpsertRecord],), }, - "location_map": { - "x_pinecone_api_version": "header", - "namespace": "path", - "upsert_record": "body", + 'attribute_map': { + 'x_pinecone_api_version': 'X-Pinecone-Api-Version', + 'namespace': 'namespace', }, - "collection_format_map": {}, + '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' + ] }, - headers_map={"accept": ["application/json"], "content_type": ["application/x-ndjson"]}, api_client=api_client, - callable=__upsert_records_namespace, + callable=__upsert_records_namespace ) async def __upsert_vectors( - self, upsert_request, x_pinecone_api_version="2025-10", **kwargs + self, + upsert_request, + x_pinecone_api_version="2025-10", + **kwargs ) -> UpsertResponse: """Upsert vectors # noqa: E501 @@ -1632,38 +2193,68 @@ async def __upsert_vectors( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['upsert_request'] = \ + upsert_request + return cast(UpsertResponse, await self.call_with_http_info(**kwargs)) self.upsert_vectors = _AsyncioEndpoint( settings={ - "response_type": (UpsertResponse,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/vectors/upsert", - "operation_id": "upsert_vectors", - "http_method": "POST", - "servers": None, + 'response_type': (UpsertResponse,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/vectors/upsert', + 'operation_id': 'upsert_vectors', + 'http_method': 'POST', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "upsert_request"], - "required": ["x_pinecone_api_version", "upsert_request"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'upsert_request', + ], + 'required': [ + 'x_pinecone_api_version', + 'upsert_request', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_pinecone_api_version": (str,), - "upsert_request": (UpsertRequest,), + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'x_pinecone_api_version': + (str,), + 'upsert_request': + (UpsertRequest,), + }, + 'attribute_map': { + 'x_pinecone_api_version': 'X-Pinecone-Api-Version', }, - "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, - "location_map": {"x_pinecone_api_version": "header", "upsert_request": "body"}, - "collection_format_map": {}, + 'location_map': { + 'x_pinecone_api_version': 'header', + 'upsert_request': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__upsert_vectors, + callable=__upsert_vectors ) diff --git a/pinecone/core/openapi/db_data/apis/__init__.py b/pinecone/core/openapi/db_data/apis/__init__.py index a5caa981e..f0a1cd81d 100644 --- a/pinecone/core/openapi/db_data/apis/__init__.py +++ b/pinecone/core/openapi/db_data/apis/__init__.py @@ -1,3 +1,4 @@ + # flake8: noqa # Import all APIs into this package. diff --git a/pinecone/core/openapi/db_data/model/create_namespace_request.py b/pinecone/core/openapi/db_data/model/create_namespace_request.py index 41b0fccef..0511c92ba 100644 --- a/pinecone/core/openapi/db_data/model/create_namespace_request.py +++ b/pinecone/core/openapi/db_data/model/create_namespace_request.py @@ -1,14 +1,15 @@ """ -Pinecone Data Plane API + Pinecone Data Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,13 +27,14 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): - from pinecone.core.openapi.db_data.model.create_namespace_request_schema import ( - CreateNamespaceRequestSchema, - ) +if TYPE_CHECKING: + from pinecone.core.openapi.db_data.model.create_namespace_request_schema import CreateNamespaceRequestSchema - globals()["CreateNamespaceRequestSchema"] = CreateNamespaceRequestSchema +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 @@ -67,9 +69,11 @@ class CreateNamespaceRequest(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -78,7 +82,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -94,22 +98,24 @@ def openapi_types(cls): """ lazy_import() return { - "name": (str,), # noqa: E501 - "schema": (CreateNamespaceRequestSchema,), # noqa: E501 + '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 + 'name': 'name', # noqa: E501 + 'schema': 'schema', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of CreateNamespaceRequest. @@ -119,7 +125,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -163,20 +172,22 @@ def _from_openapi_data(cls: Type[T], name, *args, **kwargs) -> T: # noqa: E501 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", ()) + _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__), + "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__,), ) @@ -192,29 +203,25 @@ def _from_openapi_data(cls: Type[T], name, *args, **kwargs) -> T: # noqa: E501 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 - ): + 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", - ] - ) + 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 @@ -258,17 +265,19 @@ def __init__(self, name, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -284,17 +293,13 @@ def __init__(self, name, *args, **kwargs) -> None: # noqa: E501 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 - ): + 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." - ) + 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 index 5e2bab334..c9d663a7b 100644 --- a/pinecone/core/openapi/db_data/model/create_namespace_request_schema.py +++ b/pinecone/core/openapi/db_data/model/create_namespace_request_schema.py @@ -1,14 +1,15 @@ """ -Pinecone Data Plane API + Pinecone Data Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,13 +27,14 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): - from pinecone.core.openapi.db_data.model.create_namespace_request_schema_fields import ( - CreateNamespaceRequestSchemaFields, - ) +if TYPE_CHECKING: + from pinecone.core.openapi.db_data.model.create_namespace_request_schema_fields import CreateNamespaceRequestSchemaFields - globals()["CreateNamespaceRequestSchemaFields"] = CreateNamespaceRequestSchemaFields +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 @@ -67,9 +69,11 @@ class CreateNamespaceRequestSchema(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -78,7 +82,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -94,20 +98,22 @@ def openapi_types(cls): """ lazy_import() return { - "fields": ({str: (CreateNamespaceRequestSchemaFields,)},) # noqa: E501 + 'fields': ({str: (CreateNamespaceRequestSchemaFields,)},), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "fields": "fields" # noqa: E501 + 'fields': 'fields', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of CreateNamespaceRequestSchema. @@ -117,7 +123,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -160,20 +169,22 @@ def _from_openapi_data(cls: Type[T], fields, *args, **kwargs) -> T: # noqa: E50 _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", ()) + _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__), + "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__,), ) @@ -189,29 +200,25 @@ def _from_openapi_data(cls: Type[T], fields, *args, **kwargs) -> T: # noqa: E50 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 - ): + 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", - ] - ) + 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 @@ -254,17 +261,19 @@ def __init__(self, fields, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -280,17 +289,13 @@ def __init__(self, fields, *args, **kwargs) -> None: # noqa: E501 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 - ): + 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." - ) + 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 index b98d27cdb..a7cac4cdb 100644 --- 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 @@ -1,14 +1,15 @@ """ -Pinecone Data Plane API + Pinecone Data Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -27,6 +28,7 @@ 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 @@ -59,9 +61,11 @@ class CreateNamespaceRequestSchemaFields(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -69,7 +73,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 """ - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -84,20 +88,22 @@ def openapi_types(cls): and the value is attribute type. """ return { - "filterable": (bool,) # noqa: E501 + 'filterable': (bool,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "filterable": "filterable" # noqa: E501 + 'filterable': 'filterable', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of CreateNamespaceRequestSchemaFields. @@ -107,7 +113,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -148,20 +157,22 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 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", ()) + _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__), + "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__,), ) @@ -176,29 +187,25 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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 @@ -239,17 +246,19 @@ def __init__(self, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -264,17 +273,13 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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 3c941e532..b67c60e89 100644 --- a/pinecone/core/openapi/db_data/model/delete_request.py +++ b/pinecone/core/openapi/db_data/model/delete_request.py @@ -1,14 +1,15 @@ """ -Pinecone Data Plane API + Pinecone Data Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -27,6 +28,7 @@ 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 @@ -59,9 +61,13 @@ class DeleteRequest(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {("ids",): {}} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + ('ids',): { + }, + } @cached_class_property def additional_properties_type(cls): @@ -69,7 +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 """ - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -84,26 +90,28 @@ def openapi_types(cls): and the value is attribute type. """ return { - "ids": ([str],), # noqa: E501 - "delete_all": (bool,), # noqa: E501 - "namespace": (str,), # noqa: E501 - "filter": ({str: (bool, dict, float, int, list, str, none_type)},), # noqa: E501 + 'ids': ([str],), # noqa: E501 + 'delete_all': (bool,), # noqa: E501 + 'namespace': (str,), # noqa: E501 + 'filter': (Dict[str, Any],), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "ids": "ids", # noqa: E501 - "delete_all": "deleteAll", # noqa: E501 - "namespace": "namespace", # noqa: E501 - "filter": "filter", # noqa: E501 + 'ids': 'ids', # noqa: E501 + 'delete_all': 'deleteAll', # noqa: E501 + 'namespace': 'namespace', # noqa: E501 + 'filter': 'filter', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of DeleteRequest. @@ -113,7 +121,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -154,23 +165,25 @@ 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 [Delete data](https://docs.pinecone.io/guides/manage-data/delete-data#delete-records-by-metadata). [optional] # noqa: E501 + filter (Dict[str, Any]): 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) - _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", ()) + _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__), + "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__,), ) @@ -185,29 +198,25 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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 @@ -247,21 +256,23 @@ 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 [Delete data](https://docs.pinecone.io/guides/manage-data/delete-data#delete-records-by-metadata). [optional] # noqa: E501 + filter (Dict[str, Any]): 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) - _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", ()) + _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__), + "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__,), ) @@ -276,17 +287,13 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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/describe_index_stats_request.py b/pinecone/core/openapi/db_data/model/describe_index_stats_request.py index ea037a747..f8917fff0 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 @@ -1,14 +1,15 @@ """ -Pinecone Data Plane API + Pinecone Data Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -27,6 +28,7 @@ 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 @@ -59,9 +61,11 @@ class DescribeIndexStatsRequest(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -69,7 +73,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 """ - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -84,20 +88,22 @@ def openapi_types(cls): and the value is attribute type. """ return { - "filter": ({str: (bool, dict, float, int, list, str, none_type)},) # noqa: E501 + 'filter': (Dict[str, Any],), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "filter": "filter" # noqa: E501 + 'filter': 'filter', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of DescribeIndexStatsRequest. @@ -107,7 +113,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -145,23 +154,25 @@ 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,) - filter ({str: (bool, dict, float, int, list, str, none_type)}): If this parameter is present, the operation only returns statistics for vectors that satisfy the filter. See [Understanding metadata](https://docs.pinecone.io/guides/index-data/indexing-overview#metadata). Serverless indexes do not support filtering `describe_index_stats` by metadata. [optional] # noqa: E501 + filter (Dict[str, Any]): If this parameter is present, the operation only returns statistics for vectors that satisfy the filter. See [Understanding metadata](https://docs.pinecone.io/guides/index-data/indexing-overview#metadata). Serverless indexes do not support filtering `describe_index_stats` by metadata. [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", ()) + _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__), + "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__,), ) @@ -176,29 +187,25 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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 @@ -235,21 +242,23 @@ 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,) - filter ({str: (bool, dict, float, int, list, str, none_type)}): If this parameter is present, the operation only returns statistics for vectors that satisfy the filter. See [Understanding metadata](https://docs.pinecone.io/guides/index-data/indexing-overview#metadata). Serverless indexes do not support filtering `describe_index_stats` by metadata. [optional] # noqa: E501 + filter (Dict[str, Any]): If this parameter is present, the operation only returns statistics for vectors that satisfy the filter. See [Understanding metadata](https://docs.pinecone.io/guides/index-data/indexing-overview#metadata). Serverless indexes do not support filtering `describe_index_stats` by metadata. [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", ()) + _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__), + "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__,), ) @@ -264,17 +273,13 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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_request.py b/pinecone/core/openapi/db_data/model/fetch_by_metadata_request.py index 3db3d451a..757fc1106 100644 --- a/pinecone/core/openapi/db_data/model/fetch_by_metadata_request.py +++ b/pinecone/core/openapi/db_data/model/fetch_by_metadata_request.py @@ -1,14 +1,15 @@ """ -Pinecone Data Plane API + Pinecone Data Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -27,6 +28,7 @@ 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 @@ -59,10 +61,13 @@ class FetchByMetadataRequest(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ("limit",): {"inclusive_minimum": 1} + ('limit',): { + 'inclusive_minimum': 1, + }, } @cached_class_property @@ -71,7 +76,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 """ - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -86,26 +91,28 @@ def openapi_types(cls): 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 + 'namespace': (str,), # noqa: E501 + 'filter': (Dict[str, Any],), # 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 + 'namespace': 'namespace', # noqa: E501 + 'filter': 'filter', # noqa: E501 + 'limit': 'limit', # noqa: E501 + 'pagination_token': 'paginationToken', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of FetchByMetadataRequest. @@ -115,7 +122,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -154,25 +164,27 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 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 + filter (Dict[str, Any]): 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", ()) + _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__), + "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__,), ) @@ -187,29 +199,25 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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 @@ -247,23 +255,25 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 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 + filter (Dict[str, Any]): 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", ()) + _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__), + "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__,), ) @@ -278,17 +288,13 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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 index e5a18ff7d..024c9bf7c 100644 --- a/pinecone/core/openapi/db_data/model/fetch_by_metadata_response.py +++ b/pinecone/core/openapi/db_data/model/fetch_by_metadata_response.py @@ -1,14 +1,15 @@ """ -Pinecone Data Plane API + Pinecone Data Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,15 +27,20 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): +if TYPE_CHECKING: 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 +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 @@ -69,9 +75,11 @@ class FetchByMetadataResponse(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -80,7 +88,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -96,26 +104,28 @@ def openapi_types(cls): """ lazy_import() return { - "vectors": ({str: (Vector,)},), # noqa: E501 - "namespace": (str,), # noqa: E501 - "usage": (Usage,), # noqa: E501 - "pagination": (Pagination,), # noqa: E501 + '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 + 'vectors': 'vectors', # noqa: E501 + 'namespace': 'namespace', # noqa: E501 + 'usage': 'usage', # noqa: E501 + 'pagination': 'pagination', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of FetchByMetadataResponse. @@ -125,7 +135,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -169,20 +182,22 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # 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", ()) + _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__), + "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__,), ) @@ -197,29 +212,25 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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 @@ -263,17 +274,19 @@ def __init__(self, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -288,17 +301,13 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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 bec3cc982..fbdd4da0d 100644 --- a/pinecone/core/openapi/db_data/model/fetch_response.py +++ b/pinecone/core/openapi/db_data/model/fetch_response.py @@ -1,14 +1,15 @@ """ -Pinecone Data Plane API + Pinecone Data Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,13 +27,17 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): +if TYPE_CHECKING: from pinecone.core.openapi.db_data.model.usage import Usage from pinecone.core.openapi.db_data.model.vector import Vector - globals()["Usage"] = Usage - globals()["Vector"] = Vector +def lazy_import(): + from pinecone.core.openapi.db_data.model.usage import Usage + from pinecone.core.openapi.db_data.model.vector import Vector + globals()['Usage'] = Usage + globals()['Vector'] = Vector from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -67,9 +72,11 @@ class FetchResponse(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -78,7 +85,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -94,24 +101,26 @@ def openapi_types(cls): """ lazy_import() return { - "vectors": ({str: (Vector,)},), # noqa: E501 - "namespace": (str,), # noqa: E501 - "usage": (Usage,), # noqa: E501 + 'vectors': ({str: (Vector,)},), # noqa: E501 + 'namespace': (str,), # noqa: E501 + 'usage': (Usage,), # 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 + 'vectors': 'vectors', # noqa: E501 + 'namespace': 'namespace', # noqa: E501 + 'usage': 'usage', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of FetchResponse. @@ -121,7 +130,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -164,20 +176,22 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 usage (Usage): [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", ()) + _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__), + "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__,), ) @@ -192,29 +206,25 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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 @@ -257,17 +267,19 @@ def __init__(self, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -282,17 +294,13 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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/hit.py b/pinecone/core/openapi/db_data/model/hit.py index 6e1f6d7a1..f389aa800 100644 --- a/pinecone/core/openapi/db_data/model/hit.py +++ b/pinecone/core/openapi/db_data/model/hit.py @@ -1,14 +1,15 @@ """ -Pinecone Data Plane API + Pinecone Data Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -27,6 +28,7 @@ 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 @@ -59,9 +61,11 @@ class Hit(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -69,7 +73,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 """ - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -84,24 +88,26 @@ def openapi_types(cls): and the value is attribute type. """ return { - "_id": (str,), # noqa: E501 - "_score": (float,), # noqa: E501 - "fields": ({str: (bool, dict, float, int, list, str, none_type)},), # noqa: E501 + '_id': (str,), # noqa: E501 + '_score': (float,), # noqa: E501 + 'fields': (Dict[str, Any],), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "_id": "_id", # noqa: E501 - "_score": "_score", # noqa: E501 - "fields": "fields", # noqa: E501 + '_id': '_id', # noqa: E501 + '_score': '_score', # noqa: E501 + 'fields': 'fields', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of Hit. @@ -111,7 +117,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -121,7 +130,7 @@ def _from_openapi_data(cls: Type[T], _id, _score, fields, *args, **kwargs) -> T: Args: _id (str): The record id of the search hit. _score (float): The similarity score of the returned record. - fields ({str: (bool, dict, float, int, list, str, none_type)}): The selected record fields associated with the search hit. + fields (Dict[str, Any]): The selected record fields associated with the search hit. Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -156,20 +165,22 @@ def _from_openapi_data(cls: Type[T], _id, _score, fields, *args, **kwargs) -> T: _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", ()) + _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__), + "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__,), ) @@ -187,29 +198,25 @@ def _from_openapi_data(cls: Type[T], _id, _score, fields, *args, **kwargs) -> T: self._score = _score 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 - ): + 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", - ] - ) + 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, _score, fields, *args, **kwargs) -> None: # noqa: E501 @@ -218,7 +225,7 @@ def __init__(self, _id, _score, fields, *args, **kwargs) -> None: # noqa: E501 Args: _id (str): The record id of the search hit. _score (float): The similarity score of the returned record. - fields ({str: (bool, dict, float, int, list, str, none_type)}): The selected record fields associated with the search hit. + fields (Dict[str, Any]): The selected record fields associated with the search hit. Keyword Args: _check_type (bool): if True, values for parameters in openapi_types @@ -254,17 +261,19 @@ def __init__(self, _id, _score, fields, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -282,17 +291,13 @@ def __init__(self, _id, _score, fields, *args, **kwargs) -> None: # noqa: E501 self._score = _score 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 - ): + 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." - ) + 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/import_error_mode.py b/pinecone/core/openapi/db_data/model/import_error_mode.py index 3cb889d49..2aee4a2e4 100644 --- a/pinecone/core/openapi/db_data/model/import_error_mode.py +++ b/pinecone/core/openapi/db_data/model/import_error_mode.py @@ -1,14 +1,15 @@ """ -Pinecone Data Plane API + Pinecone Data Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -27,6 +28,7 @@ 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 @@ -59,9 +61,11 @@ class ImportErrorMode(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -69,7 +73,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 """ - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -84,20 +88,22 @@ def openapi_types(cls): and the value is attribute type. """ return { - "on_error": (str,) # noqa: E501 + 'on_error': (str,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "on_error": "onError" # noqa: E501 + 'on_error': 'onError', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ImportErrorMode. @@ -107,7 +113,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -148,20 +157,22 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # 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) - _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", ()) + _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__), + "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__,), ) @@ -176,29 +187,25 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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 @@ -239,17 +246,19 @@ def __init__(self, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -264,17 +273,13 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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/import_model.py b/pinecone/core/openapi/db_data/model/import_model.py index d96a623bb..ee6b049cd 100644 --- a/pinecone/core/openapi/db_data/model/import_model.py +++ b/pinecone/core/openapi/db_data/model/import_model.py @@ -1,14 +1,15 @@ """ -Pinecone Data Plane API + Pinecone Data Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -27,6 +28,7 @@ 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 @@ -59,11 +61,18 @@ class ImportModel(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ("id",): {"max_length": 1000, "min_length": 1}, - ("percent_complete",): {"inclusive_maximum": 100.0, "inclusive_minimum": 0.0}, + ('id',): { + 'max_length': 1000, + 'min_length': 1, + }, + ('percent_complete',): { + 'inclusive_maximum': 100.0, + 'inclusive_minimum': 0.0, + }, } @cached_class_property @@ -72,7 +81,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 """ - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -87,34 +96,36 @@ def openapi_types(cls): and the value is attribute type. """ return { - "id": (str,), # noqa: E501 - "uri": (str,), # noqa: E501 - "status": (str,), # noqa: E501 - "created_at": (datetime,), # noqa: E501 - "finished_at": (datetime,), # noqa: E501 - "percent_complete": (float,), # noqa: E501 - "records_imported": (int,), # noqa: E501 - "error": (str,), # noqa: E501 + 'id': (str,), # noqa: E501 + 'uri': (str,), # noqa: E501 + 'status': (str,), # noqa: E501 + 'created_at': (datetime,), # noqa: E501 + 'finished_at': (datetime,), # noqa: E501 + 'percent_complete': (float,), # noqa: E501 + 'records_imported': (int,), # noqa: E501 + 'error': (str,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "id": "id", # noqa: E501 - "uri": "uri", # noqa: E501 - "status": "status", # noqa: E501 - "created_at": "createdAt", # noqa: E501 - "finished_at": "finishedAt", # noqa: E501 - "percent_complete": "percentComplete", # noqa: E501 - "records_imported": "recordsImported", # noqa: E501 - "error": "error", # noqa: E501 + 'id': 'id', # noqa: E501 + 'uri': 'uri', # noqa: E501 + 'status': 'status', # noqa: E501 + 'created_at': 'createdAt', # noqa: E501 + 'finished_at': 'finishedAt', # noqa: E501 + 'percent_complete': 'percentComplete', # noqa: E501 + 'records_imported': 'recordsImported', # noqa: E501 + 'error': 'error', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ImportModel. @@ -124,7 +135,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -172,20 +186,22 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 error (str): The error message if the import process failed. [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", ()) + _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__), + "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__,), ) @@ -200,29 +216,25 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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 @@ -270,17 +282,19 @@ def __init__(self, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -295,17 +309,13 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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/index_description.py b/pinecone/core/openapi/db_data/model/index_description.py index 2b8ef628e..5b63aabbf 100644 --- a/pinecone/core/openapi/db_data/model/index_description.py +++ b/pinecone/core/openapi/db_data/model/index_description.py @@ -1,14 +1,15 @@ """ -Pinecone Data Plane API + Pinecone Data Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,11 +27,14 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): +if TYPE_CHECKING: from pinecone.core.openapi.db_data.model.namespace_summary import NamespaceSummary - globals()["NamespaceSummary"] = NamespaceSummary +def lazy_import(): + from pinecone.core.openapi.db_data.model.namespace_summary import NamespaceSummary + globals()['NamespaceSummary'] = NamespaceSummary from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -65,9 +69,11 @@ class IndexDescription(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -76,7 +82,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -92,34 +98,36 @@ def openapi_types(cls): """ lazy_import() return { - "namespaces": ({str: (NamespaceSummary,)},), # noqa: E501 - "dimension": (int,), # noqa: E501 - "index_fullness": (float,), # noqa: E501 - "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 + 'namespaces': ({str: (NamespaceSummary,)},), # noqa: E501 + 'dimension': (int,), # noqa: E501 + 'index_fullness': (float,), # noqa: E501 + '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 def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "namespaces": "namespaces", # noqa: E501 - "dimension": "dimension", # noqa: E501 - "index_fullness": "indexFullness", # noqa: E501 - "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 + 'namespaces': 'namespaces', # noqa: E501 + 'dimension': 'dimension', # noqa: E501 + 'index_fullness': 'indexFullness', # noqa: E501 + '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([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of IndexDescription. @@ -129,7 +137,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -177,20 +188,22 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # 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) - _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", ()) + _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__), + "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__,), ) @@ -205,29 +218,25 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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 @@ -275,17 +284,19 @@ def __init__(self, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -300,17 +311,13 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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/list_imports_response.py b/pinecone/core/openapi/db_data/model/list_imports_response.py index 3394ebf31..7aa20d888 100644 --- a/pinecone/core/openapi/db_data/model/list_imports_response.py +++ b/pinecone/core/openapi/db_data/model/list_imports_response.py @@ -1,14 +1,15 @@ """ -Pinecone Data Plane API + Pinecone Data Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,13 +27,17 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): +if TYPE_CHECKING: from pinecone.core.openapi.db_data.model.import_model import ImportModel from pinecone.core.openapi.db_data.model.pagination import Pagination - globals()["ImportModel"] = ImportModel - globals()["Pagination"] = Pagination +def lazy_import(): + from pinecone.core.openapi.db_data.model.import_model import ImportModel + from pinecone.core.openapi.db_data.model.pagination import Pagination + globals()['ImportModel'] = ImportModel + globals()['Pagination'] = Pagination from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -67,9 +72,11 @@ class ListImportsResponse(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -78,7 +85,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -94,22 +101,24 @@ def openapi_types(cls): """ lazy_import() return { - "data": ([ImportModel],), # noqa: E501 - "pagination": (Pagination,), # noqa: E501 + 'data': ([ImportModel],), # noqa: E501 + 'pagination': (Pagination,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "data": "data", # noqa: E501 - "pagination": "pagination", # noqa: E501 + 'data': 'data', # noqa: E501 + 'pagination': 'pagination', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ListImportsResponse. @@ -119,7 +128,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -161,20 +173,22 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # 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", ()) + _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__), + "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__,), ) @@ -189,29 +203,25 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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 @@ -253,17 +263,19 @@ def __init__(self, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -278,17 +290,13 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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/list_item.py b/pinecone/core/openapi/db_data/model/list_item.py index f7da88428..90e9b99a7 100644 --- a/pinecone/core/openapi/db_data/model/list_item.py +++ b/pinecone/core/openapi/db_data/model/list_item.py @@ -1,14 +1,15 @@ """ -Pinecone Data Plane API + Pinecone Data Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -27,6 +28,7 @@ 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 @@ -59,9 +61,11 @@ class ListItem(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -69,7 +73,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 """ - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -84,20 +88,22 @@ def openapi_types(cls): and the value is attribute type. """ return { - "id": (str,) # noqa: E501 + 'id': (str,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "id": "id" # noqa: E501 + 'id': 'id', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ListItem. @@ -107,7 +113,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -148,20 +157,22 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 id (str): [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", ()) + _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__), + "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__,), ) @@ -176,29 +187,25 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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 @@ -239,17 +246,19 @@ def __init__(self, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -264,17 +273,13 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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/list_namespaces_response.py b/pinecone/core/openapi/db_data/model/list_namespaces_response.py index 1eae7e80b..f5eca2910 100644 --- a/pinecone/core/openapi/db_data/model/list_namespaces_response.py +++ b/pinecone/core/openapi/db_data/model/list_namespaces_response.py @@ -1,14 +1,15 @@ """ -Pinecone Data Plane API + Pinecone Data Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,13 +27,17 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): +if TYPE_CHECKING: from pinecone.core.openapi.db_data.model.namespace_description import NamespaceDescription from pinecone.core.openapi.db_data.model.pagination import Pagination - globals()["NamespaceDescription"] = NamespaceDescription - globals()["Pagination"] = Pagination +def lazy_import(): + from pinecone.core.openapi.db_data.model.namespace_description import NamespaceDescription + from pinecone.core.openapi.db_data.model.pagination import Pagination + globals()['NamespaceDescription'] = NamespaceDescription + globals()['Pagination'] = Pagination from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -67,9 +72,11 @@ class ListNamespacesResponse(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -78,7 +85,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -94,24 +101,26 @@ def openapi_types(cls): """ lazy_import() return { - "namespaces": ([NamespaceDescription],), # noqa: E501 - "pagination": (Pagination,), # noqa: E501 - "total_count": (int,), # noqa: E501 + 'namespaces': ([NamespaceDescription],), # noqa: E501 + 'pagination': (Pagination,), # noqa: E501 + 'total_count': (int,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "namespaces": "namespaces", # noqa: E501 - "pagination": "pagination", # noqa: E501 - "total_count": "total_count", # noqa: E501 + 'namespaces': 'namespaces', # noqa: E501 + 'pagination': 'pagination', # noqa: E501 + 'total_count': 'total_count', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ListNamespacesResponse. @@ -121,7 +130,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -164,20 +176,22 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # 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) - _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", ()) + _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__), + "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__,), ) @@ -192,29 +206,25 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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 @@ -257,17 +267,19 @@ def __init__(self, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -282,17 +294,13 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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/list_response.py b/pinecone/core/openapi/db_data/model/list_response.py index 9ffc40fb4..129c2df91 100644 --- a/pinecone/core/openapi/db_data/model/list_response.py +++ b/pinecone/core/openapi/db_data/model/list_response.py @@ -1,14 +1,15 @@ """ -Pinecone Data Plane API + Pinecone Data Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,15 +27,20 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): +if TYPE_CHECKING: from pinecone.core.openapi.db_data.model.list_item import ListItem from pinecone.core.openapi.db_data.model.pagination import Pagination from pinecone.core.openapi.db_data.model.usage import Usage - globals()["ListItem"] = ListItem - globals()["Pagination"] = Pagination - globals()["Usage"] = Usage +def lazy_import(): + from pinecone.core.openapi.db_data.model.list_item import ListItem + from pinecone.core.openapi.db_data.model.pagination import Pagination + from pinecone.core.openapi.db_data.model.usage import Usage + globals()['ListItem'] = ListItem + globals()['Pagination'] = Pagination + globals()['Usage'] = Usage from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -69,9 +75,11 @@ class ListResponse(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -80,7 +88,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -96,26 +104,28 @@ def openapi_types(cls): """ lazy_import() return { - "vectors": ([ListItem],), # noqa: E501 - "pagination": (Pagination,), # noqa: E501 - "namespace": (str,), # noqa: E501 - "usage": (Usage,), # noqa: E501 + 'vectors': ([ListItem],), # noqa: E501 + 'pagination': (Pagination,), # noqa: E501 + 'namespace': (str,), # noqa: E501 + 'usage': (Usage,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "vectors": "vectors", # noqa: E501 - "pagination": "pagination", # noqa: E501 - "namespace": "namespace", # noqa: E501 - "usage": "usage", # noqa: E501 + 'vectors': 'vectors', # noqa: E501 + 'pagination': 'pagination', # noqa: E501 + 'namespace': 'namespace', # noqa: E501 + 'usage': 'usage', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ListResponse. @@ -125,7 +135,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -169,20 +182,22 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 usage (Usage): [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", ()) + _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__), + "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__,), ) @@ -197,29 +212,25 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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 @@ -263,17 +274,19 @@ def __init__(self, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -288,17 +301,13 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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/namespace_description.py b/pinecone/core/openapi/db_data/model/namespace_description.py index 6d2d87438..42c7022ed 100644 --- a/pinecone/core/openapi/db_data/model/namespace_description.py +++ b/pinecone/core/openapi/db_data/model/namespace_description.py @@ -1,14 +1,15 @@ """ -Pinecone Data Plane API + Pinecone Data Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,17 +27,17 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): - from pinecone.core.openapi.db_data.model.create_namespace_request_schema import ( - CreateNamespaceRequestSchema, - ) - from pinecone.core.openapi.db_data.model.namespace_description_indexed_fields import ( - NamespaceDescriptionIndexedFields, - ) +if TYPE_CHECKING: + from pinecone.core.openapi.db_data.model.create_namespace_request_schema import CreateNamespaceRequestSchema + from pinecone.core.openapi.db_data.model.namespace_description_indexed_fields import NamespaceDescriptionIndexedFields - globals()["CreateNamespaceRequestSchema"] = CreateNamespaceRequestSchema - globals()["NamespaceDescriptionIndexedFields"] = NamespaceDescriptionIndexedFields +def lazy_import(): + from pinecone.core.openapi.db_data.model.create_namespace_request_schema import CreateNamespaceRequestSchema + from pinecone.core.openapi.db_data.model.namespace_description_indexed_fields import NamespaceDescriptionIndexedFields + globals()['CreateNamespaceRequestSchema'] = CreateNamespaceRequestSchema + globals()['NamespaceDescriptionIndexedFields'] = NamespaceDescriptionIndexedFields from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -71,9 +72,11 @@ class NamespaceDescription(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -82,7 +85,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -98,26 +101,28 @@ def openapi_types(cls): """ lazy_import() return { - "name": (str,), # noqa: E501 - "record_count": (int,), # noqa: E501 - "schema": (CreateNamespaceRequestSchema,), # noqa: E501 - "indexed_fields": (NamespaceDescriptionIndexedFields,), # noqa: E501 + 'name': (str,), # noqa: E501 + 'record_count': (int,), # noqa: E501 + 'schema': (CreateNamespaceRequestSchema,), # noqa: E501 + 'indexed_fields': (NamespaceDescriptionIndexedFields,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "name": "name", # noqa: E501 - "record_count": "record_count", # noqa: E501 - "schema": "schema", # noqa: E501 - "indexed_fields": "indexed_fields", # noqa: E501 + 'name': 'name', # noqa: E501 + 'record_count': 'record_count', # noqa: E501 + 'schema': 'schema', # noqa: E501 + 'indexed_fields': 'indexed_fields', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of NamespaceDescription. @@ -127,7 +132,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -171,20 +179,22 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 indexed_fields (NamespaceDescriptionIndexedFields): [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", ()) + _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__), + "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__,), ) @@ -199,29 +209,25 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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 @@ -265,17 +271,19 @@ def __init__(self, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -290,17 +298,13 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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/namespace_description_indexed_fields.py b/pinecone/core/openapi/db_data/model/namespace_description_indexed_fields.py index b5d039961..d235fb8da 100644 --- a/pinecone/core/openapi/db_data/model/namespace_description_indexed_fields.py +++ b/pinecone/core/openapi/db_data/model/namespace_description_indexed_fields.py @@ -1,14 +1,15 @@ """ -Pinecone Data Plane API + Pinecone Data Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -27,6 +28,7 @@ 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 @@ -59,9 +61,11 @@ class NamespaceDescriptionIndexedFields(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -69,7 +73,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 """ - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -84,20 +88,22 @@ def openapi_types(cls): and the value is attribute type. """ return { - "fields": ([str],) # noqa: E501 + 'fields': ([str],), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "fields": "fields" # noqa: E501 + 'fields': 'fields', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of NamespaceDescriptionIndexedFields. @@ -107,7 +113,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -148,20 +157,22 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 fields ([str]): [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", ()) + _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__), + "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__,), ) @@ -176,29 +187,25 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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 @@ -239,17 +246,19 @@ def __init__(self, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -264,17 +273,13 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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/namespace_summary.py b/pinecone/core/openapi/db_data/model/namespace_summary.py index 32be17646..310a1e4b2 100644 --- a/pinecone/core/openapi/db_data/model/namespace_summary.py +++ b/pinecone/core/openapi/db_data/model/namespace_summary.py @@ -1,14 +1,15 @@ """ -Pinecone Data Plane API + Pinecone Data Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -27,6 +28,7 @@ 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 @@ -59,9 +61,11 @@ class NamespaceSummary(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -69,7 +73,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 """ - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -84,20 +88,22 @@ def openapi_types(cls): and the value is attribute type. """ return { - "vector_count": (int,) # noqa: E501 + 'vector_count': (int,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "vector_count": "vectorCount" # noqa: E501 + 'vector_count': 'vectorCount', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of NamespaceSummary. @@ -107,7 +113,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -148,20 +157,22 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 vector_count (int): The number of vectors stored in this namespace. Note that updates to this field may lag behind updates to the underlying index and corresponding query results, etc. [optional] # noqa: E501 """ - _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", ()) + _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__), + "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__,), ) @@ -176,29 +187,25 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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 @@ -239,17 +246,19 @@ def __init__(self, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -264,17 +273,13 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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/pagination.py b/pinecone/core/openapi/db_data/model/pagination.py index 2167046cb..7c79aa03e 100644 --- a/pinecone/core/openapi/db_data/model/pagination.py +++ b/pinecone/core/openapi/db_data/model/pagination.py @@ -1,14 +1,15 @@ """ -Pinecone Data Plane API + Pinecone Data Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -27,6 +28,7 @@ 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 @@ -59,9 +61,11 @@ class Pagination(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -69,7 +73,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 """ - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -84,20 +88,22 @@ def openapi_types(cls): and the value is attribute type. """ return { - "next": (str,) # noqa: E501 + 'next': (str,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "next": "next" # noqa: E501 + 'next': 'next', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of Pagination. @@ -107,7 +113,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -148,20 +157,22 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 next (str): [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", ()) + _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__), + "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__,), ) @@ -176,29 +187,25 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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 @@ -239,17 +246,19 @@ def __init__(self, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -264,17 +273,13 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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/protobuf_any.py b/pinecone/core/openapi/db_data/model/protobuf_any.py index 26066116b..825e985e2 100644 --- a/pinecone/core/openapi/db_data/model/protobuf_any.py +++ b/pinecone/core/openapi/db_data/model/protobuf_any.py @@ -1,14 +1,15 @@ """ -Pinecone Data Plane API + Pinecone Data Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -27,6 +28,7 @@ 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 @@ -59,9 +61,11 @@ class ProtobufAny(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -69,7 +73,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 """ - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -84,22 +88,24 @@ def openapi_types(cls): and the value is attribute type. """ return { - "type_url": (str,), # noqa: E501 - "value": (str,), # noqa: E501 + 'type_url': (str,), # noqa: E501 + 'value': (str,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "type_url": "typeUrl", # noqa: E501 - "value": "value", # noqa: E501 + 'type_url': 'typeUrl', # noqa: E501 + 'value': 'value', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ProtobufAny. @@ -109,7 +115,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -151,20 +160,22 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 value (str): [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", ()) + _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__), + "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__,), ) @@ -179,29 +190,25 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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 @@ -243,17 +250,19 @@ def __init__(self, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -268,17 +277,13 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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/query_request.py b/pinecone/core/openapi/db_data/model/query_request.py index fd523a1e8..e547fc67e 100644 --- a/pinecone/core/openapi/db_data/model/query_request.py +++ b/pinecone/core/openapi/db_data/model/query_request.py @@ -1,14 +1,15 @@ """ -Pinecone Data Plane API + Pinecone Data Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,13 +27,17 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): +if TYPE_CHECKING: from pinecone.core.openapi.db_data.model.query_vector import QueryVector from pinecone.core.openapi.db_data.model.sparse_values import SparseValues - globals()["QueryVector"] = QueryVector - globals()["SparseValues"] = SparseValues +def lazy_import(): + from pinecone.core.openapi.db_data.model.query_vector import QueryVector + from pinecone.core.openapi.db_data.model.sparse_values import SparseValues + globals()['QueryVector'] = QueryVector + globals()['SparseValues'] = SparseValues from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -67,13 +72,21 @@ class QueryRequest(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ("top_k",): {"inclusive_maximum": 10000, "inclusive_minimum": 1}, - ("queries",): {}, - ("vector",): {}, - ("id",): {"max_length": 512}, + ('top_k',): { + 'inclusive_maximum': 10000, + 'inclusive_minimum': 1, + }, + ('queries',): { + }, + ('vector',): { + }, + ('id',): { + 'max_length': 512, + }, } @cached_class_property @@ -83,7 +96,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -99,36 +112,38 @@ def openapi_types(cls): """ lazy_import() return { - "top_k": (int,), # noqa: E501 - "namespace": (str,), # noqa: E501 - "filter": ({str: (bool, dict, float, int, list, str, none_type)},), # noqa: E501 - "include_values": (bool,), # noqa: E501 - "include_metadata": (bool,), # noqa: E501 - "queries": ([QueryVector],), # noqa: E501 - "vector": ([float],), # noqa: E501 - "sparse_vector": (SparseValues,), # noqa: E501 - "id": (str,), # noqa: E501 + 'top_k': (int,), # noqa: E501 + 'namespace': (str,), # noqa: E501 + 'filter': (Dict[str, Any],), # noqa: E501 + 'include_values': (bool,), # noqa: E501 + 'include_metadata': (bool,), # noqa: E501 + 'queries': ([QueryVector],), # noqa: E501 + 'vector': ([float],), # noqa: E501 + 'sparse_vector': (SparseValues,), # noqa: E501 + 'id': (str,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "top_k": "topK", # noqa: E501 - "namespace": "namespace", # noqa: E501 - "filter": "filter", # noqa: E501 - "include_values": "includeValues", # noqa: E501 - "include_metadata": "includeMetadata", # noqa: E501 - "queries": "queries", # noqa: E501 - "vector": "vector", # noqa: E501 - "sparse_vector": "sparseVector", # noqa: E501 - "id": "id", # noqa: E501 + 'top_k': 'topK', # noqa: E501 + 'namespace': 'namespace', # noqa: E501 + 'filter': 'filter', # noqa: E501 + 'include_values': 'includeValues', # noqa: E501 + 'include_metadata': 'includeMetadata', # noqa: E501 + 'queries': 'queries', # noqa: E501 + 'vector': 'vector', # noqa: E501 + 'sparse_vector': 'sparseVector', # noqa: E501 + 'id': 'id', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of QueryRequest. @@ -138,7 +153,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -180,7 +198,7 @@ def _from_openapi_data(cls: Type[T], top_k, *args, **kwargs) -> T: # noqa: E501 through its discriminator because we passed in _visited_composed_classes = (Animal,) namespace (str): The namespace to query. [optional] # noqa: E501 - filter ({str: (bool, dict, float, int, list, str, none_type)}): The filter to apply. You can use vector metadata to limit your search. See [Understanding metadata](https://docs.pinecone.io/guides/index-data/indexing-overview#metadata). [optional] # noqa: E501 + filter (Dict[str, Any]): The filter to apply. You can use vector metadata to limit your search. See [Understanding metadata](https://docs.pinecone.io/guides/index-data/indexing-overview#metadata). [optional] # noqa: E501 include_values (bool): Indicates whether vector values are included in the response. [optional] if omitted the server will use the default value of False. # noqa: E501 include_metadata (bool): Indicates whether metadata is included in the response as well as the ids. [optional] if omitted the server will use the default value of False. # noqa: E501 queries ([QueryVector]): DEPRECATED. Use `vector` or `id` instead. [optional] # noqa: E501 @@ -189,20 +207,22 @@ def _from_openapi_data(cls: Type[T], top_k, *args, **kwargs) -> T: # noqa: E501 id (str): The unique ID of the vector to be used as a query vector. Each request can contain either the `vector` or `id` parameter. [optional] # noqa: E501 """ - _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", ()) + _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__), + "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__,), ) @@ -218,29 +238,25 @@ def _from_openapi_data(cls: Type[T], top_k, *args, **kwargs) -> T: # noqa: E501 self.top_k = top_k for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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, top_k, *args, **kwargs) -> None: # noqa: E501 @@ -281,7 +297,7 @@ def __init__(self, top_k, *args, **kwargs) -> None: # noqa: E501 through its discriminator because we passed in _visited_composed_classes = (Animal,) namespace (str): The namespace to query. [optional] # noqa: E501 - filter ({str: (bool, dict, float, int, list, str, none_type)}): The filter to apply. You can use vector metadata to limit your search. See [Understanding metadata](https://docs.pinecone.io/guides/index-data/indexing-overview#metadata). [optional] # noqa: E501 + filter (Dict[str, Any]): The filter to apply. You can use vector metadata to limit your search. See [Understanding metadata](https://docs.pinecone.io/guides/index-data/indexing-overview#metadata). [optional] # noqa: E501 include_values (bool): Indicates whether vector values are included in the response. [optional] if omitted the server will use the default value of False. # noqa: E501 include_metadata (bool): Indicates whether metadata is included in the response as well as the ids. [optional] if omitted the server will use the default value of False. # noqa: E501 queries ([QueryVector]): DEPRECATED. Use `vector` or `id` instead. [optional] # noqa: E501 @@ -291,17 +307,19 @@ def __init__(self, top_k, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -317,17 +335,13 @@ def __init__(self, top_k, *args, **kwargs) -> None: # noqa: E501 self.top_k = top_k for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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/query_response.py b/pinecone/core/openapi/db_data/model/query_response.py index 536710098..53c7fbc72 100644 --- a/pinecone/core/openapi/db_data/model/query_response.py +++ b/pinecone/core/openapi/db_data/model/query_response.py @@ -1,14 +1,15 @@ """ -Pinecone Data Plane API + Pinecone Data Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,15 +27,20 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): +if TYPE_CHECKING: from pinecone.core.openapi.db_data.model.scored_vector import ScoredVector from pinecone.core.openapi.db_data.model.single_query_results import SingleQueryResults from pinecone.core.openapi.db_data.model.usage import Usage - globals()["ScoredVector"] = ScoredVector - globals()["SingleQueryResults"] = SingleQueryResults - globals()["Usage"] = Usage +def lazy_import(): + from pinecone.core.openapi.db_data.model.scored_vector import ScoredVector + from pinecone.core.openapi.db_data.model.single_query_results import SingleQueryResults + from pinecone.core.openapi.db_data.model.usage import Usage + globals()['ScoredVector'] = ScoredVector + globals()['SingleQueryResults'] = SingleQueryResults + globals()['Usage'] = Usage from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -69,9 +75,11 @@ class QueryResponse(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -80,7 +88,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -96,26 +104,28 @@ def openapi_types(cls): """ lazy_import() return { - "results": ([SingleQueryResults],), # noqa: E501 - "matches": ([ScoredVector],), # noqa: E501 - "namespace": (str,), # noqa: E501 - "usage": (Usage,), # noqa: E501 + 'results': ([SingleQueryResults],), # noqa: E501 + 'matches': ([ScoredVector],), # noqa: E501 + 'namespace': (str,), # noqa: E501 + 'usage': (Usage,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "results": "results", # noqa: E501 - "matches": "matches", # noqa: E501 - "namespace": "namespace", # noqa: E501 - "usage": "usage", # noqa: E501 + 'results': 'results', # noqa: E501 + 'matches': 'matches', # noqa: E501 + 'namespace': 'namespace', # noqa: E501 + 'usage': 'usage', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of QueryResponse. @@ -125,7 +135,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -169,20 +182,22 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 usage (Usage): [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", ()) + _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__), + "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__,), ) @@ -197,29 +212,25 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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 @@ -263,17 +274,19 @@ def __init__(self, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -288,17 +301,13 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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/query_vector.py b/pinecone/core/openapi/db_data/model/query_vector.py index 8096695eb..d55f8c6c3 100644 --- a/pinecone/core/openapi/db_data/model/query_vector.py +++ b/pinecone/core/openapi/db_data/model/query_vector.py @@ -1,14 +1,15 @@ """ -Pinecone Data Plane API + Pinecone Data Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,11 +27,14 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): +if TYPE_CHECKING: from pinecone.core.openapi.db_data.model.sparse_values import SparseValues - globals()["SparseValues"] = SparseValues +def lazy_import(): + from pinecone.core.openapi.db_data.model.sparse_values import SparseValues + globals()['SparseValues'] = SparseValues from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -65,11 +69,16 @@ class QueryVector(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ("values",): {}, - ("top_k",): {"inclusive_maximum": 10000, "inclusive_minimum": 1}, + ('values',): { + }, + ('top_k',): { + 'inclusive_maximum': 10000, + 'inclusive_minimum': 1, + }, } @cached_class_property @@ -79,7 +88,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -95,28 +104,30 @@ def openapi_types(cls): """ lazy_import() return { - "values": ([float],), # noqa: E501 - "sparse_values": (SparseValues,), # noqa: E501 - "top_k": (int,), # noqa: E501 - "namespace": (str,), # noqa: E501 - "filter": ({str: (bool, dict, float, int, list, str, none_type)},), # noqa: E501 + 'values': ([float],), # noqa: E501 + 'sparse_values': (SparseValues,), # noqa: E501 + 'top_k': (int,), # noqa: E501 + 'namespace': (str,), # noqa: E501 + 'filter': (Dict[str, Any],), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "values": "values", # noqa: E501 - "sparse_values": "sparseValues", # noqa: E501 - "top_k": "topK", # noqa: E501 - "namespace": "namespace", # noqa: E501 - "filter": "filter", # noqa: E501 + 'values': 'values', # noqa: E501 + 'sparse_values': 'sparseValues', # noqa: E501 + 'top_k': 'topK', # noqa: E501 + 'namespace': 'namespace', # noqa: E501 + 'filter': 'filter', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of QueryVector. @@ -126,7 +137,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -170,23 +184,25 @@ def _from_openapi_data(cls: Type[T], values, *args, **kwargs) -> T: # noqa: E50 sparse_values (SparseValues): [optional] # noqa: E501 top_k (int): An override for the number of results to return for this query vector. [optional] # noqa: E501 namespace (str): An override the namespace to search. [optional] # noqa: E501 - filter ({str: (bool, dict, float, int, list, str, none_type)}): An override for the metadata filter to apply. This replaces the request-level filter. [optional] # noqa: E501 + filter (Dict[str, Any]): An override for the metadata filter to apply. This replaces the request-level filter. [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", ()) + _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__), + "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__,), ) @@ -202,29 +218,25 @@ def _from_openapi_data(cls: Type[T], values, *args, **kwargs) -> T: # noqa: E50 self.values = values for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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, values, *args, **kwargs) -> None: # noqa: E501 @@ -267,21 +279,23 @@ def __init__(self, values, *args, **kwargs) -> None: # noqa: E501 sparse_values (SparseValues): [optional] # noqa: E501 top_k (int): An override for the number of results to return for this query vector. [optional] # noqa: E501 namespace (str): An override the namespace to search. [optional] # noqa: E501 - filter ({str: (bool, dict, float, int, list, str, none_type)}): An override for the metadata filter to apply. This replaces the request-level filter. [optional] # noqa: E501 + filter (Dict[str, Any]): An override for the metadata filter to apply. This replaces the request-level filter. [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", ()) + _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__), + "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__,), ) @@ -297,17 +311,13 @@ def __init__(self, values, *args, **kwargs) -> None: # noqa: E501 self.values = values for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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/rpc_status.py b/pinecone/core/openapi/db_data/model/rpc_status.py index ffa392dcc..fe99c1843 100644 --- a/pinecone/core/openapi/db_data/model/rpc_status.py +++ b/pinecone/core/openapi/db_data/model/rpc_status.py @@ -1,14 +1,15 @@ """ -Pinecone Data Plane API + Pinecone Data Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,11 +27,14 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): +if TYPE_CHECKING: from pinecone.core.openapi.db_data.model.protobuf_any import ProtobufAny - globals()["ProtobufAny"] = ProtobufAny +def lazy_import(): + from pinecone.core.openapi.db_data.model.protobuf_any import ProtobufAny + globals()['ProtobufAny'] = ProtobufAny from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -65,9 +69,11 @@ class RpcStatus(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -76,7 +82,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -92,24 +98,26 @@ def openapi_types(cls): """ lazy_import() return { - "code": (int,), # noqa: E501 - "message": (str,), # noqa: E501 - "details": ([ProtobufAny],), # noqa: E501 + 'code': (int,), # noqa: E501 + 'message': (str,), # noqa: E501 + 'details': ([ProtobufAny],), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "code": "code", # noqa: E501 - "message": "message", # noqa: E501 - "details": "details", # noqa: E501 + 'code': 'code', # noqa: E501 + 'message': 'message', # noqa: E501 + 'details': 'details', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of RpcStatus. @@ -119,7 +127,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -162,20 +173,22 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 details ([ProtobufAny]): [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", ()) + _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__), + "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__,), ) @@ -190,29 +203,25 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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 @@ -255,17 +264,19 @@ def __init__(self, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -280,17 +291,13 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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/scored_vector.py b/pinecone/core/openapi/db_data/model/scored_vector.py index 7f6d5f195..bd17bed37 100644 --- a/pinecone/core/openapi/db_data/model/scored_vector.py +++ b/pinecone/core/openapi/db_data/model/scored_vector.py @@ -1,14 +1,15 @@ """ -Pinecone Data Plane API + Pinecone Data Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,11 +27,14 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): +if TYPE_CHECKING: from pinecone.core.openapi.db_data.model.sparse_values import SparseValues - globals()["SparseValues"] = SparseValues +def lazy_import(): + from pinecone.core.openapi.db_data.model.sparse_values import SparseValues + globals()['SparseValues'] = SparseValues from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -65,10 +69,14 @@ class ScoredVector(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ("id",): {"max_length": 512, "min_length": 1} + ('id',): { + 'max_length': 512, + 'min_length': 1, + }, } @cached_class_property @@ -78,7 +86,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -94,28 +102,30 @@ def openapi_types(cls): """ lazy_import() return { - "id": (str,), # noqa: E501 - "score": (float,), # noqa: E501 - "values": ([float],), # noqa: E501 - "sparse_values": (SparseValues,), # noqa: E501 - "metadata": ({str: (bool, dict, float, int, list, str, none_type)},), # noqa: E501 + 'id': (str,), # noqa: E501 + 'score': (float,), # noqa: E501 + 'values': ([float],), # noqa: E501 + 'sparse_values': (SparseValues,), # noqa: E501 + 'metadata': (Dict[str, Any],), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "id": "id", # noqa: E501 - "score": "score", # noqa: E501 - "values": "values", # noqa: E501 - "sparse_values": "sparseValues", # noqa: E501 - "metadata": "metadata", # noqa: E501 + 'id': 'id', # noqa: E501 + 'score': 'score', # noqa: E501 + 'values': 'values', # noqa: E501 + 'sparse_values': 'sparseValues', # noqa: E501 + 'metadata': 'metadata', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ScoredVector. @@ -125,7 +135,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -169,23 +182,25 @@ def _from_openapi_data(cls: Type[T], id, *args, **kwargs) -> T: # noqa: E501 score (float): This is a measure of similarity between this vector and the query vector. The higher the score, the more they are similar. [optional] # noqa: E501 values ([float]): This is the vector data, if it is requested. [optional] # noqa: E501 sparse_values (SparseValues): [optional] # noqa: E501 - metadata ({str: (bool, dict, float, int, list, str, none_type)}): This is the metadata, if it is requested. [optional] # noqa: E501 + metadata (Dict[str, Any]): This is the metadata, if it is requested. [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", ()) + _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__), + "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__,), ) @@ -201,29 +216,25 @@ def _from_openapi_data(cls: Type[T], id, *args, **kwargs) -> T: # noqa: E501 self.id = id for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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, *args, **kwargs) -> None: # noqa: E501 @@ -266,21 +277,23 @@ def __init__(self, id, *args, **kwargs) -> None: # noqa: E501 score (float): This is a measure of similarity between this vector and the query vector. The higher the score, the more they are similar. [optional] # noqa: E501 values ([float]): This is the vector data, if it is requested. [optional] # noqa: E501 sparse_values (SparseValues): [optional] # noqa: E501 - metadata ({str: (bool, dict, float, int, list, str, none_type)}): This is the metadata, if it is requested. [optional] # noqa: E501 + metadata (Dict[str, Any]): This is the metadata, if it is requested. [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", ()) + _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__), + "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__,), ) @@ -296,17 +309,13 @@ def __init__(self, id, *args, **kwargs) -> None: # noqa: E501 self.id = id for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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_match_terms.py b/pinecone/core/openapi/db_data/model/search_match_terms.py index 5c92c874c..bb9fbf7ae 100644 --- a/pinecone/core/openapi/db_data/model/search_match_terms.py +++ b/pinecone/core/openapi/db_data/model/search_match_terms.py @@ -1,14 +1,15 @@ """ -Pinecone Data Plane API + Pinecone Data Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -27,6 +28,7 @@ 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 @@ -59,9 +61,11 @@ class SearchMatchTerms(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -69,7 +73,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 """ - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -84,22 +88,24 @@ def openapi_types(cls): and the value is attribute type. """ return { - "strategy": (str,), # noqa: E501 - "terms": ([str],), # noqa: E501 + '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 + 'strategy': 'strategy', # noqa: E501 + 'terms': 'terms', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of SearchMatchTerms. @@ -109,7 +115,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -151,20 +160,22 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # 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", ()) + _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__), + "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__,), ) @@ -179,29 +190,25 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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 @@ -243,17 +250,19 @@ def __init__(self, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -268,17 +277,13 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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 ff043a4f6..4ff9e3d3a 100644 --- a/pinecone/core/openapi/db_data/model/search_records_request.py +++ b/pinecone/core/openapi/db_data/model/search_records_request.py @@ -1,14 +1,15 @@ """ -Pinecone Data Plane API + Pinecone Data Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,17 +27,17 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): - from pinecone.core.openapi.db_data.model.search_records_request_query import ( - SearchRecordsRequestQuery, - ) - from pinecone.core.openapi.db_data.model.search_records_request_rerank import ( - SearchRecordsRequestRerank, - ) +if TYPE_CHECKING: + from pinecone.core.openapi.db_data.model.search_records_request_query import SearchRecordsRequestQuery + from pinecone.core.openapi.db_data.model.search_records_request_rerank import SearchRecordsRequestRerank - globals()["SearchRecordsRequestQuery"] = SearchRecordsRequestQuery - globals()["SearchRecordsRequestRerank"] = SearchRecordsRequestRerank +def lazy_import(): + from pinecone.core.openapi.db_data.model.search_records_request_query import SearchRecordsRequestQuery + from pinecone.core.openapi.db_data.model.search_records_request_rerank import SearchRecordsRequestRerank + globals()['SearchRecordsRequestQuery'] = SearchRecordsRequestQuery + globals()['SearchRecordsRequestRerank'] = SearchRecordsRequestRerank from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -71,9 +72,13 @@ class SearchRecordsRequest(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {("fields",): {}} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + ('fields',): { + }, + } @cached_class_property def additional_properties_type(cls): @@ -82,7 +87,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -98,24 +103,26 @@ def openapi_types(cls): """ lazy_import() return { - "query": (SearchRecordsRequestQuery,), # noqa: E501 - "fields": ([str],), # noqa: E501 - "rerank": (SearchRecordsRequestRerank,), # noqa: E501 + 'query': (SearchRecordsRequestQuery,), # noqa: E501 + 'fields': ([str],), # noqa: E501 + 'rerank': (SearchRecordsRequestRerank,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "query": "query", # noqa: E501 - "fields": "fields", # noqa: E501 - "rerank": "rerank", # noqa: E501 + 'query': 'query', # noqa: E501 + 'fields': 'fields', # noqa: E501 + 'rerank': 'rerank', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of SearchRecordsRequest. @@ -125,7 +132,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -170,20 +180,22 @@ def _from_openapi_data(cls: Type[T], query, *args, **kwargs) -> T: # noqa: E501 rerank (SearchRecordsRequestRerank): [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", ()) + _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__), + "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__,), ) @@ -199,29 +211,25 @@ def _from_openapi_data(cls: Type[T], query, *args, **kwargs) -> T: # noqa: E501 self.query = query for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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, query, *args, **kwargs) -> None: # noqa: E501 @@ -266,17 +274,19 @@ def __init__(self, query, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -292,17 +302,13 @@ def __init__(self, query, *args, **kwargs) -> None: # noqa: E501 self.query = query for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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_query.py b/pinecone/core/openapi/db_data/model/search_records_request_query.py index 0f1b1ee52..67f365029 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 @@ -1,14 +1,15 @@ """ -Pinecone Data Plane API + Pinecone Data Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,13 +27,17 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): +if TYPE_CHECKING: 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 +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 from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -67,9 +72,14 @@ class SearchRecordsRequestQuery(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {("id",): {"max_length": 512}} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + ('id',): { + 'max_length': 512, + }, + } @cached_class_property def additional_properties_type(cls): @@ -78,7 +88,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -94,30 +104,32 @@ def openapi_types(cls): """ lazy_import() return { - "top_k": (int,), # noqa: E501 - "filter": ({str: (bool, dict, float, int, list, str, none_type)},), # noqa: E501 - "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 + 'top_k': (int,), # noqa: E501 + 'filter': (Dict[str, Any],), # noqa: E501 + 'inputs': (Dict[str, Any],), # noqa: E501 + 'vector': (SearchRecordsVector,), # noqa: E501 + 'id': (str,), # noqa: E501 + 'match_terms': (SearchMatchTerms,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "top_k": "top_k", # noqa: E501 - "filter": "filter", # noqa: E501 - "inputs": "inputs", # noqa: E501 - "vector": "vector", # noqa: E501 - "id": "id", # noqa: E501 - "match_terms": "match_terms", # noqa: E501 + 'top_k': 'top_k', # noqa: E501 + 'filter': 'filter', # noqa: E501 + 'inputs': 'inputs', # noqa: E501 + 'vector': 'vector', # noqa: E501 + 'id': 'id', # noqa: E501 + 'match_terms': 'match_terms', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of SearchRecordsRequestQuery. @@ -127,7 +139,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -168,27 +183,29 @@ def _from_openapi_data(cls: Type[T], top_k, *args, **kwargs) -> T: # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - filter ({str: (bool, dict, float, int, list, str, none_type)}): The filter to apply. You can use vector metadata to limit your search. See [Understanding metadata](https://docs.pinecone.io/guides/index-data/indexing-overview#metadata). [optional] # noqa: E501 - inputs ({str: (bool, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 + filter (Dict[str, Any]): The filter to apply. You can use vector metadata to limit your search. See [Understanding metadata](https://docs.pinecone.io/guides/index-data/indexing-overview#metadata). [optional] # noqa: E501 + inputs (Dict[str, Any]): [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) - _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", ()) + _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__), + "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__,), ) @@ -204,29 +221,25 @@ def _from_openapi_data(cls: Type[T], top_k, *args, **kwargs) -> T: # noqa: E501 self.top_k = top_k for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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, top_k, *args, **kwargs) -> None: # noqa: E501 @@ -266,25 +279,27 @@ def __init__(self, top_k, *args, **kwargs) -> None: # noqa: E501 Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - filter ({str: (bool, dict, float, int, list, str, none_type)}): The filter to apply. You can use vector metadata to limit your search. See [Understanding metadata](https://docs.pinecone.io/guides/index-data/indexing-overview#metadata). [optional] # noqa: E501 - inputs ({str: (bool, dict, float, int, list, str, none_type)}): [optional] # noqa: E501 + filter (Dict[str, Any]): The filter to apply. You can use vector metadata to limit your search. See [Understanding metadata](https://docs.pinecone.io/guides/index-data/indexing-overview#metadata). [optional] # noqa: E501 + inputs (Dict[str, Any]): [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) - _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", ()) + _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__), + "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__,), ) @@ -300,17 +315,13 @@ def __init__(self, top_k, *args, **kwargs) -> None: # noqa: E501 self.top_k = top_k for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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_rerank.py b/pinecone/core/openapi/db_data/model/search_records_request_rerank.py index 331baeaff..e84a79789 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 @@ -1,14 +1,15 @@ """ -Pinecone Data Plane API + Pinecone Data Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -27,6 +28,7 @@ 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 @@ -59,9 +61,11 @@ class SearchRecordsRequestRerank(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -69,7 +73,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 """ - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -84,28 +88,30 @@ def openapi_types(cls): and the value is attribute type. """ return { - "model": (str,), # noqa: E501 - "rank_fields": ([str],), # noqa: E501 - "top_n": (int,), # noqa: E501 - "parameters": ({str: (bool, dict, float, int, list, str, none_type)},), # noqa: E501 - "query": (str,), # noqa: E501 + 'model': (str,), # noqa: E501 + 'rank_fields': ([str],), # noqa: E501 + 'top_n': (int,), # noqa: E501 + 'parameters': (Dict[str, Any],), # noqa: E501 + 'query': (str,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "model": "model", # noqa: E501 - "rank_fields": "rank_fields", # noqa: E501 - "top_n": "top_n", # noqa: E501 - "parameters": "parameters", # noqa: E501 - "query": "query", # noqa: E501 + 'model': 'model', # noqa: E501 + 'rank_fields': 'rank_fields', # noqa: E501 + 'top_n': 'top_n', # noqa: E501 + 'parameters': 'parameters', # noqa: E501 + 'query': 'query', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of SearchRecordsRequestRerank. @@ -115,7 +121,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -158,24 +167,26 @@ def _from_openapi_data(cls: Type[T], model, rank_fields, *args, **kwargs) -> T: through its discriminator because we passed in _visited_composed_classes = (Animal,) top_n (int): The number of top results to return after reranking. Defaults to top_k. [optional] # noqa: E501 - parameters ({str: (bool, dict, float, int, list, str, none_type)}): Additional model-specific parameters. Refer to the [model guide](https://docs.pinecone.io/guides/search/rerank-results#reranking-models) for available model parameters. [optional] # noqa: E501 + parameters (Dict[str, Any]): Additional model-specific parameters. Refer to the [model guide](https://docs.pinecone.io/guides/search/rerank-results#reranking-models) for available model parameters. [optional] # noqa: E501 query (str): The query to rerank documents against. If a specific rerank query is specified, it overwrites the query input that was provided at the top level. [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", ()) + _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__), + "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__,), ) @@ -192,29 +203,25 @@ def _from_openapi_data(cls: Type[T], model, rank_fields, *args, **kwargs) -> T: self.model = model self.rank_fields = rank_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 - ): + 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", - ] - ) + 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, model, rank_fields, *args, **kwargs) -> None: # noqa: E501 @@ -256,22 +263,24 @@ def __init__(self, model, rank_fields, *args, **kwargs) -> None: # noqa: E501 through its discriminator because we passed in _visited_composed_classes = (Animal,) top_n (int): The number of top results to return after reranking. Defaults to top_k. [optional] # noqa: E501 - parameters ({str: (bool, dict, float, int, list, str, none_type)}): Additional model-specific parameters. Refer to the [model guide](https://docs.pinecone.io/guides/search/rerank-results#reranking-models) for available model parameters. [optional] # noqa: E501 + parameters (Dict[str, Any]): Additional model-specific parameters. Refer to the [model guide](https://docs.pinecone.io/guides/search/rerank-results#reranking-models) for available model parameters. [optional] # noqa: E501 query (str): The query to rerank documents against. If a specific rerank query is specified, it overwrites the query input that was provided at the top level. [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", ()) + _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__), + "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__,), ) @@ -288,17 +297,13 @@ def __init__(self, model, rank_fields, *args, **kwargs) -> None: # noqa: E501 self.model = model self.rank_fields = rank_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 - ): + 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." - ) + 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_response.py b/pinecone/core/openapi/db_data/model/search_records_response.py index f2d3fe045..3e67bffcb 100644 --- a/pinecone/core/openapi/db_data/model/search_records_response.py +++ b/pinecone/core/openapi/db_data/model/search_records_response.py @@ -1,14 +1,15 @@ """ -Pinecone Data Plane API + Pinecone Data Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,15 +27,17 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): - from pinecone.core.openapi.db_data.model.search_records_response_result import ( - SearchRecordsResponseResult, - ) +if TYPE_CHECKING: + from pinecone.core.openapi.db_data.model.search_records_response_result import SearchRecordsResponseResult from pinecone.core.openapi.db_data.model.search_usage import SearchUsage - globals()["SearchRecordsResponseResult"] = SearchRecordsResponseResult - globals()["SearchUsage"] = SearchUsage +def lazy_import(): + from pinecone.core.openapi.db_data.model.search_records_response_result import SearchRecordsResponseResult + from pinecone.core.openapi.db_data.model.search_usage import SearchUsage + globals()['SearchRecordsResponseResult'] = SearchRecordsResponseResult + globals()['SearchUsage'] = SearchUsage from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -69,9 +72,11 @@ class SearchRecordsResponse(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -80,7 +85,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -96,22 +101,24 @@ def openapi_types(cls): """ lazy_import() return { - "result": (SearchRecordsResponseResult,), # noqa: E501 - "usage": (SearchUsage,), # noqa: E501 + 'result': (SearchRecordsResponseResult,), # noqa: E501 + 'usage': (SearchUsage,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "result": "result", # noqa: E501 - "usage": "usage", # noqa: E501 + 'result': 'result', # noqa: E501 + 'usage': 'usage', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of SearchRecordsResponse. @@ -121,7 +128,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -165,20 +175,22 @@ def _from_openapi_data(cls: Type[T], result, usage, *args, **kwargs) -> T: # no _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", ()) + _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__), + "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__,), ) @@ -195,29 +207,25 @@ def _from_openapi_data(cls: Type[T], result, usage, *args, **kwargs) -> T: # no self.result = result self.usage = usage for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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, result, usage, *args, **kwargs) -> None: # noqa: E501 @@ -261,17 +269,19 @@ def __init__(self, result, usage, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -288,17 +298,13 @@ def __init__(self, result, usage, *args, **kwargs) -> None: # noqa: E501 self.result = result self.usage = usage for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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_response_result.py b/pinecone/core/openapi/db_data/model/search_records_response_result.py index 0c568aecc..156d64f25 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 @@ -1,14 +1,15 @@ """ -Pinecone Data Plane API + Pinecone Data Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,11 +27,14 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): +if TYPE_CHECKING: from pinecone.core.openapi.db_data.model.hit import Hit - globals()["Hit"] = Hit +def lazy_import(): + from pinecone.core.openapi.db_data.model.hit import Hit + globals()['Hit'] = Hit from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -65,9 +69,11 @@ class SearchRecordsResponseResult(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -76,7 +82,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -92,20 +98,22 @@ def openapi_types(cls): """ lazy_import() return { - "hits": ([Hit],) # noqa: E501 + 'hits': ([Hit],), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "hits": "hits" # noqa: E501 + 'hits': 'hits', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of SearchRecordsResponseResult. @@ -115,7 +123,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -158,20 +169,22 @@ def _from_openapi_data(cls: Type[T], hits, *args, **kwargs) -> T: # noqa: E501 _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", ()) + _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__), + "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__,), ) @@ -187,29 +200,25 @@ def _from_openapi_data(cls: Type[T], hits, *args, **kwargs) -> T: # noqa: E501 self.hits = hits for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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, hits, *args, **kwargs) -> None: # noqa: E501 @@ -252,17 +261,19 @@ def __init__(self, hits, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -278,17 +289,13 @@ def __init__(self, hits, *args, **kwargs) -> None: # noqa: E501 self.hits = hits for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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_vector.py b/pinecone/core/openapi/db_data/model/search_records_vector.py index a19005d2b..420e6bd0c 100644 --- a/pinecone/core/openapi/db_data/model/search_records_vector.py +++ b/pinecone/core/openapi/db_data/model/search_records_vector.py @@ -1,14 +1,15 @@ """ -Pinecone Data Plane API + Pinecone Data Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,11 +27,14 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): +if TYPE_CHECKING: from pinecone.core.openapi.db_data.model.vector_values import VectorValues - globals()["VectorValues"] = VectorValues +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 @@ -65,9 +69,11 @@ class SearchRecordsVector(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -76,7 +82,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -92,24 +98,26 @@ def openapi_types(cls): """ lazy_import() return { - "values": (VectorValues,), # noqa: E501 - "sparse_values": ([float],), # noqa: E501 - "sparse_indices": ([int],), # noqa: E501 + 'values': (VectorValues,), # noqa: E501 + 'sparse_values': ([float],), # noqa: E501 + 'sparse_indices': ([int],), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "values": "values", # noqa: E501 - "sparse_values": "sparse_values", # noqa: E501 - "sparse_indices": "sparse_indices", # noqa: E501 + 'values': 'values', # noqa: E501 + 'sparse_values': 'sparse_values', # noqa: E501 + 'sparse_indices': 'sparse_indices', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of SearchRecordsVector. @@ -119,7 +127,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -162,20 +173,22 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 sparse_indices ([int]): The sparse embedding indices. [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", ()) + _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__), + "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__,), ) @@ -190,29 +203,25 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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 @@ -255,17 +264,19 @@ def __init__(self, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -280,17 +291,13 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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_usage.py b/pinecone/core/openapi/db_data/model/search_usage.py index 22bbd73a2..07341c967 100644 --- a/pinecone/core/openapi/db_data/model/search_usage.py +++ b/pinecone/core/openapi/db_data/model/search_usage.py @@ -1,14 +1,15 @@ """ -Pinecone Data Plane API + Pinecone Data Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -27,6 +28,7 @@ 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 @@ -59,12 +61,19 @@ class SearchUsage(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ("read_units",): {"inclusive_minimum": 0}, - ("embed_total_tokens",): {"inclusive_minimum": 0}, - ("rerank_units",): {"inclusive_minimum": 0}, + ('read_units',): { + 'inclusive_minimum': 0, + }, + ('embed_total_tokens',): { + 'inclusive_minimum': 0, + }, + ('rerank_units',): { + 'inclusive_minimum': 0, + }, } @cached_class_property @@ -73,7 +82,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 """ - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -88,24 +97,26 @@ def openapi_types(cls): and the value is attribute type. """ return { - "read_units": (int,), # noqa: E501 - "embed_total_tokens": (int,), # noqa: E501 - "rerank_units": (int,), # noqa: E501 + 'read_units': (int,), # noqa: E501 + 'embed_total_tokens': (int,), # noqa: E501 + 'rerank_units': (int,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "read_units": "read_units", # noqa: E501 - "embed_total_tokens": "embed_total_tokens", # noqa: E501 - "rerank_units": "rerank_units", # noqa: E501 + 'read_units': 'read_units', # noqa: E501 + 'embed_total_tokens': 'embed_total_tokens', # noqa: E501 + 'rerank_units': 'rerank_units', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of SearchUsage. @@ -115,7 +126,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -160,20 +174,22 @@ def _from_openapi_data(cls: Type[T], read_units, *args, **kwargs) -> T: # noqa: rerank_units (int): The number of rerank units consumed by this 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", ()) + _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__), + "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__,), ) @@ -189,29 +205,25 @@ def _from_openapi_data(cls: Type[T], read_units, *args, **kwargs) -> T: # noqa: self.read_units = read_units for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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, read_units, *args, **kwargs) -> None: # noqa: E501 @@ -256,17 +268,19 @@ def __init__(self, read_units, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -282,17 +296,13 @@ def __init__(self, read_units, *args, **kwargs) -> None: # noqa: E501 self.read_units = read_units for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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/single_query_results.py b/pinecone/core/openapi/db_data/model/single_query_results.py index a5edcb0ac..e3e1288c2 100644 --- a/pinecone/core/openapi/db_data/model/single_query_results.py +++ b/pinecone/core/openapi/db_data/model/single_query_results.py @@ -1,14 +1,15 @@ """ -Pinecone Data Plane API + Pinecone Data Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,11 +27,14 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): +if TYPE_CHECKING: from pinecone.core.openapi.db_data.model.scored_vector import ScoredVector - globals()["ScoredVector"] = ScoredVector +def lazy_import(): + from pinecone.core.openapi.db_data.model.scored_vector import ScoredVector + globals()['ScoredVector'] = ScoredVector from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -65,9 +69,11 @@ class SingleQueryResults(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -76,7 +82,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -92,22 +98,24 @@ def openapi_types(cls): """ lazy_import() return { - "matches": ([ScoredVector],), # noqa: E501 - "namespace": (str,), # noqa: E501 + 'matches': ([ScoredVector],), # noqa: E501 + 'namespace': (str,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "matches": "matches", # noqa: E501 - "namespace": "namespace", # noqa: E501 + 'matches': 'matches', # noqa: E501 + 'namespace': 'namespace', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of SingleQueryResults. @@ -117,7 +125,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -159,20 +170,22 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 namespace (str): The namespace for the vectors. [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", ()) + _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__), + "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__,), ) @@ -187,29 +200,25 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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 @@ -251,17 +260,19 @@ def __init__(self, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -276,17 +287,13 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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/sparse_values.py b/pinecone/core/openapi/db_data/model/sparse_values.py index 4f4d77887..aeaceb32f 100644 --- a/pinecone/core/openapi/db_data/model/sparse_values.py +++ b/pinecone/core/openapi/db_data/model/sparse_values.py @@ -1,14 +1,15 @@ """ -Pinecone Data Plane API + Pinecone Data Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -27,6 +28,7 @@ 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 @@ -59,11 +61,14 @@ class SparseValues(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ("indices",): {}, - ("values",): {}, + ('indices',): { + }, + ('values',): { + }, } @cached_class_property @@ -72,7 +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 """ - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -87,22 +92,24 @@ def openapi_types(cls): and the value is attribute type. """ return { - "indices": ([int],), # noqa: E501 - "values": ([float],), # noqa: E501 + 'indices': ([int],), # noqa: E501 + 'values': ([float],), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "indices": "indices", # noqa: E501 - "values": "values", # noqa: E501 + 'indices': 'indices', # noqa: E501 + 'values': 'values', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of SparseValues. @@ -112,7 +119,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -156,20 +166,22 @@ def _from_openapi_data(cls: Type[T], indices, values, *args, **kwargs) -> T: # _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", ()) + _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__), + "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__,), ) @@ -186,29 +198,25 @@ def _from_openapi_data(cls: Type[T], indices, values, *args, **kwargs) -> T: # self.indices = indices self.values = values for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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, indices, values, *args, **kwargs) -> None: # noqa: E501 @@ -252,17 +260,19 @@ def __init__(self, indices, values, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -279,17 +289,13 @@ def __init__(self, indices, values, *args, **kwargs) -> None: # noqa: E501 self.indices = indices self.values = values for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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/start_import_request.py b/pinecone/core/openapi/db_data/model/start_import_request.py index 1f2f820a9..b91e4a769 100644 --- a/pinecone/core/openapi/db_data/model/start_import_request.py +++ b/pinecone/core/openapi/db_data/model/start_import_request.py @@ -1,14 +1,15 @@ """ -Pinecone Data Plane API + Pinecone Data Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,11 +27,14 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): +if TYPE_CHECKING: from pinecone.core.openapi.db_data.model.import_error_mode import ImportErrorMode - globals()["ImportErrorMode"] = ImportErrorMode +def lazy_import(): + from pinecone.core.openapi.db_data.model.import_error_mode import ImportErrorMode + globals()['ImportErrorMode'] = ImportErrorMode from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -65,11 +69,17 @@ class StartImportRequest(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ("uri",): {"max_length": 1500, "min_length": 1}, - ("integration_id",): {"max_length": 1000}, + ('uri',): { + 'max_length': 1500, + 'min_length': 1, + }, + ('integration_id',): { + 'max_length': 1000, + }, } @cached_class_property @@ -79,7 +89,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -95,24 +105,26 @@ def openapi_types(cls): """ lazy_import() return { - "uri": (str,), # noqa: E501 - "integration_id": (str,), # noqa: E501 - "error_mode": (ImportErrorMode,), # noqa: E501 + 'uri': (str,), # noqa: E501 + 'integration_id': (str,), # noqa: E501 + 'error_mode': (ImportErrorMode,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "uri": "uri", # noqa: E501 - "integration_id": "integrationId", # noqa: E501 - "error_mode": "errorMode", # noqa: E501 + 'uri': 'uri', # noqa: E501 + 'integration_id': 'integrationId', # noqa: E501 + 'error_mode': 'errorMode', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of StartImportRequest. @@ -122,7 +134,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -167,20 +182,22 @@ def _from_openapi_data(cls: Type[T], uri, *args, **kwargs) -> T: # noqa: E501 error_mode (ImportErrorMode): [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", ()) + _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__), + "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__,), ) @@ -196,29 +213,25 @@ def _from_openapi_data(cls: Type[T], uri, *args, **kwargs) -> T: # noqa: E501 self.uri = uri for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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, uri, *args, **kwargs) -> None: # noqa: E501 @@ -263,17 +276,19 @@ def __init__(self, uri, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -289,17 +304,13 @@ def __init__(self, uri, *args, **kwargs) -> None: # noqa: E501 self.uri = uri for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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/start_import_response.py b/pinecone/core/openapi/db_data/model/start_import_response.py index 362c1030a..38d82937c 100644 --- a/pinecone/core/openapi/db_data/model/start_import_response.py +++ b/pinecone/core/openapi/db_data/model/start_import_response.py @@ -1,14 +1,15 @@ """ -Pinecone Data Plane API + Pinecone Data Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -27,6 +28,7 @@ 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 @@ -59,10 +61,14 @@ class StartImportResponse(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ("id",): {"max_length": 1000, "min_length": 1} + ('id',): { + 'max_length': 1000, + 'min_length': 1, + }, } @cached_class_property @@ -71,7 +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 """ - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -86,20 +92,22 @@ def openapi_types(cls): and the value is attribute type. """ return { - "id": (str,) # noqa: E501 + 'id': (str,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "id": "id" # noqa: E501 + 'id': 'id', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of StartImportResponse. @@ -109,7 +117,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -150,20 +161,22 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 id (str): Unique identifier for the import 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", ()) + _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__), + "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__,), ) @@ -178,29 +191,25 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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 @@ -241,17 +250,19 @@ def __init__(self, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -266,17 +277,13 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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/update_request.py b/pinecone/core/openapi/db_data/model/update_request.py index bf4e8d431..6a4f58540 100644 --- a/pinecone/core/openapi/db_data/model/update_request.py +++ b/pinecone/core/openapi/db_data/model/update_request.py @@ -1,14 +1,15 @@ """ -Pinecone Data Plane API + Pinecone Data Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,11 +27,14 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): +if TYPE_CHECKING: from pinecone.core.openapi.db_data.model.sparse_values import SparseValues - globals()["SparseValues"] = SparseValues +def lazy_import(): + from pinecone.core.openapi.db_data.model.sparse_values import SparseValues + globals()['SparseValues'] = SparseValues from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -65,11 +69,16 @@ class UpdateRequest(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ("id",): {"max_length": 512, "min_length": 1}, - ("values",): {}, + ('id',): { + 'max_length': 512, + 'min_length': 1, + }, + ('values',): { + }, } @cached_class_property @@ -79,7 +88,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -95,32 +104,34 @@ def openapi_types(cls): """ lazy_import() return { - "id": (str,), # noqa: E501 - "values": ([float],), # noqa: E501 - "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 + 'id': (str,), # noqa: E501 + 'values': ([float],), # noqa: E501 + 'sparse_values': (SparseValues,), # noqa: E501 + 'set_metadata': (Dict[str, Any],), # noqa: E501 + 'namespace': (str,), # noqa: E501 + 'filter': (Dict[str, Any],), # noqa: E501 + 'dry_run': (bool,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "id": "id", # noqa: E501 - "values": "values", # noqa: E501 - "sparse_values": "sparseValues", # noqa: E501 - "set_metadata": "setMetadata", # noqa: E501 - "namespace": "namespace", # noqa: E501 - "filter": "filter", # noqa: E501 - "dry_run": "dryRun", # noqa: E501 + 'id': 'id', # noqa: E501 + 'values': 'values', # noqa: E501 + '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([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of UpdateRequest. @@ -130,7 +141,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -171,26 +185,28 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 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 + set_metadata (Dict[str, Any]): 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 + filter (Dict[str, Any]): 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) - _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", ()) + _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__), + "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__,), ) @@ -205,29 +221,25 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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 @@ -267,24 +279,26 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 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 + set_metadata (Dict[str, Any]): 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 + filter (Dict[str, Any]): 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) - _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", ()) + _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__), + "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__,), ) @@ -299,17 +313,13 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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/update_response.py b/pinecone/core/openapi/db_data/model/update_response.py index 599a63fed..81fad8793 100644 --- a/pinecone/core/openapi/db_data/model/update_response.py +++ b/pinecone/core/openapi/db_data/model/update_response.py @@ -1,14 +1,15 @@ """ -Pinecone Data Plane API + Pinecone Data Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -27,6 +28,7 @@ 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 @@ -59,9 +61,11 @@ class UpdateResponse(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -69,7 +73,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 """ - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -84,20 +88,22 @@ def openapi_types(cls): and the value is attribute type. """ return { - "matched_records": (int,) # noqa: E501 + 'matched_records': (int,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "matched_records": "matchedRecords" # noqa: E501 + 'matched_records': 'matchedRecords', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of UpdateResponse. @@ -107,7 +113,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -148,20 +157,22 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # 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) - _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", ()) + _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__), + "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__,), ) @@ -176,29 +187,25 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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 @@ -239,17 +246,19 @@ def __init__(self, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -264,17 +273,13 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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/upsert_record.py b/pinecone/core/openapi/db_data/model/upsert_record.py index cb9293a87..32bf40122 100644 --- a/pinecone/core/openapi/db_data/model/upsert_record.py +++ b/pinecone/core/openapi/db_data/model/upsert_record.py @@ -1,14 +1,15 @@ """ -Pinecone Data Plane API + Pinecone Data Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -27,6 +28,7 @@ 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 @@ -59,9 +61,11 @@ class UpsertRecord(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -69,7 +73,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 """ - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -84,20 +88,22 @@ def openapi_types(cls): and the value is attribute type. """ return { - "_id": (str,) # noqa: E501 + '_id': (str,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "_id": "_id" # noqa: E501 + '_id': '_id', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of UpsertRecord. @@ -107,7 +113,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -150,20 +159,22 @@ def _from_openapi_data(cls: Type[T], _id, *args, **kwargs) -> T: # noqa: E501 _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", ()) + _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__), + "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__,), ) @@ -179,29 +190,25 @@ def _from_openapi_data(cls: Type[T], _id, *args, **kwargs) -> T: # noqa: E501 self._id = _id for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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, *args, **kwargs) -> None: # noqa: E501 @@ -244,17 +251,19 @@ def __init__(self, _id, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -270,17 +279,13 @@ def __init__(self, _id, *args, **kwargs) -> None: # noqa: E501 self._id = _id for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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/upsert_request.py b/pinecone/core/openapi/db_data/model/upsert_request.py index 28a89533f..7778f7273 100644 --- a/pinecone/core/openapi/db_data/model/upsert_request.py +++ b/pinecone/core/openapi/db_data/model/upsert_request.py @@ -1,14 +1,15 @@ """ -Pinecone Data Plane API + Pinecone Data Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,11 +27,14 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): +if TYPE_CHECKING: from pinecone.core.openapi.db_data.model.vector import Vector - globals()["Vector"] = Vector +def lazy_import(): + from pinecone.core.openapi.db_data.model.vector import Vector + globals()['Vector'] = Vector from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -65,9 +69,13 @@ class UpsertRequest(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {("vectors",): {}} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + ('vectors',): { + }, + } @cached_class_property def additional_properties_type(cls): @@ -76,7 +84,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -92,22 +100,24 @@ def openapi_types(cls): """ lazy_import() return { - "vectors": ([Vector],), # noqa: E501 - "namespace": (str,), # noqa: E501 + 'vectors': ([Vector],), # noqa: E501 + 'namespace': (str,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "vectors": "vectors", # noqa: E501 - "namespace": "namespace", # noqa: E501 + 'vectors': 'vectors', # noqa: E501 + 'namespace': 'namespace', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of UpsertRequest. @@ -117,7 +127,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -161,20 +174,22 @@ def _from_openapi_data(cls: Type[T], vectors, *args, **kwargs) -> T: # noqa: E5 namespace (str): The namespace where you upsert vectors. [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", ()) + _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__), + "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__,), ) @@ -190,29 +205,25 @@ def _from_openapi_data(cls: Type[T], vectors, *args, **kwargs) -> T: # noqa: E5 self.vectors = vectors for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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, vectors, *args, **kwargs) -> None: # noqa: E501 @@ -256,17 +267,19 @@ def __init__(self, vectors, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -282,17 +295,13 @@ def __init__(self, vectors, *args, **kwargs) -> None: # noqa: E501 self.vectors = vectors for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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/upsert_response.py b/pinecone/core/openapi/db_data/model/upsert_response.py index d21e99d91..5c74b419d 100644 --- a/pinecone/core/openapi/db_data/model/upsert_response.py +++ b/pinecone/core/openapi/db_data/model/upsert_response.py @@ -1,14 +1,15 @@ """ -Pinecone Data Plane API + Pinecone Data Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -27,6 +28,7 @@ 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 @@ -59,9 +61,11 @@ class UpsertResponse(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -69,7 +73,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 """ - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -84,20 +88,22 @@ def openapi_types(cls): and the value is attribute type. """ return { - "upserted_count": (int,) # noqa: E501 + 'upserted_count': (int,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "upserted_count": "upsertedCount" # noqa: E501 + 'upserted_count': 'upsertedCount', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of UpsertResponse. @@ -107,7 +113,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -148,20 +157,22 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 upserted_count (int): The number of vectors upserted. [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", ()) + _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__), + "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__,), ) @@ -176,29 +187,25 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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 @@ -239,17 +246,19 @@ def __init__(self, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -264,17 +273,13 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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/usage.py b/pinecone/core/openapi/db_data/model/usage.py index 8c8d108e8..c9edae90a 100644 --- a/pinecone/core/openapi/db_data/model/usage.py +++ b/pinecone/core/openapi/db_data/model/usage.py @@ -1,14 +1,15 @@ """ -Pinecone Data Plane API + Pinecone Data Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -27,6 +28,7 @@ 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 @@ -59,9 +61,11 @@ class Usage(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -69,7 +73,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 """ - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -84,20 +88,22 @@ def openapi_types(cls): and the value is attribute type. """ return { - "read_units": (int,) # noqa: E501 + 'read_units': (int,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "read_units": "readUnits" # noqa: E501 + 'read_units': 'readUnits', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of Usage. @@ -107,7 +113,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -148,20 +157,22 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 read_units (int): The number of read units consumed by this 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", ()) + _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__), + "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__,), ) @@ -176,29 +187,25 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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 @@ -239,17 +246,19 @@ def __init__(self, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -264,17 +273,13 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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/vector.py b/pinecone/core/openapi/db_data/model/vector.py index 6d72376c5..80ceddc34 100644 --- a/pinecone/core/openapi/db_data/model/vector.py +++ b/pinecone/core/openapi/db_data/model/vector.py @@ -1,14 +1,15 @@ """ -Pinecone Data Plane API + Pinecone Data Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,11 +27,14 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): +if TYPE_CHECKING: from pinecone.core.openapi.db_data.model.sparse_values import SparseValues - globals()["SparseValues"] = SparseValues +def lazy_import(): + from pinecone.core.openapi.db_data.model.sparse_values import SparseValues + globals()['SparseValues'] = SparseValues from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -65,11 +69,16 @@ class Vector(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ("id",): {"max_length": 512, "min_length": 1}, - ("values",): {}, + ('id',): { + 'max_length': 512, + 'min_length': 1, + }, + ('values',): { + }, } @cached_class_property @@ -79,7 +88,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -95,26 +104,28 @@ def openapi_types(cls): """ lazy_import() return { - "id": (str,), # noqa: E501 - "values": ([float],), # noqa: E501 - "sparse_values": (SparseValues,), # noqa: E501 - "metadata": ({str: (bool, dict, float, int, list, str, none_type)},), # noqa: E501 + 'id': (str,), # noqa: E501 + 'values': ([float],), # noqa: E501 + 'sparse_values': (SparseValues,), # noqa: E501 + 'metadata': (Dict[str, Any],), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "id": "id", # noqa: E501 - "values": "values", # noqa: E501 - "sparse_values": "sparseValues", # noqa: E501 - "metadata": "metadata", # noqa: E501 + 'id': 'id', # noqa: E501 + 'values': 'values', # noqa: E501 + 'sparse_values': 'sparseValues', # noqa: E501 + 'metadata': 'metadata', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of Vector. @@ -124,7 +135,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -167,23 +181,25 @@ def _from_openapi_data(cls: Type[T], id, *args, **kwargs) -> T: # noqa: E501 _visited_composed_classes = (Animal,) values ([float]): This is the vector data included in the request. [optional] # noqa: E501 sparse_values (SparseValues): [optional] # noqa: E501 - metadata ({str: (bool, dict, float, int, list, str, none_type)}): This is the metadata included in the request. [optional] # noqa: E501 + metadata (Dict[str, Any]): This is the metadata included in the request. [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", ()) + _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__), + "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__,), ) @@ -199,29 +215,25 @@ def _from_openapi_data(cls: Type[T], id, *args, **kwargs) -> T: # noqa: E501 self.id = id for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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, *args, **kwargs) -> None: # noqa: E501 @@ -263,21 +275,23 @@ def __init__(self, id, *args, **kwargs) -> None: # noqa: E501 _visited_composed_classes = (Animal,) values ([float]): This is the vector data included in the request. [optional] # noqa: E501 sparse_values (SparseValues): [optional] # noqa: E501 - metadata ({str: (bool, dict, float, int, list, str, none_type)}): This is the metadata included in the request. [optional] # noqa: E501 + metadata (Dict[str, Any]): This is the metadata included in the request. [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", ()) + _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__), + "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__,), ) @@ -293,17 +307,13 @@ def __init__(self, id, *args, **kwargs) -> None: # noqa: E501 self.id = id for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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/vector_values.py b/pinecone/core/openapi/db_data/model/vector_values.py index 0175fda4c..7a700830e 100644 --- a/pinecone/core/openapi/db_data/model/vector_values.py +++ b/pinecone/core/openapi/db_data/model/vector_values.py @@ -1,14 +1,15 @@ """ -Pinecone Data Plane API + Pinecone Data Plane API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -27,6 +28,7 @@ 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 @@ -55,9 +57,13 @@ class VectorValues(ModelSimple): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {("value",): {}} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + ('value',): { + }, + } @cached_class_property def additional_properties_type(cls): @@ -65,7 +71,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 """ - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -79,30 +85,31 @@ def openapi_types(cls): openapi_types (dict): The key is attribute name and the value is attribute type. """ - return {"value": ([float],)} + return { + 'value': ([float],), + } @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", - ] - ) + 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: @@ -147,19 +154,21 @@ def __init__(self, *args, **kwargs) -> None: _visited_composed_classes = (Animal,) """ # required up here when default value is not given - _path_to_item = kwargs.pop("_path_to_item", ()) + _path_to_item = kwargs.pop('_path_to_item', ()) value = None - if "value" in kwargs: - value = kwargs.pop("value") + 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__), + "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__,), ) @@ -171,12 +180,13 @@ def __init__(self, *args, **kwargs) -> None: 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", ()) + + _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 @@ -189,8 +199,10 @@ def __init__(self, *args, **kwargs) -> None: self.value = value if kwargs: raise PineconeApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." - % (kwargs, self.__class__.__name__), + "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__,), ) @@ -239,21 +251,23 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: _visited_composed_classes = (Animal,) """ # required up here when default value is not given - _path_to_item = kwargs.pop("_path_to_item", ()) + _path_to_item = kwargs.pop('_path_to_item', ()) self = super(OpenApiModel, cls).__new__(cls) value = None - if "value" in kwargs: - value = kwargs.pop("value") + 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__), + "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__,), ) @@ -265,12 +279,13 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: 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", ()) + + _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 @@ -283,8 +298,10 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: self.value = value if kwargs: raise PineconeApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." - % (kwargs, self.__class__.__name__), + "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__,), ) diff --git a/pinecone/core/openapi/db_data/models/__init__.py b/pinecone/core/openapi/db_data/models/__init__.py index e3b28075a..8bab597bb 100644 --- a/pinecone/core/openapi/db_data/models/__init__.py +++ b/pinecone/core/openapi/db_data/models/__init__.py @@ -10,16 +10,10 @@ # 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.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.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 @@ -32,9 +26,7 @@ from pinecone.core.openapi.db_data.model.list_namespaces_response import ListNamespacesResponse from pinecone.core.openapi.db_data.model.list_response import ListResponse from pinecone.core.openapi.db_data.model.namespace_description import NamespaceDescription -from pinecone.core.openapi.db_data.model.namespace_description_indexed_fields import ( - NamespaceDescriptionIndexedFields, -) +from pinecone.core.openapi.db_data.model.namespace_description_indexed_fields import NamespaceDescriptionIndexedFields 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 @@ -45,16 +37,10 @@ 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, -) -from pinecone.core.openapi.db_data.model.search_records_request_rerank import ( - SearchRecordsRequestRerank, -) +from pinecone.core.openapi.db_data.model.search_records_request_query import SearchRecordsRequestQuery +from pinecone.core.openapi.db_data.model.search_records_request_rerank import SearchRecordsRequestRerank from pinecone.core.openapi.db_data.model.search_records_response import SearchRecordsResponse -from pinecone.core.openapi.db_data.model.search_records_response_result import ( - SearchRecordsResponseResult, -) +from pinecone.core.openapi.db_data.model.search_records_response_result import SearchRecordsResponseResult 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.single_query_results import SingleQueryResults diff --git a/pinecone/core/openapi/inference/__init__.py b/pinecone/core/openapi/inference/__init__.py index e483fc73f..4a9d16dbb 100644 --- a/pinecone/core/openapi/inference/__init__.py +++ b/pinecone/core/openapi/inference/__init__.py @@ -1,16 +1,17 @@ # flake8: noqa """ -Pinecone Inference API + Pinecone Inference API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + __version__ = "1.0.0" # import ApiClient @@ -26,5 +27,4 @@ from pinecone.openapi_support.exceptions import PineconeApiValueError from pinecone.openapi_support.exceptions import PineconeApiKeyError from pinecone.openapi_support.exceptions import PineconeApiException - -API_VERSION = "2025-10" +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 d2f82def0..f72f183f4 100644 --- a/pinecone/core/openapi/inference/api/inference_api.py +++ b/pinecone/core/openapi/inference/api/inference_api.py @@ -1,26 +1,24 @@ """ -Pinecone Inference API + Pinecone Inference API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from __future__ import annotations -from typing import TYPE_CHECKING +from typing import TYPE_CHECKING, Any, Dict, cast if TYPE_CHECKING: from multiprocessing.pool import ApplyResult from pinecone.openapi_support import ApiClient, AsyncioApiClient -from pinecone.openapi_support.endpoint_utils import ( - ExtraOpenApiKwargsTypedDict, - KwargsWithOpenApiKwargDefaultsTypedDict, -) +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 @@ -28,7 +26,7 @@ datetime, file_type, none_type, - validate_and_convert_types, + validate_and_convert_types ) from pinecone.core.openapi.inference.model.embed_request import EmbedRequest from pinecone.core.openapi.inference.model.embeddings_list import EmbeddingsList @@ -51,7 +49,9 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client def __embed( - self, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict + self, + x_pinecone_api_version="2025-10", + **kwargs: ExtraOpenApiKwargsTypedDict ) -> EmbeddingsList | ApplyResult[EmbeddingsList]: """Generate vectors # noqa: E501 @@ -90,46 +90,74 @@ def __embed( thread. """ kwargs = self._process_openapi_kwargs(kwargs) - kwargs["x_pinecone_api_version"] = x_pinecone_api_version - return self.call_with_http_info(**kwargs) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + return cast(EmbeddingsList | ApplyResult[EmbeddingsList], self.call_with_http_info(**kwargs)) self.embed = _Endpoint( settings={ - "response_type": (EmbeddingsList,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/embed", - "operation_id": "embed", - "http_method": "POST", - "servers": None, + 'response_type': (EmbeddingsList,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/embed', + 'operation_id': 'embed', + 'http_method': 'POST', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "embed_request"], - "required": ["x_pinecone_api_version"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'embed_request', + ], + 'required': [ + 'x_pinecone_api_version', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_pinecone_api_version": (str,), - "embed_request": (EmbedRequest,), + 'validations': { + }, + 'allowed_values': { + }, + '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', }, - "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, - "location_map": {"x_pinecone_api_version": "header", "embed_request": "body"}, - "collection_format_map": {}, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__embed, + callable=__embed ) def __get_model( self, model_name, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict, + **kwargs: ExtraOpenApiKwargsTypedDict ) -> ModelInfo | ApplyResult[ModelInfo]: """Describe a model # noqa: E501 @@ -168,44 +196,75 @@ def __get_model( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['model_name'] = \ + model_name + return cast(ModelInfo | ApplyResult[ModelInfo], self.call_with_http_info(**kwargs)) self.get_model = _Endpoint( settings={ - "response_type": (ModelInfo,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/models/{model_name}", - "operation_id": "get_model", - "http_method": "GET", - "servers": None, + 'response_type': (ModelInfo,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/models/{model_name}', + 'operation_id': 'get_model', + 'http_method': 'GET', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "model_name"], - "required": ["x_pinecone_api_version", "model_name"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'model_name', + ], + 'required': [ + 'x_pinecone_api_version', + 'model_name', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": {"x_pinecone_api_version": (str,), "model_name": (str,)}, - "attribute_map": { - "x_pinecone_api_version": "X-Pinecone-Api-Version", - "model_name": "model_name", + 'validations': { + }, + 'allowed_values': { + }, + '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": {}, + 'location_map': { + 'x_pinecone_api_version': 'header', + 'model_name': 'path', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [], }, - headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__get_model, + callable=__get_model ) def __list_models( - self, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict + self, + x_pinecone_api_version="2025-10", + **kwargs: ExtraOpenApiKwargsTypedDict ) -> ModelInfoList | ApplyResult[ModelInfoList]: """List available models # noqa: E501 @@ -245,52 +304,77 @@ def __list_models( thread. """ kwargs = self._process_openapi_kwargs(kwargs) - kwargs["x_pinecone_api_version"] = x_pinecone_api_version - return self.call_with_http_info(**kwargs) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + return cast(ModelInfoList | ApplyResult[ModelInfoList], self.call_with_http_info(**kwargs)) self.list_models = _Endpoint( settings={ - "response_type": (ModelInfoList,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/models", - "operation_id": "list_models", - "http_method": "GET", - "servers": None, + 'response_type': (ModelInfoList,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/models', + 'operation_id': 'list_models', + 'http_method': 'GET', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "type", "vector_type"], - "required": ["x_pinecone_api_version"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'type', + 'vector_type', + ], + 'required': [ + 'x_pinecone_api_version', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "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": []}, + 'validations': { + }, + 'allowed_values': { + }, + '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': [], + }, api_client=api_client, - callable=__list_models, + callable=__list_models ) def __rerank( - self, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict + self, + x_pinecone_api_version="2025-10", + **kwargs: ExtraOpenApiKwargsTypedDict ) -> RerankResult | ApplyResult[RerankResult]: """Rerank results # noqa: E501 @@ -329,42 +413,71 @@ def __rerank( thread. """ kwargs = self._process_openapi_kwargs(kwargs) - kwargs["x_pinecone_api_version"] = x_pinecone_api_version - return self.call_with_http_info(**kwargs) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + return cast(RerankResult | ApplyResult[RerankResult], self.call_with_http_info(**kwargs)) self.rerank = _Endpoint( settings={ - "response_type": (RerankResult,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/rerank", - "operation_id": "rerank", - "http_method": "POST", - "servers": None, + 'response_type': (RerankResult,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/rerank', + 'operation_id': 'rerank', + 'http_method': 'POST', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "rerank_request"], - "required": ["x_pinecone_api_version"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'rerank_request', + ], + 'required': [ + 'x_pinecone_api_version', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_pinecone_api_version": (str,), - "rerank_request": (RerankRequest,), + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'x_pinecone_api_version': + (str,), + 'rerank_request': + (RerankRequest,), + }, + 'attribute_map': { + 'x_pinecone_api_version': 'X-Pinecone-Api-Version', }, - "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, - "location_map": {"x_pinecone_api_version": "header", "rerank_request": "body"}, - "collection_format_map": {}, + 'location_map': { + 'x_pinecone_api_version': 'header', + 'rerank_request': 'body', + }, + 'collection_format_map': { + } + }, + headers_map={ + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json' + ] }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__rerank, + callable=__rerank ) + class AsyncioInferenceApi: """NOTE: This class is @generated using OpenAPI @@ -376,7 +489,11 @@ def __init__(self, api_client=None) -> None: api_client = AsyncioApiClient() self.api_client = api_client - async def __embed(self, x_pinecone_api_version="2025-10", **kwargs) -> EmbeddingsList: + async def __embed( + self, + x_pinecone_api_version="2025-10", + **kwargs + ) -> EmbeddingsList: """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 @@ -407,43 +524,74 @@ async def __embed(self, x_pinecone_api_version="2025-10", **kwargs) -> Embedding EmbeddingsList """ self._process_openapi_kwargs(kwargs) - kwargs["x_pinecone_api_version"] = x_pinecone_api_version - return await self.call_with_http_info(**kwargs) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + return cast(EmbeddingsList, await self.call_with_http_info(**kwargs)) self.embed = _AsyncioEndpoint( settings={ - "response_type": (EmbeddingsList,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/embed", - "operation_id": "embed", - "http_method": "POST", - "servers": None, + 'response_type': (EmbeddingsList,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/embed', + 'operation_id': 'embed', + 'http_method': 'POST', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "embed_request"], - "required": ["x_pinecone_api_version"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'embed_request', + ], + 'required': [ + 'x_pinecone_api_version', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_pinecone_api_version": (str,), - "embed_request": (EmbedRequest,), + 'validations': { + }, + 'allowed_values': { + }, + '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": {}, + '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' + ] }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__embed, + callable=__embed ) async def __get_model( - self, model_name, x_pinecone_api_version="2025-10", **kwargs + self, + model_name, + x_pinecone_api_version="2025-10", + **kwargs ) -> ModelInfo: """Describe a model # noqa: E501 @@ -475,43 +623,76 @@ async def __get_model( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['model_name'] = \ + model_name + return cast(ModelInfo, await self.call_with_http_info(**kwargs)) self.get_model = _AsyncioEndpoint( settings={ - "response_type": (ModelInfo,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/models/{model_name}", - "operation_id": "get_model", - "http_method": "GET", - "servers": None, + 'response_type': (ModelInfo,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/models/{model_name}', + 'operation_id': 'get_model', + 'http_method': 'GET', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "model_name"], - "required": ["x_pinecone_api_version", "model_name"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'model_name', + ], + 'required': [ + 'x_pinecone_api_version', + 'model_name', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": {"x_pinecone_api_version": (str,), "model_name": (str,)}, - "attribute_map": { - "x_pinecone_api_version": "X-Pinecone-Api-Version", - "model_name": "model_name", + 'validations': { + }, + 'allowed_values': { + }, + 'openapi_types': { + 'x_pinecone_api_version': + (str,), + 'model_name': + (str,), }, - "location_map": {"x_pinecone_api_version": "header", "model_name": "path"}, - "collection_format_map": {}, + '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': [], }, - headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__get_model, + callable=__get_model ) - async def __list_models(self, x_pinecone_api_version="2025-10", **kwargs) -> ModelInfoList: + async def __list_models( + self, + x_pinecone_api_version="2025-10", + **kwargs + ) -> ModelInfoList: """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 @@ -543,51 +724,78 @@ async def __list_models(self, x_pinecone_api_version="2025-10", **kwargs) -> Mod ModelInfoList """ self._process_openapi_kwargs(kwargs) - kwargs["x_pinecone_api_version"] = x_pinecone_api_version - return await self.call_with_http_info(**kwargs) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + return cast(ModelInfoList, await self.call_with_http_info(**kwargs)) self.list_models = _AsyncioEndpoint( settings={ - "response_type": (ModelInfoList,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/models", - "operation_id": "list_models", - "http_method": "GET", - "servers": None, + 'response_type': (ModelInfoList,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/models', + 'operation_id': 'list_models', + 'http_method': 'GET', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "type", "vector_type"], - "required": ["x_pinecone_api_version"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'type', + 'vector_type', + ], + 'required': [ + 'x_pinecone_api_version', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "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": []}, + 'validations': { + }, + 'allowed_values': { + }, + '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': [], + }, api_client=api_client, - callable=__list_models, + callable=__list_models ) - async def __rerank(self, x_pinecone_api_version="2025-10", **kwargs) -> RerankResult: + async def __rerank( + self, + x_pinecone_api_version="2025-10", + **kwargs + ) -> RerankResult: """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 @@ -618,37 +826,65 @@ async def __rerank(self, x_pinecone_api_version="2025-10", **kwargs) -> RerankRe RerankResult """ self._process_openapi_kwargs(kwargs) - kwargs["x_pinecone_api_version"] = x_pinecone_api_version - return await self.call_with_http_info(**kwargs) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + return cast(RerankResult, await self.call_with_http_info(**kwargs)) self.rerank = _AsyncioEndpoint( settings={ - "response_type": (RerankResult,), - "auth": ["ApiKeyAuth"], - "endpoint_path": "/rerank", - "operation_id": "rerank", - "http_method": "POST", - "servers": None, + 'response_type': (RerankResult,), + 'auth': [ + 'ApiKeyAuth' + ], + 'endpoint_path': '/rerank', + 'operation_id': 'rerank', + 'http_method': 'POST', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "rerank_request"], - "required": ["x_pinecone_api_version"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'rerank_request', + ], + 'required': [ + 'x_pinecone_api_version', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_pinecone_api_version": (str,), - "rerank_request": (RerankRequest,), + 'validations': { + }, + 'allowed_values': { + }, + '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": {}, + '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' + ] }, - headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__rerank, + callable=__rerank ) diff --git a/pinecone/core/openapi/inference/apis/__init__.py b/pinecone/core/openapi/inference/apis/__init__.py index 647ee6f2e..ca637bf77 100644 --- a/pinecone/core/openapi/inference/apis/__init__.py +++ b/pinecone/core/openapi/inference/apis/__init__.py @@ -1,3 +1,4 @@ + # flake8: noqa # Import all APIs into this package. diff --git a/pinecone/core/openapi/inference/model/dense_embedding.py b/pinecone/core/openapi/inference/model/dense_embedding.py index 455ac87b0..560c88220 100644 --- a/pinecone/core/openapi/inference/model/dense_embedding.py +++ b/pinecone/core/openapi/inference/model/dense_embedding.py @@ -1,14 +1,15 @@ """ -Pinecone Inference API + Pinecone Inference API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -27,6 +28,7 @@ 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 @@ -59,9 +61,11 @@ class DenseEmbedding(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -69,7 +73,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 """ - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -84,22 +88,24 @@ def openapi_types(cls): and the value is attribute type. """ return { - "values": ([float],), # noqa: E501 - "vector_type": (str,), # noqa: E501 + 'values': ([float],), # noqa: E501 + 'vector_type': (str,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "values": "values", # noqa: E501 - "vector_type": "vector_type", # noqa: E501 + 'values': 'values', # noqa: E501 + 'vector_type': 'vector_type', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of DenseEmbedding. @@ -109,7 +115,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -153,20 +162,22 @@ def _from_openapi_data(cls: Type[T], values, vector_type, *args, **kwargs) -> T: _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", ()) + _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__), + "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__,), ) @@ -183,29 +194,25 @@ def _from_openapi_data(cls: Type[T], values, vector_type, *args, **kwargs) -> T: self.values = values self.vector_type = vector_type for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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, values, vector_type, *args, **kwargs) -> None: # noqa: E501 @@ -249,17 +256,19 @@ def __init__(self, values, vector_type, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -276,17 +285,13 @@ def __init__(self, values, vector_type, *args, **kwargs) -> None: # noqa: E501 self.values = values self.vector_type = vector_type for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/pinecone/core/openapi/inference/model/document.py b/pinecone/core/openapi/inference/model/document.py index 1a3262fbc..1ca0785f3 100644 --- a/pinecone/core/openapi/inference/model/document.py +++ b/pinecone/core/openapi/inference/model/document.py @@ -1,14 +1,15 @@ """ -Pinecone Inference API + Pinecone Inference API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -27,6 +28,7 @@ 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 @@ -59,9 +61,11 @@ class Document(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -69,7 +73,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 """ - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -83,17 +87,21 @@ def openapi_types(cls): openapi_types (dict): The key is attribute name and the value is attribute type. """ - return {} + return { + } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = {} - read_only_vars: Set[str] = set([]) + attribute_map: Dict[str, str] = { + } + + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of Document. @@ -103,7 +111,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -143,20 +154,22 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 _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", ()) + _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__), + "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__,), ) @@ -171,29 +184,25 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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 @@ -233,17 +242,19 @@ def __init__(self, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -258,17 +269,13 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/pinecone/core/openapi/inference/model/embed_request.py b/pinecone/core/openapi/inference/model/embed_request.py index c8d760646..e15f69080 100644 --- a/pinecone/core/openapi/inference/model/embed_request.py +++ b/pinecone/core/openapi/inference/model/embed_request.py @@ -1,14 +1,15 @@ """ -Pinecone Inference API + Pinecone Inference API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,11 +27,14 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): +if TYPE_CHECKING: from pinecone.core.openapi.inference.model.embed_request_inputs import EmbedRequestInputs - globals()["EmbedRequestInputs"] = EmbedRequestInputs +def lazy_import(): + from pinecone.core.openapi.inference.model.embed_request_inputs import EmbedRequestInputs + globals()['EmbedRequestInputs'] = EmbedRequestInputs from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -65,9 +69,11 @@ class EmbedRequest(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -76,7 +82,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -92,24 +98,26 @@ def openapi_types(cls): """ lazy_import() return { - "model": (str,), # noqa: E501 - "inputs": ([EmbedRequestInputs],), # noqa: E501 - "parameters": ({str: (bool, dict, float, int, list, str, none_type)},), # noqa: E501 + 'model': (str,), # noqa: E501 + 'inputs': ([EmbedRequestInputs],), # noqa: E501 + 'parameters': (Dict[str, Any],), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "model": "model", # noqa: E501 - "inputs": "inputs", # noqa: E501 - "parameters": "parameters", # noqa: E501 + 'model': 'model', # noqa: E501 + 'inputs': 'inputs', # noqa: E501 + 'parameters': 'parameters', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of EmbedRequest. @@ -119,7 +127,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -161,23 +172,25 @@ def _from_openapi_data(cls: Type[T], model, inputs, *args, **kwargs) -> T: # no Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - parameters ({str: (bool, dict, float, int, list, str, none_type)}): Additional model-specific parameters. Refer to the [model guide](https://docs.pinecone.io/guides/index-data/create-an-index#embedding-models) for available model parameters. [optional] # noqa: E501 + parameters (Dict[str, Any]): Additional model-specific parameters. Refer to the [model guide](https://docs.pinecone.io/guides/index-data/create-an-index#embedding-models) for available model parameters. [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", ()) + _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__), + "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__,), ) @@ -194,29 +207,25 @@ def _from_openapi_data(cls: Type[T], model, inputs, *args, **kwargs) -> T: # no self.model = model self.inputs = inputs for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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, model, inputs, *args, **kwargs) -> None: # noqa: E501 @@ -257,21 +266,23 @@ def __init__(self, model, inputs, *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,) - parameters ({str: (bool, dict, float, int, list, str, none_type)}): Additional model-specific parameters. Refer to the [model guide](https://docs.pinecone.io/guides/index-data/create-an-index#embedding-models) for available model parameters. [optional] # noqa: E501 + parameters (Dict[str, Any]): Additional model-specific parameters. Refer to the [model guide](https://docs.pinecone.io/guides/index-data/create-an-index#embedding-models) for available model parameters. [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", ()) + _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__), + "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__,), ) @@ -288,17 +299,13 @@ def __init__(self, model, inputs, *args, **kwargs) -> None: # noqa: E501 self.model = model self.inputs = inputs for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/pinecone/core/openapi/inference/model/embed_request_inputs.py b/pinecone/core/openapi/inference/model/embed_request_inputs.py index e42174606..1432066ed 100644 --- a/pinecone/core/openapi/inference/model/embed_request_inputs.py +++ b/pinecone/core/openapi/inference/model/embed_request_inputs.py @@ -1,14 +1,15 @@ """ -Pinecone Inference API + Pinecone Inference API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -27,6 +28,7 @@ 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 @@ -59,9 +61,11 @@ class EmbedRequestInputs(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -69,7 +73,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 """ - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -84,20 +88,22 @@ def openapi_types(cls): and the value is attribute type. """ return { - "text": (str,) # noqa: E501 + 'text': (str,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "text": "text" # noqa: E501 + 'text': 'text', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of EmbedRequestInputs. @@ -107,7 +113,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -148,20 +157,22 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 text (str): The text input to generate embeddings for. [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", ()) + _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__), + "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__,), ) @@ -176,29 +187,25 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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 @@ -239,17 +246,19 @@ def __init__(self, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -264,17 +273,13 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/pinecone/core/openapi/inference/model/embedding.py b/pinecone/core/openapi/inference/model/embedding.py index d6cf5556a..630f75c3b 100644 --- a/pinecone/core/openapi/inference/model/embedding.py +++ b/pinecone/core/openapi/inference/model/embedding.py @@ -1,14 +1,15 @@ """ -Pinecone Inference API + Pinecone Inference API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,13 +27,17 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): +if TYPE_CHECKING: from pinecone.core.openapi.inference.model.dense_embedding import DenseEmbedding from pinecone.core.openapi.inference.model.sparse_embedding import SparseEmbedding - globals()["DenseEmbedding"] = DenseEmbedding - globals()["SparseEmbedding"] = SparseEmbedding +def lazy_import(): + from pinecone.core.openapi.inference.model.dense_embedding import DenseEmbedding + from pinecone.core.openapi.inference.model.sparse_embedding import SparseEmbedding + globals()['DenseEmbedding'] = DenseEmbedding + globals()['SparseEmbedding'] = SparseEmbedding from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -67,9 +72,11 @@ class Embedding(ModelComposed): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -78,7 +85,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -94,35 +101,36 @@ def openapi_types(cls): """ lazy_import() return { - "vector_type": (str,), # noqa: E501 - "sparse_tokens": ([str],), # noqa: E501 - "values": ([float],), # noqa: E501 - "sparse_values": ([float],), # noqa: E501 - "sparse_indices": ([int],), # noqa: E501 + 'vector_type': (str,), # noqa: E501 + 'sparse_tokens': ([str],), # noqa: E501 + 'values': ([float],), # noqa: E501 + 'sparse_values': ([float],), # noqa: E501 + 'sparse_indices': ([int],), # noqa: E501 } @cached_class_property def discriminator(cls): lazy_import() val = { - "DenseEmbedding": DenseEmbedding, - "SparseEmbedding": SparseEmbedding, - "dense": DenseEmbedding, - "sparse": SparseEmbedding, + 'DenseEmbedding': DenseEmbedding, + 'SparseEmbedding': SparseEmbedding, + 'dense': DenseEmbedding, + 'sparse': SparseEmbedding, } if not val: return None - return {"vector_type": val} + return {'vector_type': val} attribute_map: Dict[str, str] = { - "vector_type": "vector_type", # noqa: E501 - "sparse_tokens": "sparse_tokens", # noqa: E501 - "values": "values", # noqa: E501 - "sparse_values": "sparse_values", # noqa: E501 - "sparse_indices": "sparse_indices", # noqa: E501 + 'vector_type': 'vector_type', # noqa: E501 + 'sparse_tokens': 'sparse_tokens', # noqa: E501 + 'values': 'values', # noqa: E501 + 'sparse_values': 'sparse_values', # noqa: E501 + 'sparse_indices': 'sparse_indices', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) @classmethod @convert_js_args_to_python_args @@ -167,18 +175,20 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 sparse_indices ([int]): The sparse embedding indices. [optional] # noqa: E501 """ - _check_type = kwargs.pop("_check_type", True) - _spec_property_naming = kwargs.pop("_spec_property_naming", False) - _path_to_item = kwargs.pop("_path_to_item", ()) - _configuration = kwargs.pop("_configuration", None) - _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) + _check_type = kwargs.pop('_check_type', True) + _spec_property_naming = kwargs.pop('_spec_property_naming', False) + _path_to_item = kwargs.pop('_path_to_item', ()) + _configuration = kwargs.pop('_configuration', None) + _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) self = super(OpenApiModel, cls).__new__(cls) if args: raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." - % (args, self.__class__.__name__), + "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__,), ) @@ -191,46 +201,43 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 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, + '_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) + 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 - ): + 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", - ] - ) + 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 @@ -274,18 +281,20 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 sparse_indices ([int]): The sparse embedding indices. [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", ()) + _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__), + "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__,), ) @@ -300,36 +309,33 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 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, + '_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) + 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 - ): + 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." - ) + 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 + def _composed_schemas(): # 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 @@ -338,4 +344,13 @@ def _composed_schemas(): # type: ignore # classes don't exist yet because their module has not finished # loading lazy_import() - return {"anyOf": [], "allOf": [], "oneOf": [DenseEmbedding, SparseEmbedding]} + return { + 'anyOf': [ + ], + 'allOf': [ + ], + 'oneOf': [ + DenseEmbedding, + SparseEmbedding, + ], + } diff --git a/pinecone/core/openapi/inference/model/embeddings_list.py b/pinecone/core/openapi/inference/model/embeddings_list.py index d8b67c137..70659abd6 100644 --- a/pinecone/core/openapi/inference/model/embeddings_list.py +++ b/pinecone/core/openapi/inference/model/embeddings_list.py @@ -1,14 +1,15 @@ """ -Pinecone Inference API + Pinecone Inference API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,13 +27,17 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): +if TYPE_CHECKING: from pinecone.core.openapi.inference.model.embedding import Embedding from pinecone.core.openapi.inference.model.embeddings_list_usage import EmbeddingsListUsage - globals()["Embedding"] = Embedding - globals()["EmbeddingsListUsage"] = EmbeddingsListUsage +def lazy_import(): + from pinecone.core.openapi.inference.model.embedding import Embedding + from pinecone.core.openapi.inference.model.embeddings_list_usage import EmbeddingsListUsage + globals()['Embedding'] = Embedding + globals()['EmbeddingsListUsage'] = EmbeddingsListUsage from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -67,9 +72,11 @@ class EmbeddingsList(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -78,7 +85,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -94,26 +101,28 @@ def openapi_types(cls): """ lazy_import() return { - "model": (str,), # noqa: E501 - "vector_type": (str,), # noqa: E501 - "data": ([Embedding],), # noqa: E501 - "usage": (EmbeddingsListUsage,), # noqa: E501 + 'model': (str,), # noqa: E501 + 'vector_type': (str,), # noqa: E501 + 'data': ([Embedding],), # noqa: E501 + 'usage': (EmbeddingsListUsage,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "model": "model", # noqa: E501 - "vector_type": "vector_type", # noqa: E501 - "data": "data", # noqa: E501 - "usage": "usage", # noqa: E501 + 'model': 'model', # noqa: E501 + 'vector_type': 'vector_type', # noqa: E501 + 'data': 'data', # noqa: E501 + 'usage': 'usage', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of EmbeddingsList. @@ -123,7 +132,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -169,20 +181,22 @@ def _from_openapi_data(cls: Type[T], model, vector_type, data, usage, *args, **k _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", ()) + _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__), + "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__,), ) @@ -201,29 +215,25 @@ def _from_openapi_data(cls: Type[T], model, vector_type, data, usage, *args, **k self.data = data self.usage = usage for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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, model, vector_type, data, usage, *args, **kwargs) -> None: # noqa: E501 @@ -269,17 +279,19 @@ def __init__(self, model, vector_type, data, usage, *args, **kwargs) -> None: # """ _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", ()) + _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__), + "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__,), ) @@ -298,17 +310,13 @@ def __init__(self, model, vector_type, data, usage, *args, **kwargs) -> None: # self.data = data self.usage = usage for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/pinecone/core/openapi/inference/model/embeddings_list_usage.py b/pinecone/core/openapi/inference/model/embeddings_list_usage.py index 04695e9e0..902ce69b8 100644 --- a/pinecone/core/openapi/inference/model/embeddings_list_usage.py +++ b/pinecone/core/openapi/inference/model/embeddings_list_usage.py @@ -1,14 +1,15 @@ """ -Pinecone Inference API + Pinecone Inference API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -27,6 +28,7 @@ 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 @@ -59,10 +61,13 @@ class EmbeddingsListUsage(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ("total_tokens",): {"inclusive_minimum": 0} + ('total_tokens',): { + 'inclusive_minimum': 0, + }, } @cached_class_property @@ -71,7 +76,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 """ - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -86,20 +91,22 @@ def openapi_types(cls): and the value is attribute type. """ return { - "total_tokens": (int,) # noqa: E501 + 'total_tokens': (int,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "total_tokens": "total_tokens" # noqa: E501 + 'total_tokens': 'total_tokens', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of EmbeddingsListUsage. @@ -109,7 +116,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -150,20 +160,22 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 total_tokens (int): Total number of tokens consumed across all inputs. [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", ()) + _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__), + "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__,), ) @@ -178,29 +190,25 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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 @@ -241,17 +249,19 @@ def __init__(self, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -266,17 +276,13 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/pinecone/core/openapi/inference/model/error_response.py b/pinecone/core/openapi/inference/model/error_response.py index 12e1f25de..1307b6b63 100644 --- a/pinecone/core/openapi/inference/model/error_response.py +++ b/pinecone/core/openapi/inference/model/error_response.py @@ -1,14 +1,15 @@ """ -Pinecone Inference API + Pinecone Inference API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,11 +27,14 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): +if TYPE_CHECKING: from pinecone.core.openapi.inference.model.error_response_error import ErrorResponseError - globals()["ErrorResponseError"] = ErrorResponseError +def lazy_import(): + from pinecone.core.openapi.inference.model.error_response_error import ErrorResponseError + globals()['ErrorResponseError'] = ErrorResponseError from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -65,9 +69,11 @@ class ErrorResponse(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -76,7 +82,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -92,22 +98,24 @@ def openapi_types(cls): """ lazy_import() return { - "status": (int,), # noqa: E501 - "error": (ErrorResponseError,), # noqa: E501 + 'status': (int,), # noqa: E501 + 'error': (ErrorResponseError,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "status": "status", # noqa: E501 - "error": "error", # noqa: E501 + 'status': 'status', # noqa: E501 + 'error': 'error', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ErrorResponse. @@ -117,7 +125,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -161,20 +172,22 @@ def _from_openapi_data(cls: Type[T], status, error, *args, **kwargs) -> T: # no _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", ()) + _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__), + "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__,), ) @@ -191,29 +204,25 @@ def _from_openapi_data(cls: Type[T], status, error, *args, **kwargs) -> T: # no self.status = status self.error = error for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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, status, error, *args, **kwargs) -> None: # noqa: E501 @@ -257,17 +266,19 @@ def __init__(self, status, error, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -284,17 +295,13 @@ def __init__(self, status, error, *args, **kwargs) -> None: # noqa: E501 self.status = status self.error = error for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/pinecone/core/openapi/inference/model/error_response_error.py b/pinecone/core/openapi/inference/model/error_response_error.py index e6af5aae6..91703a1d5 100644 --- a/pinecone/core/openapi/inference/model/error_response_error.py +++ b/pinecone/core/openapi/inference/model/error_response_error.py @@ -1,14 +1,15 @@ """ -Pinecone Inference API + Pinecone Inference API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -27,6 +28,7 @@ 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 @@ -59,9 +61,11 @@ class ErrorResponseError(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -69,7 +73,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 """ - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -84,24 +88,26 @@ def openapi_types(cls): and the value is attribute type. """ return { - "code": (str,), # noqa: E501 - "message": (str,), # noqa: E501 - "details": ({str: (bool, dict, float, int, list, str, none_type)},), # noqa: E501 + 'code': (str,), # noqa: E501 + 'message': (str,), # noqa: E501 + 'details': (Dict[str, Any],), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "code": "code", # noqa: E501 - "message": "message", # noqa: E501 - "details": "details", # noqa: E501 + 'code': 'code', # noqa: E501 + 'message': 'message', # noqa: E501 + 'details': 'details', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ErrorResponseError. @@ -111,7 +117,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -153,23 +162,25 @@ def _from_openapi_data(cls: Type[T], code, message, *args, **kwargs) -> T: # no Animal class but this time we won't travel through its discriminator because we passed in _visited_composed_classes = (Animal,) - details ({str: (bool, dict, float, int, list, str, none_type)}): Additional information about the error. This field is not guaranteed to be present. [optional] # noqa: E501 + details (Dict[str, Any]): Additional information about the error. This field is not guaranteed to be present. [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", ()) + _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__), + "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__,), ) @@ -186,29 +197,25 @@ def _from_openapi_data(cls: Type[T], code, message, *args, **kwargs) -> T: # no self.code = code self.message = message for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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, code, message, *args, **kwargs) -> None: # noqa: E501 @@ -249,21 +256,23 @@ def __init__(self, code, message, *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,) - details ({str: (bool, dict, float, int, list, str, none_type)}): Additional information about the error. This field is not guaranteed to be present. [optional] # noqa: E501 + details (Dict[str, Any]): Additional information about the error. This field is not guaranteed to be present. [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", ()) + _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__), + "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__,), ) @@ -280,17 +289,13 @@ def __init__(self, code, message, *args, **kwargs) -> None: # noqa: E501 self.code = code self.message = message for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/pinecone/core/openapi/inference/model/model_info.py b/pinecone/core/openapi/inference/model/model_info.py index 95a55447f..85b5f19bd 100644 --- a/pinecone/core/openapi/inference/model/model_info.py +++ b/pinecone/core/openapi/inference/model/model_info.py @@ -1,14 +1,15 @@ """ -Pinecone Inference API + Pinecone Inference API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,17 +27,17 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): - from pinecone.core.openapi.inference.model.model_info_supported_metrics import ( - ModelInfoSupportedMetrics, - ) - from pinecone.core.openapi.inference.model.model_info_supported_parameter import ( - ModelInfoSupportedParameter, - ) +if TYPE_CHECKING: + from pinecone.core.openapi.inference.model.model_info_supported_metrics import ModelInfoSupportedMetrics + from pinecone.core.openapi.inference.model.model_info_supported_parameter import ModelInfoSupportedParameter - globals()["ModelInfoSupportedMetrics"] = ModelInfoSupportedMetrics - globals()["ModelInfoSupportedParameter"] = ModelInfoSupportedParameter +def lazy_import(): + from pinecone.core.openapi.inference.model.model_info_supported_metrics import ModelInfoSupportedMetrics + from pinecone.core.openapi.inference.model.model_info_supported_parameter import ModelInfoSupportedParameter + globals()['ModelInfoSupportedMetrics'] = ModelInfoSupportedMetrics + globals()['ModelInfoSupportedParameter'] = ModelInfoSupportedParameter from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -71,12 +72,20 @@ class ModelInfo(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ("default_dimension",): {"inclusive_maximum": 20000, "inclusive_minimum": 1}, - ("max_sequence_length",): {"inclusive_minimum": 1}, - ("max_batch_size",): {"inclusive_minimum": 1}, + ('default_dimension',): { + 'inclusive_maximum': 20000, + 'inclusive_minimum': 1, + }, + ('max_sequence_length',): { + 'inclusive_minimum': 1, + }, + ('max_batch_size',): { + 'inclusive_minimum': 1, + }, } @cached_class_property @@ -86,7 +95,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -102,42 +111,44 @@ def openapi_types(cls): """ lazy_import() return { - "model": (str,), # noqa: E501 - "short_description": (str,), # noqa: E501 - "type": (str,), # noqa: E501 - "supported_parameters": ([ModelInfoSupportedParameter],), # noqa: E501 - "vector_type": (str,), # noqa: E501 - "default_dimension": (int,), # noqa: E501 - "modality": (str,), # noqa: E501 - "max_sequence_length": (int,), # noqa: E501 - "max_batch_size": (int,), # noqa: E501 - "provider_name": (str,), # noqa: E501 - "supported_dimensions": ([int],), # noqa: E501 - "supported_metrics": (ModelInfoSupportedMetrics,), # noqa: E501 + 'model': (str,), # noqa: E501 + 'short_description': (str,), # noqa: E501 + 'type': (str,), # noqa: E501 + 'supported_parameters': ([ModelInfoSupportedParameter],), # noqa: E501 + 'vector_type': (str,), # noqa: E501 + 'default_dimension': (int,), # noqa: E501 + 'modality': (str,), # noqa: E501 + 'max_sequence_length': (int,), # noqa: E501 + 'max_batch_size': (int,), # noqa: E501 + 'provider_name': (str,), # noqa: E501 + 'supported_dimensions': ([int],), # noqa: E501 + 'supported_metrics': (ModelInfoSupportedMetrics,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "model": "model", # noqa: E501 - "short_description": "short_description", # noqa: E501 - "type": "type", # noqa: E501 - "supported_parameters": "supported_parameters", # noqa: E501 - "vector_type": "vector_type", # noqa: E501 - "default_dimension": "default_dimension", # noqa: E501 - "modality": "modality", # noqa: E501 - "max_sequence_length": "max_sequence_length", # noqa: E501 - "max_batch_size": "max_batch_size", # noqa: E501 - "provider_name": "provider_name", # noqa: E501 - "supported_dimensions": "supported_dimensions", # noqa: E501 - "supported_metrics": "supported_metrics", # noqa: E501 + 'model': 'model', # noqa: E501 + 'short_description': 'short_description', # noqa: E501 + 'type': 'type', # noqa: E501 + 'supported_parameters': 'supported_parameters', # noqa: E501 + 'vector_type': 'vector_type', # noqa: E501 + 'default_dimension': 'default_dimension', # noqa: E501 + 'modality': 'modality', # noqa: E501 + 'max_sequence_length': 'max_sequence_length', # noqa: E501 + 'max_batch_size': 'max_batch_size', # noqa: E501 + 'provider_name': 'provider_name', # noqa: E501 + 'supported_dimensions': 'supported_dimensions', # noqa: E501 + 'supported_metrics': 'supported_metrics', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ModelInfo. @@ -147,13 +158,14 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args - def _from_openapi_data( - cls: Type[T], model, short_description, type, supported_parameters, *args, **kwargs - ) -> T: # noqa: E501 + def _from_openapi_data(cls: Type[T], model, short_description, type, supported_parameters, *args, **kwargs) -> T: # noqa: E501 """ModelInfo - a model defined in OpenAPI Args: @@ -203,20 +215,22 @@ def _from_openapi_data( supported_metrics (ModelInfoSupportedMetrics): [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", ()) + _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__), + "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__,), ) @@ -235,34 +249,28 @@ def _from_openapi_data( self.type = type self.supported_parameters = supported_parameters for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + 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", - ] - ) + 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, model, short_description, type, supported_parameters, *args, **kwargs - ) -> None: # noqa: E501 + def __init__(self, model, short_description, type, supported_parameters, *args, **kwargs) -> None: # noqa: E501 """ModelInfo - a model defined in OpenAPI Args: @@ -313,17 +321,19 @@ def __init__( """ _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", ()) + _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__), + "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__,), ) @@ -342,17 +352,13 @@ def __init__( self.type = type self.supported_parameters = supported_parameters for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + 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." - ) + raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/pinecone/core/openapi/inference/model/model_info_list.py b/pinecone/core/openapi/inference/model/model_info_list.py index a1e23c2b9..ea2c70472 100644 --- a/pinecone/core/openapi/inference/model/model_info_list.py +++ b/pinecone/core/openapi/inference/model/model_info_list.py @@ -1,14 +1,15 @@ """ -Pinecone Inference API + Pinecone Inference API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,11 +27,14 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): +if TYPE_CHECKING: from pinecone.core.openapi.inference.model.model_info import ModelInfo - globals()["ModelInfo"] = ModelInfo +def lazy_import(): + from pinecone.core.openapi.inference.model.model_info import ModelInfo + globals()['ModelInfo'] = ModelInfo from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -65,9 +69,11 @@ class ModelInfoList(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -76,7 +82,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -92,20 +98,22 @@ def openapi_types(cls): """ lazy_import() return { - "models": ([ModelInfo],) # noqa: E501 + 'models': ([ModelInfo],), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "models": "models" # noqa: E501 + 'models': 'models', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ModelInfoList. @@ -115,7 +123,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -156,20 +167,22 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 models ([ModelInfo]): List of available models. [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", ()) + _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__), + "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__,), ) @@ -184,29 +197,25 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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 @@ -247,17 +256,19 @@ def __init__(self, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -272,17 +283,13 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/pinecone/core/openapi/inference/model/model_info_supported_metrics.py b/pinecone/core/openapi/inference/model/model_info_supported_metrics.py index ff34dfed3..38c7297ad 100644 --- a/pinecone/core/openapi/inference/model/model_info_supported_metrics.py +++ b/pinecone/core/openapi/inference/model/model_info_supported_metrics.py @@ -1,14 +1,15 @@ """ -Pinecone Inference API + Pinecone Inference API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -27,6 +28,7 @@ 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 @@ -55,9 +57,11 @@ class ModelInfoSupportedMetrics(ModelSimple): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -65,7 +69,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 """ - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -79,30 +83,31 @@ def openapi_types(cls): openapi_types (dict): The key is attribute name and the value is attribute type. """ - return {"value": ([str],)} + 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", - ] - ) + 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: @@ -147,19 +152,21 @@ def __init__(self, *args, **kwargs) -> None: _visited_composed_classes = (Animal,) """ # required up here when default value is not given - _path_to_item = kwargs.pop("_path_to_item", ()) + _path_to_item = kwargs.pop('_path_to_item', ()) value = None - if "value" in kwargs: - value = kwargs.pop("value") + 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__), + "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__,), ) @@ -171,12 +178,13 @@ def __init__(self, *args, **kwargs) -> None: 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", ()) + + _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 @@ -189,8 +197,10 @@ def __init__(self, *args, **kwargs) -> None: self.value = value if kwargs: raise PineconeApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." - % (kwargs, self.__class__.__name__), + "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__,), ) @@ -239,21 +249,23 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: _visited_composed_classes = (Animal,) """ # required up here when default value is not given - _path_to_item = kwargs.pop("_path_to_item", ()) + _path_to_item = kwargs.pop('_path_to_item', ()) self = super(OpenApiModel, cls).__new__(cls) value = None - if "value" in kwargs: - value = kwargs.pop("value") + 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__), + "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__,), ) @@ -265,12 +277,13 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: 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", ()) + + _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 @@ -283,8 +296,10 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: self.value = value if kwargs: raise PineconeApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." - % (kwargs, self.__class__.__name__), + "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__,), ) 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 058d1b8d7..0cd57c188 100644 --- a/pinecone/core/openapi/inference/model/model_info_supported_parameter.py +++ b/pinecone/core/openapi/inference/model/model_info_supported_parameter.py @@ -1,14 +1,15 @@ """ -Pinecone Inference API + Pinecone Inference API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -27,6 +28,7 @@ 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 @@ -59,9 +61,11 @@ class ModelInfoSupportedParameter(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -69,7 +73,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 """ - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -84,34 +88,36 @@ def openapi_types(cls): and the value is attribute type. """ return { - "parameter": (str,), # noqa: E501 - "type": (str,), # noqa: E501 - "value_type": (str,), # noqa: E501 - "required": (bool,), # noqa: E501 - "allowed_values": ([dict],), # noqa: E501 - "min": (float,), # noqa: E501 - "max": (float,), # noqa: E501 - "default": (dict,), # noqa: E501 + 'parameter': (str,), # noqa: E501 + 'type': (str,), # noqa: E501 + 'value_type': (str,), # noqa: E501 + 'required': (bool,), # noqa: E501 + 'allowed_values': ([dict],), # noqa: E501 + 'min': (float,), # noqa: E501 + 'max': (float,), # noqa: E501 + 'default': (dict,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "parameter": "parameter", # noqa: E501 - "type": "type", # noqa: E501 - "value_type": "value_type", # noqa: E501 - "required": "required", # noqa: E501 - "allowed_values": "allowed_values", # noqa: E501 - "min": "min", # noqa: E501 - "max": "max", # noqa: E501 - "default": "default", # noqa: E501 + 'parameter': 'parameter', # noqa: E501 + 'type': 'type', # noqa: E501 + 'value_type': 'value_type', # noqa: E501 + 'required': 'required', # noqa: E501 + 'allowed_values': 'allowed_values', # noqa: E501 + 'min': 'min', # noqa: E501 + 'max': 'max', # noqa: E501 + 'default': 'default', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ModelInfoSupportedParameter. @@ -121,13 +127,14 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args - def _from_openapi_data( - cls: Type[T], parameter, type, value_type, required, *args, **kwargs - ) -> T: # noqa: E501 + def _from_openapi_data(cls: Type[T], parameter, type, value_type, required, *args, **kwargs) -> T: # noqa: E501 """ModelInfoSupportedParameter - a model defined in OpenAPI Args: @@ -173,20 +180,22 @@ def _from_openapi_data( default (dict): The default value for the parameter when a parameter is optional. [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", ()) + _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__), + "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__,), ) @@ -205,29 +214,25 @@ def _from_openapi_data( self.value_type = value_type self.required = required for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + 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", - ] - ) + 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, parameter, type, value_type, required, *args, **kwargs) -> None: # noqa: E501 @@ -277,17 +282,19 @@ def __init__(self, parameter, type, value_type, required, *args, **kwargs) -> No """ _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", ()) + _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__), + "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__,), ) @@ -306,17 +313,13 @@ def __init__(self, parameter, type, value_type, required, *args, **kwargs) -> No self.value_type = value_type self.required = required for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + 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." - ) + raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/pinecone/core/openapi/inference/model/ranked_document.py b/pinecone/core/openapi/inference/model/ranked_document.py index 97c792dce..4456dfeb4 100644 --- a/pinecone/core/openapi/inference/model/ranked_document.py +++ b/pinecone/core/openapi/inference/model/ranked_document.py @@ -1,14 +1,15 @@ """ -Pinecone Inference API + Pinecone Inference API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,11 +27,14 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): +if TYPE_CHECKING: from pinecone.core.openapi.inference.model.document import Document - globals()["Document"] = Document +def lazy_import(): + from pinecone.core.openapi.inference.model.document import Document + globals()['Document'] = Document from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -65,9 +69,11 @@ class RankedDocument(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -76,7 +82,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -92,24 +98,26 @@ def openapi_types(cls): """ lazy_import() return { - "index": (int,), # noqa: E501 - "score": (float,), # noqa: E501 - "document": (Document,), # noqa: E501 + 'index': (int,), # noqa: E501 + 'score': (float,), # noqa: E501 + 'document': (Document,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "index": "index", # noqa: E501 - "score": "score", # noqa: E501 - "document": "document", # noqa: E501 + 'index': 'index', # noqa: E501 + 'score': 'score', # noqa: E501 + 'document': 'document', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of RankedDocument. @@ -119,7 +127,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -164,20 +175,22 @@ def _from_openapi_data(cls: Type[T], index, score, *args, **kwargs) -> T: # noq document (Document): [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", ()) + _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__), + "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__,), ) @@ -194,29 +207,25 @@ def _from_openapi_data(cls: Type[T], index, score, *args, **kwargs) -> T: # noq self.index = index self.score = score for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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, index, score, *args, **kwargs) -> None: # noqa: E501 @@ -261,17 +270,19 @@ def __init__(self, index, score, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -288,17 +299,13 @@ def __init__(self, index, score, *args, **kwargs) -> None: # noqa: E501 self.index = index self.score = score for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/pinecone/core/openapi/inference/model/rerank_request.py b/pinecone/core/openapi/inference/model/rerank_request.py index 95120be4c..56a47c355 100644 --- a/pinecone/core/openapi/inference/model/rerank_request.py +++ b/pinecone/core/openapi/inference/model/rerank_request.py @@ -1,14 +1,15 @@ """ -Pinecone Inference API + Pinecone Inference API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,11 +27,14 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): +if TYPE_CHECKING: from pinecone.core.openapi.inference.model.document import Document - globals()["Document"] = Document +def lazy_import(): + from pinecone.core.openapi.inference.model.document import Document + globals()['Document'] = Document from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -65,9 +69,11 @@ class RerankRequest(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -76,7 +82,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -92,32 +98,34 @@ def openapi_types(cls): """ lazy_import() return { - "model": (str,), # noqa: E501 - "query": (str,), # noqa: E501 - "documents": ([Document],), # noqa: E501 - "top_n": (int,), # noqa: E501 - "return_documents": (bool,), # noqa: E501 - "rank_fields": ([str],), # noqa: E501 - "parameters": ({str: (bool, dict, float, int, list, str, none_type)},), # noqa: E501 + 'model': (str,), # noqa: E501 + 'query': (str,), # noqa: E501 + 'documents': ([Document],), # noqa: E501 + 'top_n': (int,), # noqa: E501 + 'return_documents': (bool,), # noqa: E501 + 'rank_fields': ([str],), # noqa: E501 + 'parameters': (Dict[str, Any],), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "model": "model", # noqa: E501 - "query": "query", # noqa: E501 - "documents": "documents", # noqa: E501 - "top_n": "top_n", # noqa: E501 - "return_documents": "return_documents", # noqa: E501 - "rank_fields": "rank_fields", # noqa: E501 - "parameters": "parameters", # noqa: E501 + 'model': 'model', # noqa: E501 + 'query': 'query', # noqa: E501 + 'documents': 'documents', # noqa: E501 + 'top_n': 'top_n', # noqa: E501 + 'return_documents': 'return_documents', # noqa: E501 + 'rank_fields': 'rank_fields', # noqa: E501 + 'parameters': 'parameters', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of RerankRequest. @@ -127,7 +135,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -173,23 +184,25 @@ def _from_openapi_data(cls: Type[T], model, query, documents, *args, **kwargs) - top_n (int): The number of results to return sorted by relevance. Defaults to the number of inputs. [optional] # noqa: E501 return_documents (bool): Whether to return the documents in the response. [optional] if omitted the server will use the default value of True. # noqa: E501 rank_fields ([str]): The field(s) to consider for reranking. If not provided, the default is `[\"text\"]`. The number of fields supported is [model-specific](https://docs.pinecone.io/guides/search/rerank-results#reranking-models). [optional] if omitted the server will use the default value of ["text"]. # noqa: E501 - parameters ({str: (bool, dict, float, int, list, str, none_type)}): Additional model-specific parameters. Refer to the [model guide](https://docs.pinecone.io/guides/search/rerank-results#reranking-models) for available model parameters. [optional] # noqa: E501 + parameters (Dict[str, Any]): Additional model-specific parameters. Refer to the [model guide](https://docs.pinecone.io/guides/search/rerank-results#reranking-models) for available model parameters. [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", ()) + _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__), + "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__,), ) @@ -207,29 +220,25 @@ def _from_openapi_data(cls: Type[T], model, query, documents, *args, **kwargs) - self.query = query self.documents = documents for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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, model, query, documents, *args, **kwargs) -> None: # noqa: E501 @@ -274,21 +283,23 @@ def __init__(self, model, query, documents, *args, **kwargs) -> None: # noqa: E top_n (int): The number of results to return sorted by relevance. Defaults to the number of inputs. [optional] # noqa: E501 return_documents (bool): Whether to return the documents in the response. [optional] if omitted the server will use the default value of True. # noqa: E501 rank_fields ([str]): The field(s) to consider for reranking. If not provided, the default is `[\"text\"]`. The number of fields supported is [model-specific](https://docs.pinecone.io/guides/search/rerank-results#reranking-models). [optional] if omitted the server will use the default value of ["text"]. # noqa: E501 - parameters ({str: (bool, dict, float, int, list, str, none_type)}): Additional model-specific parameters. Refer to the [model guide](https://docs.pinecone.io/guides/search/rerank-results#reranking-models) for available model parameters. [optional] # noqa: E501 + parameters (Dict[str, Any]): Additional model-specific parameters. Refer to the [model guide](https://docs.pinecone.io/guides/search/rerank-results#reranking-models) for available model parameters. [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", ()) + _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__), + "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__,), ) @@ -306,17 +317,13 @@ def __init__(self, model, query, documents, *args, **kwargs) -> None: # noqa: E self.query = query self.documents = documents for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/pinecone/core/openapi/inference/model/rerank_result.py b/pinecone/core/openapi/inference/model/rerank_result.py index 3dd945fed..4774a5c13 100644 --- a/pinecone/core/openapi/inference/model/rerank_result.py +++ b/pinecone/core/openapi/inference/model/rerank_result.py @@ -1,14 +1,15 @@ """ -Pinecone Inference API + Pinecone Inference API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -26,13 +27,17 @@ ) from pinecone.openapi_support.exceptions import PineconeApiAttributeError +from typing import TYPE_CHECKING -def lazy_import(): +if TYPE_CHECKING: from pinecone.core.openapi.inference.model.ranked_document import RankedDocument from pinecone.core.openapi.inference.model.rerank_result_usage import RerankResultUsage - globals()["RankedDocument"] = RankedDocument - globals()["RerankResultUsage"] = RerankResultUsage +def lazy_import(): + from pinecone.core.openapi.inference.model.ranked_document import RankedDocument + from pinecone.core.openapi.inference.model.rerank_result_usage import RerankResultUsage + globals()['RankedDocument'] = RankedDocument + globals()['RerankResultUsage'] = RerankResultUsage from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -67,9 +72,11 @@ class RerankResult(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -78,7 +85,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -94,24 +101,26 @@ def openapi_types(cls): """ lazy_import() return { - "model": (str,), # noqa: E501 - "data": ([RankedDocument],), # noqa: E501 - "usage": (RerankResultUsage,), # noqa: E501 + 'model': (str,), # noqa: E501 + 'data': ([RankedDocument],), # noqa: E501 + 'usage': (RerankResultUsage,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "model": "model", # noqa: E501 - "data": "data", # noqa: E501 - "usage": "usage", # noqa: E501 + 'model': 'model', # noqa: E501 + 'data': 'data', # noqa: E501 + 'usage': 'usage', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of RerankResult. @@ -121,7 +130,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -166,20 +178,22 @@ def _from_openapi_data(cls: Type[T], model, data, usage, *args, **kwargs) -> T: _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", ()) + _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__), + "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__,), ) @@ -197,29 +211,25 @@ def _from_openapi_data(cls: Type[T], model, data, usage, *args, **kwargs) -> T: self.data = data self.usage = usage for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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, model, data, usage, *args, **kwargs) -> None: # noqa: E501 @@ -264,17 +274,19 @@ def __init__(self, model, data, usage, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -292,17 +304,13 @@ def __init__(self, model, data, usage, *args, **kwargs) -> None: # noqa: E501 self.data = data self.usage = usage for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/pinecone/core/openapi/inference/model/rerank_result_usage.py b/pinecone/core/openapi/inference/model/rerank_result_usage.py index eeb617ae4..2ad118648 100644 --- a/pinecone/core/openapi/inference/model/rerank_result_usage.py +++ b/pinecone/core/openapi/inference/model/rerank_result_usage.py @@ -1,14 +1,15 @@ """ -Pinecone Inference API + Pinecone Inference API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -27,6 +28,7 @@ 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 @@ -59,10 +61,13 @@ class RerankResultUsage(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ("rerank_units",): {"inclusive_minimum": 0} + ('rerank_units',): { + 'inclusive_minimum': 0, + }, } @cached_class_property @@ -71,7 +76,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 """ - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -86,20 +91,22 @@ def openapi_types(cls): and the value is attribute type. """ return { - "rerank_units": (int,) # noqa: E501 + 'rerank_units': (int,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "rerank_units": "rerank_units" # noqa: E501 + 'rerank_units': 'rerank_units', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of RerankResultUsage. @@ -109,7 +116,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -150,20 +160,22 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 rerank_units (int): The number of rerank units consumed by this 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", ()) + _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__), + "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__,), ) @@ -178,29 +190,25 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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 @@ -241,17 +249,19 @@ def __init__(self, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -266,17 +276,13 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/pinecone/core/openapi/inference/model/sparse_embedding.py b/pinecone/core/openapi/inference/model/sparse_embedding.py index 05324fc81..0c07eb36d 100644 --- a/pinecone/core/openapi/inference/model/sparse_embedding.py +++ b/pinecone/core/openapi/inference/model/sparse_embedding.py @@ -1,14 +1,15 @@ """ -Pinecone Inference API + Pinecone Inference API -Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 + 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. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -27,6 +28,7 @@ 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 @@ -59,9 +61,11 @@ class SparseEmbedding(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -69,7 +73,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 """ - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -84,26 +88,28 @@ def openapi_types(cls): and the value is attribute type. """ return { - "sparse_values": ([float],), # noqa: E501 - "sparse_indices": ([int],), # noqa: E501 - "vector_type": (str,), # noqa: E501 - "sparse_tokens": ([str],), # noqa: E501 + 'sparse_values': ([float],), # noqa: E501 + 'sparse_indices': ([int],), # noqa: E501 + 'vector_type': (str,), # noqa: E501 + 'sparse_tokens': ([str],), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "sparse_values": "sparse_values", # noqa: E501 - "sparse_indices": "sparse_indices", # noqa: E501 - "vector_type": "vector_type", # noqa: E501 - "sparse_tokens": "sparse_tokens", # noqa: E501 + 'sparse_values': 'sparse_values', # noqa: E501 + 'sparse_indices': 'sparse_indices', # noqa: E501 + 'vector_type': 'vector_type', # noqa: E501 + 'sparse_tokens': 'sparse_tokens', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of SparseEmbedding. @@ -113,13 +119,14 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args - def _from_openapi_data( - cls: Type[T], sparse_values, sparse_indices, vector_type, *args, **kwargs - ) -> T: # noqa: E501 + def _from_openapi_data(cls: Type[T], sparse_values, sparse_indices, vector_type, *args, **kwargs) -> T: # noqa: E501 """SparseEmbedding - a model defined in OpenAPI Args: @@ -161,20 +168,22 @@ def _from_openapi_data( sparse_tokens ([str]): The normalized tokens used to create the sparse embedding. [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", ()) + _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__), + "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__,), ) @@ -192,29 +201,25 @@ def _from_openapi_data( self.sparse_indices = sparse_indices self.vector_type = vector_type for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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, sparse_values, sparse_indices, vector_type, *args, **kwargs) -> None: # noqa: E501 @@ -260,17 +265,19 @@ def __init__(self, sparse_values, sparse_indices, vector_type, *args, **kwargs) """ _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", ()) + _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__), + "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__,), ) @@ -288,17 +295,13 @@ def __init__(self, sparse_values, sparse_indices, vector_type, *args, **kwargs) self.sparse_indices = sparse_indices self.vector_type = vector_type for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") diff --git a/pinecone/core/openapi/inference/models/__init__.py b/pinecone/core/openapi/inference/models/__init__.py index c4e2d613b..c03211967 100644 --- a/pinecone/core/openapi/inference/models/__init__.py +++ b/pinecone/core/openapi/inference/models/__init__.py @@ -20,12 +20,8 @@ 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_supported_metrics import ( - ModelInfoSupportedMetrics, -) -from pinecone.core.openapi.inference.model.model_info_supported_parameter import ( - ModelInfoSupportedParameter, -) +from pinecone.core.openapi.inference.model.model_info_supported_metrics import ModelInfoSupportedMetrics +from pinecone.core.openapi.inference.model.model_info_supported_parameter import ModelInfoSupportedParameter from pinecone.core.openapi.inference.model.ranked_document import RankedDocument from pinecone.core.openapi.inference.model.rerank_request import RerankRequest from pinecone.core.openapi.inference.model.rerank_result import RerankResult diff --git a/pinecone/core/openapi/oauth/__init__.py b/pinecone/core/openapi/oauth/__init__.py index d9fb09073..5f85b8142 100644 --- a/pinecone/core/openapi/oauth/__init__.py +++ b/pinecone/core/openapi/oauth/__init__.py @@ -1,16 +1,17 @@ # flake8: noqa """ -Pinecone OAuth API + Pinecone OAuth API -Provides an API for authenticating with Pinecone. # noqa: E501 + Provides an API for authenticating with Pinecone. # noqa: E501 -This file is @generated using OpenAPI. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + __version__ = "1.0.0" # import ApiClient @@ -26,5 +27,4 @@ from pinecone.openapi_support.exceptions import PineconeApiValueError from pinecone.openapi_support.exceptions import PineconeApiKeyError from pinecone.openapi_support.exceptions import PineconeApiException - -API_VERSION = "2025-10" +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 6605f1afc..448b4a880 100644 --- a/pinecone/core/openapi/oauth/api/o_auth_api.py +++ b/pinecone/core/openapi/oauth/api/o_auth_api.py @@ -1,26 +1,24 @@ """ -Pinecone OAuth API + Pinecone OAuth API -Provides an API for authenticating with Pinecone. # noqa: E501 + Provides an API for authenticating with Pinecone. # noqa: E501 -This file is @generated using OpenAPI. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from __future__ import annotations -from typing import TYPE_CHECKING +from typing import TYPE_CHECKING, Any, Dict, cast if TYPE_CHECKING: from multiprocessing.pool import ApplyResult from pinecone.openapi_support import ApiClient, AsyncioApiClient -from pinecone.openapi_support.endpoint_utils import ( - ExtraOpenApiKwargsTypedDict, - KwargsWithOpenApiKwargDefaultsTypedDict, -) +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 @@ -28,7 +26,7 @@ datetime, file_type, none_type, - validate_and_convert_types, + validate_and_convert_types ) from pinecone.core.openapi.oauth.model.error_response import ErrorResponse from pinecone.core.openapi.oauth.model.token_request import TokenRequest @@ -50,7 +48,7 @@ def __get_token( self, token_request, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict, + **kwargs: ExtraOpenApiKwargsTypedDict ) -> TokenResponse | ApplyResult[TokenResponse]: """Create an access token # noqa: E501 @@ -89,46 +87,73 @@ def __get_token( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['token_request'] = \ + token_request + return cast(TokenResponse | ApplyResult[TokenResponse], self.call_with_http_info(**kwargs)) self.get_token = _Endpoint( settings={ - "response_type": (TokenResponse,), - "auth": [], - "endpoint_path": "/oauth/token", - "operation_id": "get_token", - "http_method": "POST", - "servers": None, + 'response_type': (TokenResponse,), + 'auth': [], + 'endpoint_path': '/oauth/token', + 'operation_id': 'get_token', + 'http_method': 'POST', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "token_request"], - "required": ["x_pinecone_api_version", "token_request"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'token_request', + ], + 'required': [ + 'x_pinecone_api_version', + 'token_request', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_pinecone_api_version": (str,), - "token_request": (TokenRequest,), + 'validations': { + }, + 'allowed_values': { + }, + '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": {}, + '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={ - "accept": ["application/json"], - "content_type": ["application/json", "application/x-www-form-urlencoded"], + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json', + 'application/x-www-form-urlencoded' + ] }, api_client=api_client, - callable=__get_token, + callable=__get_token ) + class AsyncioOAuthApi: """NOTE: This class is @generated using OpenAPI @@ -141,7 +166,10 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client async def __get_token( - self, token_request, x_pinecone_api_version="2025-10", **kwargs + self, + token_request, + x_pinecone_api_version="2025-10", + **kwargs ) -> TokenResponse: """Create an access token # noqa: E501 @@ -173,41 +201,67 @@ async def __get_token( 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) + kwargs['x_pinecone_api_version'] = \ + x_pinecone_api_version + kwargs['token_request'] = \ + token_request + return cast(TokenResponse, await self.call_with_http_info(**kwargs)) self.get_token = _AsyncioEndpoint( settings={ - "response_type": (TokenResponse,), - "auth": [], - "endpoint_path": "/oauth/token", - "operation_id": "get_token", - "http_method": "POST", - "servers": None, + 'response_type': (TokenResponse,), + 'auth': [], + 'endpoint_path': '/oauth/token', + 'operation_id': 'get_token', + 'http_method': 'POST', + 'servers': None, }, params_map={ - "all": ["x_pinecone_api_version", "token_request"], - "required": ["x_pinecone_api_version", "token_request"], - "nullable": [], - "enum": [], - "validation": [], + 'all': [ + 'x_pinecone_api_version', + 'token_request', + ], + 'required': [ + 'x_pinecone_api_version', + 'token_request', + ], + 'nullable': [ + ], + 'enum': [ + ], + 'validation': [ + ] }, root_map={ - "validations": {}, - "allowed_values": {}, - "openapi_types": { - "x_pinecone_api_version": (str,), - "token_request": (TokenRequest,), + 'validations': { + }, + 'allowed_values': { + }, + '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', }, - "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, - "location_map": {"x_pinecone_api_version": "header", "token_request": "body"}, - "collection_format_map": {}, + 'collection_format_map': { + } }, headers_map={ - "accept": ["application/json"], - "content_type": ["application/json", "application/x-www-form-urlencoded"], + 'accept': [ + 'application/json' + ], + 'content_type': [ + 'application/json', + 'application/x-www-form-urlencoded' + ] }, api_client=api_client, - callable=__get_token, + callable=__get_token ) diff --git a/pinecone/core/openapi/oauth/apis/__init__.py b/pinecone/core/openapi/oauth/apis/__init__.py index 9da169522..3383ac6ff 100644 --- a/pinecone/core/openapi/oauth/apis/__init__.py +++ b/pinecone/core/openapi/oauth/apis/__init__.py @@ -1,3 +1,4 @@ + # flake8: noqa # Import all APIs into this package. diff --git a/pinecone/core/openapi/oauth/model/error_response.py b/pinecone/core/openapi/oauth/model/error_response.py index 311c647c5..7751ad876 100644 --- a/pinecone/core/openapi/oauth/model/error_response.py +++ b/pinecone/core/openapi/oauth/model/error_response.py @@ -1,14 +1,15 @@ """ -Pinecone OAuth API + Pinecone OAuth API -Provides an API for authenticating with Pinecone. # noqa: E501 + Provides an API for authenticating with Pinecone. # noqa: E501 -This file is @generated using OpenAPI. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -27,6 +28,7 @@ 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 @@ -59,9 +61,11 @@ class ErrorResponse(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -69,7 +73,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 """ - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -84,22 +88,24 @@ def openapi_types(cls): and the value is attribute type. """ return { - "error": (str,), # noqa: E501 - "error_description": (str,), # noqa: E501 + 'error': (str,), # noqa: E501 + 'error_description': (str,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "error": "error", # noqa: E501 - "error_description": "error_description", # noqa: E501 + 'error': 'error', # noqa: E501 + 'error_description': 'error_description', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ErrorResponse. @@ -109,7 +115,10 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args @@ -151,20 +160,22 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 error_description (str): A human-readable description of the error. [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", ()) + _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__), + "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__,), ) @@ -179,29 +190,25 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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 @@ -243,17 +250,19 @@ def __init__(self, *args, **kwargs) -> None: # 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", ()) + _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__), + "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__,), ) @@ -268,17 +277,13 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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/oauth/model/token_request.py b/pinecone/core/openapi/oauth/model/token_request.py index 64e7b4f2c..78672a88b 100644 --- a/pinecone/core/openapi/oauth/model/token_request.py +++ b/pinecone/core/openapi/oauth/model/token_request.py @@ -1,14 +1,15 @@ """ -Pinecone OAuth API + Pinecone OAuth API -Provides an API for authenticating with Pinecone. # noqa: E501 + Provides an API for authenticating with Pinecone. # noqa: E501 -This file is @generated using OpenAPI. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -27,6 +28,7 @@ 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 @@ -59,9 +61,11 @@ class TokenRequest(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -69,7 +73,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 """ - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -84,26 +88,28 @@ def openapi_types(cls): and the value is attribute type. """ return { - "client_id": (str,), # noqa: E501 - "client_secret": (str,), # noqa: E501 - "grant_type": (str,), # noqa: E501 - "audience": (str,), # noqa: E501 + 'client_id': (str,), # noqa: E501 + 'client_secret': (str,), # noqa: E501 + 'grant_type': (str,), # noqa: E501 + 'audience': (str,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "client_id": "client_id", # noqa: E501 - "client_secret": "client_secret", # noqa: E501 - "grant_type": "grant_type", # noqa: E501 - "audience": "audience", # noqa: E501 + 'client_id': 'client_id', # noqa: E501 + 'client_secret': 'client_secret', # noqa: E501 + 'grant_type': 'grant_type', # noqa: E501 + 'audience': 'audience', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of TokenRequest. @@ -113,13 +119,14 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args - def _from_openapi_data( - cls: Type[T], client_id, client_secret, grant_type, audience, *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: @@ -161,20 +168,22 @@ def _from_openapi_data( _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", ()) + _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__), + "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__,), ) @@ -193,29 +202,25 @@ def _from_openapi_data( self.grant_type = grant_type self.audience = audience for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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, client_id, client_secret, grant_type, audience, *args, **kwargs) -> None: # noqa: E501 @@ -261,17 +266,19 @@ def __init__(self, client_id, client_secret, grant_type, audience, *args, **kwar """ _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", ()) + _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__), + "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__,), ) @@ -290,17 +297,13 @@ def __init__(self, client_id, client_secret, grant_type, audience, *args, **kwar self.grant_type = grant_type self.audience = audience for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + 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/oauth/model/token_response.py b/pinecone/core/openapi/oauth/model/token_response.py index 25d371fd1..43452c535 100644 --- a/pinecone/core/openapi/oauth/model/token_response.py +++ b/pinecone/core/openapi/oauth/model/token_response.py @@ -1,14 +1,15 @@ """ -Pinecone OAuth API + Pinecone OAuth API -Provides an API for authenticating with Pinecone. # noqa: E501 + Provides an API for authenticating with Pinecone. # noqa: E501 -This file is @generated using OpenAPI. + This file is @generated using OpenAPI. -The version of the OpenAPI document: 2025-10 -Contact: support@pinecone.io + The version of the OpenAPI document: 2025-10 + Contact: support@pinecone.io """ + from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -27,6 +28,7 @@ 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 @@ -59,9 +61,11 @@ class TokenResponse(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { + } - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { + } @cached_class_property def additional_properties_type(cls): @@ -69,7 +73,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 """ - return (bool, dict, float, int, list, str, none_type) # noqa: E501 + return (bool, dict, float, int, list, str, none_type,) # noqa: E501 _nullable = False @@ -84,24 +88,26 @@ def openapi_types(cls): and the value is attribute type. """ return { - "access_token": (str,), # noqa: E501 - "token_type": (str,), # noqa: E501 - "expires_in": (int,), # noqa: E501 + 'access_token': (str,), # noqa: E501 + 'token_type': (str,), # noqa: E501 + 'expires_in': (int,), # noqa: E501 } @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = { - "access_token": "access_token", # noqa: E501 - "token_type": "token_type", # noqa: E501 - "expires_in": "expires_in", # noqa: E501 + 'access_token': 'access_token', # noqa: E501 + 'token_type': 'token_type', # noqa: E501 + 'expires_in': 'expires_in', # noqa: E501 } - read_only_vars: Set[str] = set([]) + read_only_vars: Set[str] = set([ + ]) - _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} + _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of TokenResponse. @@ -111,13 +117,14 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: is handled by the parent class's __new__ method. """ # Call parent's __new__ with all arguments to preserve discriminator logic - return super().__new__(cls, *args, **kwargs) # type: ignore[misc] + instance: T = super().__new__(cls, *args, **kwargs) + return instance + + @classmethod @convert_js_args_to_python_args - def _from_openapi_data( - cls: Type[T], access_token, token_type, 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: @@ -158,20 +165,22 @@ def _from_openapi_data( _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", ()) + _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__), + "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__,), ) @@ -189,29 +198,25 @@ def _from_openapi_data( self.token_type = token_type self.expires_in = expires_in for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set( - [ - "_enforce_allowed_values", - "_enforce_validations", - "_data_store", - "_check_type", - "_spec_property_naming", - "_path_to_item", - "_configuration", - "_visited_composed_classes", - ] - ) + 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, access_token, token_type, expires_in, *args, **kwargs) -> None: # noqa: E501 @@ -256,17 +261,19 @@ def __init__(self, access_token, token_type, expires_in, *args, **kwargs) -> Non """ _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", ()) + _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__), + "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__,), ) @@ -284,17 +291,13 @@ def __init__(self, access_token, token_type, expires_in, *args, **kwargs) -> Non self.token_type = token_type self.expires_in = expires_in for var_name, var_value in kwargs.items(): - if ( - var_name not in self.attribute_map - and self._configuration is not None - and self._configuration.discard_unknown_keys - and self.additional_properties_type is None - ): + if var_name not in self.attribute_map and \ + self._configuration is not None and \ + self._configuration.discard_unknown_keys and \ + self.additional_properties_type is None: # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError( - f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes." - ) + raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes.") From 5fa25cd8bc6c85ed0269ab747fbf3c8867cdad3d Mon Sep 17 00:00:00 2001 From: Jen Hamon Date: Mon, 17 Nov 2025 02:40:02 -0500 Subject: [PATCH 7/7] Fix unit tests --- codegen/build-oas.sh | 63 + mypy.ini | 3 + pinecone/core/openapi/admin/__init__.py | 14 +- .../core/openapi/admin/api/api_keys_api.py | 875 ++--- .../openapi/admin/api/organizations_api.py | 677 ++-- .../core/openapi/admin/api/projects_api.py | 828 ++--- pinecone/core/openapi/admin/apis/__init__.py | 1 - pinecone/core/openapi/admin/model/api_key.py | 130 +- .../admin/model/api_key_with_secret.py | 125 +- .../admin/model/create_api_key_request.py | 124 +- .../admin/model/create_project_request.py | 128 +- .../openapi/admin/model/error_response.py | 125 +- .../admin/model/error_response_error.py | 126 +- .../admin/model/list_api_keys_response.py | 121 +- .../core/openapi/admin/model/organization.py | 148 +- .../openapi/admin/model/organization_list.py | 121 +- pinecone/core/openapi/admin/model/project.py | 155 +- .../core/openapi/admin/model/project_list.py | 121 +- .../admin/model/update_api_key_request.py | 124 +- .../model/update_organization_request.py | 120 +- .../admin/model/update_project_request.py | 128 +- pinecone/core/openapi/db_control/__init__.py | 14 +- .../db_control/api/manage_indexes_api.py | 3112 ++++++----------- .../core/openapi/db_control/apis/__init__.py | 1 - .../openapi/db_control/model/backup_list.py | 127 +- .../openapi/db_control/model/backup_model.py | 201 +- .../db_control/model/backup_model_schema.py | 129 +- .../model/backup_model_schema_fields.py | 118 +- .../core/openapi/db_control/model/byoc.py | 121 +- .../openapi/db_control/model/byoc_spec.py | 125 +- .../db_control/model/collection_list.py | 121 +- .../db_control/model/collection_model.py | 140 +- .../model/configure_index_request.py | 143 +- .../model/configure_index_request_embed.py | 130 +- .../db_control/model/create_backup_request.py | 122 +- .../model/create_collection_request.py | 124 +- .../model/create_index_for_model_request.py | 165 +- .../create_index_for_model_request_embed.py | 138 +- .../model/create_index_from_backup_request.py | 131 +- .../create_index_from_backup_response.py | 122 +- .../db_control/model/create_index_request.py | 154 +- .../db_control/model/error_response.py | 125 +- .../db_control/model/error_response_error.py | 126 +- .../openapi/db_control/model/index_list.py | 121 +- .../openapi/db_control/model/index_model.py | 176 +- .../db_control/model/index_model_status.py | 122 +- .../openapi/db_control/model/index_spec.py | 177 +- .../openapi/db_control/model/index_tags.py | 118 +- .../db_control/model/model_index_embed.py | 144 +- .../db_control/model/pagination_response.py | 118 +- .../openapi/db_control/model/pod_based.py | 121 +- .../core/openapi/db_control/model/pod_spec.py | 166 +- .../model/pod_spec_metadata_config.py | 118 +- .../openapi/db_control/model/read_capacity.py | 199 +- .../model/read_capacity_dedicated_config.py | 129 +- .../model/read_capacity_dedicated_spec.py | 133 +- .../read_capacity_dedicated_spec_response.py | 137 +- .../model/read_capacity_on_demand_spec.py | 116 +- .../read_capacity_on_demand_spec_response.py | 123 +- .../model/read_capacity_response.py | 205 +- .../db_control/model/read_capacity_status.py | 130 +- .../db_control/model/restore_job_list.py | 127 +- .../db_control/model/restore_job_model.py | 172 +- .../db_control/model/scaling_config_manual.py | 127 +- .../openapi/db_control/model/serverless.py | 121 +- .../db_control/model/serverless_spec.py | 139 +- .../model/serverless_spec_response.py | 139 +- .../openapi/db_control/models/__init__.py | 44 +- pinecone/core/openapi/db_data/__init__.py | 14 +- .../db_data/api/bulk_operations_api.py | 740 ++-- .../db_data/api/namespace_operations_api.py | 725 ++-- .../db_data/api/vector_operations_api.py | 1825 ++++------ .../core/openapi/db_data/apis/__init__.py | 1 - .../db_data/model/create_namespace_request.py | 133 +- .../model/create_namespace_request_schema.py | 129 +- .../create_namespace_request_schema_fields.py | 118 +- .../openapi/db_data/model/delete_request.py | 132 +- .../model/describe_index_stats_request.py | 118 +- .../model/fetch_by_metadata_request.py | 131 +- .../model/fetch_by_metadata_response.py | 137 +- .../openapi/db_data/model/fetch_response.py | 131 +- pinecone/core/openapi/db_data/model/hit.py | 126 +- .../db_data/model/import_error_mode.py | 118 +- .../openapi/db_data/model/import_model.py | 153 +- .../db_data/model/index_description.py | 149 +- .../db_data/model/list_imports_response.py | 127 +- .../core/openapi/db_data/model/list_item.py | 118 +- .../db_data/model/list_namespaces_response.py | 131 +- .../openapi/db_data/model/list_response.py | 137 +- .../db_data/model/namespace_description.py | 151 +- .../namespace_description_indexed_fields.py | 118 +- .../db_data/model/namespace_summary.py | 118 +- .../core/openapi/db_data/model/pagination.py | 118 +- .../openapi/db_data/model/protobuf_any.py | 122 +- .../openapi/db_data/model/query_request.py | 167 +- .../openapi/db_data/model/query_response.py | 137 +- .../openapi/db_data/model/query_vector.py | 142 +- .../core/openapi/db_data/model/rpc_status.py | 129 +- .../openapi/db_data/model/scored_vector.py | 139 +- .../db_data/model/search_match_terms.py | 122 +- .../db_data/model/search_records_request.py | 149 +- .../model/search_records_request_query.py | 146 +- .../model/search_records_request_rerank.py | 134 +- .../db_data/model/search_records_response.py | 135 +- .../model/search_records_response_result.py | 121 +- .../db_data/model/search_records_vector.py | 129 +- .../openapi/db_data/model/search_usage.py | 135 +- .../db_data/model/single_query_results.py | 125 +- .../openapi/db_data/model/sparse_values.py | 125 +- .../db_data/model/start_import_request.py | 135 +- .../db_data/model/start_import_response.py | 120 +- .../openapi/db_data/model/update_request.py | 150 +- .../openapi/db_data/model/update_response.py | 118 +- .../openapi/db_data/model/upsert_record.py | 118 +- .../openapi/db_data/model/upsert_request.py | 127 +- .../openapi/db_data/model/upsert_response.py | 118 +- pinecone/core/openapi/db_data/model/usage.py | 118 +- pinecone/core/openapi/db_data/model/vector.py | 138 +- .../openapi/db_data/model/vector_values.py | 111 +- .../core/openapi/db_data/models/__init__.py | 28 +- pinecone/core/openapi/inference/__init__.py | 14 +- .../openapi/inference/api/inference_api.py | 688 ++-- .../core/openapi/inference/apis/__init__.py | 1 - .../inference/model/dense_embedding.py | 122 +- .../core/openapi/inference/model/document.py | 120 +- .../openapi/inference/model/embed_request.py | 129 +- .../inference/model/embed_request_inputs.py | 118 +- .../core/openapi/inference/model/embedding.py | 185 +- .../inference/model/embeddings_list.py | 135 +- .../inference/model/embeddings_list_usage.py | 119 +- .../openapi/inference/model/error_response.py | 125 +- .../inference/model/error_response_error.py | 126 +- .../openapi/inference/model/model_info.py | 201 +- .../inference/model/model_info_list.py | 121 +- .../model/model_info_supported_metrics.py | 109 +- .../model/model_info_supported_parameter.py | 150 +- .../inference/model/ranked_document.py | 129 +- .../openapi/inference/model/rerank_request.py | 145 +- .../openapi/inference/model/rerank_result.py | 131 +- .../inference/model/rerank_result_usage.py | 119 +- .../inference/model/sparse_embedding.py | 134 +- .../core/openapi/inference/models/__init__.py | 8 +- pinecone/core/openapi/oauth/__init__.py | 14 +- pinecone/core/openapi/oauth/api/o_auth_api.py | 182 +- pinecone/core/openapi/oauth/apis/__init__.py | 1 - .../openapi/oauth/model/error_response.py | 122 +- .../core/openapi/oauth/model/token_request.py | 134 +- .../openapi/oauth/model/token_response.py | 130 +- pinecone/db_data/index.py | 51 +- pinecone/db_data/resources/sync/vector.py | 51 +- pinecone/openapi_support/model_utils.py | 60 +- pinecone/openapi_support/rest_aiohttp.py | 2 +- 152 files changed, 11592 insertions(+), 14988 deletions(-) diff --git a/codegen/build-oas.sh b/codegen/build-oas.sh index f1fc1842e..3e06b1044 100755 --- a/codegen/build-oas.sh +++ b/codegen/build-oas.sh @@ -140,6 +140,69 @@ PYTHON_SCRIPT sed -i '' 's/instance: T = super().__new__(cls, \*args, \*\*kwargs) # type: ignore\[misc\]/instance: T = super().__new__(cls, *args, **kwargs)/g' "$file" done + # Fix ApplyResult import - move from TYPE_CHECKING to runtime import + # ApplyResult is used in cast() calls which need it at runtime + find "${build_dir}" -name "*_api.py" | while IFS= read -r file; do + python3 < APIKeyWithSecret | ApplyResult[APIKeyWithSecret]: """Create an API key # noqa: E501 @@ -92,85 +92,58 @@ 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 cast(APIKeyWithSecret | ApplyResult[APIKeyWithSecret], self.call_with_http_info(**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 cast( + APIKeyWithSecret | ApplyResult[APIKeyWithSecret], self.call_with_http_info(**kwargs) + ) self.create_api_key = _Endpoint( settings={ - 'response_type': (APIKeyWithSecret,), - 'auth': [ - 'BearerAuth' - ], - 'endpoint_path': '/admin/projects/{project_id}/api-keys', - 'operation_id': 'create_api_key', - 'http_method': 'POST', - 'servers': None, + "response_type": (APIKeyWithSecret,), + "auth": ["BearerAuth"], + "endpoint_path": "/admin/projects/{project_id}/api-keys", + "operation_id": "create_api_key", + "http_method": "POST", + "servers": None, }, params_map={ - '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': [ - ] + "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": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "project_id": (str,), + "create_api_key_request": (CreateAPIKeyRequest,), }, - 'openapi_types': { - 'x_pinecone_api_version': - (str,), - 'project_id': - (str,), - 'create_api_key_request': - (CreateAPIKeyRequest,), + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "project_id": "project_id", }, - '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", }, - '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' - ] + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__create_api_key + callable=__create_api_key, ) def __delete_api_key( self, api_key_id, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict + **kwargs: ExtraOpenApiKwargsTypedDict, ) -> None: """Delete an API key # noqa: E501 @@ -209,76 +182,47 @@ def __delete_api_key( thread. """ kwargs = self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['api_key_id'] = \ - api_key_id + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["api_key_id"] = api_key_id return cast(None, self.call_with_http_info(**kwargs)) self.delete_api_key = _Endpoint( settings={ - 'response_type': None, - 'auth': [ - 'BearerAuth' - ], - 'endpoint_path': '/admin/api-keys/{api_key_id}', - 'operation_id': 'delete_api_key', - 'http_method': 'DELETE', - 'servers': None, + "response_type": None, + "auth": ["BearerAuth"], + "endpoint_path": "/admin/api-keys/{api_key_id}", + "operation_id": "delete_api_key", + "http_method": "DELETE", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'api_key_id', - ], - 'required': [ - 'x_pinecone_api_version', - 'api_key_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "api_key_id"], + "required": ["x_pinecone_api_version", "api_key_id"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_pinecone_api_version': - (str,), - 'api_key_id': - (str,), + "validations": {}, + "allowed_values": {}, + "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", }, - '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': [], + "location_map": {"x_pinecone_api_version": "header", "api_key_id": "path"}, + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__delete_api_key + callable=__delete_api_key, ) def __fetch_api_key( self, api_key_id, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict + **kwargs: ExtraOpenApiKwargsTypedDict, ) -> APIKey | ApplyResult[APIKey]: """Get API key details # noqa: E501 @@ -317,76 +261,47 @@ def __fetch_api_key( thread. """ kwargs = self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['api_key_id'] = \ - api_key_id + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["api_key_id"] = api_key_id return cast(APIKey | ApplyResult[APIKey], self.call_with_http_info(**kwargs)) self.fetch_api_key = _Endpoint( settings={ - 'response_type': (APIKey,), - 'auth': [ - 'BearerAuth' - ], - 'endpoint_path': '/admin/api-keys/{api_key_id}', - 'operation_id': 'fetch_api_key', - 'http_method': 'GET', - 'servers': None, + "response_type": (APIKey,), + "auth": ["BearerAuth"], + "endpoint_path": "/admin/api-keys/{api_key_id}", + "operation_id": "fetch_api_key", + "http_method": "GET", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'api_key_id', - ], - 'required': [ - 'x_pinecone_api_version', - 'api_key_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "api_key_id"], + "required": ["x_pinecone_api_version", "api_key_id"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { + "validations": {}, + "allowed_values": {}, + "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", }, - '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': [], + "location_map": {"x_pinecone_api_version": "header", "api_key_id": "path"}, + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__fetch_api_key + callable=__fetch_api_key, ) def __list_project_api_keys( self, project_id, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict + **kwargs: ExtraOpenApiKwargsTypedDict, ) -> ListApiKeysResponse | ApplyResult[ListApiKeysResponse]: """List API keys # noqa: E501 @@ -425,69 +340,43 @@ def __list_project_api_keys( thread. """ kwargs = self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['project_id'] = \ - project_id - return cast(ListApiKeysResponse | ApplyResult[ListApiKeysResponse], self.call_with_http_info(**kwargs)) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["project_id"] = project_id + return cast( + ListApiKeysResponse | ApplyResult[ListApiKeysResponse], + self.call_with_http_info(**kwargs), + ) self.list_project_api_keys = _Endpoint( settings={ - 'response_type': (ListApiKeysResponse,), - 'auth': [ - 'BearerAuth' - ], - 'endpoint_path': '/admin/projects/{project_id}/api-keys', - 'operation_id': 'list_project_api_keys', - 'http_method': 'GET', - 'servers': None, + "response_type": (ListApiKeysResponse,), + "auth": ["BearerAuth"], + "endpoint_path": "/admin/projects/{project_id}/api-keys", + "operation_id": "list_project_api_keys", + "http_method": "GET", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'project_id', - ], - 'required': [ - 'x_pinecone_api_version', - 'project_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "project_id"], + "required": ["x_pinecone_api_version", "project_id"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { + "validations": {}, + "allowed_values": {}, + "openapi_types": {"x_pinecone_api_version": (str,), "project_id": (str,)}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "project_id": "project_id", }, - 'allowed_values': { - }, - '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': [], + "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_project_api_keys + callable=__list_project_api_keys, ) def __update_api_key( @@ -495,7 +384,7 @@ def __update_api_key( api_key_id, update_api_key_request, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict + **kwargs: ExtraOpenApiKwargsTypedDict, ) -> APIKey | ApplyResult[APIKey]: """Update an API key # noqa: E501 @@ -535,82 +424,52 @@ def __update_api_key( 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 + 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 cast(APIKey | ApplyResult[APIKey], 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, + "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': [ - ] + "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': { + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "api_key_id": (str,), + "update_api_key_request": (UpdateAPIKeyRequest,), }, - '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", }, - '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", }, - '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' - ] + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__update_api_key + callable=__update_api_key, ) - class AsyncioAPIKeysApi: """NOTE: This class is @generated using OpenAPI @@ -623,11 +482,7 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client async def __create_api_key( - self, - project_id, - create_api_key_request, - x_pinecone_api_version="2025-10", - **kwargs + self, project_id, create_api_key_request, x_pinecone_api_version="2025-10", **kwargs ) -> APIKeyWithSecret: """Create an API key # noqa: E501 @@ -660,85 +515,53 @@ async def __create_api_key( 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 + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["project_id"] = project_id + kwargs["create_api_key_request"] = create_api_key_request return cast(APIKeyWithSecret, await self.call_with_http_info(**kwargs)) self.create_api_key = _AsyncioEndpoint( settings={ - 'response_type': (APIKeyWithSecret,), - 'auth': [ - 'BearerAuth' - ], - 'endpoint_path': '/admin/projects/{project_id}/api-keys', - 'operation_id': 'create_api_key', - 'http_method': 'POST', - 'servers': None, + "response_type": (APIKeyWithSecret,), + "auth": ["BearerAuth"], + "endpoint_path": "/admin/projects/{project_id}/api-keys", + "operation_id": "create_api_key", + "http_method": "POST", + "servers": None, }, params_map={ - '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': [ - ] + "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": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "project_id": (str,), + "create_api_key_request": (CreateAPIKeyRequest,), }, - 'openapi_types': { - 'x_pinecone_api_version': - (str,), - 'project_id': - (str,), - 'create_api_key_request': - (CreateAPIKeyRequest,), + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "project_id": "project_id", }, - '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", }, - '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' - ] + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__create_api_key + callable=__create_api_key, ) async def __delete_api_key( - self, - api_key_id, - x_pinecone_api_version="2025-10", - **kwargs + self, api_key_id, x_pinecone_api_version="2025-10", **kwargs ) -> None: """Delete an API key # noqa: E501 @@ -770,76 +593,44 @@ async def __delete_api_key( None """ self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['api_key_id'] = \ - api_key_id + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["api_key_id"] = api_key_id return cast(None, await self.call_with_http_info(**kwargs)) self.delete_api_key = _AsyncioEndpoint( settings={ - 'response_type': None, - 'auth': [ - 'BearerAuth' - ], - 'endpoint_path': '/admin/api-keys/{api_key_id}', - 'operation_id': 'delete_api_key', - 'http_method': 'DELETE', - 'servers': None, + "response_type": None, + "auth": ["BearerAuth"], + "endpoint_path": "/admin/api-keys/{api_key_id}", + "operation_id": "delete_api_key", + "http_method": "DELETE", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'api_key_id', - ], - 'required': [ - 'x_pinecone_api_version', - 'api_key_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "api_key_id"], + "required": ["x_pinecone_api_version", "api_key_id"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { + "validations": {}, + "allowed_values": {}, + "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", }, - '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': [], + "location_map": {"x_pinecone_api_version": "header", "api_key_id": "path"}, + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__delete_api_key + callable=__delete_api_key, ) async def __fetch_api_key( - self, - api_key_id, - x_pinecone_api_version="2025-10", - **kwargs + self, api_key_id, x_pinecone_api_version="2025-10", **kwargs ) -> APIKey: """Get API key details # noqa: E501 @@ -871,76 +662,44 @@ async def __fetch_api_key( APIKey """ self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['api_key_id'] = \ - api_key_id + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["api_key_id"] = api_key_id return cast(APIKey, await self.call_with_http_info(**kwargs)) self.fetch_api_key = _AsyncioEndpoint( settings={ - 'response_type': (APIKey,), - 'auth': [ - 'BearerAuth' - ], - 'endpoint_path': '/admin/api-keys/{api_key_id}', - 'operation_id': 'fetch_api_key', - 'http_method': 'GET', - 'servers': None, + "response_type": (APIKey,), + "auth": ["BearerAuth"], + "endpoint_path": "/admin/api-keys/{api_key_id}", + "operation_id": "fetch_api_key", + "http_method": "GET", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'api_key_id', - ], - 'required': [ - 'x_pinecone_api_version', - 'api_key_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "api_key_id"], + "required": ["x_pinecone_api_version", "api_key_id"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { + "validations": {}, + "allowed_values": {}, + "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", }, - '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': [], + "location_map": {"x_pinecone_api_version": "header", "api_key_id": "path"}, + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__fetch_api_key + callable=__fetch_api_key, ) async def __list_project_api_keys( - self, - project_id, - x_pinecone_api_version="2025-10", - **kwargs + self, project_id, x_pinecone_api_version="2025-10", **kwargs ) -> ListApiKeysResponse: """List API keys # noqa: E501 @@ -972,77 +731,44 @@ async def __list_project_api_keys( ListApiKeysResponse """ self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['project_id'] = \ - project_id + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["project_id"] = project_id return cast(ListApiKeysResponse, await self.call_with_http_info(**kwargs)) self.list_project_api_keys = _AsyncioEndpoint( settings={ - 'response_type': (ListApiKeysResponse,), - 'auth': [ - 'BearerAuth' - ], - 'endpoint_path': '/admin/projects/{project_id}/api-keys', - 'operation_id': 'list_project_api_keys', - 'http_method': 'GET', - 'servers': None, + "response_type": (ListApiKeysResponse,), + "auth": ["BearerAuth"], + "endpoint_path": "/admin/projects/{project_id}/api-keys", + "operation_id": "list_project_api_keys", + "http_method": "GET", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'project_id', - ], - 'required': [ - 'x_pinecone_api_version', - 'project_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "project_id"], + "required": ["x_pinecone_api_version", "project_id"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { + "validations": {}, + "allowed_values": {}, + "openapi_types": {"x_pinecone_api_version": (str,), "project_id": (str,)}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "project_id": "project_id", }, - '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': [], + "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_project_api_keys + callable=__list_project_api_keys, ) async def __update_api_key( - self, - api_key_id, - update_api_key_request, - x_pinecone_api_version="2025-10", - **kwargs + self, api_key_id, update_api_key_request, x_pinecone_api_version="2025-10", **kwargs ) -> APIKey: """Update an API key # noqa: E501 @@ -1075,76 +801,47 @@ async def __update_api_key( 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 + 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 cast(APIKey, 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, + "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': [ - ] + "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': { + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "api_key_id": (str,), + "update_api_key_request": (UpdateAPIKeyRequest,), }, - 'allowed_values': { + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "api_key_id": "api_key_id", }, - 'openapi_types': { - 'x_pinecone_api_version': - (str,), - 'api_key_id': - (str,), - 'update_api_key_request': - (UpdateAPIKeyRequest,), + "location_map": { + "x_pinecone_api_version": "header", + "api_key_id": "path", + "update_api_key_request": "body", }, - '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' - ] + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__update_api_key + callable=__update_api_key, ) diff --git a/pinecone/core/openapi/admin/api/organizations_api.py b/pinecone/core/openapi/admin/api/organizations_api.py index 7a6ecc0b7..cdbc7a8d3 100644 --- a/pinecone/core/openapi/admin/api/organizations_api.py +++ b/pinecone/core/openapi/admin/api/organizations_api.py @@ -1,24 +1,24 @@ """ - Pinecone Admin API +Pinecone Admin API - Provides an API for managing a Pinecone organization and its resources. # noqa: E501 +Provides an API for managing a Pinecone organization and its resources. # noqa: E501 - This file is @generated using OpenAPI. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from __future__ import annotations from typing import TYPE_CHECKING, Any, Dict, cast - -if TYPE_CHECKING: - from multiprocessing.pool import ApplyResult +from multiprocessing.pool import ApplyResult from pinecone.openapi_support import ApiClient, AsyncioApiClient -from pinecone.openapi_support.endpoint_utils import ExtraOpenApiKwargsTypedDict, KwargsWithOpenApiKwargDefaultsTypedDict +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 @@ -26,7 +26,7 @@ datetime, file_type, none_type, - validate_and_convert_types + validate_and_convert_types, ) from pinecone.core.openapi.admin.model.error_response import ErrorResponse from pinecone.core.openapi.admin.model.organization import Organization @@ -49,7 +49,7 @@ def __delete_organization( self, organization_id, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict + **kwargs: ExtraOpenApiKwargsTypedDict, ) -> None: """Delete an organization # noqa: E501 @@ -88,76 +88,47 @@ def __delete_organization( thread. """ kwargs = self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['organization_id'] = \ - organization_id + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["organization_id"] = organization_id return cast(None, 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, + "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': [ - ] + "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,), + "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", }, - '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': [], + "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 + callable=__delete_organization, ) def __fetch_organization( self, organization_id, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict + **kwargs: ExtraOpenApiKwargsTypedDict, ) -> Organization | ApplyResult[Organization]: """Get organization details # noqa: E501 @@ -196,75 +167,46 @@ def __fetch_organization( thread. """ kwargs = self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['organization_id'] = \ - organization_id - return cast(Organization | ApplyResult[Organization], self.call_with_http_info(**kwargs)) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["organization_id"] = organization_id + return cast( + Organization | ApplyResult[Organization], 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, + "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': [ - ] + "all": ["x_pinecone_api_version", "organization_id"], + "required": ["x_pinecone_api_version", "organization_id"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { + "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", }, - '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': [], + "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 + callable=__fetch_organization, ) def __list_organizations( - self, - x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict + self, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict ) -> OrganizationList | ApplyResult[OrganizationList]: """List organizations # noqa: E501 @@ -302,61 +244,38 @@ def __list_organizations( thread. """ kwargs = self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - return cast(OrganizationList | ApplyResult[OrganizationList], self.call_with_http_info(**kwargs)) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + return cast( + OrganizationList | ApplyResult[OrganizationList], 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, + "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': [ - ] + "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': [], - }, + "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 + callable=__list_organizations, ) def __update_organization( @@ -364,7 +283,7 @@ def __update_organization( organization_id, update_organization_request, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict + **kwargs: ExtraOpenApiKwargsTypedDict, ) -> Organization | ApplyResult[Organization]: """Update an organization # noqa: E501 @@ -404,82 +323,58 @@ def __update_organization( 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 cast(Organization | ApplyResult[Organization], self.call_with_http_info(**kwargs)) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["organization_id"] = organization_id + kwargs["update_organization_request"] = update_organization_request + return cast( + Organization | ApplyResult[Organization], 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, + "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': [ + "all": ["x_pinecone_api_version", "organization_id", "update_organization_request"], + "required": [ + "x_pinecone_api_version", + "organization_id", + "update_organization_request", ], - 'validation': [ - ] + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "organization_id": (str,), + "update_organization_request": (UpdateOrganizationRequest,), }, - 'allowed_values': { + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "organization_id": "organization_id", }, - 'openapi_types': { - 'x_pinecone_api_version': - (str,), - 'organization_id': - (str,), - 'update_organization_request': - (UpdateOrganizationRequest,), + "location_map": { + "x_pinecone_api_version": "header", + "organization_id": "path", + "update_organization_request": "body", }, - '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' - ] + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__update_organization + callable=__update_organization, ) - class AsyncioOrganizationsApi: """NOTE: This class is @generated using OpenAPI @@ -492,10 +387,7 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client async def __delete_organization( - self, - organization_id, - x_pinecone_api_version="2025-10", - **kwargs + self, organization_id, x_pinecone_api_version="2025-10", **kwargs ) -> None: """Delete an organization # noqa: E501 @@ -527,76 +419,44 @@ async def __delete_organization( None """ self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['organization_id'] = \ - organization_id + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["organization_id"] = organization_id return cast(None, 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, + "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': [ - ] + "all": ["x_pinecone_api_version", "organization_id"], + "required": ["x_pinecone_api_version", "organization_id"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { + "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", }, - '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': [], + "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 + callable=__delete_organization, ) async def __fetch_organization( - self, - organization_id, - x_pinecone_api_version="2025-10", - **kwargs + self, organization_id, x_pinecone_api_version="2025-10", **kwargs ) -> Organization: """Get organization details # noqa: E501 @@ -628,75 +488,44 @@ async def __fetch_organization( Organization """ self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['organization_id'] = \ - organization_id + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["organization_id"] = organization_id return cast(Organization, 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, + "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': [ - ] + "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', + "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", }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], + "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 + callable=__fetch_organization, ) async def __list_organizations( - self, - x_pinecone_api_version="2025-10", - **kwargs + self, x_pinecone_api_version="2025-10", **kwargs ) -> OrganizationList: """List organizations # noqa: E501 @@ -727,61 +556,36 @@ async def __list_organizations( OrganizationList """ self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version + kwargs["x_pinecone_api_version"] = x_pinecone_api_version return cast(OrganizationList, 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, + "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': [ - ] + "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': [], - }, + "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 + callable=__list_organizations, ) async def __update_organization( @@ -789,7 +593,7 @@ async def __update_organization( organization_id, update_organization_request, x_pinecone_api_version="2025-10", - **kwargs + **kwargs, ) -> Organization: """Update an organization # noqa: E501 @@ -822,76 +626,51 @@ async def __update_organization( 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 + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["organization_id"] = organization_id + kwargs["update_organization_request"] = update_organization_request return cast(Organization, 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, + "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', + "all": ["x_pinecone_api_version", "organization_id", "update_organization_request"], + "required": [ + "x_pinecone_api_version", + "organization_id", + "update_organization_request", ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "organization_id": (str,), + "update_organization_request": (UpdateOrganizationRequest,), }, - '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", }, - '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", }, - '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' - ] + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__update_organization + callable=__update_organization, ) diff --git a/pinecone/core/openapi/admin/api/projects_api.py b/pinecone/core/openapi/admin/api/projects_api.py index 3d46f8939..1d1849ddf 100644 --- a/pinecone/core/openapi/admin/api/projects_api.py +++ b/pinecone/core/openapi/admin/api/projects_api.py @@ -1,24 +1,24 @@ """ - Pinecone Admin API +Pinecone Admin API - Provides an API for managing a Pinecone organization and its resources. # noqa: E501 +Provides an API for managing a Pinecone organization and its resources. # noqa: E501 - This file is @generated using OpenAPI. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from __future__ import annotations from typing import TYPE_CHECKING, Any, Dict, cast - -if TYPE_CHECKING: - from multiprocessing.pool import ApplyResult +from multiprocessing.pool import ApplyResult from pinecone.openapi_support import ApiClient, AsyncioApiClient -from pinecone.openapi_support.endpoint_utils import ExtraOpenApiKwargsTypedDict, KwargsWithOpenApiKwargDefaultsTypedDict +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 @@ -26,7 +26,7 @@ datetime, file_type, none_type, - validate_and_convert_types + validate_and_convert_types, ) from pinecone.core.openapi.admin.model.create_project_request import CreateProjectRequest from pinecone.core.openapi.admin.model.error_response import ErrorResponse @@ -50,7 +50,7 @@ def __create_project( self, create_project_request, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict + **kwargs: ExtraOpenApiKwargsTypedDict, ) -> Project | ApplyResult[Project]: """Create a new project # noqa: E501 @@ -89,77 +89,50 @@ def __create_project( thread. """ kwargs = self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['create_project_request'] = \ - create_project_request + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["create_project_request"] = create_project_request return cast(Project | ApplyResult[Project], self.call_with_http_info(**kwargs)) self.create_project = _Endpoint( settings={ - 'response_type': (Project,), - 'auth': [ - 'BearerAuth' - ], - 'endpoint_path': '/admin/projects', - 'operation_id': 'create_project', - 'http_method': 'POST', - 'servers': None, + "response_type": (Project,), + "auth": ["BearerAuth"], + "endpoint_path": "/admin/projects", + "operation_id": "create_project", + "http_method": "POST", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'create_project_request', - ], - 'required': [ - 'x_pinecone_api_version', - 'create_project_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "create_project_request"], + "required": ["x_pinecone_api_version", "create_project_request"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_pinecone_api_version': - (str,), - 'create_project_request': - (CreateProjectRequest,), + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "create_project_request": (CreateProjectRequest,), }, - 'attribute_map': { - 'x_pinecone_api_version': 'X-Pinecone-Api-Version', + "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, + "location_map": { + "x_pinecone_api_version": "header", + "create_project_request": "body", }, - 'location_map': { - 'x_pinecone_api_version': 'header', - 'create_project_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__create_project + callable=__create_project, ) def __delete_project( self, project_id, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict + **kwargs: ExtraOpenApiKwargsTypedDict, ) -> None: """Delete a project # noqa: E501 @@ -198,76 +171,47 @@ def __delete_project( thread. """ kwargs = self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['project_id'] = \ - project_id + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["project_id"] = project_id return cast(None, self.call_with_http_info(**kwargs)) self.delete_project = _Endpoint( settings={ - 'response_type': None, - 'auth': [ - 'BearerAuth' - ], - 'endpoint_path': '/admin/projects/{project_id}', - 'operation_id': 'delete_project', - 'http_method': 'DELETE', - 'servers': None, + "response_type": None, + "auth": ["BearerAuth"], + "endpoint_path": "/admin/projects/{project_id}", + "operation_id": "delete_project", + "http_method": "DELETE", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'project_id', - ], - 'required': [ - 'x_pinecone_api_version', - 'project_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "project_id"], + "required": ["x_pinecone_api_version", "project_id"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_pinecone_api_version': - (str,), - 'project_id': - (str,), + "validations": {}, + "allowed_values": {}, + "openapi_types": {"x_pinecone_api_version": (str,), "project_id": (str,)}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "project_id": "project_id", }, - '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': [], + "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=__delete_project + callable=__delete_project, ) def __fetch_project( self, project_id, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict + **kwargs: ExtraOpenApiKwargsTypedDict, ) -> Project | ApplyResult[Project]: """Get project details # noqa: E501 @@ -306,75 +250,44 @@ def __fetch_project( thread. """ kwargs = self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['project_id'] = \ - project_id + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["project_id"] = project_id return cast(Project | ApplyResult[Project], self.call_with_http_info(**kwargs)) self.fetch_project = _Endpoint( settings={ - 'response_type': (Project,), - 'auth': [ - 'BearerAuth' - ], - 'endpoint_path': '/admin/projects/{project_id}', - 'operation_id': 'fetch_project', - 'http_method': 'GET', - 'servers': None, + "response_type": (Project,), + "auth": ["BearerAuth"], + "endpoint_path": "/admin/projects/{project_id}", + "operation_id": "fetch_project", + "http_method": "GET", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'project_id', - ], - 'required': [ - 'x_pinecone_api_version', - 'project_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "project_id"], + "required": ["x_pinecone_api_version", "project_id"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_pinecone_api_version': - (str,), - 'project_id': - (str,), + "validations": {}, + "allowed_values": {}, + "openapi_types": {"x_pinecone_api_version": (str,), "project_id": (str,)}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "project_id": "project_id", }, - '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': [], + "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=__fetch_project + callable=__fetch_project, ) def __list_projects( - self, - x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict + self, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict ) -> ProjectList | ApplyResult[ProjectList]: """List projects # noqa: E501 @@ -412,61 +325,36 @@ def __list_projects( thread. """ kwargs = self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version + kwargs["x_pinecone_api_version"] = x_pinecone_api_version return cast(ProjectList | ApplyResult[ProjectList], self.call_with_http_info(**kwargs)) self.list_projects = _Endpoint( settings={ - 'response_type': (ProjectList,), - 'auth': [ - 'BearerAuth' - ], - 'endpoint_path': '/admin/projects', - 'operation_id': 'list_projects', - 'http_method': 'GET', - 'servers': None, + "response_type": (ProjectList,), + "auth": ["BearerAuth"], + "endpoint_path": "/admin/projects", + "operation_id": "list_projects", + "http_method": "GET", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - ], - 'required': [ - 'x_pinecone_api_version', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "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': [], - }, + "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_projects + callable=__list_projects, ) def __update_project( @@ -474,7 +362,7 @@ def __update_project( project_id, update_project_request, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict + **kwargs: ExtraOpenApiKwargsTypedDict, ) -> Project | ApplyResult[Project]: """Update a project # noqa: E501 @@ -514,82 +402,52 @@ 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 + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["project_id"] = project_id + kwargs["update_project_request"] = update_project_request return cast(Project | ApplyResult[Project], self.call_with_http_info(**kwargs)) self.update_project = _Endpoint( settings={ - 'response_type': (Project,), - 'auth': [ - 'BearerAuth' - ], - 'endpoint_path': '/admin/projects/{project_id}', - 'operation_id': 'update_project', - 'http_method': 'PATCH', - 'servers': None, + "response_type": (Project,), + "auth": ["BearerAuth"], + "endpoint_path": "/admin/projects/{project_id}", + "operation_id": "update_project", + "http_method": "PATCH", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'project_id', - 'update_project_request', - ], - 'required': [ - 'x_pinecone_api_version', - 'project_id', - 'update_project_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "project_id", "update_project_request"], + "required": ["x_pinecone_api_version", "project_id", "update_project_request"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "project_id": (str,), + "update_project_request": (UpdateProjectRequest,), }, - 'openapi_types': { - 'x_pinecone_api_version': - (str,), - 'project_id': - (str,), - 'update_project_request': - (UpdateProjectRequest,), + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "project_id": "project_id", }, - '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", }, - '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' - ] + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__update_project + callable=__update_project, ) - class AsyncioProjectsApi: """NOTE: This class is @generated using OpenAPI @@ -602,10 +460,7 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client async def __create_project( - self, - create_project_request, - x_pinecone_api_version="2025-10", - **kwargs + self, create_project_request, x_pinecone_api_version="2025-10", **kwargs ) -> Project: """Create a new project # noqa: E501 @@ -637,77 +492,47 @@ async def __create_project( Project """ self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['create_project_request'] = \ - create_project_request + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["create_project_request"] = create_project_request return cast(Project, await self.call_with_http_info(**kwargs)) self.create_project = _AsyncioEndpoint( settings={ - 'response_type': (Project,), - 'auth': [ - 'BearerAuth' - ], - 'endpoint_path': '/admin/projects', - 'operation_id': 'create_project', - 'http_method': 'POST', - 'servers': None, + "response_type": (Project,), + "auth": ["BearerAuth"], + "endpoint_path": "/admin/projects", + "operation_id": "create_project", + "http_method": "POST", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'create_project_request', - ], - 'required': [ - 'x_pinecone_api_version', - 'create_project_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "create_project_request"], + "required": ["x_pinecone_api_version", "create_project_request"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_pinecone_api_version': - (str,), - 'create_project_request': - (CreateProjectRequest,), + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "create_project_request": (CreateProjectRequest,), }, - 'attribute_map': { - 'x_pinecone_api_version': 'X-Pinecone-Api-Version', + "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, + "location_map": { + "x_pinecone_api_version": "header", + "create_project_request": "body", }, - 'location_map': { - 'x_pinecone_api_version': 'header', - 'create_project_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__create_project + callable=__create_project, ) async def __delete_project( - self, - project_id, - x_pinecone_api_version="2025-10", - **kwargs + self, project_id, x_pinecone_api_version="2025-10", **kwargs ) -> None: """Delete a project # noqa: E501 @@ -739,76 +564,44 @@ async def __delete_project( None """ self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['project_id'] = \ - project_id + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["project_id"] = project_id return cast(None, await self.call_with_http_info(**kwargs)) self.delete_project = _AsyncioEndpoint( settings={ - 'response_type': None, - 'auth': [ - 'BearerAuth' - ], - 'endpoint_path': '/admin/projects/{project_id}', - 'operation_id': 'delete_project', - 'http_method': 'DELETE', - 'servers': None, + "response_type": None, + "auth": ["BearerAuth"], + "endpoint_path": "/admin/projects/{project_id}", + "operation_id": "delete_project", + "http_method": "DELETE", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'project_id', - ], - 'required': [ - 'x_pinecone_api_version', - 'project_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "project_id"], + "required": ["x_pinecone_api_version", "project_id"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { - }, - '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', + "validations": {}, + "allowed_values": {}, + "openapi_types": {"x_pinecone_api_version": (str,), "project_id": (str,)}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "project_id": "project_id", }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], + "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=__delete_project + callable=__delete_project, ) async def __fetch_project( - self, - project_id, - x_pinecone_api_version="2025-10", - **kwargs + self, project_id, x_pinecone_api_version="2025-10", **kwargs ) -> Project: """Get project details # noqa: E501 @@ -840,76 +633,43 @@ async def __fetch_project( Project """ self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['project_id'] = \ - project_id + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["project_id"] = project_id return cast(Project, await self.call_with_http_info(**kwargs)) self.fetch_project = _AsyncioEndpoint( settings={ - 'response_type': (Project,), - 'auth': [ - 'BearerAuth' - ], - 'endpoint_path': '/admin/projects/{project_id}', - 'operation_id': 'fetch_project', - 'http_method': 'GET', - 'servers': None, + "response_type": (Project,), + "auth": ["BearerAuth"], + "endpoint_path": "/admin/projects/{project_id}", + "operation_id": "fetch_project", + "http_method": "GET", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'project_id', - ], - 'required': [ - 'x_pinecone_api_version', - 'project_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "project_id"], + "required": ["x_pinecone_api_version", "project_id"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { - }, - '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', + "validations": {}, + "allowed_values": {}, + "openapi_types": {"x_pinecone_api_version": (str,), "project_id": (str,)}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "project_id": "project_id", }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], + "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=__fetch_project + callable=__fetch_project, ) - async def __list_projects( - self, - x_pinecone_api_version="2025-10", - **kwargs - ) -> ProjectList: + async def __list_projects(self, x_pinecone_api_version="2025-10", **kwargs) -> ProjectList: """List projects # noqa: E501 List all projects in an organization. # noqa: E501 @@ -939,69 +699,40 @@ async def __list_projects( ProjectList """ self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version + kwargs["x_pinecone_api_version"] = x_pinecone_api_version return cast(ProjectList, await self.call_with_http_info(**kwargs)) self.list_projects = _AsyncioEndpoint( settings={ - 'response_type': (ProjectList,), - 'auth': [ - 'BearerAuth' - ], - 'endpoint_path': '/admin/projects', - 'operation_id': 'list_projects', - 'http_method': 'GET', - 'servers': None, + "response_type": (ProjectList,), + "auth": ["BearerAuth"], + "endpoint_path": "/admin/projects", + "operation_id": "list_projects", + "http_method": "GET", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - ], - 'required': [ - 'x_pinecone_api_version', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "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': [], - }, + "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_projects + callable=__list_projects, ) async def __update_project( - self, - project_id, - update_project_request, - x_pinecone_api_version="2025-10", - **kwargs + self, project_id, update_project_request, x_pinecone_api_version="2025-10", **kwargs ) -> Project: """Update a project # noqa: E501 @@ -1034,76 +765,47 @@ async def __update_project( 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 + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["project_id"] = project_id + kwargs["update_project_request"] = update_project_request return cast(Project, await self.call_with_http_info(**kwargs)) self.update_project = _AsyncioEndpoint( settings={ - 'response_type': (Project,), - 'auth': [ - 'BearerAuth' - ], - 'endpoint_path': '/admin/projects/{project_id}', - 'operation_id': 'update_project', - 'http_method': 'PATCH', - 'servers': None, + "response_type": (Project,), + "auth": ["BearerAuth"], + "endpoint_path": "/admin/projects/{project_id}", + "operation_id": "update_project", + "http_method": "PATCH", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'project_id', - 'update_project_request', - ], - 'required': [ - 'x_pinecone_api_version', - 'project_id', - 'update_project_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "project_id", "update_project_request"], + "required": ["x_pinecone_api_version", "project_id", "update_project_request"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "project_id": (str,), + "update_project_request": (UpdateProjectRequest,), }, - 'openapi_types': { - 'x_pinecone_api_version': - (str,), - 'project_id': - (str,), - 'update_project_request': - (UpdateProjectRequest,), + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "project_id": "project_id", }, - '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", }, - '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' - ] + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__update_project + callable=__update_project, ) diff --git a/pinecone/core/openapi/admin/apis/__init__.py b/pinecone/core/openapi/admin/apis/__init__.py index 1c7223890..2e2b8c23d 100644 --- a/pinecone/core/openapi/admin/apis/__init__.py +++ b/pinecone/core/openapi/admin/apis/__init__.py @@ -1,4 +1,3 @@ - # flake8: noqa # Import all APIs into this package. diff --git a/pinecone/core/openapi/admin/model/api_key.py b/pinecone/core/openapi/admin/model/api_key.py index aa4a293a9..bb8f27137 100644 --- a/pinecone/core/openapi/admin/model/api_key.py +++ b/pinecone/core/openapi/admin/model/api_key.py @@ -1,15 +1,14 @@ """ - Pinecone Admin API +Pinecone Admin API - Provides an API for managing a Pinecone organization and its resources. # noqa: E501 +Provides an API for managing a Pinecone organization and its resources. # noqa: E501 - This file is @generated using OpenAPI. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -28,7 +27,6 @@ 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 @@ -61,11 +59,9 @@ class APIKey(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -73,7 +69,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 """ - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -88,28 +84,26 @@ def openapi_types(cls): and the value is attribute type. """ return { - 'id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'project_id': (str,), # noqa: E501 - 'roles': ([str],), # noqa: E501 + "id": (str,), # noqa: E501 + "name": (str,), # noqa: E501 + "project_id": (str,), # noqa: E501 + "roles": ([str],), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'id': 'id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'project_id': 'project_id', # noqa: E501 - 'roles': 'roles', # noqa: E501 + "id": "id", # noqa: E501 + "name": "name", # noqa: E501 + "project_id": "project_id", # noqa: E501 + "roles": "roles", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of APIKey. @@ -122,8 +116,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], id, name, project_id, roles, *args, **kwargs) -> T: # noqa: E501 @@ -168,22 +160,20 @@ def _from_openapi_data(cls: Type[T], id, name, project_id, roles, *args, **kwarg _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', ()) + _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__, - ), + "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__,), ) @@ -202,25 +192,29 @@ def _from_openapi_data(cls: Type[T], id, name, project_id, roles, *args, **kwarg self.project_id = project_id self.roles = roles for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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, project_id, roles, *args, **kwargs) -> None: # noqa: E501 @@ -266,19 +260,17 @@ def __init__(self, id, name, project_id, roles, *args, **kwargs) -> None: # noq """ _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', ()) + _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__, - ), + "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__,), ) @@ -297,13 +289,17 @@ def __init__(self, id, name, project_id, roles, *args, **kwargs) -> None: # noq self.project_id = project_id self.roles = roles for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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/api_key_with_secret.py b/pinecone/core/openapi/admin/model/api_key_with_secret.py index bfaf75ab2..5f4afa2ab 100644 --- a/pinecone/core/openapi/admin/model/api_key_with_secret.py +++ b/pinecone/core/openapi/admin/model/api_key_with_secret.py @@ -1,15 +1,14 @@ """ - Pinecone Admin API +Pinecone Admin API - Provides an API for managing a Pinecone organization and its resources. # noqa: E501 +Provides an API for managing a Pinecone organization and its resources. # noqa: E501 - This file is @generated using OpenAPI. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -32,9 +31,11 @@ if TYPE_CHECKING: from pinecone.core.openapi.admin.model.api_key import APIKey + def lazy_import(): from pinecone.core.openapi.admin.model.api_key import APIKey - globals()['APIKey'] = APIKey + + globals()["APIKey"] = APIKey from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -69,11 +70,9 @@ class APIKeyWithSecret(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -82,7 +81,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -98,24 +97,22 @@ def openapi_types(cls): """ lazy_import() return { - 'key': (APIKey,), # noqa: E501 - 'value': (str,), # noqa: E501 + "key": (APIKey,), # noqa: E501 + "value": (str,), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'key': 'key', # noqa: E501 - 'value': 'value', # noqa: E501 + "key": "key", # noqa: E501 + "value": "value", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of APIKeyWithSecret. @@ -128,8 +125,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], key, value, *args, **kwargs) -> T: # noqa: E501 @@ -172,22 +167,20 @@ def _from_openapi_data(cls: Type[T], key, value, *args, **kwargs) -> T: # noqa: _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', ()) + _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__, - ), + "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__,), ) @@ -204,25 +197,29 @@ def _from_openapi_data(cls: Type[T], key, value, *args, **kwargs) -> T: # noqa: self.key = key self.value = value for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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, key, value, *args, **kwargs) -> None: # noqa: E501 @@ -266,19 +263,17 @@ def __init__(self, key, value, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -295,13 +290,17 @@ def __init__(self, key, value, *args, **kwargs) -> None: # noqa: E501 self.key = key self.value = value for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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/create_api_key_request.py b/pinecone/core/openapi/admin/model/create_api_key_request.py index 2c996d88c..bc24a641b 100644 --- a/pinecone/core/openapi/admin/model/create_api_key_request.py +++ b/pinecone/core/openapi/admin/model/create_api_key_request.py @@ -1,15 +1,14 @@ """ - Pinecone Admin API +Pinecone Admin API - Provides an API for managing a Pinecone organization and its resources. # noqa: E501 +Provides an API for managing a Pinecone organization and its resources. # noqa: E501 - This file is @generated using OpenAPI. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -28,7 +27,6 @@ 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 @@ -61,14 +59,10 @@ class CreateAPIKeyRequest(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ('name',): { - 'max_length': 80, - 'min_length': 1, - }, + ("name",): {"max_length": 80, "min_length": 1} } @cached_class_property @@ -77,7 +71,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 """ - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -92,24 +86,22 @@ def openapi_types(cls): and the value is attribute type. """ return { - 'name': (str,), # noqa: E501 - 'roles': ([str],), # noqa: E501 + "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 + "name": "name", # noqa: E501 + "roles": "roles", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of CreateAPIKeyRequest. @@ -122,8 +114,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], name, *args, **kwargs) -> T: # noqa: E501 @@ -166,22 +156,20 @@ def _from_openapi_data(cls: Type[T], name, *args, **kwargs) -> T: # noqa: E501 roles ([str]): The roles to create the API key with. Default is `[\"ProjectEditor\"]`. [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', ()) + _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__, - ), + "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__,), ) @@ -197,25 +185,29 @@ def _from_openapi_data(cls: Type[T], name, *args, **kwargs) -> T: # noqa: E501 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: + 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', - ]) + 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 @@ -259,19 +251,17 @@ def __init__(self, name, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -287,13 +277,17 @@ def __init__(self, name, *args, **kwargs) -> None: # noqa: E501 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: + 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.") + 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/create_project_request.py b/pinecone/core/openapi/admin/model/create_project_request.py index 09cd8b80f..b0574e27c 100644 --- a/pinecone/core/openapi/admin/model/create_project_request.py +++ b/pinecone/core/openapi/admin/model/create_project_request.py @@ -1,15 +1,14 @@ """ - Pinecone Admin API +Pinecone Admin API - Provides an API for managing a Pinecone organization and its resources. # noqa: E501 +Provides an API for managing a Pinecone organization and its resources. # noqa: E501 - This file is @generated using OpenAPI. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -28,7 +27,6 @@ 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 @@ -61,14 +59,10 @@ class CreateProjectRequest(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ('name',): { - 'max_length': 512, - 'min_length': 1, - }, + ("name",): {"max_length": 512, "min_length": 1} } @cached_class_property @@ -77,7 +71,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 """ - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -92,26 +86,24 @@ def openapi_types(cls): and the value is attribute type. """ return { - 'name': (str,), # noqa: E501 - 'max_pods': (int,), # noqa: E501 - 'force_encryption_with_cmek': (bool,), # noqa: E501 + "name": (str,), # noqa: E501 + "max_pods": (int,), # noqa: E501 + "force_encryption_with_cmek": (bool,), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'name': 'name', # noqa: E501 - 'max_pods': 'max_pods', # noqa: E501 - 'force_encryption_with_cmek': 'force_encryption_with_cmek', # noqa: E501 + "name": "name", # noqa: E501 + "max_pods": "max_pods", # noqa: E501 + "force_encryption_with_cmek": "force_encryption_with_cmek", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of CreateProjectRequest. @@ -124,8 +116,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], name, *args, **kwargs) -> T: # noqa: E501 @@ -169,22 +159,20 @@ def _from_openapi_data(cls: Type[T], name, *args, **kwargs) -> T: # noqa: E501 force_encryption_with_cmek (bool): Whether to force encryption with a customer-managed encryption key (CMEK). Default is `false`. [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', ()) + _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__, - ), + "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__,), ) @@ -200,25 +188,29 @@ def _from_openapi_data(cls: Type[T], name, *args, **kwargs) -> T: # noqa: E501 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: + 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', - ]) + 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 @@ -263,19 +255,17 @@ def __init__(self, name, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -291,13 +281,17 @@ def __init__(self, name, *args, **kwargs) -> None: # noqa: E501 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: + 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.") + 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/error_response.py b/pinecone/core/openapi/admin/model/error_response.py index 3637e05ad..e0684b5c8 100644 --- a/pinecone/core/openapi/admin/model/error_response.py +++ b/pinecone/core/openapi/admin/model/error_response.py @@ -1,15 +1,14 @@ """ - Pinecone Admin API +Pinecone Admin API - Provides an API for managing a Pinecone organization and its resources. # noqa: E501 +Provides an API for managing a Pinecone organization and its resources. # noqa: E501 - This file is @generated using OpenAPI. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -32,9 +31,11 @@ if TYPE_CHECKING: from pinecone.core.openapi.admin.model.error_response_error import ErrorResponseError + def lazy_import(): from pinecone.core.openapi.admin.model.error_response_error import ErrorResponseError - globals()['ErrorResponseError'] = ErrorResponseError + + globals()["ErrorResponseError"] = ErrorResponseError from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -69,11 +70,9 @@ class ErrorResponse(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -82,7 +81,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -98,24 +97,22 @@ def openapi_types(cls): """ lazy_import() return { - 'status': (int,), # noqa: E501 - 'error': (ErrorResponseError,), # noqa: E501 + "status": (int,), # noqa: E501 + "error": (ErrorResponseError,), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'status': 'status', # noqa: E501 - 'error': 'error', # noqa: E501 + "status": "status", # noqa: E501 + "error": "error", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ErrorResponse. @@ -128,8 +125,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], status, error, *args, **kwargs) -> T: # noqa: E501 @@ -172,22 +167,20 @@ def _from_openapi_data(cls: Type[T], status, error, *args, **kwargs) -> T: # no _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', ()) + _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__, - ), + "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__,), ) @@ -204,25 +197,29 @@ def _from_openapi_data(cls: Type[T], status, error, *args, **kwargs) -> T: # no self.status = status self.error = error for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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, status, error, *args, **kwargs) -> None: # noqa: E501 @@ -266,19 +263,17 @@ def __init__(self, status, error, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -295,13 +290,17 @@ def __init__(self, status, error, *args, **kwargs) -> None: # noqa: E501 self.status = status self.error = error for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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/error_response_error.py b/pinecone/core/openapi/admin/model/error_response_error.py index 2016eab99..6443ea723 100644 --- a/pinecone/core/openapi/admin/model/error_response_error.py +++ b/pinecone/core/openapi/admin/model/error_response_error.py @@ -1,15 +1,14 @@ """ - Pinecone Admin API +Pinecone Admin API - Provides an API for managing a Pinecone organization and its resources. # noqa: E501 +Provides an API for managing a Pinecone organization and its resources. # noqa: E501 - This file is @generated using OpenAPI. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -28,7 +27,6 @@ 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 @@ -61,11 +59,9 @@ class ErrorResponseError(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -73,7 +69,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 """ - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -88,26 +84,24 @@ def openapi_types(cls): and the value is attribute type. """ return { - 'code': (str,), # noqa: E501 - 'message': (str,), # noqa: E501 - 'details': (Dict[str, Any],), # noqa: E501 + "code": (str,), # noqa: E501 + "message": (str,), # noqa: E501 + "details": (Dict[str, Any],), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'code': 'code', # noqa: E501 - 'message': 'message', # noqa: E501 - 'details': 'details', # noqa: E501 + "code": "code", # noqa: E501 + "message": "message", # noqa: E501 + "details": "details", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ErrorResponseError. @@ -120,8 +114,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], code, message, *args, **kwargs) -> T: # noqa: E501 @@ -165,22 +157,20 @@ def _from_openapi_data(cls: Type[T], code, message, *args, **kwargs) -> T: # no details (Dict[str, Any]): Additional information about the error. This field is not guaranteed to be present. [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', ()) + _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__, - ), + "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__,), ) @@ -197,25 +187,29 @@ def _from_openapi_data(cls: Type[T], code, message, *args, **kwargs) -> T: # no self.code = code self.message = message for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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, code, message, *args, **kwargs) -> None: # noqa: E501 @@ -260,19 +254,17 @@ def __init__(self, code, message, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -289,13 +281,17 @@ def __init__(self, code, message, *args, **kwargs) -> None: # noqa: E501 self.code = code self.message = message for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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/list_api_keys_response.py b/pinecone/core/openapi/admin/model/list_api_keys_response.py index 1ffa01217..3b83213f8 100644 --- a/pinecone/core/openapi/admin/model/list_api_keys_response.py +++ b/pinecone/core/openapi/admin/model/list_api_keys_response.py @@ -1,15 +1,14 @@ """ - Pinecone Admin API +Pinecone Admin API - Provides an API for managing a Pinecone organization and its resources. # noqa: E501 +Provides an API for managing a Pinecone organization and its resources. # noqa: E501 - This file is @generated using OpenAPI. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -32,9 +31,11 @@ if TYPE_CHECKING: from pinecone.core.openapi.admin.model.api_key import APIKey + def lazy_import(): from pinecone.core.openapi.admin.model.api_key import APIKey - globals()['APIKey'] = APIKey + + globals()["APIKey"] = APIKey from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -69,11 +70,9 @@ class ListApiKeysResponse(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -82,7 +81,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -98,22 +97,20 @@ def openapi_types(cls): """ lazy_import() return { - 'data': ([APIKey],), # noqa: E501 + "data": ([APIKey],) # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'data': 'data', # noqa: E501 + "data": "data" # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ListApiKeysResponse. @@ -126,8 +123,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], data, *args, **kwargs) -> T: # noqa: E501 @@ -169,22 +164,20 @@ def _from_openapi_data(cls: Type[T], data, *args, **kwargs) -> T: # noqa: E501 _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', ()) + _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__, - ), + "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__,), ) @@ -200,25 +193,29 @@ def _from_openapi_data(cls: Type[T], data, *args, **kwargs) -> T: # noqa: E501 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: + 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', - ]) + 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 @@ -261,19 +258,17 @@ def __init__(self, data, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -289,13 +284,17 @@ def __init__(self, data, *args, **kwargs) -> None: # noqa: E501 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: + 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.") + 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.py b/pinecone/core/openapi/admin/model/organization.py index 6d12eb263..2b2fdaa78 100644 --- a/pinecone/core/openapi/admin/model/organization.py +++ b/pinecone/core/openapi/admin/model/organization.py @@ -1,15 +1,14 @@ """ - Pinecone Admin API +Pinecone Admin API - Provides an API for managing a Pinecone organization and its resources. # noqa: E501 +Provides an API for managing a Pinecone organization and its resources. # noqa: E501 - This file is @generated using OpenAPI. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -28,7 +27,6 @@ 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 @@ -61,14 +59,10 @@ class Organization(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ('name',): { - 'max_length': 512, - 'min_length': 1, - }, + ("name",): {"max_length": 512, "min_length": 1} } @cached_class_property @@ -77,7 +71,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 """ - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -92,32 +86,30 @@ def openapi_types(cls): 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 + "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 + "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([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of Organization. @@ -130,11 +122,11 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @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 + 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: @@ -178,22 +170,20 @@ def _from_openapi_data(cls: Type[T], id, name, plan, payment_status, created_at, _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', ()) + _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__, - ), + "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__,), ) @@ -214,28 +204,34 @@ def _from_openapi_data(cls: Type[T], id, name, plan, payment_status, created_at, 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: + 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', - ]) + 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 + def __init__( + self, id, name, plan, payment_status, created_at, support_tier, *args, **kwargs + ) -> None: # noqa: E501 """Organization - a model defined in OpenAPI Args: @@ -280,19 +276,17 @@ def __init__(self, id, name, plan, payment_status, created_at, support_tier, *ar """ _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', ()) + _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__, - ), + "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__,), ) @@ -313,13 +307,17 @@ def __init__(self, id, name, plan, payment_status, created_at, support_tier, *ar 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: + 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.") + 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 index 59d3503bd..ad7141554 100644 --- a/pinecone/core/openapi/admin/model/organization_list.py +++ b/pinecone/core/openapi/admin/model/organization_list.py @@ -1,15 +1,14 @@ """ - Pinecone Admin API +Pinecone Admin API - Provides an API for managing a Pinecone organization and its resources. # noqa: E501 +Provides an API for managing a Pinecone organization and its resources. # noqa: E501 - This file is @generated using OpenAPI. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -32,9 +31,11 @@ if TYPE_CHECKING: from pinecone.core.openapi.admin.model.organization import Organization + def lazy_import(): from pinecone.core.openapi.admin.model.organization import Organization - globals()['Organization'] = Organization + + globals()["Organization"] = Organization from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -69,11 +70,9 @@ class OrganizationList(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -82,7 +81,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -98,22 +97,20 @@ def openapi_types(cls): """ lazy_import() return { - 'data': ([Organization],), # noqa: E501 + "data": ([Organization],) # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'data': 'data', # noqa: E501 + "data": "data" # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of OrganizationList. @@ -126,8 +123,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], data, *args, **kwargs) -> T: # noqa: E501 @@ -169,22 +164,20 @@ def _from_openapi_data(cls: Type[T], data, *args, **kwargs) -> T: # noqa: E501 _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', ()) + _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__, - ), + "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__,), ) @@ -200,25 +193,29 @@ def _from_openapi_data(cls: Type[T], data, *args, **kwargs) -> T: # noqa: E501 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: + 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', - ]) + 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 @@ -261,19 +258,17 @@ def __init__(self, data, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -289,13 +284,17 @@ def __init__(self, data, *args, **kwargs) -> None: # noqa: E501 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: + 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.") + 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 b24ee1151..7a641d12a 100644 --- a/pinecone/core/openapi/admin/model/project.py +++ b/pinecone/core/openapi/admin/model/project.py @@ -1,15 +1,14 @@ """ - Pinecone Admin API +Pinecone Admin API - Provides an API for managing a Pinecone organization and its resources. # noqa: E501 +Provides an API for managing a Pinecone organization and its resources. # noqa: E501 - This file is @generated using OpenAPI. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -28,7 +27,6 @@ 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 @@ -61,14 +59,10 @@ class Project(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ('name',): { - 'max_length': 512, - 'min_length': 1, - }, + ("name",): {"max_length": 512, "min_length": 1} } @cached_class_property @@ -77,7 +71,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 """ - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -92,32 +86,30 @@ def openapi_types(cls): and the value is attribute type. """ return { - 'id': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'max_pods': (int,), # noqa: E501 - 'force_encryption_with_cmek': (bool,), # noqa: E501 - 'organization_id': (str,), # noqa: E501 - 'created_at': (datetime,), # noqa: E501 + "id": (str,), # noqa: E501 + "name": (str,), # noqa: E501 + "max_pods": (int,), # noqa: E501 + "force_encryption_with_cmek": (bool,), # noqa: E501 + "organization_id": (str,), # noqa: E501 + "created_at": (datetime,), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'id': 'id', # noqa: E501 - 'name': 'name', # noqa: E501 - 'max_pods': 'max_pods', # noqa: E501 - 'force_encryption_with_cmek': 'force_encryption_with_cmek', # noqa: E501 - 'organization_id': 'organization_id', # noqa: E501 - 'created_at': 'created_at', # noqa: E501 + "id": "id", # noqa: E501 + "name": "name", # noqa: E501 + "max_pods": "max_pods", # noqa: E501 + "force_encryption_with_cmek": "force_encryption_with_cmek", # noqa: E501 + "organization_id": "organization_id", # noqa: E501 + "created_at": "created_at", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of Project. @@ -130,11 +122,18 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args - def _from_openapi_data(cls: Type[T], id, name, max_pods, force_encryption_with_cmek, organization_id, *args, **kwargs) -> T: # noqa: E501 + def _from_openapi_data( + cls: Type[T], + id, + name, + max_pods, + force_encryption_with_cmek, + organization_id, + *args, + **kwargs, + ) -> T: # noqa: E501 """Project - a model defined in OpenAPI Args: @@ -178,22 +177,20 @@ def _from_openapi_data(cls: Type[T], id, name, max_pods, force_encryption_with_c created_at (datetime): The date and time when the project was created. [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', ()) + _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__, - ), + "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__,), ) @@ -213,28 +210,34 @@ def _from_openapi_data(cls: Type[T], id, name, max_pods, force_encryption_with_c self.force_encryption_with_cmek = force_encryption_with_cmek self.organization_id = organization_id for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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, max_pods, force_encryption_with_cmek, organization_id, *args, **kwargs) -> None: # noqa: E501 + def __init__( + self, id, name, max_pods, force_encryption_with_cmek, organization_id, *args, **kwargs + ) -> None: # noqa: E501 """Project - a model defined in OpenAPI Args: @@ -279,19 +282,17 @@ def __init__(self, id, name, max_pods, force_encryption_with_cmek, organization_ """ _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', ()) + _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__, - ), + "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__,), ) @@ -311,13 +312,17 @@ def __init__(self, id, name, max_pods, force_encryption_with_cmek, organization_ self.force_encryption_with_cmek = force_encryption_with_cmek self.organization_id = organization_id for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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_list.py b/pinecone/core/openapi/admin/model/project_list.py index 82d704915..4811ef4d0 100644 --- a/pinecone/core/openapi/admin/model/project_list.py +++ b/pinecone/core/openapi/admin/model/project_list.py @@ -1,15 +1,14 @@ """ - Pinecone Admin API +Pinecone Admin API - Provides an API for managing a Pinecone organization and its resources. # noqa: E501 +Provides an API for managing a Pinecone organization and its resources. # noqa: E501 - This file is @generated using OpenAPI. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -32,9 +31,11 @@ if TYPE_CHECKING: from pinecone.core.openapi.admin.model.project import Project + def lazy_import(): from pinecone.core.openapi.admin.model.project import Project - globals()['Project'] = Project + + globals()["Project"] = Project from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -69,11 +70,9 @@ class ProjectList(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -82,7 +81,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -98,22 +97,20 @@ def openapi_types(cls): """ lazy_import() return { - 'data': ([Project],), # noqa: E501 + "data": ([Project],) # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'data': 'data', # noqa: E501 + "data": "data" # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ProjectList. @@ -126,8 +123,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], data, *args, **kwargs) -> T: # noqa: E501 @@ -169,22 +164,20 @@ def _from_openapi_data(cls: Type[T], data, *args, **kwargs) -> T: # noqa: E501 _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', ()) + _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__, - ), + "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__,), ) @@ -200,25 +193,29 @@ def _from_openapi_data(cls: Type[T], data, *args, **kwargs) -> T: # noqa: E501 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: + 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', - ]) + 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 @@ -261,19 +258,17 @@ def __init__(self, data, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -289,13 +284,17 @@ def __init__(self, data, *args, **kwargs) -> None: # noqa: E501 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: + 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.") + 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_api_key_request.py b/pinecone/core/openapi/admin/model/update_api_key_request.py index 40d84c342..101164ce4 100644 --- a/pinecone/core/openapi/admin/model/update_api_key_request.py +++ b/pinecone/core/openapi/admin/model/update_api_key_request.py @@ -1,15 +1,14 @@ """ - Pinecone Admin API +Pinecone Admin API - Provides an API for managing a Pinecone organization and its resources. # noqa: E501 +Provides an API for managing a Pinecone organization and its resources. # noqa: E501 - This file is @generated using OpenAPI. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -28,7 +27,6 @@ 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 @@ -61,14 +59,10 @@ class UpdateAPIKeyRequest(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ('name',): { - 'max_length': 80, - 'min_length': 1, - }, + ("name",): {"max_length": 80, "min_length": 1} } @cached_class_property @@ -77,7 +71,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 """ - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -92,24 +86,22 @@ def openapi_types(cls): and the value is attribute type. """ return { - 'name': (str,), # noqa: E501 - 'roles': ([str],), # noqa: E501 + "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 + "name": "name", # noqa: E501 + "roles": "roles", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of UpdateAPIKeyRequest. @@ -122,8 +114,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 @@ -164,22 +154,20 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # 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', ()) + _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__, - ), + "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__,), ) @@ -194,25 +182,29 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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 @@ -254,19 +246,17 @@ def __init__(self, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -281,13 +271,17 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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 index fdb30eef6..a537961b0 100644 --- a/pinecone/core/openapi/admin/model/update_organization_request.py +++ b/pinecone/core/openapi/admin/model/update_organization_request.py @@ -1,15 +1,14 @@ """ - Pinecone Admin API +Pinecone Admin API - Provides an API for managing a Pinecone organization and its resources. # noqa: E501 +Provides an API for managing a Pinecone organization and its resources. # noqa: E501 - This file is @generated using OpenAPI. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -28,7 +27,6 @@ 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 @@ -61,14 +59,10 @@ class UpdateOrganizationRequest(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ('name',): { - 'max_length': 512, - 'min_length': 1, - }, + ("name",): {"max_length": 512, "min_length": 1} } @cached_class_property @@ -77,7 +71,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 """ - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -92,22 +86,20 @@ def openapi_types(cls): and the value is attribute type. """ return { - 'name': (str,), # noqa: E501 + "name": (str,) # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'name': 'name', # noqa: E501 + "name": "name" # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of UpdateOrganizationRequest. @@ -120,8 +112,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 @@ -161,22 +151,20 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 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', ()) + _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__, - ), + "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__,), ) @@ -191,25 +179,29 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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 @@ -250,19 +242,17 @@ def __init__(self, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -277,13 +267,17 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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 0af2a3496..0cec6bc2d 100644 --- a/pinecone/core/openapi/admin/model/update_project_request.py +++ b/pinecone/core/openapi/admin/model/update_project_request.py @@ -1,15 +1,14 @@ """ - Pinecone Admin API +Pinecone Admin API - Provides an API for managing a Pinecone organization and its resources. # noqa: E501 +Provides an API for managing a Pinecone organization and its resources. # noqa: E501 - This file is @generated using OpenAPI. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -28,7 +27,6 @@ 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 @@ -61,14 +59,10 @@ class UpdateProjectRequest(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ('name',): { - 'max_length': 512, - 'min_length': 1, - }, + ("name",): {"max_length": 512, "min_length": 1} } @cached_class_property @@ -77,7 +71,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 """ - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -92,26 +86,24 @@ def openapi_types(cls): and the value is attribute type. """ return { - 'name': (str,), # noqa: E501 - 'max_pods': (int,), # noqa: E501 - 'force_encryption_with_cmek': (bool,), # noqa: E501 + "name": (str,), # noqa: E501 + "max_pods": (int,), # noqa: E501 + "force_encryption_with_cmek": (bool,), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'name': 'name', # noqa: E501 - 'max_pods': 'max_pods', # noqa: E501 - 'force_encryption_with_cmek': 'force_encryption_with_cmek', # noqa: E501 + "name": "name", # noqa: E501 + "max_pods": "max_pods", # noqa: E501 + "force_encryption_with_cmek": "force_encryption_with_cmek", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of UpdateProjectRequest. @@ -124,8 +116,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 @@ -167,22 +157,20 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 force_encryption_with_cmek (bool): Whether to force encryption with a customer-managed encryption key (CMEK). Once enabled, CMEK encryption cannot be disabled. [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', ()) + _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__, - ), + "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__,), ) @@ -197,25 +185,29 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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 @@ -258,19 +250,17 @@ def __init__(self, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -285,13 +275,17 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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/__init__.py b/pinecone/core/openapi/db_control/__init__.py index 905704fc1..52fc459de 100644 --- a/pinecone/core/openapi/db_control/__init__.py +++ b/pinecone/core/openapi/db_control/__init__.py @@ -1,17 +1,16 @@ # flake8: noqa """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - __version__ = "1.0.0" # import ApiClient @@ -27,4 +26,5 @@ from pinecone.openapi_support.exceptions import PineconeApiValueError from pinecone.openapi_support.exceptions import PineconeApiKeyError from pinecone.openapi_support.exceptions import PineconeApiException -API_VERSION = '2025-10' + +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 3e5d2e891..8190a4559 100644 --- a/pinecone/core/openapi/db_control/api/manage_indexes_api.py +++ b/pinecone/core/openapi/db_control/api/manage_indexes_api.py @@ -1,24 +1,24 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from __future__ import annotations from typing import TYPE_CHECKING, Any, Dict, cast - -if TYPE_CHECKING: - from multiprocessing.pool import ApplyResult +from multiprocessing.pool import ApplyResult from pinecone.openapi_support import ApiClient, AsyncioApiClient -from pinecone.openapi_support.endpoint_utils import ExtraOpenApiKwargsTypedDict, KwargsWithOpenApiKwargDefaultsTypedDict +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 @@ -26,7 +26,7 @@ datetime, file_type, none_type, - validate_and_convert_types + validate_and_convert_types, ) from pinecone.core.openapi.db_control.model.backup_list import BackupList from pinecone.core.openapi.db_control.model.backup_model import BackupModel @@ -35,9 +35,15 @@ from pinecone.core.openapi.db_control.model.configure_index_request import ConfigureIndexRequest from pinecone.core.openapi.db_control.model.create_backup_request import CreateBackupRequest from pinecone.core.openapi.db_control.model.create_collection_request import CreateCollectionRequest -from pinecone.core.openapi.db_control.model.create_index_for_model_request import CreateIndexForModelRequest -from pinecone.core.openapi.db_control.model.create_index_from_backup_request import CreateIndexFromBackupRequest -from pinecone.core.openapi.db_control.model.create_index_from_backup_response import CreateIndexFromBackupResponse +from pinecone.core.openapi.db_control.model.create_index_for_model_request import ( + CreateIndexForModelRequest, +) +from pinecone.core.openapi.db_control.model.create_index_from_backup_request import ( + CreateIndexFromBackupRequest, +) +from pinecone.core.openapi.db_control.model.create_index_from_backup_response import ( + CreateIndexFromBackupResponse, +) from pinecone.core.openapi.db_control.model.create_index_request import CreateIndexRequest from pinecone.core.openapi.db_control.model.error_response import ErrorResponse from pinecone.core.openapi.db_control.model.index_list import IndexList @@ -62,7 +68,7 @@ def __configure_index( index_name, configure_index_request, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict + **kwargs: ExtraOpenApiKwargsTypedDict, ) -> IndexModel | ApplyResult[IndexModel]: """Configure an index # noqa: E501 @@ -102,78 +108,49 @@ 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 + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["index_name"] = index_name + kwargs["configure_index_request"] = configure_index_request return cast(IndexModel | ApplyResult[IndexModel], self.call_with_http_info(**kwargs)) self.configure_index = _Endpoint( settings={ - 'response_type': (IndexModel,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/indexes/{index_name}', - 'operation_id': 'configure_index', - 'http_method': 'PATCH', - 'servers': None, + "response_type": (IndexModel,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/indexes/{index_name}", + "operation_id": "configure_index", + "http_method": "PATCH", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'index_name', - 'configure_index_request', - ], - 'required': [ - 'x_pinecone_api_version', - 'index_name', - 'configure_index_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "index_name", "configure_index_request"], + "required": ["x_pinecone_api_version", "index_name", "configure_index_request"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "index_name": (str,), + "configure_index_request": (ConfigureIndexRequest,), }, - 'openapi_types': { - 'x_pinecone_api_version': - (str,), - 'index_name': - (str,), - 'configure_index_request': - (ConfigureIndexRequest,), + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "index_name": "index_name", }, - '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", }, - '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' - ] + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__configure_index + callable=__configure_index, ) def __create_backup( @@ -181,7 +158,7 @@ def __create_backup( index_name, create_backup_request, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict + **kwargs: ExtraOpenApiKwargsTypedDict, ) -> BackupModel | ApplyResult[BackupModel]: """Create a backup of an index # noqa: E501 @@ -221,85 +198,56 @@ 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 + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["index_name"] = index_name + kwargs["create_backup_request"] = create_backup_request return cast(BackupModel | ApplyResult[BackupModel], self.call_with_http_info(**kwargs)) self.create_backup = _Endpoint( settings={ - 'response_type': (BackupModel,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/indexes/{index_name}/backups', - 'operation_id': 'create_backup', - 'http_method': 'POST', - 'servers': None, + "response_type": (BackupModel,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/indexes/{index_name}/backups", + "operation_id": "create_backup", + "http_method": "POST", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'index_name', - 'create_backup_request', - ], - 'required': [ - 'x_pinecone_api_version', - 'index_name', - 'create_backup_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "index_name", "create_backup_request"], + "required": ["x_pinecone_api_version", "index_name", "create_backup_request"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "index_name": (str,), + "create_backup_request": (CreateBackupRequest,), }, - 'openapi_types': { - 'x_pinecone_api_version': - (str,), - 'index_name': - (str,), - 'create_backup_request': - (CreateBackupRequest,), + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "index_name": "index_name", }, - '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", }, - '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' - ] + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__create_backup + callable=__create_backup, ) def __create_collection( self, create_collection_request, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict + **kwargs: ExtraOpenApiKwargsTypedDict, ) -> CollectionModel | ApplyResult[CollectionModel]: """Create a collection # noqa: E501 @@ -338,77 +286,52 @@ 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 cast(CollectionModel | ApplyResult[CollectionModel], self.call_with_http_info(**kwargs)) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["create_collection_request"] = create_collection_request + return cast( + CollectionModel | ApplyResult[CollectionModel], self.call_with_http_info(**kwargs) + ) self.create_collection = _Endpoint( settings={ - 'response_type': (CollectionModel,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/collections', - 'operation_id': 'create_collection', - 'http_method': 'POST', - 'servers': None, + "response_type": (CollectionModel,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/collections", + "operation_id": "create_collection", + "http_method": "POST", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'create_collection_request', - ], - 'required': [ - 'x_pinecone_api_version', - 'create_collection_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "create_collection_request"], + "required": ["x_pinecone_api_version", "create_collection_request"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "create_collection_request": (CreateCollectionRequest,), }, - '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", }, - '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' - ] + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__create_collection + callable=__create_collection, ) def __create_index( self, create_index_request, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict + **kwargs: ExtraOpenApiKwargsTypedDict, ) -> IndexModel | ApplyResult[IndexModel]: """Create an index # noqa: E501 @@ -447,77 +370,50 @@ def __create_index( thread. """ kwargs = self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['create_index_request'] = \ - create_index_request + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["create_index_request"] = create_index_request return cast(IndexModel | ApplyResult[IndexModel], self.call_with_http_info(**kwargs)) self.create_index = _Endpoint( settings={ - 'response_type': (IndexModel,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/indexes', - 'operation_id': 'create_index', - 'http_method': 'POST', - 'servers': None, + "response_type": (IndexModel,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/indexes", + "operation_id": "create_index", + "http_method": "POST", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'create_index_request', - ], - 'required': [ - 'x_pinecone_api_version', - 'create_index_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "create_index_request"], + "required": ["x_pinecone_api_version", "create_index_request"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_pinecone_api_version': - (str,), - 'create_index_request': - (CreateIndexRequest,), - }, - 'attribute_map': { - 'x_pinecone_api_version': 'X-Pinecone-Api-Version', + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "create_index_request": (CreateIndexRequest,), }, - 'location_map': { - 'x_pinecone_api_version': 'header', - 'create_index_request': 'body', + "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' - ] + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__create_index + callable=__create_index, ) def __create_index_for_model( self, create_index_for_model_request, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict + **kwargs: ExtraOpenApiKwargsTypedDict, ) -> IndexModel | ApplyResult[IndexModel]: """Create an index with integrated embedding # noqa: E501 @@ -556,70 +452,43 @@ 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 + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["create_index_for_model_request"] = create_index_for_model_request return cast(IndexModel | ApplyResult[IndexModel], self.call_with_http_info(**kwargs)) self.create_index_for_model = _Endpoint( settings={ - 'response_type': (IndexModel,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/indexes/create-for-model', - 'operation_id': 'create_index_for_model', - 'http_method': 'POST', - 'servers': None, + "response_type": (IndexModel,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/indexes/create-for-model", + "operation_id": "create_index_for_model", + "http_method": "POST", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'create_index_for_model_request', - ], - 'required': [ - 'x_pinecone_api_version', - 'create_index_for_model_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "create_index_for_model_request"], + "required": ["x_pinecone_api_version", "create_index_for_model_request"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "create_index_for_model_request": (CreateIndexForModelRequest,), }, - 'allowed_values': { + "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, + "location_map": { + "x_pinecone_api_version": "header", + "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' - ] + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__create_index_for_model + callable=__create_index_for_model, ) def __create_index_from_backup_operation( @@ -627,7 +496,7 @@ def __create_index_from_backup_operation( backup_id, create_index_from_backup_request, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict + **kwargs: ExtraOpenApiKwargsTypedDict, ) -> CreateIndexFromBackupResponse | ApplyResult[CreateIndexFromBackupResponse]: """Create an index from a backup # noqa: E501 @@ -667,85 +536,60 @@ 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 cast(CreateIndexFromBackupResponse | ApplyResult[CreateIndexFromBackupResponse], self.call_with_http_info(**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 cast( + CreateIndexFromBackupResponse | ApplyResult[CreateIndexFromBackupResponse], + self.call_with_http_info(**kwargs), + ) self.create_index_from_backup_operation = _Endpoint( settings={ - 'response_type': (CreateIndexFromBackupResponse,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/backups/{backup_id}/create-index', - 'operation_id': 'create_index_from_backup_operation', - 'http_method': 'POST', - 'servers': None, + "response_type": (CreateIndexFromBackupResponse,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/backups/{backup_id}/create-index", + "operation_id": "create_index_from_backup_operation", + "http_method": "POST", + "servers": None, }, params_map={ - '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': [ + "all": ["x_pinecone_api_version", "backup_id", "create_index_from_backup_request"], + "required": [ + "x_pinecone_api_version", + "backup_id", + "create_index_from_backup_request", ], - 'enum': [ - ], - 'validation': [ - ] + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_pinecone_api_version': - (str,), - 'backup_id': - (str,), - 'create_index_from_backup_request': - (CreateIndexFromBackupRequest,), + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "backup_id": (str,), + "create_index_from_backup_request": (CreateIndexFromBackupRequest,), }, - 'attribute_map': { - 'x_pinecone_api_version': 'X-Pinecone-Api-Version', - 'backup_id': 'backup_id', + "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', + "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' - ] + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__create_index_from_backup_operation + callable=__create_index_from_backup_operation, ) def __delete_backup( - self, - backup_id, - x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict + self, backup_id, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict ) -> None: """Delete a backup # noqa: E501 @@ -784,76 +628,47 @@ def __delete_backup( thread. """ kwargs = self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['backup_id'] = \ - backup_id + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["backup_id"] = backup_id return cast(None, self.call_with_http_info(**kwargs)) self.delete_backup = _Endpoint( settings={ - 'response_type': None, - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/backups/{backup_id}', - 'operation_id': 'delete_backup', - 'http_method': 'DELETE', - 'servers': None, + "response_type": None, + "auth": ["ApiKeyAuth"], + "endpoint_path": "/backups/{backup_id}", + "operation_id": "delete_backup", + "http_method": "DELETE", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'backup_id', - ], - 'required': [ - 'x_pinecone_api_version', - 'backup_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "backup_id"], + "required": ["x_pinecone_api_version", "backup_id"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_pinecone_api_version': - (str,), - 'backup_id': - (str,), + "validations": {}, + "allowed_values": {}, + "openapi_types": {"x_pinecone_api_version": (str,), "backup_id": (str,)}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "backup_id": "backup_id", }, - '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': [], + "location_map": {"x_pinecone_api_version": "header", "backup_id": "path"}, + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__delete_backup + callable=__delete_backup, ) def __delete_collection( self, collection_name, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict + **kwargs: ExtraOpenApiKwargsTypedDict, ) -> None: """Delete a collection # noqa: E501 @@ -892,76 +707,47 @@ def __delete_collection( thread. """ kwargs = self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['collection_name'] = \ - collection_name + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["collection_name"] = collection_name return cast(None, self.call_with_http_info(**kwargs)) self.delete_collection = _Endpoint( settings={ - 'response_type': None, - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/collections/{collection_name}', - 'operation_id': 'delete_collection', - 'http_method': 'DELETE', - 'servers': None, + "response_type": None, + "auth": ["ApiKeyAuth"], + "endpoint_path": "/collections/{collection_name}", + "operation_id": "delete_collection", + "http_method": "DELETE", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'collection_name', - ], - 'required': [ - 'x_pinecone_api_version', - 'collection_name', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "collection_name"], + "required": ["x_pinecone_api_version", "collection_name"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_pinecone_api_version': - (str,), - 'collection_name': - (str,), + "validations": {}, + "allowed_values": {}, + "openapi_types": {"x_pinecone_api_version": (str,), "collection_name": (str,)}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "collection_name": "collection_name", }, - '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': [], + "location_map": {"x_pinecone_api_version": "header", "collection_name": "path"}, + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__delete_collection + callable=__delete_collection, ) def __delete_index( self, index_name, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict + **kwargs: ExtraOpenApiKwargsTypedDict, ) -> None: """Delete an index # noqa: E501 @@ -1000,76 +786,44 @@ def __delete_index( thread. """ kwargs = self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['index_name'] = \ - index_name + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["index_name"] = index_name return cast(None, self.call_with_http_info(**kwargs)) self.delete_index = _Endpoint( settings={ - 'response_type': None, - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/indexes/{index_name}', - 'operation_id': 'delete_index', - 'http_method': 'DELETE', - 'servers': None, + "response_type": None, + "auth": ["ApiKeyAuth"], + "endpoint_path": "/indexes/{index_name}", + "operation_id": "delete_index", + "http_method": "DELETE", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'index_name', - ], - 'required': [ - 'x_pinecone_api_version', - 'index_name', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "index_name"], + "required": ["x_pinecone_api_version", "index_name"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_pinecone_api_version': - (str,), - 'index_name': - (str,), + "validations": {}, + "allowed_values": {}, + "openapi_types": {"x_pinecone_api_version": (str,), "index_name": (str,)}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "index_name": "index_name", }, - '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': [], + "location_map": {"x_pinecone_api_version": "header", "index_name": "path"}, + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__delete_index + callable=__delete_index, ) def __describe_backup( - self, - backup_id, - x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict + self, backup_id, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict ) -> BackupModel | ApplyResult[BackupModel]: """Describe a backup # noqa: E501 @@ -1108,76 +862,47 @@ def __describe_backup( thread. """ kwargs = self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['backup_id'] = \ - backup_id + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["backup_id"] = backup_id return cast(BackupModel | ApplyResult[BackupModel], self.call_with_http_info(**kwargs)) self.describe_backup = _Endpoint( settings={ - 'response_type': (BackupModel,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/backups/{backup_id}', - 'operation_id': 'describe_backup', - 'http_method': 'GET', - 'servers': None, + "response_type": (BackupModel,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/backups/{backup_id}", + "operation_id": "describe_backup", + "http_method": "GET", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'backup_id', - ], - 'required': [ - 'x_pinecone_api_version', - 'backup_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "backup_id"], + "required": ["x_pinecone_api_version", "backup_id"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_pinecone_api_version': - (str,), - 'backup_id': - (str,), - }, - 'attribute_map': { - 'x_pinecone_api_version': 'X-Pinecone-Api-Version', - 'backup_id': 'backup_id', + "validations": {}, + "allowed_values": {}, + "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': [], + "location_map": {"x_pinecone_api_version": "header", "backup_id": "path"}, + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__describe_backup + callable=__describe_backup, ) def __describe_collection( self, collection_name, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict + **kwargs: ExtraOpenApiKwargsTypedDict, ) -> CollectionModel | ApplyResult[CollectionModel]: """Describe a collection # noqa: E501 @@ -1216,76 +941,49 @@ def __describe_collection( thread. """ kwargs = self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['collection_name'] = \ - collection_name - return cast(CollectionModel | ApplyResult[CollectionModel], self.call_with_http_info(**kwargs)) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["collection_name"] = collection_name + return cast( + CollectionModel | ApplyResult[CollectionModel], self.call_with_http_info(**kwargs) + ) self.describe_collection = _Endpoint( settings={ - 'response_type': (CollectionModel,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/collections/{collection_name}', - 'operation_id': 'describe_collection', - 'http_method': 'GET', - 'servers': None, + "response_type": (CollectionModel,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/collections/{collection_name}", + "operation_id": "describe_collection", + "http_method": "GET", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'collection_name', - ], - 'required': [ - 'x_pinecone_api_version', - 'collection_name', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "collection_name"], + "required": ["x_pinecone_api_version", "collection_name"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_pinecone_api_version': - (str,), - 'collection_name': - (str,), + "validations": {}, + "allowed_values": {}, + "openapi_types": {"x_pinecone_api_version": (str,), "collection_name": (str,)}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "collection_name": "collection_name", }, - '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': [], + "location_map": {"x_pinecone_api_version": "header", "collection_name": "path"}, + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__describe_collection + callable=__describe_collection, ) def __describe_index( self, index_name, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict + **kwargs: ExtraOpenApiKwargsTypedDict, ) -> IndexModel | ApplyResult[IndexModel]: """Describe an index # noqa: E501 @@ -1324,76 +1022,44 @@ def __describe_index( thread. """ kwargs = self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['index_name'] = \ - index_name + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["index_name"] = index_name return cast(IndexModel | ApplyResult[IndexModel], self.call_with_http_info(**kwargs)) self.describe_index = _Endpoint( settings={ - 'response_type': (IndexModel,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/indexes/{index_name}', - 'operation_id': 'describe_index', - 'http_method': 'GET', - 'servers': None, + "response_type": (IndexModel,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/indexes/{index_name}", + "operation_id": "describe_index", + "http_method": "GET", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'index_name', - ], - 'required': [ - 'x_pinecone_api_version', - 'index_name', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "index_name"], + "required": ["x_pinecone_api_version", "index_name"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_pinecone_api_version': - (str,), - 'index_name': - (str,), - }, - 'attribute_map': { - 'x_pinecone_api_version': 'X-Pinecone-Api-Version', - 'index_name': 'index_name', + "validations": {}, + "allowed_values": {}, + "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': [], + "location_map": {"x_pinecone_api_version": "header", "index_name": "path"}, + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__describe_index + callable=__describe_index, ) def __describe_restore_job( - self, - job_id, - x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict + self, job_id, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict ) -> RestoreJobModel | ApplyResult[RestoreJobModel]: """Describe a restore job # noqa: E501 @@ -1432,75 +1098,46 @@ def __describe_restore_job( thread. """ kwargs = self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['job_id'] = \ - job_id - return cast(RestoreJobModel | ApplyResult[RestoreJobModel], self.call_with_http_info(**kwargs)) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["job_id"] = job_id + return cast( + RestoreJobModel | ApplyResult[RestoreJobModel], self.call_with_http_info(**kwargs) + ) self.describe_restore_job = _Endpoint( settings={ - 'response_type': (RestoreJobModel,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/restore-jobs/{job_id}', - 'operation_id': 'describe_restore_job', - 'http_method': 'GET', - 'servers': None, + "response_type": (RestoreJobModel,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/restore-jobs/{job_id}", + "operation_id": "describe_restore_job", + "http_method": "GET", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'job_id', - ], - 'required': [ - 'x_pinecone_api_version', - 'job_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "job_id"], + "required": ["x_pinecone_api_version", "job_id"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { + "validations": {}, + "allowed_values": {}, + "openapi_types": {"x_pinecone_api_version": (str,), "job_id": (str,)}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "job_id": "job_id", }, - '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': [], + "location_map": {"x_pinecone_api_version": "header", "job_id": "path"}, + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__describe_restore_job + callable=__describe_restore_job, ) def __list_collections( - self, - x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict + self, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict ) -> CollectionList | ApplyResult[CollectionList]: """List collections # noqa: E501 @@ -1538,68 +1175,45 @@ def __list_collections( thread. """ kwargs = self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - return cast(CollectionList | ApplyResult[CollectionList], self.call_with_http_info(**kwargs)) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + return cast( + CollectionList | ApplyResult[CollectionList], self.call_with_http_info(**kwargs) + ) self.list_collections = _Endpoint( settings={ - 'response_type': (CollectionList,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/collections', - 'operation_id': 'list_collections', - 'http_method': 'GET', - 'servers': None, + "response_type": (CollectionList,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/collections", + "operation_id": "list_collections", + "http_method": "GET", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - ], - 'required': [ - 'x_pinecone_api_version', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "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': [], - }, + "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_collections + callable=__list_collections, ) def __list_index_backups( self, index_name, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict + **kwargs: ExtraOpenApiKwargsTypedDict, ) -> BackupList | ApplyResult[BackupList]: """List backups for an index # noqa: E501 @@ -1640,91 +1254,56 @@ def __list_index_backups( thread. """ kwargs = self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['index_name'] = \ - index_name + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["index_name"] = index_name return cast(BackupList | ApplyResult[BackupList], self.call_with_http_info(**kwargs)) self.list_index_backups = _Endpoint( settings={ - 'response_type': (BackupList,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/indexes/{index_name}/backups', - 'operation_id': 'list_index_backups', - 'http_method': 'GET', - 'servers': None, + "response_type": (BackupList,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/indexes/{index_name}/backups", + "operation_id": "list_index_backups", + "http_method": "GET", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'index_name', - 'limit', - 'pagination_token', - ], - 'required': [ - 'x_pinecone_api_version', - 'index_name', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'limit', - ] + "all": ["x_pinecone_api_version", "index_name", "limit", "pagination_token"], + "required": ["x_pinecone_api_version", "index_name"], + "nullable": [], + "enum": [], + "validation": ["limit"], }, root_map={ - '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', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, + "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", + }, + "collection_format_map": {}, + }, + headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__list_index_backups + callable=__list_index_backups, ) def __list_indexes( - self, - x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict + self, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict ) -> IndexList | ApplyResult[IndexList]: """List indexes # noqa: E501 @@ -1762,67 +1341,40 @@ def __list_indexes( thread. """ kwargs = self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version + kwargs["x_pinecone_api_version"] = x_pinecone_api_version return cast(IndexList | ApplyResult[IndexList], self.call_with_http_info(**kwargs)) self.list_indexes = _Endpoint( settings={ - 'response_type': (IndexList,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/indexes', - 'operation_id': 'list_indexes', - 'http_method': 'GET', - 'servers': None, + "response_type": (IndexList,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/indexes", + "operation_id": "list_indexes", + "http_method": "GET", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - ], - 'required': [ - 'x_pinecone_api_version', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "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': [], - }, + "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_indexes + callable=__list_indexes, ) def __list_project_backups( - self, - x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict + self, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict ) -> BackupList | ApplyResult[BackupList]: """List backups for all indexes in a project # noqa: E501 @@ -1862,83 +1414,52 @@ def __list_project_backups( thread. """ kwargs = self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version + kwargs["x_pinecone_api_version"] = x_pinecone_api_version return cast(BackupList | ApplyResult[BackupList], self.call_with_http_info(**kwargs)) self.list_project_backups = _Endpoint( settings={ - 'response_type': (BackupList,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/backups', - 'operation_id': 'list_project_backups', - 'http_method': 'GET', - 'servers': None, + "response_type": (BackupList,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/backups", + "operation_id": "list_project_backups", + "http_method": "GET", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'limit', - 'pagination_token', - ], - 'required': [ - 'x_pinecone_api_version', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'limit', - ] + "all": ["x_pinecone_api_version", "limit", "pagination_token"], + "required": ["x_pinecone_api_version"], + "nullable": [], + "enum": [], + "validation": ["limit"], }, root_map={ - 'validations': { - ('limit',): { - - 'inclusive_maximum': 100, - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - }, - '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': [], - }, + "validations": {("limit",): {"inclusive_maximum": 100, "inclusive_minimum": 1}}, + "allowed_values": {}, + "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": []}, api_client=api_client, - callable=__list_project_backups + callable=__list_project_backups, ) def __list_restore_jobs( - self, - x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict + self, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict ) -> RestoreJobList | ApplyResult[RestoreJobList]: """List restore jobs # noqa: E501 @@ -1978,81 +1499,53 @@ def __list_restore_jobs( thread. """ kwargs = self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - return cast(RestoreJobList | ApplyResult[RestoreJobList], self.call_with_http_info(**kwargs)) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + return cast( + RestoreJobList | ApplyResult[RestoreJobList], self.call_with_http_info(**kwargs) + ) self.list_restore_jobs = _Endpoint( settings={ - 'response_type': (RestoreJobList,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/restore-jobs', - 'operation_id': 'list_restore_jobs', - 'http_method': 'GET', - 'servers': None, + "response_type": (RestoreJobList,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/restore-jobs", + "operation_id": "list_restore_jobs", + "http_method": "GET", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'limit', - 'pagination_token', - ], - 'required': [ - 'x_pinecone_api_version', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'limit', - ] + "all": ["x_pinecone_api_version", "limit", "pagination_token"], + "required": ["x_pinecone_api_version"], + "nullable": [], + "enum": [], + "validation": ["limit"], }, root_map={ - 'validations': { - ('limit',): { - - 'inclusive_maximum': 100, - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - }, - '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': [], - }, + "validations": {("limit",): {"inclusive_maximum": 100, "inclusive_minimum": 1}}, + "allowed_values": {}, + "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": []}, api_client=api_client, - callable=__list_restore_jobs + callable=__list_restore_jobs, ) - class AsyncioManageIndexesApi: """NOTE: This class is @generated using OpenAPI @@ -2065,11 +1558,7 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client async def __configure_index( - self, - index_name, - configure_index_request, - x_pinecone_api_version="2025-10", - **kwargs + self, index_name, configure_index_request, x_pinecone_api_version="2025-10", **kwargs ) -> IndexModel: """Configure an index # noqa: E501 @@ -2102,86 +1591,53 @@ async def __configure_index( 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 + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["index_name"] = index_name + kwargs["configure_index_request"] = configure_index_request return cast(IndexModel, await self.call_with_http_info(**kwargs)) self.configure_index = _AsyncioEndpoint( settings={ - 'response_type': (IndexModel,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/indexes/{index_name}', - 'operation_id': 'configure_index', - 'http_method': 'PATCH', - 'servers': None, + "response_type": (IndexModel,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/indexes/{index_name}", + "operation_id": "configure_index", + "http_method": "PATCH", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'index_name', - 'configure_index_request', - ], - 'required': [ - 'x_pinecone_api_version', - 'index_name', - 'configure_index_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "index_name", "configure_index_request"], + "required": ["x_pinecone_api_version", "index_name", "configure_index_request"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "index_name": (str,), + "configure_index_request": (ConfigureIndexRequest,), }, - 'openapi_types': { - 'x_pinecone_api_version': - (str,), - 'index_name': - (str,), - 'configure_index_request': - (ConfigureIndexRequest,), + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "index_name": "index_name", }, - '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", }, - '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' - ] + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__configure_index + callable=__configure_index, ) async def __create_backup( - self, - index_name, - create_backup_request, - x_pinecone_api_version="2025-10", - **kwargs + self, index_name, create_backup_request, x_pinecone_api_version="2025-10", **kwargs ) -> BackupModel: """Create a backup of an index # noqa: E501 @@ -2214,85 +1670,53 @@ async def __create_backup( 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 + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["index_name"] = index_name + kwargs["create_backup_request"] = create_backup_request return cast(BackupModel, await self.call_with_http_info(**kwargs)) self.create_backup = _AsyncioEndpoint( settings={ - 'response_type': (BackupModel,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/indexes/{index_name}/backups', - 'operation_id': 'create_backup', - 'http_method': 'POST', - 'servers': None, + "response_type": (BackupModel,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/indexes/{index_name}/backups", + "operation_id": "create_backup", + "http_method": "POST", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'index_name', - 'create_backup_request', - ], - 'required': [ - 'x_pinecone_api_version', - 'index_name', - 'create_backup_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "index_name", "create_backup_request"], + "required": ["x_pinecone_api_version", "index_name", "create_backup_request"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "index_name": (str,), + "create_backup_request": (CreateBackupRequest,), }, - 'openapi_types': { - 'x_pinecone_api_version': - (str,), - 'index_name': - (str,), - 'create_backup_request': - (CreateBackupRequest,), + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "index_name": "index_name", }, - '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", }, - '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' - ] + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__create_backup + callable=__create_backup, ) async def __create_collection( - self, - create_collection_request, - x_pinecone_api_version="2025-10", - **kwargs + self, create_collection_request, x_pinecone_api_version="2025-10", **kwargs ) -> CollectionModel: """Create a collection # noqa: E501 @@ -2324,77 +1748,47 @@ async def __create_collection( CollectionModel """ self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['create_collection_request'] = \ - create_collection_request + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["create_collection_request"] = create_collection_request return cast(CollectionModel, await self.call_with_http_info(**kwargs)) self.create_collection = _AsyncioEndpoint( settings={ - 'response_type': (CollectionModel,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/collections', - 'operation_id': 'create_collection', - 'http_method': 'POST', - 'servers': None, + "response_type": (CollectionModel,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/collections", + "operation_id": "create_collection", + "http_method": "POST", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'create_collection_request', - ], - 'required': [ - 'x_pinecone_api_version', - 'create_collection_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "create_collection_request"], + "required": ["x_pinecone_api_version", "create_collection_request"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_pinecone_api_version': - (str,), - 'create_collection_request': - (CreateCollectionRequest,), + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "create_collection_request": (CreateCollectionRequest,), }, - 'attribute_map': { - 'x_pinecone_api_version': 'X-Pinecone-Api-Version', + "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, + "location_map": { + "x_pinecone_api_version": "header", + "create_collection_request": "body", }, - 'location_map': { - 'x_pinecone_api_version': 'header', - 'create_collection_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__create_collection + callable=__create_collection, ) async def __create_index( - self, - create_index_request, - x_pinecone_api_version="2025-10", - **kwargs + self, create_index_request, x_pinecone_api_version="2025-10", **kwargs ) -> IndexModel: """Create an index # noqa: E501 @@ -2426,77 +1820,47 @@ async def __create_index( IndexModel """ self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['create_index_request'] = \ - create_index_request + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["create_index_request"] = create_index_request return cast(IndexModel, await self.call_with_http_info(**kwargs)) self.create_index = _AsyncioEndpoint( settings={ - 'response_type': (IndexModel,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/indexes', - 'operation_id': 'create_index', - 'http_method': 'POST', - 'servers': None, + "response_type": (IndexModel,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/indexes", + "operation_id": "create_index", + "http_method": "POST", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'create_index_request', - ], - 'required': [ - 'x_pinecone_api_version', - 'create_index_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "create_index_request"], + "required": ["x_pinecone_api_version", "create_index_request"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "create_index_request": (CreateIndexRequest,), }, - 'allowed_values': { + "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, + "location_map": { + "x_pinecone_api_version": "header", + "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' - ] + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__create_index + callable=__create_index, ) async def __create_index_for_model( - self, - create_index_for_model_request, - x_pinecone_api_version="2025-10", - **kwargs + self, create_index_for_model_request, x_pinecone_api_version="2025-10", **kwargs ) -> IndexModel: """Create an index with integrated embedding # noqa: E501 @@ -2528,70 +1892,43 @@ async def __create_index_for_model( 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 + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["create_index_for_model_request"] = create_index_for_model_request return cast(IndexModel, await self.call_with_http_info(**kwargs)) self.create_index_for_model = _AsyncioEndpoint( settings={ - 'response_type': (IndexModel,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/indexes/create-for-model', - 'operation_id': 'create_index_for_model', - 'http_method': 'POST', - 'servers': None, + "response_type": (IndexModel,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/indexes/create-for-model", + "operation_id": "create_index_for_model", + "http_method": "POST", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'create_index_for_model_request', - ], - 'required': [ - 'x_pinecone_api_version', - 'create_index_for_model_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "create_index_for_model_request"], + "required": ["x_pinecone_api_version", "create_index_for_model_request"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_pinecone_api_version': - (str,), - 'create_index_for_model_request': - (CreateIndexForModelRequest,), + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "create_index_for_model_request": (CreateIndexForModelRequest,), }, - 'attribute_map': { - 'x_pinecone_api_version': 'X-Pinecone-Api-Version', + "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, + "location_map": { + "x_pinecone_api_version": "header", + "create_index_for_model_request": "body", }, - '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' - ] + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__create_index_for_model + callable=__create_index_for_model, ) async def __create_index_from_backup_operation( @@ -2599,7 +1936,7 @@ async def __create_index_from_backup_operation( backup_id, create_index_from_backup_request, x_pinecone_api_version="2025-10", - **kwargs + **kwargs, ) -> CreateIndexFromBackupResponse: """Create an index from a backup # noqa: E501 @@ -2632,85 +1969,57 @@ 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 + 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 cast(CreateIndexFromBackupResponse, await self.call_with_http_info(**kwargs)) self.create_index_from_backup_operation = _AsyncioEndpoint( settings={ - 'response_type': (CreateIndexFromBackupResponse,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/backups/{backup_id}/create-index', - 'operation_id': 'create_index_from_backup_operation', - 'http_method': 'POST', - 'servers': None, + "response_type": (CreateIndexFromBackupResponse,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/backups/{backup_id}/create-index", + "operation_id": "create_index_from_backup_operation", + "http_method": "POST", + "servers": None, }, params_map={ - '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': [ + "all": ["x_pinecone_api_version", "backup_id", "create_index_from_backup_request"], + "required": [ + "x_pinecone_api_version", + "backup_id", + "create_index_from_backup_request", ], - 'validation': [ - ] + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "backup_id": (str,), + "create_index_from_backup_request": (CreateIndexFromBackupRequest,), }, - 'allowed_values': { + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "backup_id": "backup_id", }, - 'openapi_types': { - 'x_pinecone_api_version': - (str,), - 'backup_id': - (str,), - 'create_index_from_backup_request': - (CreateIndexFromBackupRequest,), + "location_map": { + "x_pinecone_api_version": "header", + "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' - ] + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__create_index_from_backup_operation + callable=__create_index_from_backup_operation, ) async def __delete_backup( - self, - backup_id, - x_pinecone_api_version="2025-10", - **kwargs + self, backup_id, x_pinecone_api_version="2025-10", **kwargs ) -> None: """Delete a backup # noqa: E501 @@ -2742,76 +2051,44 @@ async def __delete_backup( None """ self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['backup_id'] = \ - backup_id + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["backup_id"] = backup_id return cast(None, await self.call_with_http_info(**kwargs)) self.delete_backup = _AsyncioEndpoint( settings={ - 'response_type': None, - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/backups/{backup_id}', - 'operation_id': 'delete_backup', - 'http_method': 'DELETE', - 'servers': None, + "response_type": None, + "auth": ["ApiKeyAuth"], + "endpoint_path": "/backups/{backup_id}", + "operation_id": "delete_backup", + "http_method": "DELETE", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'backup_id', - ], - 'required': [ - 'x_pinecone_api_version', - 'backup_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "backup_id"], + "required": ["x_pinecone_api_version", "backup_id"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_pinecone_api_version': - (str,), - 'backup_id': - (str,), - }, - 'attribute_map': { - 'x_pinecone_api_version': 'X-Pinecone-Api-Version', - 'backup_id': 'backup_id', + "validations": {}, + "allowed_values": {}, + "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': [], + "location_map": {"x_pinecone_api_version": "header", "backup_id": "path"}, + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__delete_backup + callable=__delete_backup, ) async def __delete_collection( - self, - collection_name, - x_pinecone_api_version="2025-10", - **kwargs + self, collection_name, x_pinecone_api_version="2025-10", **kwargs ) -> None: """Delete a collection # noqa: E501 @@ -2843,76 +2120,44 @@ async def __delete_collection( None """ self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['collection_name'] = \ - collection_name + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["collection_name"] = collection_name return cast(None, await self.call_with_http_info(**kwargs)) self.delete_collection = _AsyncioEndpoint( settings={ - 'response_type': None, - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/collections/{collection_name}', - 'operation_id': 'delete_collection', - 'http_method': 'DELETE', - 'servers': None, + "response_type": None, + "auth": ["ApiKeyAuth"], + "endpoint_path": "/collections/{collection_name}", + "operation_id": "delete_collection", + "http_method": "DELETE", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'collection_name', - ], - 'required': [ - 'x_pinecone_api_version', - 'collection_name', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "collection_name"], + "required": ["x_pinecone_api_version", "collection_name"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { + "validations": {}, + "allowed_values": {}, + "openapi_types": {"x_pinecone_api_version": (str,), "collection_name": (str,)}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "collection_name": "collection_name", }, - 'allowed_values': { - }, - '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': [], + "location_map": {"x_pinecone_api_version": "header", "collection_name": "path"}, + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__delete_collection + callable=__delete_collection, ) async def __delete_index( - self, - index_name, - x_pinecone_api_version="2025-10", - **kwargs + self, index_name, x_pinecone_api_version="2025-10", **kwargs ) -> None: """Delete an index # noqa: E501 @@ -2944,76 +2189,44 @@ async def __delete_index( None """ self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['index_name'] = \ - index_name + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["index_name"] = index_name return cast(None, await self.call_with_http_info(**kwargs)) self.delete_index = _AsyncioEndpoint( settings={ - 'response_type': None, - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/indexes/{index_name}', - 'operation_id': 'delete_index', - 'http_method': 'DELETE', - 'servers': None, + "response_type": None, + "auth": ["ApiKeyAuth"], + "endpoint_path": "/indexes/{index_name}", + "operation_id": "delete_index", + "http_method": "DELETE", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'index_name', - ], - 'required': [ - 'x_pinecone_api_version', - 'index_name', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "index_name"], + "required": ["x_pinecone_api_version", "index_name"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { + "validations": {}, + "allowed_values": {}, + "openapi_types": {"x_pinecone_api_version": (str,), "index_name": (str,)}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "index_name": "index_name", }, - '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': [], + "location_map": {"x_pinecone_api_version": "header", "index_name": "path"}, + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__delete_index + callable=__delete_index, ) async def __describe_backup( - self, - backup_id, - x_pinecone_api_version="2025-10", - **kwargs + self, backup_id, x_pinecone_api_version="2025-10", **kwargs ) -> BackupModel: """Describe a backup # noqa: E501 @@ -3045,76 +2258,44 @@ async def __describe_backup( BackupModel """ self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['backup_id'] = \ - backup_id + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["backup_id"] = backup_id return cast(BackupModel, await self.call_with_http_info(**kwargs)) self.describe_backup = _AsyncioEndpoint( settings={ - 'response_type': (BackupModel,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/backups/{backup_id}', - 'operation_id': 'describe_backup', - 'http_method': 'GET', - 'servers': None, + "response_type": (BackupModel,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/backups/{backup_id}", + "operation_id": "describe_backup", + "http_method": "GET", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'backup_id', - ], - 'required': [ - 'x_pinecone_api_version', - 'backup_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "backup_id"], + "required": ["x_pinecone_api_version", "backup_id"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { + "validations": {}, + "allowed_values": {}, + "openapi_types": {"x_pinecone_api_version": (str,), "backup_id": (str,)}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "backup_id": "backup_id", }, - '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': [], + "location_map": {"x_pinecone_api_version": "header", "backup_id": "path"}, + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__describe_backup + callable=__describe_backup, ) async def __describe_collection( - self, - collection_name, - x_pinecone_api_version="2025-10", - **kwargs + self, collection_name, x_pinecone_api_version="2025-10", **kwargs ) -> CollectionModel: """Describe a collection # noqa: E501 @@ -3146,76 +2327,44 @@ async def __describe_collection( CollectionModel """ self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['collection_name'] = \ - collection_name + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["collection_name"] = collection_name return cast(CollectionModel, await self.call_with_http_info(**kwargs)) self.describe_collection = _AsyncioEndpoint( settings={ - 'response_type': (CollectionModel,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/collections/{collection_name}', - 'operation_id': 'describe_collection', - 'http_method': 'GET', - 'servers': None, + "response_type": (CollectionModel,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/collections/{collection_name}", + "operation_id": "describe_collection", + "http_method": "GET", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'collection_name', - ], - 'required': [ - 'x_pinecone_api_version', - 'collection_name', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "collection_name"], + "required": ["x_pinecone_api_version", "collection_name"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_pinecone_api_version': - (str,), - 'collection_name': - (str,), + "validations": {}, + "allowed_values": {}, + "openapi_types": {"x_pinecone_api_version": (str,), "collection_name": (str,)}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "collection_name": "collection_name", }, - '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': [], + "location_map": {"x_pinecone_api_version": "header", "collection_name": "path"}, + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__describe_collection + callable=__describe_collection, ) async def __describe_index( - self, - index_name, - x_pinecone_api_version="2025-10", - **kwargs + self, index_name, x_pinecone_api_version="2025-10", **kwargs ) -> IndexModel: """Describe an index # noqa: E501 @@ -3247,76 +2396,44 @@ async def __describe_index( IndexModel """ self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['index_name'] = \ - index_name + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["index_name"] = index_name return cast(IndexModel, await self.call_with_http_info(**kwargs)) self.describe_index = _AsyncioEndpoint( settings={ - 'response_type': (IndexModel,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/indexes/{index_name}', - 'operation_id': 'describe_index', - 'http_method': 'GET', - 'servers': None, + "response_type": (IndexModel,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/indexes/{index_name}", + "operation_id": "describe_index", + "http_method": "GET", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'index_name', - ], - 'required': [ - 'x_pinecone_api_version', - 'index_name', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "index_name"], + "required": ["x_pinecone_api_version", "index_name"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_pinecone_api_version': - (str,), - 'index_name': - (str,), - }, - 'attribute_map': { - 'x_pinecone_api_version': 'X-Pinecone-Api-Version', - 'index_name': 'index_name', + "validations": {}, + "allowed_values": {}, + "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': [], + "location_map": {"x_pinecone_api_version": "header", "index_name": "path"}, + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__describe_index + callable=__describe_index, ) async def __describe_restore_job( - self, - job_id, - x_pinecone_api_version="2025-10", - **kwargs + self, job_id, x_pinecone_api_version="2025-10", **kwargs ) -> RestoreJobModel: """Describe a restore job # noqa: E501 @@ -3348,75 +2465,44 @@ async def __describe_restore_job( RestoreJobModel """ self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['job_id'] = \ - job_id + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["job_id"] = job_id return cast(RestoreJobModel, await self.call_with_http_info(**kwargs)) self.describe_restore_job = _AsyncioEndpoint( settings={ - 'response_type': (RestoreJobModel,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/restore-jobs/{job_id}', - 'operation_id': 'describe_restore_job', - 'http_method': 'GET', - 'servers': None, + "response_type": (RestoreJobModel,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/restore-jobs/{job_id}", + "operation_id": "describe_restore_job", + "http_method": "GET", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'job_id', - ], - 'required': [ - 'x_pinecone_api_version', - 'job_id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "job_id"], + "required": ["x_pinecone_api_version", "job_id"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { + "validations": {}, + "allowed_values": {}, + "openapi_types": {"x_pinecone_api_version": (str,), "job_id": (str,)}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "job_id": "job_id", }, - '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': [], + "location_map": {"x_pinecone_api_version": "header", "job_id": "path"}, + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__describe_restore_job + callable=__describe_restore_job, ) async def __list_collections( - self, - x_pinecone_api_version="2025-10", - **kwargs + self, x_pinecone_api_version="2025-10", **kwargs ) -> CollectionList: """List collections # noqa: E501 @@ -3447,68 +2533,40 @@ async def __list_collections( CollectionList """ self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version + kwargs["x_pinecone_api_version"] = x_pinecone_api_version return cast(CollectionList, await self.call_with_http_info(**kwargs)) self.list_collections = _AsyncioEndpoint( settings={ - 'response_type': (CollectionList,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/collections', - 'operation_id': 'list_collections', - 'http_method': 'GET', - 'servers': None, + "response_type": (CollectionList,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/collections", + "operation_id": "list_collections", + "http_method": "GET", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - ], - 'required': [ - 'x_pinecone_api_version', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "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': [], - }, + "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_collections + callable=__list_collections, ) async def __list_index_backups( - self, - index_name, - x_pinecone_api_version="2025-10", - **kwargs + self, index_name, x_pinecone_api_version="2025-10", **kwargs ) -> BackupList: """List backups for an index # noqa: E501 @@ -3542,92 +2600,55 @@ async def __list_index_backups( BackupList """ self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['index_name'] = \ - index_name + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["index_name"] = index_name return cast(BackupList, await self.call_with_http_info(**kwargs)) self.list_index_backups = _AsyncioEndpoint( settings={ - 'response_type': (BackupList,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/indexes/{index_name}/backups', - 'operation_id': 'list_index_backups', - 'http_method': 'GET', - 'servers': None, + "response_type": (BackupList,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/indexes/{index_name}/backups", + "operation_id": "list_index_backups", + "http_method": "GET", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'index_name', - 'limit', - 'pagination_token', - ], - 'required': [ - 'x_pinecone_api_version', - 'index_name', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'limit', - ] + "all": ["x_pinecone_api_version", "index_name", "limit", "pagination_token"], + "required": ["x_pinecone_api_version", "index_name"], + "nullable": [], + "enum": [], + "validation": ["limit"], }, root_map={ - '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', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, + "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", + }, + "collection_format_map": {}, + }, + headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__list_index_backups + callable=__list_index_backups, ) - async def __list_indexes( - self, - x_pinecone_api_version="2025-10", - **kwargs - ) -> IndexList: + async def __list_indexes(self, x_pinecone_api_version="2025-10", **kwargs) -> IndexList: """List indexes # noqa: E501 List all indexes in a project. # noqa: E501 @@ -3657,67 +2678,40 @@ async def __list_indexes( IndexList """ self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version + kwargs["x_pinecone_api_version"] = x_pinecone_api_version return cast(IndexList, await self.call_with_http_info(**kwargs)) self.list_indexes = _AsyncioEndpoint( settings={ - 'response_type': (IndexList,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/indexes', - 'operation_id': 'list_indexes', - 'http_method': 'GET', - 'servers': None, + "response_type": (IndexList,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/indexes", + "operation_id": "list_indexes", + "http_method": "GET", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - ], - 'required': [ - 'x_pinecone_api_version', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "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': [], - }, + "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_indexes + callable=__list_indexes, ) async def __list_project_backups( - self, - x_pinecone_api_version="2025-10", - **kwargs + self, x_pinecone_api_version="2025-10", **kwargs ) -> BackupList: """List backups for all indexes in a project # noqa: E501 @@ -3750,83 +2744,52 @@ async def __list_project_backups( BackupList """ self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version + kwargs["x_pinecone_api_version"] = x_pinecone_api_version return cast(BackupList, await self.call_with_http_info(**kwargs)) self.list_project_backups = _AsyncioEndpoint( settings={ - 'response_type': (BackupList,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/backups', - 'operation_id': 'list_project_backups', - 'http_method': 'GET', - 'servers': None, + "response_type": (BackupList,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/backups", + "operation_id": "list_project_backups", + "http_method": "GET", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'limit', - 'pagination_token', - ], - 'required': [ - 'x_pinecone_api_version', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'limit', - ] + "all": ["x_pinecone_api_version", "limit", "pagination_token"], + "required": ["x_pinecone_api_version"], + "nullable": [], + "enum": [], + "validation": ["limit"], }, root_map={ - 'validations': { - ('limit',): { - - 'inclusive_maximum': 100, - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - }, - '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': [], - }, + "validations": {("limit",): {"inclusive_maximum": 100, "inclusive_minimum": 1}}, + "allowed_values": {}, + "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": []}, api_client=api_client, - callable=__list_project_backups + callable=__list_project_backups, ) async def __list_restore_jobs( - self, - x_pinecone_api_version="2025-10", - **kwargs + self, x_pinecone_api_version="2025-10", **kwargs ) -> RestoreJobList: """List restore jobs # noqa: E501 @@ -3859,75 +2822,46 @@ async def __list_restore_jobs( RestoreJobList """ self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version + kwargs["x_pinecone_api_version"] = x_pinecone_api_version return cast(RestoreJobList, await self.call_with_http_info(**kwargs)) self.list_restore_jobs = _AsyncioEndpoint( settings={ - 'response_type': (RestoreJobList,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/restore-jobs', - 'operation_id': 'list_restore_jobs', - 'http_method': 'GET', - 'servers': None, + "response_type": (RestoreJobList,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/restore-jobs", + "operation_id": "list_restore_jobs", + "http_method": "GET", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'limit', - 'pagination_token', - ], - 'required': [ - 'x_pinecone_api_version', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'limit', - ] + "all": ["x_pinecone_api_version", "limit", "pagination_token"], + "required": ["x_pinecone_api_version"], + "nullable": [], + "enum": [], + "validation": ["limit"], }, root_map={ - 'validations': { - ('limit',): { - - 'inclusive_maximum': 100, - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - }, - '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': [], - }, + "validations": {("limit",): {"inclusive_maximum": 100, "inclusive_minimum": 1}}, + "allowed_values": {}, + "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": []}, api_client=api_client, - callable=__list_restore_jobs + callable=__list_restore_jobs, ) diff --git a/pinecone/core/openapi/db_control/apis/__init__.py b/pinecone/core/openapi/db_control/apis/__init__.py index 40d74ba49..c82584141 100644 --- a/pinecone/core/openapi/db_control/apis/__init__.py +++ b/pinecone/core/openapi/db_control/apis/__init__.py @@ -1,4 +1,3 @@ - # flake8: noqa # Import all APIs into this package. diff --git a/pinecone/core/openapi/db_control/model/backup_list.py b/pinecone/core/openapi/db_control/model/backup_list.py index f79592958..49633da76 100644 --- a/pinecone/core/openapi/db_control/model/backup_list.py +++ b/pinecone/core/openapi/db_control/model/backup_list.py @@ -1,15 +1,14 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -33,11 +32,13 @@ from pinecone.core.openapi.db_control.model.backup_model import BackupModel from pinecone.core.openapi.db_control.model.pagination_response import PaginationResponse + def lazy_import(): from pinecone.core.openapi.db_control.model.backup_model import BackupModel from pinecone.core.openapi.db_control.model.pagination_response import PaginationResponse - globals()['BackupModel'] = BackupModel - globals()['PaginationResponse'] = PaginationResponse + + globals()["BackupModel"] = BackupModel + globals()["PaginationResponse"] = PaginationResponse from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -72,11 +73,9 @@ class BackupList(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -85,7 +84,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -101,24 +100,22 @@ def openapi_types(cls): """ lazy_import() return { - 'data': ([BackupModel],), # noqa: E501 - 'pagination': (PaginationResponse,), # noqa: E501 + "data": ([BackupModel],), # noqa: E501 + "pagination": (PaginationResponse,), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'data': 'data', # noqa: E501 - 'pagination': 'pagination', # noqa: E501 + "data": "data", # noqa: E501 + "pagination": "pagination", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of BackupList. @@ -131,8 +128,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 @@ -173,22 +168,20 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 pagination (PaginationResponse): [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', ()) + _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__, - ), + "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__,), ) @@ -203,25 +196,29 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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 @@ -263,19 +260,17 @@ def __init__(self, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -290,13 +285,17 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + raise PineconeApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/pinecone/core/openapi/db_control/model/backup_model.py b/pinecone/core/openapi/db_control/model/backup_model.py index b9385568c..f41e5f439 100644 --- a/pinecone/core/openapi/db_control/model/backup_model.py +++ b/pinecone/core/openapi/db_control/model/backup_model.py @@ -1,15 +1,14 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -33,11 +32,13 @@ from pinecone.core.openapi.db_control.model.backup_model_schema import BackupModelSchema from pinecone.core.openapi.db_control.model.index_tags import IndexTags + 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 + + globals()["BackupModelSchema"] = BackupModelSchema + globals()["IndexTags"] = IndexTags from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -72,14 +73,10 @@ class BackupModel(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ('dimension',): { - 'inclusive_maximum': 20000, - 'inclusive_minimum': 1, - }, + ("dimension",): {"inclusive_maximum": 20000, "inclusive_minimum": 1} } @cached_class_property @@ -89,7 +86,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -105,52 +102,50 @@ def openapi_types(cls): """ lazy_import() return { - 'backup_id': (str,), # noqa: E501 - 'source_index_name': (str,), # noqa: E501 - 'source_index_id': (str,), # noqa: E501 - 'status': (str,), # noqa: E501 - 'cloud': (str,), # noqa: E501 - 'region': (str,), # noqa: E501 - 'name': (str,), # noqa: E501 - 'description': (str,), # noqa: E501 - 'dimension': (int,), # noqa: E501 - 'metric': (str,), # noqa: E501 - 'schema': (BackupModelSchema,), # noqa: E501 - 'record_count': (int,), # noqa: E501 - 'namespace_count': (int,), # noqa: E501 - 'size_bytes': (int,), # noqa: E501 - 'tags': (IndexTags,), # noqa: E501 - 'created_at': (str,), # noqa: E501 + "backup_id": (str,), # noqa: E501 + "source_index_name": (str,), # noqa: E501 + "source_index_id": (str,), # noqa: E501 + "status": (str,), # noqa: E501 + "cloud": (str,), # noqa: E501 + "region": (str,), # noqa: E501 + "name": (str,), # noqa: E501 + "description": (str,), # noqa: E501 + "dimension": (int,), # noqa: E501 + "metric": (str,), # noqa: E501 + "schema": (BackupModelSchema,), # noqa: E501 + "record_count": (int,), # noqa: E501 + "namespace_count": (int,), # noqa: E501 + "size_bytes": (int,), # noqa: E501 + "tags": (IndexTags,), # noqa: E501 + "created_at": (str,), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'backup_id': 'backup_id', # noqa: E501 - 'source_index_name': 'source_index_name', # noqa: E501 - 'source_index_id': 'source_index_id', # noqa: E501 - 'status': 'status', # noqa: E501 - 'cloud': 'cloud', # noqa: E501 - 'region': 'region', # noqa: E501 - 'name': 'name', # noqa: E501 - 'description': 'description', # noqa: E501 - 'dimension': 'dimension', # noqa: E501 - 'metric': 'metric', # noqa: E501 - 'schema': 'schema', # noqa: E501 - 'record_count': 'record_count', # noqa: E501 - 'namespace_count': 'namespace_count', # noqa: E501 - 'size_bytes': 'size_bytes', # noqa: E501 - 'tags': 'tags', # noqa: E501 - 'created_at': 'created_at', # noqa: E501 + "backup_id": "backup_id", # noqa: E501 + "source_index_name": "source_index_name", # noqa: E501 + "source_index_id": "source_index_id", # noqa: E501 + "status": "status", # noqa: E501 + "cloud": "cloud", # noqa: E501 + "region": "region", # noqa: E501 + "name": "name", # noqa: E501 + "description": "description", # noqa: E501 + "dimension": "dimension", # noqa: E501 + "metric": "metric", # noqa: E501 + "schema": "schema", # noqa: E501 + "record_count": "record_count", # noqa: E501 + "namespace_count": "namespace_count", # noqa: E501 + "size_bytes": "size_bytes", # noqa: E501 + "tags": "tags", # noqa: E501 + "created_at": "created_at", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of BackupModel. @@ -163,11 +158,19 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args - def _from_openapi_data(cls: Type[T], backup_id, source_index_name, source_index_id, status, cloud, region, *args, **kwargs) -> T: # noqa: E501 + def _from_openapi_data( + cls: Type[T], + backup_id, + source_index_name, + source_index_id, + status, + cloud, + region, + *args, + **kwargs, + ) -> T: # noqa: E501 """BackupModel - a model defined in OpenAPI Args: @@ -221,22 +224,20 @@ def _from_openapi_data(cls: Type[T], backup_id, source_index_name, source_index_ created_at (str): Timestamp when the backup was created. [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', ()) + _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__, - ), + "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__,), ) @@ -257,28 +258,34 @@ def _from_openapi_data(cls: Type[T], backup_id, source_index_name, source_index_ self.cloud = cloud self.region = region for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + 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', - ]) + 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, backup_id, source_index_name, source_index_id, status, cloud, region, *args, **kwargs) -> None: # noqa: E501 + def __init__( + self, backup_id, source_index_name, source_index_id, status, cloud, region, *args, **kwargs + ) -> None: # noqa: E501 """BackupModel - a model defined in OpenAPI Args: @@ -333,19 +340,17 @@ def __init__(self, backup_id, source_index_name, source_index_id, status, cloud, """ _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', ()) + _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__, - ), + "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__,), ) @@ -366,13 +371,17 @@ def __init__(self, backup_id, source_index_name, source_index_id, status, cloud, self.cloud = cloud self.region = region for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + 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.") + raise PineconeApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/pinecone/core/openapi/db_control/model/backup_model_schema.py b/pinecone/core/openapi/db_control/model/backup_model_schema.py index a15d0e063..157d5ec36 100644 --- a/pinecone/core/openapi/db_control/model/backup_model_schema.py +++ b/pinecone/core/openapi/db_control/model/backup_model_schema.py @@ -1,15 +1,14 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -30,11 +29,17 @@ from typing import TYPE_CHECKING if TYPE_CHECKING: - from pinecone.core.openapi.db_control.model.backup_model_schema_fields import BackupModelSchemaFields + from pinecone.core.openapi.db_control.model.backup_model_schema_fields import ( + BackupModelSchemaFields, + ) + def lazy_import(): - from pinecone.core.openapi.db_control.model.backup_model_schema_fields import BackupModelSchemaFields - globals()['BackupModelSchemaFields'] = BackupModelSchemaFields + from pinecone.core.openapi.db_control.model.backup_model_schema_fields import ( + BackupModelSchemaFields, + ) + + globals()["BackupModelSchemaFields"] = BackupModelSchemaFields from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -69,11 +74,9 @@ class BackupModelSchema(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -82,7 +85,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -98,22 +101,20 @@ def openapi_types(cls): """ lazy_import() return { - 'fields': ({str: (BackupModelSchemaFields,)},), # noqa: E501 + "fields": ({str: (BackupModelSchemaFields,)},) # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'fields': 'fields', # noqa: E501 + "fields": "fields" # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of BackupModelSchema. @@ -126,8 +127,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], fields, *args, **kwargs) -> T: # noqa: E501 @@ -169,22 +168,20 @@ def _from_openapi_data(cls: Type[T], fields, *args, **kwargs) -> T: # noqa: E50 _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', ()) + _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__, - ), + "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__,), ) @@ -200,25 +197,29 @@ def _from_openapi_data(cls: Type[T], fields, *args, **kwargs) -> T: # noqa: E50 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: + 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', - ]) + 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 @@ -261,19 +262,17 @@ def __init__(self, fields, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -289,13 +288,17 @@ def __init__(self, fields, *args, **kwargs) -> None: # noqa: E501 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: + 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.") + raise PineconeApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/pinecone/core/openapi/db_control/model/backup_model_schema_fields.py b/pinecone/core/openapi/db_control/model/backup_model_schema_fields.py index 552aed875..f95b7cb0f 100644 --- a/pinecone/core/openapi/db_control/model/backup_model_schema_fields.py +++ b/pinecone/core/openapi/db_control/model/backup_model_schema_fields.py @@ -1,15 +1,14 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -28,7 +27,6 @@ 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 @@ -61,11 +59,9 @@ class BackupModelSchemaFields(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -73,7 +69,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 """ - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -88,22 +84,20 @@ def openapi_types(cls): and the value is attribute type. """ return { - 'filterable': (bool,), # noqa: E501 + "filterable": (bool,) # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'filterable': 'filterable', # noqa: E501 + "filterable": "filterable" # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of BackupModelSchemaFields. @@ -116,8 +110,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 @@ -157,22 +149,20 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 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', ()) + _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__, - ), + "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__,), ) @@ -187,25 +177,29 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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 @@ -246,19 +240,17 @@ def __init__(self, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -273,13 +265,17 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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 index d2faf8ad8..2e45fc821 100644 --- a/pinecone/core/openapi/db_control/model/byoc.py +++ b/pinecone/core/openapi/db_control/model/byoc.py @@ -1,15 +1,14 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -32,9 +31,11 @@ if TYPE_CHECKING: from pinecone.core.openapi.db_control.model.byoc_spec import ByocSpec + def lazy_import(): from pinecone.core.openapi.db_control.model.byoc_spec import ByocSpec - globals()['ByocSpec'] = ByocSpec + + globals()["ByocSpec"] = ByocSpec from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -69,11 +70,9 @@ class BYOC(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -82,7 +81,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -98,22 +97,20 @@ def openapi_types(cls): """ lazy_import() return { - 'byoc': (ByocSpec,), # noqa: E501 + "byoc": (ByocSpec,) # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'byoc': 'byoc', # noqa: E501 + "byoc": "byoc" # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of BYOC. @@ -126,8 +123,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], byoc, *args, **kwargs) -> T: # noqa: E501 @@ -169,22 +164,20 @@ def _from_openapi_data(cls: Type[T], byoc, *args, **kwargs) -> T: # noqa: E501 _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', ()) + _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__, - ), + "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__,), ) @@ -200,25 +193,29 @@ def _from_openapi_data(cls: Type[T], byoc, *args, **kwargs) -> T: # noqa: E501 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: + 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', - ]) + 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 @@ -261,19 +258,17 @@ def __init__(self, byoc, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -289,13 +284,17 @@ def __init__(self, byoc, *args, **kwargs) -> None: # noqa: E501 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: + 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.") + 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 963b1fcbf..9eaae678a 100644 --- a/pinecone/core/openapi/db_control/model/byoc_spec.py +++ b/pinecone/core/openapi/db_control/model/byoc_spec.py @@ -1,15 +1,14 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -32,9 +31,11 @@ if TYPE_CHECKING: from pinecone.core.openapi.db_control.model.backup_model_schema import BackupModelSchema + def lazy_import(): from pinecone.core.openapi.db_control.model.backup_model_schema import BackupModelSchema - globals()['BackupModelSchema'] = BackupModelSchema + + globals()["BackupModelSchema"] = BackupModelSchema from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -69,11 +70,9 @@ class ByocSpec(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -82,7 +81,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -98,24 +97,22 @@ def openapi_types(cls): """ lazy_import() return { - 'environment': (str,), # noqa: E501 - 'schema': (BackupModelSchema,), # noqa: E501 + "environment": (str,), # noqa: E501 + "schema": (BackupModelSchema,), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'environment': 'environment', # noqa: E501 - 'schema': 'schema', # noqa: E501 + "environment": "environment", # noqa: E501 + "schema": "schema", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ByocSpec. @@ -128,8 +125,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], environment, *args, **kwargs) -> T: # noqa: E501 @@ -172,22 +167,20 @@ def _from_openapi_data(cls: Type[T], environment, *args, **kwargs) -> T: # noqa 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', ()) + _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__, - ), + "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__,), ) @@ -203,25 +196,29 @@ def _from_openapi_data(cls: Type[T], environment, *args, **kwargs) -> T: # noqa self.environment = environment for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + 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', - ]) + 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, environment, *args, **kwargs) -> None: # noqa: E501 @@ -265,19 +262,17 @@ def __init__(self, environment, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -293,13 +288,17 @@ def __init__(self, environment, *args, **kwargs) -> None: # noqa: E501 self.environment = environment for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + 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.") + 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/collection_list.py b/pinecone/core/openapi/db_control/model/collection_list.py index ce05419eb..2b495fea5 100644 --- a/pinecone/core/openapi/db_control/model/collection_list.py +++ b/pinecone/core/openapi/db_control/model/collection_list.py @@ -1,15 +1,14 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -32,9 +31,11 @@ if TYPE_CHECKING: from pinecone.core.openapi.db_control.model.collection_model import CollectionModel + def lazy_import(): from pinecone.core.openapi.db_control.model.collection_model import CollectionModel - globals()['CollectionModel'] = CollectionModel + + globals()["CollectionModel"] = CollectionModel from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -69,11 +70,9 @@ class CollectionList(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -82,7 +81,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -98,22 +97,20 @@ def openapi_types(cls): """ lazy_import() return { - 'collections': ([CollectionModel],), # noqa: E501 + "collections": ([CollectionModel],) # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'collections': 'collections', # noqa: E501 + "collections": "collections" # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of CollectionList. @@ -126,8 +123,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 @@ -167,22 +162,20 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 collections ([CollectionModel]): List of collections in the project [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', ()) + _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__, - ), + "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__,), ) @@ -197,25 +190,29 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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 @@ -256,19 +253,17 @@ def __init__(self, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -283,13 +278,17 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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/collection_model.py b/pinecone/core/openapi/db_control/model/collection_model.py index 101e30495..3ebbb8f07 100644 --- a/pinecone/core/openapi/db_control/model/collection_model.py +++ b/pinecone/core/openapi/db_control/model/collection_model.py @@ -1,15 +1,14 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -28,7 +27,6 @@ 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 @@ -61,14 +59,10 @@ class CollectionModel(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ('dimension',): { - 'inclusive_maximum': 20000, - 'inclusive_minimum': 1, - }, + ("dimension",): {"inclusive_maximum": 20000, "inclusive_minimum": 1} } @cached_class_property @@ -77,7 +71,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 """ - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -92,32 +86,30 @@ def openapi_types(cls): and the value is attribute type. """ return { - 'name': (str,), # noqa: E501 - 'status': (str,), # noqa: E501 - 'environment': (str,), # noqa: E501 - 'size': (int,), # noqa: E501 - 'dimension': (int,), # noqa: E501 - 'vector_count': (int,), # noqa: E501 + "name": (str,), # noqa: E501 + "status": (str,), # noqa: E501 + "environment": (str,), # noqa: E501 + "size": (int,), # noqa: E501 + "dimension": (int,), # noqa: E501 + "vector_count": (int,), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'name': 'name', # noqa: E501 - 'status': 'status', # noqa: E501 - 'environment': 'environment', # noqa: E501 - 'size': 'size', # noqa: E501 - 'dimension': 'dimension', # noqa: E501 - 'vector_count': 'vector_count', # noqa: E501 + "name": "name", # noqa: E501 + "status": "status", # noqa: E501 + "environment": "environment", # noqa: E501 + "size": "size", # noqa: E501 + "dimension": "dimension", # noqa: E501 + "vector_count": "vector_count", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of CollectionModel. @@ -130,8 +122,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], name, status, environment, *args, **kwargs) -> T: # noqa: E501 @@ -178,22 +168,20 @@ def _from_openapi_data(cls: Type[T], name, status, environment, *args, **kwargs) vector_count (int): The number of records stored in the collection. [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', ()) + _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__, - ), + "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__,), ) @@ -211,25 +199,29 @@ def _from_openapi_data(cls: Type[T], name, status, environment, *args, **kwargs) self.status = status self.environment = environment for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + 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', - ]) + 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, status, environment, *args, **kwargs) -> None: # noqa: E501 @@ -277,19 +269,17 @@ def __init__(self, name, status, environment, *args, **kwargs) -> None: # noqa: """ _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', ()) + _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__, - ), + "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__,), ) @@ -307,13 +297,17 @@ def __init__(self, name, status, environment, *args, **kwargs) -> None: # noqa: self.status = status self.environment = environment for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + 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.") + 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/configure_index_request.py b/pinecone/core/openapi/db_control/model/configure_index_request.py index 7e653299d..8d2241e09 100644 --- a/pinecone/core/openapi/db_control/model/configure_index_request.py +++ b/pinecone/core/openapi/db_control/model/configure_index_request.py @@ -1,15 +1,14 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -30,14 +29,20 @@ from typing import TYPE_CHECKING if TYPE_CHECKING: - from pinecone.core.openapi.db_control.model.configure_index_request_embed import ConfigureIndexRequestEmbed + from pinecone.core.openapi.db_control.model.configure_index_request_embed import ( + ConfigureIndexRequestEmbed, + ) from pinecone.core.openapi.db_control.model.index_tags import IndexTags + 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_embed import ( + ConfigureIndexRequestEmbed, + ) from pinecone.core.openapi.db_control.model.index_tags import IndexTags - globals()['ConfigureIndexRequestEmbed'] = ConfigureIndexRequestEmbed - globals()['IndexTags'] = IndexTags + + globals()["ConfigureIndexRequestEmbed"] = ConfigureIndexRequestEmbed + globals()["IndexTags"] = IndexTags from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -72,11 +77,9 @@ class ConfigureIndexRequest(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -85,7 +88,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -101,28 +104,26 @@ def openapi_types(cls): """ lazy_import() return { - 'spec': (dict,), # noqa: E501 - 'deletion_protection': (str,), # noqa: E501 - 'tags': (IndexTags,), # noqa: E501 - 'embed': (ConfigureIndexRequestEmbed,), # noqa: E501 + "spec": (dict,), # noqa: E501 + "deletion_protection": (str,), # noqa: E501 + "tags": (IndexTags,), # noqa: E501 + "embed": (ConfigureIndexRequestEmbed,), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'spec': 'spec', # noqa: E501 - 'deletion_protection': 'deletion_protection', # noqa: E501 - 'tags': 'tags', # noqa: E501 - 'embed': 'embed', # noqa: E501 + "spec": "spec", # noqa: E501 + "deletion_protection": "deletion_protection", # noqa: E501 + "tags": "tags", # noqa: E501 + "embed": "embed", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ConfigureIndexRequest. @@ -135,8 +136,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 @@ -179,22 +178,20 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 embed (ConfigureIndexRequestEmbed): [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', ()) + _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__, - ), + "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__,), ) @@ -209,25 +206,29 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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 @@ -271,19 +272,17 @@ def __init__(self, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -298,13 +297,17 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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/configure_index_request_embed.py b/pinecone/core/openapi/db_control/model/configure_index_request_embed.py index fdd231b39..1195d80f2 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 @@ -1,15 +1,14 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -28,7 +27,6 @@ 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 @@ -61,11 +59,9 @@ class ConfigureIndexRequestEmbed(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -73,7 +69,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 """ - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -88,28 +84,26 @@ def openapi_types(cls): and the value is attribute type. """ return { - 'model': (str,), # noqa: E501 - 'field_map': (Dict[str, Any],), # noqa: E501 - 'read_parameters': (Dict[str, Any],), # noqa: E501 - 'write_parameters': (Dict[str, Any],), # noqa: E501 + "model": (str,), # noqa: E501 + "field_map": (Dict[str, Any],), # noqa: E501 + "read_parameters": (Dict[str, Any],), # noqa: E501 + "write_parameters": (Dict[str, Any],), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'model': 'model', # noqa: E501 - 'field_map': 'field_map', # noqa: E501 - 'read_parameters': 'read_parameters', # noqa: E501 - 'write_parameters': 'write_parameters', # noqa: E501 + "model": "model", # noqa: E501 + "field_map": "field_map", # noqa: E501 + "read_parameters": "read_parameters", # noqa: E501 + "write_parameters": "write_parameters", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ConfigureIndexRequestEmbed. @@ -122,8 +116,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 @@ -166,22 +158,20 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 write_parameters (Dict[str, Any]): The write parameters for the embedding model. [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', ()) + _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__, - ), + "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__,), ) @@ -196,25 +186,29 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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 @@ -258,19 +252,17 @@ def __init__(self, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -285,13 +277,17 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + raise PineconeApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/pinecone/core/openapi/db_control/model/create_backup_request.py b/pinecone/core/openapi/db_control/model/create_backup_request.py index fbad231fd..cbdde388e 100644 --- a/pinecone/core/openapi/db_control/model/create_backup_request.py +++ b/pinecone/core/openapi/db_control/model/create_backup_request.py @@ -1,15 +1,14 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -28,7 +27,6 @@ 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 @@ -61,11 +59,9 @@ class CreateBackupRequest(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -73,7 +69,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 """ - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -88,24 +84,22 @@ def openapi_types(cls): and the value is attribute type. """ return { - 'name': (str,), # noqa: E501 - 'description': (str,), # noqa: E501 + "name": (str,), # noqa: E501 + "description": (str,), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'name': 'name', # noqa: E501 - 'description': 'description', # noqa: E501 + "name": "name", # noqa: E501 + "description": "description", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of CreateBackupRequest. @@ -118,8 +112,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 @@ -160,22 +152,20 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 description (str): A description of the backup. [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', ()) + _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__, - ), + "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__,), ) @@ -190,25 +180,29 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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 @@ -250,19 +244,17 @@ def __init__(self, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -277,13 +269,17 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + raise PineconeApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/pinecone/core/openapi/db_control/model/create_collection_request.py b/pinecone/core/openapi/db_control/model/create_collection_request.py index ae8cf420f..164e0a3d2 100644 --- a/pinecone/core/openapi/db_control/model/create_collection_request.py +++ b/pinecone/core/openapi/db_control/model/create_collection_request.py @@ -1,15 +1,14 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -28,7 +27,6 @@ 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 @@ -61,14 +59,10 @@ class CreateCollectionRequest(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ('name',): { - 'max_length': 45, - 'min_length': 1, - }, + ("name",): {"max_length": 45, "min_length": 1} } @cached_class_property @@ -77,7 +71,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 """ - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -92,24 +86,22 @@ def openapi_types(cls): and the value is attribute type. """ return { - 'name': (str,), # noqa: E501 - 'source': (str,), # noqa: E501 + "name": (str,), # noqa: E501 + "source": (str,), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'name': 'name', # noqa: E501 - 'source': 'source', # noqa: E501 + "name": "name", # noqa: E501 + "source": "source", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of CreateCollectionRequest. @@ -122,8 +114,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], name, source, *args, **kwargs) -> T: # noqa: E501 @@ -166,22 +156,20 @@ def _from_openapi_data(cls: Type[T], name, source, *args, **kwargs) -> T: # noq _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', ()) + _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__, - ), + "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__,), ) @@ -198,25 +186,29 @@ def _from_openapi_data(cls: Type[T], name, source, *args, **kwargs) -> T: # noq self.name = name self.source = source for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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, source, *args, **kwargs) -> None: # noqa: E501 @@ -260,19 +252,17 @@ def __init__(self, name, source, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -289,13 +279,17 @@ def __init__(self, name, source, *args, **kwargs) -> None: # noqa: E501 self.name = name self.source = source for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + raise PineconeApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/pinecone/core/openapi/db_control/model/create_index_for_model_request.py b/pinecone/core/openapi/db_control/model/create_index_for_model_request.py index d98bdb7ea..42dc820d5 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 @@ -1,15 +1,14 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -31,19 +30,25 @@ if TYPE_CHECKING: 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.create_index_for_model_request_embed import ( + CreateIndexForModelRequestEmbed, + ) from pinecone.core.openapi.db_control.model.index_tags import IndexTags from pinecone.core.openapi.db_control.model.read_capacity import ReadCapacity + 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.create_index_for_model_request_embed import ( + CreateIndexForModelRequestEmbed, + ) 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()['IndexTags'] = IndexTags - globals()['ReadCapacity'] = ReadCapacity + + globals()["BackupModelSchema"] = BackupModelSchema + globals()["CreateIndexForModelRequestEmbed"] = CreateIndexForModelRequestEmbed + globals()["IndexTags"] = IndexTags + globals()["ReadCapacity"] = ReadCapacity from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -78,14 +83,10 @@ class CreateIndexForModelRequest(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ('name',): { - 'max_length': 45, - 'min_length': 1, - }, + ("name",): {"max_length": 45, "min_length": 1} } @cached_class_property @@ -95,7 +96,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -111,36 +112,34 @@ def openapi_types(cls): """ lazy_import() return { - 'name': (str,), # noqa: E501 - 'cloud': (str,), # noqa: E501 - 'region': (str,), # noqa: E501 - 'embed': (CreateIndexForModelRequestEmbed,), # noqa: E501 - 'deletion_protection': (str,), # noqa: E501 - 'tags': (IndexTags,), # noqa: E501 - 'schema': (BackupModelSchema,), # noqa: E501 - 'read_capacity': (ReadCapacity,), # noqa: E501 + "name": (str,), # noqa: E501 + "cloud": (str,), # noqa: E501 + "region": (str,), # noqa: E501 + "embed": (CreateIndexForModelRequestEmbed,), # noqa: E501 + "deletion_protection": (str,), # noqa: E501 + "tags": (IndexTags,), # noqa: E501 + "schema": (BackupModelSchema,), # noqa: E501 + "read_capacity": (ReadCapacity,), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'name': 'name', # noqa: E501 - 'cloud': 'cloud', # noqa: E501 - 'region': 'region', # noqa: E501 - 'embed': 'embed', # noqa: E501 - 'deletion_protection': 'deletion_protection', # noqa: E501 - 'tags': 'tags', # noqa: E501 - 'schema': 'schema', # noqa: E501 - 'read_capacity': 'read_capacity', # noqa: E501 + "name": "name", # noqa: E501 + "cloud": "cloud", # noqa: E501 + "region": "region", # noqa: E501 + "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([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of CreateIndexForModelRequest. @@ -153,8 +152,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], name, cloud, region, embed, *args, **kwargs) -> T: # noqa: E501 @@ -203,22 +200,20 @@ def _from_openapi_data(cls: Type[T], name, cloud, region, embed, *args, **kwargs read_capacity (ReadCapacity): [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', ()) + _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__, - ), + "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__,), ) @@ -237,25 +232,29 @@ def _from_openapi_data(cls: Type[T], name, cloud, region, embed, *args, **kwargs self.region = region self.embed = embed for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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, cloud, region, embed, *args, **kwargs) -> None: # noqa: E501 @@ -305,19 +304,17 @@ def __init__(self, name, cloud, region, embed, *args, **kwargs) -> None: # noqa """ _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', ()) + _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__, - ), + "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__,), ) @@ -336,13 +333,17 @@ def __init__(self, name, cloud, region, embed, *args, **kwargs) -> None: # noqa self.region = region self.embed = embed for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + raise PineconeApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/pinecone/core/openapi/db_control/model/create_index_for_model_request_embed.py b/pinecone/core/openapi/db_control/model/create_index_for_model_request_embed.py index 8920b6432..8e5d7b1a7 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 @@ -1,15 +1,14 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -28,7 +27,6 @@ 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 @@ -61,11 +59,9 @@ class CreateIndexForModelRequestEmbed(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -73,7 +69,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 """ - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -88,32 +84,30 @@ def openapi_types(cls): and the value is attribute type. """ return { - 'model': (str,), # noqa: E501 - 'field_map': (Dict[str, Any],), # noqa: E501 - 'metric': (str,), # noqa: E501 - 'dimension': (int,), # noqa: E501 - 'read_parameters': (Dict[str, Any],), # noqa: E501 - 'write_parameters': (Dict[str, Any],), # noqa: E501 + "model": (str,), # noqa: E501 + "field_map": (Dict[str, Any],), # noqa: E501 + "metric": (str,), # noqa: E501 + "dimension": (int,), # noqa: E501 + "read_parameters": (Dict[str, Any],), # noqa: E501 + "write_parameters": (Dict[str, Any],), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'model': 'model', # noqa: E501 - 'field_map': 'field_map', # noqa: E501 - 'metric': 'metric', # noqa: E501 - 'dimension': 'dimension', # noqa: E501 - 'read_parameters': 'read_parameters', # noqa: E501 - 'write_parameters': 'write_parameters', # noqa: E501 + "model": "model", # noqa: E501 + "field_map": "field_map", # noqa: E501 + "metric": "metric", # noqa: E501 + "dimension": "dimension", # noqa: E501 + "read_parameters": "read_parameters", # noqa: E501 + "write_parameters": "write_parameters", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of CreateIndexForModelRequestEmbed. @@ -126,8 +120,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], model, field_map, *args, **kwargs) -> T: # noqa: E501 @@ -174,22 +166,20 @@ def _from_openapi_data(cls: Type[T], model, field_map, *args, **kwargs) -> T: # write_parameters (Dict[str, Any]): The write parameters for the embedding model. [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', ()) + _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__, - ), + "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__,), ) @@ -206,25 +196,29 @@ def _from_openapi_data(cls: Type[T], model, field_map, *args, **kwargs) -> T: # self.model = model self.field_map = field_map for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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, model, field_map, *args, **kwargs) -> None: # noqa: E501 @@ -272,19 +266,17 @@ def __init__(self, model, field_map, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -301,13 +293,17 @@ def __init__(self, model, field_map, *args, **kwargs) -> None: # noqa: E501 self.model = model self.field_map = field_map for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + raise PineconeApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/pinecone/core/openapi/db_control/model/create_index_from_backup_request.py b/pinecone/core/openapi/db_control/model/create_index_from_backup_request.py index d15afbdcf..9139cffe1 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 @@ -1,15 +1,14 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -32,9 +31,11 @@ if TYPE_CHECKING: from pinecone.core.openapi.db_control.model.index_tags import IndexTags + def lazy_import(): from pinecone.core.openapi.db_control.model.index_tags import IndexTags - globals()['IndexTags'] = IndexTags + + globals()["IndexTags"] = IndexTags from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -69,14 +70,10 @@ class CreateIndexFromBackupRequest(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ('name',): { - 'max_length': 45, - 'min_length': 1, - }, + ("name",): {"max_length": 45, "min_length": 1} } @cached_class_property @@ -86,7 +83,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -102,26 +99,24 @@ def openapi_types(cls): """ lazy_import() return { - 'name': (str,), # noqa: E501 - 'tags': (IndexTags,), # noqa: E501 - 'deletion_protection': (str,), # noqa: E501 + "name": (str,), # noqa: E501 + "tags": (IndexTags,), # noqa: E501 + "deletion_protection": (str,), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'name': 'name', # noqa: E501 - 'tags': 'tags', # noqa: E501 - 'deletion_protection': 'deletion_protection', # noqa: E501 + "name": "name", # noqa: E501 + "tags": "tags", # noqa: E501 + "deletion_protection": "deletion_protection", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of CreateIndexFromBackupRequest. @@ -134,8 +129,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], name, *args, **kwargs) -> T: # noqa: E501 @@ -179,22 +172,20 @@ def _from_openapi_data(cls: Type[T], name, *args, **kwargs) -> T: # 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) - _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', ()) + _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__, - ), + "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__,), ) @@ -210,25 +201,29 @@ def _from_openapi_data(cls: Type[T], name, *args, **kwargs) -> T: # noqa: E501 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: + 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', - ]) + 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 @@ -273,19 +268,17 @@ def __init__(self, name, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -301,13 +294,17 @@ def __init__(self, name, *args, **kwargs) -> None: # noqa: E501 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: + 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.") + raise PineconeApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/pinecone/core/openapi/db_control/model/create_index_from_backup_response.py b/pinecone/core/openapi/db_control/model/create_index_from_backup_response.py index 877002e54..d90ee4982 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 @@ -1,15 +1,14 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -28,7 +27,6 @@ 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 @@ -61,11 +59,9 @@ class CreateIndexFromBackupResponse(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -73,7 +69,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 """ - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -88,24 +84,22 @@ def openapi_types(cls): and the value is attribute type. """ return { - 'restore_job_id': (str,), # noqa: E501 - 'index_id': (str,), # noqa: E501 + "restore_job_id": (str,), # noqa: E501 + "index_id": (str,), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'restore_job_id': 'restore_job_id', # noqa: E501 - 'index_id': 'index_id', # noqa: E501 + "restore_job_id": "restore_job_id", # noqa: E501 + "index_id": "index_id", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of CreateIndexFromBackupResponse. @@ -118,8 +112,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], restore_job_id, index_id, *args, **kwargs) -> T: # noqa: E501 @@ -162,22 +154,20 @@ def _from_openapi_data(cls: Type[T], restore_job_id, index_id, *args, **kwargs) _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', ()) + _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__, - ), + "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__,), ) @@ -194,25 +184,29 @@ def _from_openapi_data(cls: Type[T], restore_job_id, index_id, *args, **kwargs) self.restore_job_id = restore_job_id self.index_id = index_id for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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, restore_job_id, index_id, *args, **kwargs) -> None: # noqa: E501 @@ -256,19 +250,17 @@ def __init__(self, restore_job_id, index_id, *args, **kwargs) -> None: # noqa: """ _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', ()) + _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__, - ), + "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__,), ) @@ -285,13 +277,17 @@ def __init__(self, restore_job_id, index_id, *args, **kwargs) -> None: # noqa: self.restore_job_id = restore_job_id self.index_id = index_id for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + raise PineconeApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/pinecone/core/openapi/db_control/model/create_index_request.py b/pinecone/core/openapi/db_control/model/create_index_request.py index e90bd7eff..dcbfc2e51 100644 --- a/pinecone/core/openapi/db_control/model/create_index_request.py +++ b/pinecone/core/openapi/db_control/model/create_index_request.py @@ -1,15 +1,14 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -33,11 +32,13 @@ from pinecone.core.openapi.db_control.model.index_spec import IndexSpec from pinecone.core.openapi.db_control.model.index_tags import IndexTags + def lazy_import(): from pinecone.core.openapi.db_control.model.index_spec import IndexSpec from pinecone.core.openapi.db_control.model.index_tags import IndexTags - globals()['IndexSpec'] = IndexSpec - globals()['IndexTags'] = IndexTags + + globals()["IndexSpec"] = IndexSpec + globals()["IndexTags"] = IndexTags from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -72,18 +73,11 @@ class CreateIndexRequest(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ('name',): { - 'max_length': 45, - 'min_length': 1, - }, - ('dimension',): { - 'inclusive_maximum': 20000, - 'inclusive_minimum': 1, - }, + ("name",): {"max_length": 45, "min_length": 1}, + ("dimension",): {"inclusive_maximum": 20000, "inclusive_minimum": 1}, } @cached_class_property @@ -93,7 +87,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -109,34 +103,32 @@ def openapi_types(cls): """ lazy_import() return { - 'name': (str,), # noqa: E501 - 'spec': (IndexSpec,), # noqa: E501 - 'dimension': (int,), # noqa: E501 - 'metric': (str,), # noqa: E501 - 'deletion_protection': (str,), # noqa: E501 - 'tags': (IndexTags,), # noqa: E501 - 'vector_type': (str,), # noqa: E501 + "name": (str,), # noqa: E501 + "spec": (IndexSpec,), # noqa: E501 + "dimension": (int,), # noqa: E501 + "metric": (str,), # noqa: E501 + "deletion_protection": (str,), # noqa: E501 + "tags": (IndexTags,), # noqa: E501 + "vector_type": (str,), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'name': 'name', # noqa: E501 - 'spec': 'spec', # noqa: E501 - 'dimension': 'dimension', # noqa: E501 - 'metric': 'metric', # noqa: E501 - 'deletion_protection': 'deletion_protection', # noqa: E501 - 'tags': 'tags', # noqa: E501 - 'vector_type': 'vector_type', # noqa: E501 + "name": "name", # noqa: E501 + "spec": "spec", # noqa: E501 + "dimension": "dimension", # noqa: E501 + "metric": "metric", # noqa: E501 + "deletion_protection": "deletion_protection", # noqa: E501 + "tags": "tags", # noqa: E501 + "vector_type": "vector_type", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of CreateIndexRequest. @@ -149,8 +141,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], name, spec, *args, **kwargs) -> T: # noqa: E501 @@ -198,22 +188,20 @@ def _from_openapi_data(cls: Type[T], name, spec, *args, **kwargs) -> T: # noqa: 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 """ - _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', ()) + _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__, - ), + "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__,), ) @@ -230,25 +218,29 @@ def _from_openapi_data(cls: Type[T], name, spec, *args, **kwargs) -> T: # noqa: self.name = name self.spec = spec for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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, spec, *args, **kwargs) -> None: # noqa: E501 @@ -297,19 +289,17 @@ def __init__(self, name, spec, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -326,13 +316,17 @@ def __init__(self, name, spec, *args, **kwargs) -> None: # noqa: E501 self.name = name self.spec = spec for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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/error_response.py b/pinecone/core/openapi/db_control/model/error_response.py index b0996f847..781a9f48f 100644 --- a/pinecone/core/openapi/db_control/model/error_response.py +++ b/pinecone/core/openapi/db_control/model/error_response.py @@ -1,15 +1,14 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -32,9 +31,11 @@ if TYPE_CHECKING: from pinecone.core.openapi.db_control.model.error_response_error import ErrorResponseError + def lazy_import(): from pinecone.core.openapi.db_control.model.error_response_error import ErrorResponseError - globals()['ErrorResponseError'] = ErrorResponseError + + globals()["ErrorResponseError"] = ErrorResponseError from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -69,11 +70,9 @@ class ErrorResponse(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -82,7 +81,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -98,24 +97,22 @@ def openapi_types(cls): """ lazy_import() return { - 'status': (int,), # noqa: E501 - 'error': (ErrorResponseError,), # noqa: E501 + "status": (int,), # noqa: E501 + "error": (ErrorResponseError,), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'status': 'status', # noqa: E501 - 'error': 'error', # noqa: E501 + "status": "status", # noqa: E501 + "error": "error", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ErrorResponse. @@ -128,8 +125,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], status, error, *args, **kwargs) -> T: # noqa: E501 @@ -172,22 +167,20 @@ def _from_openapi_data(cls: Type[T], status, error, *args, **kwargs) -> T: # no _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', ()) + _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__, - ), + "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__,), ) @@ -204,25 +197,29 @@ def _from_openapi_data(cls: Type[T], status, error, *args, **kwargs) -> T: # no self.status = status self.error = error for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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, status, error, *args, **kwargs) -> None: # noqa: E501 @@ -266,19 +263,17 @@ def __init__(self, status, error, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -295,13 +290,17 @@ def __init__(self, status, error, *args, **kwargs) -> None: # noqa: E501 self.status = status self.error = error for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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/error_response_error.py b/pinecone/core/openapi/db_control/model/error_response_error.py index ace4a86de..16fc54343 100644 --- a/pinecone/core/openapi/db_control/model/error_response_error.py +++ b/pinecone/core/openapi/db_control/model/error_response_error.py @@ -1,15 +1,14 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -28,7 +27,6 @@ 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 @@ -61,11 +59,9 @@ class ErrorResponseError(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -73,7 +69,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 """ - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -88,26 +84,24 @@ def openapi_types(cls): and the value is attribute type. """ return { - 'code': (str,), # noqa: E501 - 'message': (str,), # noqa: E501 - 'details': (Dict[str, Any],), # noqa: E501 + "code": (str,), # noqa: E501 + "message": (str,), # noqa: E501 + "details": (Dict[str, Any],), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'code': 'code', # noqa: E501 - 'message': 'message', # noqa: E501 - 'details': 'details', # noqa: E501 + "code": "code", # noqa: E501 + "message": "message", # noqa: E501 + "details": "details", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ErrorResponseError. @@ -120,8 +114,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], code, message, *args, **kwargs) -> T: # noqa: E501 @@ -165,22 +157,20 @@ def _from_openapi_data(cls: Type[T], code, message, *args, **kwargs) -> T: # no details (Dict[str, Any]): Additional information about the error. This field is not guaranteed to be present. [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', ()) + _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__, - ), + "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__,), ) @@ -197,25 +187,29 @@ def _from_openapi_data(cls: Type[T], code, message, *args, **kwargs) -> T: # no self.code = code self.message = message for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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, code, message, *args, **kwargs) -> None: # noqa: E501 @@ -260,19 +254,17 @@ def __init__(self, code, message, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -289,13 +281,17 @@ def __init__(self, code, message, *args, **kwargs) -> None: # noqa: E501 self.code = code self.message = message for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + raise PineconeApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/pinecone/core/openapi/db_control/model/index_list.py b/pinecone/core/openapi/db_control/model/index_list.py index 298fdc33b..ff4ea930c 100644 --- a/pinecone/core/openapi/db_control/model/index_list.py +++ b/pinecone/core/openapi/db_control/model/index_list.py @@ -1,15 +1,14 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -32,9 +31,11 @@ if TYPE_CHECKING: from pinecone.core.openapi.db_control.model.index_model import IndexModel + def lazy_import(): from pinecone.core.openapi.db_control.model.index_model import IndexModel - globals()['IndexModel'] = IndexModel + + globals()["IndexModel"] = IndexModel from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -69,11 +70,9 @@ class IndexList(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -82,7 +81,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -98,22 +97,20 @@ def openapi_types(cls): """ lazy_import() return { - 'indexes': ([IndexModel],), # noqa: E501 + "indexes": ([IndexModel],) # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'indexes': 'indexes', # noqa: E501 + "indexes": "indexes" # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of IndexList. @@ -126,8 +123,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 @@ -167,22 +162,20 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 indexes ([IndexModel]): List of indexes in the project [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', ()) + _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__, - ), + "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__,), ) @@ -197,25 +190,29 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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 @@ -256,19 +253,17 @@ def __init__(self, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -283,13 +278,17 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + raise PineconeApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/pinecone/core/openapi/db_control/model/index_model.py b/pinecone/core/openapi/db_control/model/index_model.py index 81b1bd544..4afd6f848 100644 --- a/pinecone/core/openapi/db_control/model/index_model.py +++ b/pinecone/core/openapi/db_control/model/index_model.py @@ -1,15 +1,14 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -34,13 +33,15 @@ from pinecone.core.openapi.db_control.model.index_tags import IndexTags from pinecone.core.openapi.db_control.model.model_index_embed import ModelIndexEmbed + def lazy_import(): 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()['IndexModelStatus'] = IndexModelStatus - globals()['IndexTags'] = IndexTags - globals()['ModelIndexEmbed'] = ModelIndexEmbed + + globals()["IndexModelStatus"] = IndexModelStatus + globals()["IndexTags"] = IndexTags + globals()["ModelIndexEmbed"] = ModelIndexEmbed from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -75,18 +76,11 @@ class IndexModel(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ('name',): { - 'max_length': 45, - 'min_length': 1, - }, - ('dimension',): { - 'inclusive_maximum': 20000, - 'inclusive_minimum': 1, - }, + ("name",): {"max_length": 45, "min_length": 1}, + ("dimension",): {"inclusive_maximum": 20000, "inclusive_minimum": 1}, } @cached_class_property @@ -96,7 +90,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -112,42 +106,40 @@ def openapi_types(cls): """ lazy_import() return { - 'name': (str,), # noqa: E501 - 'metric': (str,), # noqa: E501 - 'host': (str,), # noqa: E501 - 'spec': (Dict[str, Any],), # noqa: E501 - 'status': (IndexModelStatus,), # noqa: E501 - 'vector_type': (str,), # noqa: E501 - 'dimension': (int,), # noqa: E501 - 'private_host': (str,), # noqa: E501 - 'deletion_protection': (str,), # noqa: E501 - 'tags': (IndexTags,), # noqa: E501 - 'embed': (ModelIndexEmbed,), # noqa: E501 + "name": (str,), # noqa: E501 + "metric": (str,), # noqa: E501 + "host": (str,), # noqa: E501 + "spec": (Dict[str, Any],), # noqa: E501 + "status": (IndexModelStatus,), # noqa: E501 + "vector_type": (str,), # noqa: E501 + "dimension": (int,), # noqa: E501 + "private_host": (str,), # noqa: E501 + "deletion_protection": (str,), # noqa: E501 + "tags": (IndexTags,), # noqa: E501 + "embed": (ModelIndexEmbed,), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'name': 'name', # noqa: E501 - 'metric': 'metric', # noqa: E501 - 'host': 'host', # noqa: E501 - 'spec': 'spec', # noqa: E501 - '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 + "name": "name", # noqa: E501 + "metric": "metric", # noqa: E501 + "host": "host", # noqa: E501 + "spec": "spec", # noqa: E501 + "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 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of IndexModel. @@ -160,8 +152,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], name, metric, host, spec, status, *args, **kwargs) -> T: # noqa: E501 @@ -213,23 +203,21 @@ def _from_openapi_data(cls: Type[T], name, metric, host, spec, status, *args, ** embed (ModelIndexEmbed): [optional] # noqa: E501 """ - vector_type = kwargs.get('vector_type', "dense") - _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', ()) + vector_type = kwargs.get("vector_type", "dense") + _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__, - ), + "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__,), ) @@ -250,25 +238,29 @@ def _from_openapi_data(cls: Type[T], name, metric, host, spec, status, *args, ** self.status = status self.vector_type = vector_type for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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, metric, host, spec, status, *args, **kwargs) -> None: # noqa: E501 @@ -320,21 +312,19 @@ def __init__(self, name, metric, host, spec, status, *args, **kwargs) -> None: embed (ModelIndexEmbed): [optional] # noqa: E501 """ - vector_type = kwargs.get('vector_type', "dense") + vector_type = kwargs.get("vector_type", "dense") _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', ()) + _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__, - ), + "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__,), ) @@ -355,13 +345,17 @@ def __init__(self, name, metric, host, spec, status, *args, **kwargs) -> None: self.status = status self.vector_type = vector_type for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + raise PineconeApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/pinecone/core/openapi/db_control/model/index_model_status.py b/pinecone/core/openapi/db_control/model/index_model_status.py index 0d011a531..3d4b20fec 100644 --- a/pinecone/core/openapi/db_control/model/index_model_status.py +++ b/pinecone/core/openapi/db_control/model/index_model_status.py @@ -1,15 +1,14 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -28,7 +27,6 @@ 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 @@ -61,11 +59,9 @@ class IndexModelStatus(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -73,7 +69,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 """ - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -88,24 +84,22 @@ def openapi_types(cls): and the value is attribute type. """ return { - 'ready': (bool,), # noqa: E501 - 'state': (str,), # noqa: E501 + "ready": (bool,), # noqa: E501 + "state": (str,), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'ready': 'ready', # noqa: E501 - 'state': 'state', # noqa: E501 + "ready": "ready", # noqa: E501 + "state": "state", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of IndexModelStatus. @@ -118,8 +112,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], ready, state, *args, **kwargs) -> T: # noqa: E501 @@ -162,22 +154,20 @@ def _from_openapi_data(cls: Type[T], ready, state, *args, **kwargs) -> T: # noq _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', ()) + _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__, - ), + "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__,), ) @@ -194,25 +184,29 @@ def _from_openapi_data(cls: Type[T], ready, state, *args, **kwargs) -> T: # noq self.ready = ready 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: + 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', - ]) + 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, ready, state, *args, **kwargs) -> None: # noqa: E501 @@ -256,19 +250,17 @@ def __init__(self, ready, state, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -285,13 +277,17 @@ def __init__(self, ready, state, *args, **kwargs) -> None: # noqa: E501 self.ready = ready 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: + 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.") + raise PineconeApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/pinecone/core/openapi/db_control/model/index_spec.py b/pinecone/core/openapi/db_control/model/index_spec.py index 70d102c9a..44de6215d 100644 --- a/pinecone/core/openapi/db_control/model/index_spec.py +++ b/pinecone/core/openapi/db_control/model/index_spec.py @@ -1,15 +1,14 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -37,6 +36,7 @@ from pinecone.core.openapi.db_control.model.serverless import Serverless from pinecone.core.openapi.db_control.model.serverless_spec import ServerlessSpec + def lazy_import(): from pinecone.core.openapi.db_control.model.byoc import BYOC from pinecone.core.openapi.db_control.model.byoc_spec import ByocSpec @@ -44,12 +44,13 @@ def lazy_import(): 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 + + globals()["BYOC"] = BYOC + globals()["ByocSpec"] = ByocSpec + globals()["PodBased"] = PodBased + globals()["PodSpec"] = PodSpec + globals()["Serverless"] = Serverless + globals()["ServerlessSpec"] = ServerlessSpec from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -84,11 +85,9 @@ class IndexSpec(ModelComposed): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -97,7 +96,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -113,24 +112,22 @@ def openapi_types(cls): """ lazy_import() return { - 'serverless': (ServerlessSpec,), # noqa: E501 - 'pod': (PodSpec,), # noqa: E501 - 'byoc': (ByocSpec,), # noqa: E501 + "serverless": (ServerlessSpec,), # noqa: E501 + "pod": (PodSpec,), # noqa: E501 + "byoc": (ByocSpec,), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'serverless': 'serverless', # noqa: E501 - 'pod': 'pod', # noqa: E501 - 'byoc': 'byoc', # noqa: E501 + "serverless": "serverless", # noqa: E501 + "pod": "pod", # noqa: E501 + "byoc": "byoc", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) @classmethod @convert_js_args_to_python_args @@ -173,20 +170,18 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 byoc (ByocSpec): [optional] # noqa: E501 """ - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) self = super(OpenApiModel, cls).__new__(cls) if args: raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), + "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__,), ) @@ -199,43 +194,46 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 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, + "_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) + 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: + 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', - ]) + 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 @@ -277,20 +275,18 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 byoc (ByocSpec): [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', ()) + _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__, - ), + "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__,), ) @@ -305,30 +301,33 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 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, + "_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) + 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: + 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.") + 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(): @@ -340,14 +339,4 @@ def _composed_schemas(): # classes don't exist yet because their module has not finished # loading lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - ], - 'oneOf': [ - BYOC, - PodBased, - Serverless, - ], - } + 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 5a78e612a..a87b1ff03 100644 --- a/pinecone/core/openapi/db_control/model/index_tags.py +++ b/pinecone/core/openapi/db_control/model/index_tags.py @@ -1,15 +1,14 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -28,7 +27,6 @@ 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 @@ -61,11 +59,9 @@ class IndexTags(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -87,21 +83,17 @@ def openapi_types(cls): openapi_types (dict): The key is attribute name and the value is attribute type. """ - return { - } + return {} @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = {} - attribute_map: Dict[str, str] = { - } - - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of IndexTags. @@ -114,8 +106,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 @@ -154,22 +144,20 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 _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', ()) + _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__, - ), + "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__,), ) @@ -184,25 +172,29 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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 @@ -242,19 +234,17 @@ def __init__(self, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -269,13 +259,17 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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/model_index_embed.py b/pinecone/core/openapi/db_control/model/model_index_embed.py index f54a764bf..cf9ab54e1 100644 --- a/pinecone/core/openapi/db_control/model/model_index_embed.py +++ b/pinecone/core/openapi/db_control/model/model_index_embed.py @@ -1,15 +1,14 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -28,7 +27,6 @@ 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 @@ -61,14 +59,10 @@ class ModelIndexEmbed(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ('dimension',): { - 'inclusive_maximum': 20000, - 'inclusive_minimum': 1, - }, + ("dimension",): {"inclusive_maximum": 20000, "inclusive_minimum": 1} } @cached_class_property @@ -77,7 +71,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 """ - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -92,34 +86,32 @@ def openapi_types(cls): and the value is attribute type. """ return { - 'model': (str,), # noqa: E501 - 'metric': (str,), # noqa: E501 - 'dimension': (int,), # noqa: E501 - 'vector_type': (str,), # noqa: E501 - 'field_map': (Dict[str, Any],), # noqa: E501 - 'read_parameters': (Dict[str, Any],), # noqa: E501 - 'write_parameters': (Dict[str, Any],), # noqa: E501 + "model": (str,), # noqa: E501 + "metric": (str,), # noqa: E501 + "dimension": (int,), # noqa: E501 + "vector_type": (str,), # noqa: E501 + "field_map": (Dict[str, Any],), # noqa: E501 + "read_parameters": (Dict[str, Any],), # noqa: E501 + "write_parameters": (Dict[str, Any],), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'model': 'model', # noqa: E501 - 'metric': 'metric', # noqa: E501 - 'dimension': 'dimension', # noqa: E501 - 'vector_type': 'vector_type', # noqa: E501 - 'field_map': 'field_map', # noqa: E501 - 'read_parameters': 'read_parameters', # noqa: E501 - 'write_parameters': 'write_parameters', # noqa: E501 + "model": "model", # noqa: E501 + "metric": "metric", # noqa: E501 + "dimension": "dimension", # noqa: E501 + "vector_type": "vector_type", # noqa: E501 + "field_map": "field_map", # noqa: E501 + "read_parameters": "read_parameters", # noqa: E501 + "write_parameters": "write_parameters", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ModelIndexEmbed. @@ -132,8 +124,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], model, *args, **kwargs) -> T: # noqa: E501 @@ -181,22 +171,20 @@ def _from_openapi_data(cls: Type[T], model, *args, **kwargs) -> T: # noqa: E501 write_parameters (Dict[str, Any]): The write parameters for the embedding model. [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', ()) + _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__, - ), + "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__,), ) @@ -212,25 +200,29 @@ def _from_openapi_data(cls: Type[T], model, *args, **kwargs) -> T: # noqa: E501 self.model = model for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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, model, *args, **kwargs) -> None: # noqa: E501 @@ -279,19 +271,17 @@ def __init__(self, model, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -307,13 +297,17 @@ def __init__(self, model, *args, **kwargs) -> None: # noqa: E501 self.model = model for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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/pagination_response.py b/pinecone/core/openapi/db_control/model/pagination_response.py index dabf238e6..945b6e2e7 100644 --- a/pinecone/core/openapi/db_control/model/pagination_response.py +++ b/pinecone/core/openapi/db_control/model/pagination_response.py @@ -1,15 +1,14 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -28,7 +27,6 @@ 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 @@ -61,11 +59,9 @@ class PaginationResponse(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -73,7 +69,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 """ - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -88,22 +84,20 @@ def openapi_types(cls): and the value is attribute type. """ return { - 'next': (str,), # noqa: E501 + "next": (str,) # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'next': 'next', # noqa: E501 + "next": "next" # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of PaginationResponse. @@ -116,8 +110,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], next, *args, **kwargs) -> T: # noqa: E501 @@ -159,22 +151,20 @@ def _from_openapi_data(cls: Type[T], next, *args, **kwargs) -> T: # noqa: E501 _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', ()) + _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__, - ), + "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__,), ) @@ -190,25 +180,29 @@ def _from_openapi_data(cls: Type[T], next, *args, **kwargs) -> T: # noqa: E501 self.next = next for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + 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', - ]) + 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, next, *args, **kwargs) -> None: # noqa: E501 @@ -251,19 +245,17 @@ def __init__(self, next, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -279,13 +271,17 @@ def __init__(self, next, *args, **kwargs) -> None: # noqa: E501 self.next = next for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + 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.") + 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/pod_based.py b/pinecone/core/openapi/db_control/model/pod_based.py index f1c33498d..70a67564f 100644 --- a/pinecone/core/openapi/db_control/model/pod_based.py +++ b/pinecone/core/openapi/db_control/model/pod_based.py @@ -1,15 +1,14 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -32,9 +31,11 @@ if TYPE_CHECKING: from pinecone.core.openapi.db_control.model.pod_spec import PodSpec + def lazy_import(): from pinecone.core.openapi.db_control.model.pod_spec import PodSpec - globals()['PodSpec'] = PodSpec + + globals()["PodSpec"] = PodSpec from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -69,11 +70,9 @@ class PodBased(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -82,7 +81,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -98,22 +97,20 @@ def openapi_types(cls): """ lazy_import() return { - 'pod': (PodSpec,), # noqa: E501 + "pod": (PodSpec,) # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'pod': 'pod', # noqa: E501 + "pod": "pod" # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of PodBased. @@ -126,8 +123,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], pod, *args, **kwargs) -> T: # noqa: E501 @@ -169,22 +164,20 @@ def _from_openapi_data(cls: Type[T], pod, *args, **kwargs) -> T: # noqa: E501 _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', ()) + _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__, - ), + "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__,), ) @@ -200,25 +193,29 @@ def _from_openapi_data(cls: Type[T], pod, *args, **kwargs) -> T: # noqa: E501 self.pod = pod for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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, pod, *args, **kwargs) -> None: # noqa: E501 @@ -261,19 +258,17 @@ def __init__(self, pod, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -289,13 +284,17 @@ def __init__(self, pod, *args, **kwargs) -> None: # noqa: E501 self.pod = pod for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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/pod_spec.py b/pinecone/core/openapi/db_control/model/pod_spec.py index 489a87e89..dcb7d6544 100644 --- a/pinecone/core/openapi/db_control/model/pod_spec.py +++ b/pinecone/core/openapi/db_control/model/pod_spec.py @@ -1,15 +1,14 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -30,11 +29,17 @@ from typing import TYPE_CHECKING if TYPE_CHECKING: - from pinecone.core.openapi.db_control.model.pod_spec_metadata_config import PodSpecMetadataConfig + from pinecone.core.openapi.db_control.model.pod_spec_metadata_config import ( + PodSpecMetadataConfig, + ) + def lazy_import(): - from pinecone.core.openapi.db_control.model.pod_spec_metadata_config import PodSpecMetadataConfig - globals()['PodSpecMetadataConfig'] = PodSpecMetadataConfig + from pinecone.core.openapi.db_control.model.pod_spec_metadata_config import ( + PodSpecMetadataConfig, + ) + + globals()["PodSpecMetadataConfig"] = PodSpecMetadataConfig from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -69,19 +74,12 @@ class PodSpec(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ('replicas',): { - 'inclusive_minimum': 1, - }, - ('shards',): { - 'inclusive_minimum': 1, - }, - ('pods',): { - 'inclusive_minimum': 1, - }, + ("replicas",): {"inclusive_minimum": 1}, + ("shards",): {"inclusive_minimum": 1}, + ("pods",): {"inclusive_minimum": 1}, } @cached_class_property @@ -91,7 +89,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -107,34 +105,32 @@ def openapi_types(cls): """ lazy_import() return { - 'environment': (str,), # noqa: E501 - 'pod_type': (str,), # noqa: E501 - 'replicas': (int,), # noqa: E501 - 'shards': (int,), # noqa: E501 - 'pods': (int,), # noqa: E501 - 'metadata_config': (PodSpecMetadataConfig,), # noqa: E501 - 'source_collection': (str,), # noqa: E501 + "environment": (str,), # noqa: E501 + "pod_type": (str,), # noqa: E501 + "replicas": (int,), # noqa: E501 + "shards": (int,), # noqa: E501 + "pods": (int,), # noqa: E501 + "metadata_config": (PodSpecMetadataConfig,), # noqa: E501 + "source_collection": (str,), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'environment': 'environment', # noqa: E501 - 'pod_type': 'pod_type', # noqa: E501 - 'replicas': 'replicas', # noqa: E501 - 'shards': 'shards', # noqa: E501 - 'pods': 'pods', # noqa: E501 - 'metadata_config': 'metadata_config', # noqa: E501 - 'source_collection': 'source_collection', # noqa: E501 + "environment": "environment", # noqa: E501 + "pod_type": "pod_type", # noqa: E501 + "replicas": "replicas", # noqa: E501 + "shards": "shards", # noqa: E501 + "pods": "pods", # noqa: E501 + "metadata_config": "metadata_config", # noqa: E501 + "source_collection": "source_collection", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of PodSpec. @@ -147,8 +143,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], environment, *args, **kwargs) -> T: # noqa: E501 @@ -196,23 +190,21 @@ def _from_openapi_data(cls: Type[T], environment, *args, **kwargs) -> T: # noqa source_collection (str): The name of the collection to be used as the source for the index. [optional] # noqa: E501 """ - pod_type = kwargs.get('pod_type', "p1.x1") - _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', ()) + pod_type = kwargs.get("pod_type", "p1.x1") + _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__, - ), + "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__,), ) @@ -229,25 +221,29 @@ def _from_openapi_data(cls: Type[T], environment, *args, **kwargs) -> T: # noqa self.environment = environment self.pod_type = pod_type for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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, environment, *args, **kwargs) -> None: # noqa: E501 @@ -295,21 +291,19 @@ def __init__(self, environment, *args, **kwargs) -> None: # noqa: E501 source_collection (str): The name of the collection to be used as the source for the index. [optional] # noqa: E501 """ - pod_type = kwargs.get('pod_type', "p1.x1") + pod_type = kwargs.get("pod_type", "p1.x1") _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', ()) + _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__, - ), + "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__,), ) @@ -326,13 +320,17 @@ def __init__(self, environment, *args, **kwargs) -> None: # noqa: E501 self.environment = environment self.pod_type = pod_type for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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/pod_spec_metadata_config.py b/pinecone/core/openapi/db_control/model/pod_spec_metadata_config.py index fd3c7289d..3fdf1753b 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 @@ -1,15 +1,14 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -28,7 +27,6 @@ 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 @@ -61,11 +59,9 @@ class PodSpecMetadataConfig(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -73,7 +69,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 """ - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -88,22 +84,20 @@ def openapi_types(cls): and the value is attribute type. """ return { - 'indexed': ([str],), # noqa: E501 + "indexed": ([str],) # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'indexed': 'indexed', # noqa: E501 + "indexed": "indexed" # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of PodSpecMetadataConfig. @@ -116,8 +110,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 @@ -157,22 +149,20 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 indexed ([str]): By default, all metadata is indexed; to change this behavior, use this property to specify an array of metadata fields that should be indexed. [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', ()) + _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__, - ), + "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__,), ) @@ -187,25 +177,29 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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 @@ -246,19 +240,17 @@ def __init__(self, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -273,13 +265,17 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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.py b/pinecone/core/openapi/db_control/model/read_capacity.py index ab45a53f1..98e972ca2 100644 --- a/pinecone/core/openapi/db_control/model/read_capacity.py +++ b/pinecone/core/openapi/db_control/model/read_capacity.py @@ -1,15 +1,14 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -30,17 +29,31 @@ from typing import TYPE_CHECKING if TYPE_CHECKING: - 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 + 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, + ) + 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 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 @@ -75,11 +88,9 @@ class ReadCapacity(ModelComposed): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -88,7 +99,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -104,30 +115,29 @@ def openapi_types(cls): """ lazy_import() return { - 'mode': (str,), # noqa: E501 - 'dedicated': (ReadCapacityDedicatedConfig,), # noqa: E501 + "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, + "Dedicated": ReadCapacityDedicatedSpec, + "OnDemand": ReadCapacityOnDemandSpec, + "ReadCapacityDedicatedSpec": ReadCapacityDedicatedSpec, + "ReadCapacityOnDemandSpec": ReadCapacityOnDemandSpec, } if not val: return None - return {'mode': val} + return {"mode": val} attribute_map: Dict[str, str] = { - 'mode': 'mode', # noqa: E501 - 'dedicated': 'dedicated', # noqa: E501 + "mode": "mode", # noqa: E501 + "dedicated": "dedicated", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) @classmethod @convert_js_args_to_python_args @@ -169,20 +179,18 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # 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', ()) + _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__, - ), + "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__,), ) @@ -195,43 +203,46 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 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, + "_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) + 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: + 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', - ]) + 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 @@ -272,20 +283,18 @@ def __init__(self, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -300,30 +309,33 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 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, + "_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) + 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: + 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.") + 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(): @@ -336,12 +348,7 @@ def _composed_schemas(): # loading lazy_import() return { - 'anyOf': [ - ], - 'allOf': [ - ], - 'oneOf': [ - ReadCapacityDedicatedSpec, - ReadCapacityOnDemandSpec, - ], + "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 index 0f5e838e8..48f9648c0 100644 --- a/pinecone/core/openapi/db_control/model/read_capacity_dedicated_config.py +++ b/pinecone/core/openapi/db_control/model/read_capacity_dedicated_config.py @@ -1,15 +1,14 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -32,9 +31,11 @@ if TYPE_CHECKING: from pinecone.core.openapi.db_control.model.scaling_config_manual import ScalingConfigManual + def lazy_import(): from pinecone.core.openapi.db_control.model.scaling_config_manual import ScalingConfigManual - globals()['ScalingConfigManual'] = ScalingConfigManual + + globals()["ScalingConfigManual"] = ScalingConfigManual from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -69,11 +70,9 @@ class ReadCapacityDedicatedConfig(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -82,7 +81,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -98,26 +97,24 @@ def openapi_types(cls): """ lazy_import() return { - 'node_type': (str,), # noqa: E501 - 'scaling': (str,), # noqa: E501 - 'manual': (ScalingConfigManual,), # noqa: E501 + "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 + "node_type": "node_type", # noqa: E501 + "scaling": "scaling", # noqa: E501 + "manual": "manual", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ReadCapacityDedicatedConfig. @@ -130,8 +127,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], node_type, scaling, *args, **kwargs) -> T: # noqa: E501 @@ -175,22 +170,20 @@ def _from_openapi_data(cls: Type[T], node_type, scaling, *args, **kwargs) -> T: 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', ()) + _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__, - ), + "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__,), ) @@ -207,25 +200,29 @@ def _from_openapi_data(cls: Type[T], node_type, scaling, *args, **kwargs) -> T: 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: + 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', - ]) + 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 @@ -270,19 +267,17 @@ def __init__(self, node_type, scaling, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -299,13 +294,17 @@ def __init__(self, node_type, scaling, *args, **kwargs) -> None: # noqa: E501 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: + 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.") + 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 index 848455ac6..6a77424ce 100644 --- a/pinecone/core/openapi/db_control/model/read_capacity_dedicated_spec.py +++ b/pinecone/core/openapi/db_control/model/read_capacity_dedicated_spec.py @@ -1,15 +1,14 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -30,11 +29,17 @@ from typing import TYPE_CHECKING if TYPE_CHECKING: - from pinecone.core.openapi.db_control.model.read_capacity_dedicated_config import ReadCapacityDedicatedConfig + from pinecone.core.openapi.db_control.model.read_capacity_dedicated_config import ( + ReadCapacityDedicatedConfig, + ) + def lazy_import(): - from pinecone.core.openapi.db_control.model.read_capacity_dedicated_config import ReadCapacityDedicatedConfig - globals()['ReadCapacityDedicatedConfig'] = ReadCapacityDedicatedConfig + 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 @@ -69,11 +74,9 @@ class ReadCapacityDedicatedSpec(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -82,7 +85,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -98,24 +101,22 @@ def openapi_types(cls): """ lazy_import() return { - 'mode': (str,), # noqa: E501 - 'dedicated': (ReadCapacityDedicatedConfig,), # noqa: E501 + "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 + "mode": "mode", # noqa: E501 + "dedicated": "dedicated", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ReadCapacityDedicatedSpec. @@ -128,8 +129,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], mode, dedicated, *args, **kwargs) -> T: # noqa: E501 @@ -172,22 +171,20 @@ def _from_openapi_data(cls: Type[T], mode, dedicated, *args, **kwargs) -> T: # _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', ()) + _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__, - ), + "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__,), ) @@ -204,25 +201,29 @@ def _from_openapi_data(cls: Type[T], mode, dedicated, *args, **kwargs) -> T: # 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: + 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', - ]) + 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 @@ -266,19 +267,17 @@ def __init__(self, mode, dedicated, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -295,13 +294,17 @@ def __init__(self, mode, dedicated, *args, **kwargs) -> None: # noqa: E501 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: + 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.") + 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 index 266ced578..299450d04 100644 --- 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 @@ -1,15 +1,14 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -30,14 +29,20 @@ from typing import TYPE_CHECKING if TYPE_CHECKING: - from pinecone.core.openapi.db_control.model.read_capacity_dedicated_config import ReadCapacityDedicatedConfig + 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 + 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_config import ( + ReadCapacityDedicatedConfig, + ) from pinecone.core.openapi.db_control.model.read_capacity_status import ReadCapacityStatus - globals()['ReadCapacityDedicatedConfig'] = ReadCapacityDedicatedConfig - globals()['ReadCapacityStatus'] = ReadCapacityStatus + + globals()["ReadCapacityDedicatedConfig"] = ReadCapacityDedicatedConfig + globals()["ReadCapacityStatus"] = ReadCapacityStatus from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -72,11 +77,9 @@ class ReadCapacityDedicatedSpecResponse(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} additional_properties_type = None @@ -94,26 +97,24 @@ def openapi_types(cls): """ lazy_import() return { - 'mode': (str,), # noqa: E501 - 'dedicated': (ReadCapacityDedicatedConfig,), # noqa: E501 - 'status': (ReadCapacityStatus,), # noqa: E501 + "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 + "mode": "mode", # noqa: E501 + "dedicated": "dedicated", # noqa: E501 + "status": "status", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ReadCapacityDedicatedSpecResponse. @@ -126,8 +127,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], mode, dedicated, status, *args, **kwargs) -> T: # noqa: E501 @@ -171,22 +170,20 @@ def _from_openapi_data(cls: Type[T], mode, dedicated, status, *args, **kwargs) - _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', ()) + _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__, - ), + "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__,), ) @@ -204,25 +201,29 @@ def _from_openapi_data(cls: Type[T], mode, dedicated, status, *args, **kwargs) - 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: + 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', - ]) + 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 @@ -267,19 +268,17 @@ def __init__(self, mode, dedicated, status, *args, **kwargs) -> None: # noqa: E """ _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', ()) + _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__, - ), + "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__,), ) @@ -297,13 +296,17 @@ def __init__(self, mode, dedicated, status, *args, **kwargs) -> None: # noqa: E 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: + 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.") + 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 index 4d54fadc3..4bfd4f92f 100644 --- 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 @@ -1,15 +1,14 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -28,7 +27,6 @@ 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 @@ -61,11 +59,9 @@ class ReadCapacityOnDemandSpec(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} additional_properties_type = None @@ -82,22 +78,20 @@ def openapi_types(cls): and the value is attribute type. """ return { - 'mode': (str,), # noqa: E501 + "mode": (str,) # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'mode': 'mode', # noqa: E501 + "mode": "mode" # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ReadCapacityOnDemandSpec. @@ -110,8 +104,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], mode, *args, **kwargs) -> T: # noqa: E501 @@ -153,22 +145,20 @@ def _from_openapi_data(cls: Type[T], mode, *args, **kwargs) -> T: # noqa: E501 _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', ()) + _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__, - ), + "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__,), ) @@ -184,25 +174,29 @@ def _from_openapi_data(cls: Type[T], mode, *args, **kwargs) -> T: # noqa: E501 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: + 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', - ]) + 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 @@ -245,19 +239,17 @@ def __init__(self, mode, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -273,13 +265,17 @@ def __init__(self, mode, *args, **kwargs) -> None: # noqa: E501 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: + 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.") + 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 index 8ede2531f..6b49936f7 100644 --- 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 @@ -1,15 +1,14 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -32,9 +31,11 @@ if TYPE_CHECKING: from pinecone.core.openapi.db_control.model.read_capacity_status import ReadCapacityStatus + def lazy_import(): from pinecone.core.openapi.db_control.model.read_capacity_status import ReadCapacityStatus - globals()['ReadCapacityStatus'] = ReadCapacityStatus + + globals()["ReadCapacityStatus"] = ReadCapacityStatus from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -69,11 +70,9 @@ class ReadCapacityOnDemandSpecResponse(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} additional_properties_type = None @@ -91,24 +90,22 @@ def openapi_types(cls): """ lazy_import() return { - 'mode': (str,), # noqa: E501 - 'status': (ReadCapacityStatus,), # noqa: E501 + "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 + "mode": "mode", # noqa: E501 + "status": "status", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ReadCapacityOnDemandSpecResponse. @@ -121,8 +118,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], mode, status, *args, **kwargs) -> T: # noqa: E501 @@ -165,22 +160,20 @@ def _from_openapi_data(cls: Type[T], mode, status, *args, **kwargs) -> T: # noq _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', ()) + _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__, - ), + "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__,), ) @@ -197,25 +190,29 @@ def _from_openapi_data(cls: Type[T], mode, status, *args, **kwargs) -> T: # noq 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: + 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', - ]) + 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 @@ -259,19 +256,17 @@ def __init__(self, mode, status, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -288,13 +283,17 @@ def __init__(self, mode, status, *args, **kwargs) -> None: # noqa: E501 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: + 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.") + 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 index b072f9816..d1dc889a7 100644 --- a/pinecone/core/openapi/db_control/model/read_capacity_response.py +++ b/pinecone/core/openapi/db_control/model/read_capacity_response.py @@ -1,15 +1,14 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -30,20 +29,34 @@ from typing import TYPE_CHECKING if TYPE_CHECKING: - 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_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 + 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_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 + + globals()["ReadCapacityDedicatedConfig"] = ReadCapacityDedicatedConfig + globals()["ReadCapacityDedicatedSpecResponse"] = ReadCapacityDedicatedSpecResponse + globals()["ReadCapacityOnDemandSpecResponse"] = ReadCapacityOnDemandSpecResponse + globals()["ReadCapacityStatus"] = ReadCapacityStatus from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -78,11 +91,9 @@ class ReadCapacityResponse(ModelComposed): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -91,7 +102,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -107,32 +118,31 @@ def openapi_types(cls): """ lazy_import() return { - 'mode': (str,), # noqa: E501 - 'status': (ReadCapacityStatus,), # noqa: E501 - 'dedicated': (ReadCapacityDedicatedConfig,), # noqa: E501 + "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, + "Dedicated": ReadCapacityDedicatedSpecResponse, + "OnDemand": ReadCapacityOnDemandSpecResponse, + "ReadCapacityDedicatedSpecResponse": ReadCapacityDedicatedSpecResponse, + "ReadCapacityOnDemandSpecResponse": ReadCapacityOnDemandSpecResponse, } if not val: return None - return {'mode': val} + return {"mode": val} attribute_map: Dict[str, str] = { - 'mode': 'mode', # noqa: E501 - 'status': 'status', # noqa: E501 - 'dedicated': 'dedicated', # noqa: E501 + "mode": "mode", # noqa: E501 + "status": "status", # noqa: E501 + "dedicated": "dedicated", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) @classmethod @convert_js_args_to_python_args @@ -175,20 +185,18 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # 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', ()) + _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__, - ), + "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__,), ) @@ -201,43 +209,46 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 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, + "_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) + 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: + 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', - ]) + 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 @@ -279,20 +290,18 @@ def __init__(self, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -307,30 +316,33 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 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, + "_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) + 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: + 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.") + 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(): @@ -343,12 +355,7 @@ def _composed_schemas(): # loading lazy_import() return { - 'anyOf': [ - ], - 'allOf': [ - ], - 'oneOf': [ - ReadCapacityDedicatedSpecResponse, - ReadCapacityOnDemandSpecResponse, - ], + "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 index 40ad7790a..735a64ad5 100644 --- a/pinecone/core/openapi/db_control/model/read_capacity_status.py +++ b/pinecone/core/openapi/db_control/model/read_capacity_status.py @@ -1,15 +1,14 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -28,7 +27,6 @@ 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 @@ -61,11 +59,9 @@ class ReadCapacityStatus(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -73,7 +69,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 """ - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -88,28 +84,26 @@ def openapi_types(cls): 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 + "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 + "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([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ReadCapacityStatus. @@ -122,8 +116,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], state, *args, **kwargs) -> T: # noqa: E501 @@ -168,22 +160,20 @@ def _from_openapi_data(cls: Type[T], state, *args, **kwargs) -> T: # 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', ()) + _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__, - ), + "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__,), ) @@ -199,25 +189,29 @@ def _from_openapi_data(cls: Type[T], state, *args, **kwargs) -> T: # noqa: E501 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: + 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', - ]) + 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 @@ -263,19 +257,17 @@ def __init__(self, state, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -291,13 +283,17 @@ def __init__(self, state, *args, **kwargs) -> None: # noqa: E501 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: + 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.") + 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 64e77cc71..e1a4d21a5 100644 --- a/pinecone/core/openapi/db_control/model/restore_job_list.py +++ b/pinecone/core/openapi/db_control/model/restore_job_list.py @@ -1,15 +1,14 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -33,11 +32,13 @@ from pinecone.core.openapi.db_control.model.pagination_response import PaginationResponse from pinecone.core.openapi.db_control.model.restore_job_model import RestoreJobModel + def lazy_import(): from pinecone.core.openapi.db_control.model.pagination_response import PaginationResponse from pinecone.core.openapi.db_control.model.restore_job_model import RestoreJobModel - globals()['PaginationResponse'] = PaginationResponse - globals()['RestoreJobModel'] = RestoreJobModel + + globals()["PaginationResponse"] = PaginationResponse + globals()["RestoreJobModel"] = RestoreJobModel from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -72,11 +73,9 @@ class RestoreJobList(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -85,7 +84,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -101,24 +100,22 @@ def openapi_types(cls): """ lazy_import() return { - 'data': ([RestoreJobModel],), # noqa: E501 - 'pagination': (PaginationResponse,), # noqa: E501 + "data": ([RestoreJobModel],), # noqa: E501 + "pagination": (PaginationResponse,), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'data': 'data', # noqa: E501 - 'pagination': 'pagination', # noqa: E501 + "data": "data", # noqa: E501 + "pagination": "pagination", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of RestoreJobList. @@ -131,8 +128,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], data, *args, **kwargs) -> T: # noqa: E501 @@ -175,22 +170,20 @@ def _from_openapi_data(cls: Type[T], data, *args, **kwargs) -> T: # noqa: E501 pagination (PaginationResponse): [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', ()) + _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__, - ), + "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__,), ) @@ -206,25 +199,29 @@ def _from_openapi_data(cls: Type[T], data, *args, **kwargs) -> T: # noqa: E501 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: + 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', - ]) + 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 @@ -268,19 +265,17 @@ def __init__(self, data, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -296,13 +291,17 @@ def __init__(self, data, *args, **kwargs) -> None: # noqa: E501 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: + 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.") + raise PineconeApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/pinecone/core/openapi/db_control/model/restore_job_model.py b/pinecone/core/openapi/db_control/model/restore_job_model.py index 2abbefd0c..d278d0b6c 100644 --- a/pinecone/core/openapi/db_control/model/restore_job_model.py +++ b/pinecone/core/openapi/db_control/model/restore_job_model.py @@ -1,15 +1,14 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -28,7 +27,6 @@ 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 @@ -61,14 +59,10 @@ class RestoreJobModel(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ('percent_complete',): { - 'inclusive_maximum': 100.0, - 'inclusive_minimum': 0.0, - }, + ("percent_complete",): {"inclusive_maximum": 100.0, "inclusive_minimum": 0.0} } @cached_class_property @@ -77,7 +71,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 """ - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -92,36 +86,34 @@ def openapi_types(cls): and the value is attribute type. """ return { - 'restore_job_id': (str,), # noqa: E501 - 'backup_id': (str,), # noqa: E501 - 'target_index_name': (str,), # noqa: E501 - 'target_index_id': (str,), # noqa: E501 - 'status': (str,), # noqa: E501 - 'created_at': (datetime,), # noqa: E501 - 'completed_at': (datetime,), # noqa: E501 - 'percent_complete': (float,), # noqa: E501 + "restore_job_id": (str,), # noqa: E501 + "backup_id": (str,), # noqa: E501 + "target_index_name": (str,), # noqa: E501 + "target_index_id": (str,), # noqa: E501 + "status": (str,), # noqa: E501 + "created_at": (datetime,), # noqa: E501 + "completed_at": (datetime,), # noqa: E501 + "percent_complete": (float,), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'restore_job_id': 'restore_job_id', # noqa: E501 - 'backup_id': 'backup_id', # noqa: E501 - 'target_index_name': 'target_index_name', # noqa: E501 - 'target_index_id': 'target_index_id', # noqa: E501 - 'status': 'status', # noqa: E501 - 'created_at': 'created_at', # noqa: E501 - 'completed_at': 'completed_at', # noqa: E501 - 'percent_complete': 'percent_complete', # noqa: E501 + "restore_job_id": "restore_job_id", # noqa: E501 + "backup_id": "backup_id", # noqa: E501 + "target_index_name": "target_index_name", # noqa: E501 + "target_index_id": "target_index_id", # noqa: E501 + "status": "status", # noqa: E501 + "created_at": "created_at", # noqa: E501 + "completed_at": "completed_at", # noqa: E501 + "percent_complete": "percent_complete", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of RestoreJobModel. @@ -134,11 +126,19 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args - def _from_openapi_data(cls: Type[T], restore_job_id, backup_id, target_index_name, target_index_id, status, created_at, *args, **kwargs) -> T: # noqa: E501 + def _from_openapi_data( + cls: Type[T], + restore_job_id, + backup_id, + target_index_name, + target_index_id, + status, + created_at, + *args, + **kwargs, + ) -> T: # noqa: E501 """RestoreJobModel - a model defined in OpenAPI Args: @@ -184,22 +184,20 @@ def _from_openapi_data(cls: Type[T], restore_job_id, backup_id, target_index_nam percent_complete (float): The progress made by the restore job out of 100 [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', ()) + _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__, - ), + "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__,), ) @@ -220,28 +218,42 @@ def _from_openapi_data(cls: Type[T], restore_job_id, backup_id, target_index_nam self.status = status self.created_at = created_at for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + 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', - ]) + 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, restore_job_id, backup_id, target_index_name, target_index_id, status, created_at, *args, **kwargs) -> None: # noqa: E501 + def __init__( + self, + restore_job_id, + backup_id, + target_index_name, + target_index_id, + status, + created_at, + *args, + **kwargs, + ) -> None: # noqa: E501 """RestoreJobModel - a model defined in OpenAPI Args: @@ -288,19 +300,17 @@ def __init__(self, restore_job_id, backup_id, target_index_name, target_index_id """ _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', ()) + _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__, - ), + "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__,), ) @@ -321,13 +331,17 @@ def __init__(self, restore_job_id, backup_id, target_index_name, target_index_id self.status = status self.created_at = created_at for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + 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.") + 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/scaling_config_manual.py b/pinecone/core/openapi/db_control/model/scaling_config_manual.py index 4e1f3f925..75d02ea42 100644 --- a/pinecone/core/openapi/db_control/model/scaling_config_manual.py +++ b/pinecone/core/openapi/db_control/model/scaling_config_manual.py @@ -1,15 +1,14 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -28,7 +27,6 @@ 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 @@ -61,16 +59,11 @@ class ScalingConfigManual(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ('replicas',): { - 'inclusive_minimum': 0, - }, - ('shards',): { - 'inclusive_minimum': 1, - }, + ("replicas",): {"inclusive_minimum": 0}, + ("shards",): {"inclusive_minimum": 1}, } @cached_class_property @@ -79,7 +72,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 """ - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -94,24 +87,22 @@ def openapi_types(cls): and the value is attribute type. """ return { - 'replicas': (int,), # noqa: E501 - 'shards': (int,), # noqa: E501 + "replicas": (int,), # noqa: E501 + "shards": (int,), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'replicas': 'replicas', # noqa: E501 - 'shards': 'shards', # noqa: E501 + "replicas": "replicas", # noqa: E501 + "shards": "shards", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ScalingConfigManual. @@ -124,8 +115,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], replicas, shards, *args, **kwargs) -> T: # noqa: E501 @@ -168,22 +157,20 @@ def _from_openapi_data(cls: Type[T], replicas, shards, *args, **kwargs) -> T: # _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', ()) + _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__, - ), + "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__,), ) @@ -200,25 +187,29 @@ def _from_openapi_data(cls: Type[T], replicas, shards, *args, **kwargs) -> T: # self.replicas = replicas self.shards = shards for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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, replicas, shards, *args, **kwargs) -> None: # noqa: E501 @@ -262,19 +253,17 @@ def __init__(self, replicas, shards, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -291,13 +280,17 @@ def __init__(self, replicas, shards, *args, **kwargs) -> None: # noqa: E501 self.replicas = replicas self.shards = shards for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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.py b/pinecone/core/openapi/db_control/model/serverless.py index 936f08b7d..283f2b74e 100644 --- a/pinecone/core/openapi/db_control/model/serverless.py +++ b/pinecone/core/openapi/db_control/model/serverless.py @@ -1,15 +1,14 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -32,9 +31,11 @@ if TYPE_CHECKING: from pinecone.core.openapi.db_control.model.serverless_spec import ServerlessSpec + def lazy_import(): from pinecone.core.openapi.db_control.model.serverless_spec import ServerlessSpec - globals()['ServerlessSpec'] = ServerlessSpec + + globals()["ServerlessSpec"] = ServerlessSpec from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -69,11 +70,9 @@ class Serverless(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -82,7 +81,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -98,22 +97,20 @@ def openapi_types(cls): """ lazy_import() return { - 'serverless': (ServerlessSpec,), # noqa: E501 + "serverless": (ServerlessSpec,) # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'serverless': 'serverless', # noqa: E501 + "serverless": "serverless" # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of Serverless. @@ -126,8 +123,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], serverless, *args, **kwargs) -> T: # noqa: E501 @@ -169,22 +164,20 @@ def _from_openapi_data(cls: Type[T], serverless, *args, **kwargs) -> T: # noqa: _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', ()) + _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__, - ), + "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__,), ) @@ -200,25 +193,29 @@ def _from_openapi_data(cls: Type[T], serverless, *args, **kwargs) -> T: # noqa: 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: + 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', - ]) + 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 @@ -261,19 +258,17 @@ def __init__(self, serverless, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -289,13 +284,17 @@ def __init__(self, serverless, *args, **kwargs) -> None: # noqa: E501 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: + 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.") + 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 0408039b2..239ac69ad 100644 --- a/pinecone/core/openapi/db_control/model/serverless_spec.py +++ b/pinecone/core/openapi/db_control/model/serverless_spec.py @@ -1,15 +1,14 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -33,11 +32,13 @@ from pinecone.core.openapi.db_control.model.backup_model_schema import BackupModelSchema from pinecone.core.openapi.db_control.model.read_capacity import ReadCapacity + 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 + + globals()["BackupModelSchema"] = BackupModelSchema + globals()["ReadCapacity"] = ReadCapacity from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -72,11 +73,9 @@ class ServerlessSpec(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -85,7 +84,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -101,30 +100,28 @@ def openapi_types(cls): """ 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 + "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 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 + "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([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ServerlessSpec. @@ -137,8 +134,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], cloud, region, *args, **kwargs) -> T: # noqa: E501 @@ -184,22 +179,20 @@ def _from_openapi_data(cls: Type[T], cloud, region, *args, **kwargs) -> T: # no 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', ()) + _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__, - ), + "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__,), ) @@ -216,25 +209,29 @@ def _from_openapi_data(cls: Type[T], cloud, region, *args, **kwargs) -> T: # no self.cloud = cloud self.region = region for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + 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', - ]) + 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, *args, **kwargs) -> None: # noqa: E501 @@ -281,19 +278,17 @@ def __init__(self, cloud, region, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -310,13 +305,17 @@ def __init__(self, cloud, region, *args, **kwargs) -> None: # noqa: E501 self.cloud = cloud self.region = region for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + 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.") + 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_response.py b/pinecone/core/openapi/db_control/model/serverless_spec_response.py index 9bdf96653..cbd4f69c3 100644 --- a/pinecone/core/openapi/db_control/model/serverless_spec_response.py +++ b/pinecone/core/openapi/db_control/model/serverless_spec_response.py @@ -1,15 +1,14 @@ """ - Pinecone Control Plane API +Pinecone Control Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -33,11 +32,13 @@ from pinecone.core.openapi.db_control.model.backup_model_schema import BackupModelSchema from pinecone.core.openapi.db_control.model.read_capacity_response import ReadCapacityResponse + 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 + + globals()["BackupModelSchema"] = BackupModelSchema + globals()["ReadCapacityResponse"] = ReadCapacityResponse from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -72,11 +73,9 @@ class ServerlessSpecResponse(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -85,7 +84,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -101,30 +100,28 @@ def openapi_types(cls): """ 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 + "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 + "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([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ServerlessSpecResponse. @@ -137,8 +134,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], cloud, region, read_capacity, *args, **kwargs) -> T: # noqa: E501 @@ -184,22 +179,20 @@ def _from_openapi_data(cls: Type[T], cloud, region, read_capacity, *args, **kwar 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', ()) + _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__, - ), + "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__,), ) @@ -217,25 +210,29 @@ def _from_openapi_data(cls: Type[T], cloud, region, read_capacity, *args, **kwar 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: + 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', - ]) + 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 @@ -282,19 +279,17 @@ def __init__(self, cloud, region, read_capacity, *args, **kwargs) -> None: # no """ _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', ()) + _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__, - ), + "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__,), ) @@ -312,13 +307,17 @@ def __init__(self, cloud, region, read_capacity, *args, **kwargs) -> None: # no 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: + 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.") + 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 56e5cd212..774a057e6 100644 --- a/pinecone/core/openapi/db_control/models/__init__.py +++ b/pinecone/core/openapi/db_control/models/__init__.py @@ -13,18 +13,30 @@ 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.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 from pinecone.core.openapi.db_control.model.configure_index_request import ConfigureIndexRequest -from pinecone.core.openapi.db_control.model.configure_index_request_embed import ConfigureIndexRequestEmbed +from pinecone.core.openapi.db_control.model.configure_index_request_embed import ( + ConfigureIndexRequestEmbed, +) from pinecone.core.openapi.db_control.model.create_backup_request import CreateBackupRequest from pinecone.core.openapi.db_control.model.create_collection_request import CreateCollectionRequest -from pinecone.core.openapi.db_control.model.create_index_for_model_request import CreateIndexForModelRequest -from pinecone.core.openapi.db_control.model.create_index_for_model_request_embed import CreateIndexForModelRequestEmbed -from pinecone.core.openapi.db_control.model.create_index_from_backup_request import CreateIndexFromBackupRequest -from pinecone.core.openapi.db_control.model.create_index_from_backup_response import CreateIndexFromBackupResponse +from pinecone.core.openapi.db_control.model.create_index_for_model_request import ( + CreateIndexForModelRequest, +) +from pinecone.core.openapi.db_control.model.create_index_for_model_request_embed import ( + CreateIndexForModelRequestEmbed, +) +from pinecone.core.openapi.db_control.model.create_index_from_backup_request import ( + CreateIndexFromBackupRequest, +) +from pinecone.core.openapi.db_control.model.create_index_from_backup_response import ( + CreateIndexFromBackupResponse, +) from pinecone.core.openapi.db_control.model.create_index_request import CreateIndexRequest from pinecone.core.openapi.db_control.model.error_response import ErrorResponse from pinecone.core.openapi.db_control.model.error_response_error import ErrorResponseError @@ -39,11 +51,21 @@ 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_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 diff --git a/pinecone/core/openapi/db_data/__init__.py b/pinecone/core/openapi/db_data/__init__.py index 84761eb70..eb475f54e 100644 --- a/pinecone/core/openapi/db_data/__init__.py +++ b/pinecone/core/openapi/db_data/__init__.py @@ -1,17 +1,16 @@ # flake8: noqa """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - __version__ = "1.0.0" # import ApiClient @@ -27,4 +26,5 @@ from pinecone.openapi_support.exceptions import PineconeApiValueError from pinecone.openapi_support.exceptions import PineconeApiKeyError from pinecone.openapi_support.exceptions import PineconeApiException -API_VERSION = '2025-10' + +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 d313f9e6c..b1446c703 100644 --- a/pinecone/core/openapi/db_data/api/bulk_operations_api.py +++ b/pinecone/core/openapi/db_data/api/bulk_operations_api.py @@ -1,24 +1,24 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from __future__ import annotations from typing import TYPE_CHECKING, Any, Dict, cast - -if TYPE_CHECKING: - from multiprocessing.pool import ApplyResult +from multiprocessing.pool import ApplyResult from pinecone.openapi_support import ApiClient, AsyncioApiClient -from pinecone.openapi_support.endpoint_utils import ExtraOpenApiKwargsTypedDict, KwargsWithOpenApiKwargDefaultsTypedDict +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 @@ -26,7 +26,7 @@ datetime, file_type, none_type, - validate_and_convert_types + validate_and_convert_types, ) from pinecone.core.openapi.db_data.model.import_model import ImportModel from pinecone.core.openapi.db_data.model.list_imports_response import ListImportsResponse @@ -47,10 +47,7 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client def __cancel_bulk_import( - self, - id, - x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict + self, id, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict ) -> Dict[str, Any] | ApplyResult[Dict[str, Any]]: """Cancel an import # noqa: E501 @@ -89,81 +86,43 @@ def __cancel_bulk_import( thread. """ kwargs = self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['id'] = \ - id - return cast(Dict[str, Any] | ApplyResult[Dict[str, Any]], self.call_with_http_info(**kwargs)) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["id"] = id + return cast( + Dict[str, Any] | ApplyResult[Dict[str, Any]], self.call_with_http_info(**kwargs) + ) self.cancel_bulk_import = _Endpoint( settings={ - 'response_type': (Dict[str, Any],), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/bulk/imports/{id}', - 'operation_id': 'cancel_bulk_import', - 'http_method': 'DELETE', - 'servers': None, + "response_type": (Dict[str, Any],), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/bulk/imports/{id}", + "operation_id": "cancel_bulk_import", + "http_method": "DELETE", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'id', - ], - 'required': [ - 'x_pinecone_api_version', - 'id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'id', - ] + "all": ["x_pinecone_api_version", "id"], + "required": ["x_pinecone_api_version", "id"], + "nullable": [], + "enum": [], + "validation": ["id"], }, root_map={ - 'validations': { - ('id',): { - 'max_length': 1000, - 'min_length': 1, - }, - }, - 'allowed_values': { - }, - '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': [], - }, + "validations": {("id",): {"max_length": 1000, "min_length": 1}}, + "allowed_values": {}, + "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": []}, api_client=api_client, - callable=__cancel_bulk_import + callable=__cancel_bulk_import, ) def __describe_bulk_import( - self, - id, - x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict + self, id, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict ) -> ImportModel | ApplyResult[ImportModel]: """Describe an import # noqa: E501 @@ -202,80 +161,41 @@ def __describe_bulk_import( thread. """ kwargs = self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['id'] = \ - id + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["id"] = id return cast(ImportModel | ApplyResult[ImportModel], self.call_with_http_info(**kwargs)) self.describe_bulk_import = _Endpoint( settings={ - 'response_type': (ImportModel,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/bulk/imports/{id}', - 'operation_id': 'describe_bulk_import', - 'http_method': 'GET', - 'servers': None, + "response_type": (ImportModel,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/bulk/imports/{id}", + "operation_id": "describe_bulk_import", + "http_method": "GET", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'id', - ], - 'required': [ - 'x_pinecone_api_version', - 'id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'id', - ] + "all": ["x_pinecone_api_version", "id"], + "required": ["x_pinecone_api_version", "id"], + "nullable": [], + "enum": [], + "validation": ["id"], }, root_map={ - 'validations': { - ('id',): { - 'max_length': 1000, - 'min_length': 1, - }, - }, - 'allowed_values': { - }, - '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': [], - }, + "validations": {("id",): {"max_length": 1000, "min_length": 1}}, + "allowed_values": {}, + "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": []}, api_client=api_client, - callable=__describe_bulk_import + callable=__describe_bulk_import, ) def __list_bulk_imports( - self, - x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict + self, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict ) -> ListImportsResponse | ApplyResult[ListImportsResponse]: """List imports # noqa: E501 @@ -315,84 +235,58 @@ def __list_bulk_imports( thread. """ kwargs = self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - return cast(ListImportsResponse | ApplyResult[ListImportsResponse], self.call_with_http_info(**kwargs)) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + return cast( + ListImportsResponse | ApplyResult[ListImportsResponse], + self.call_with_http_info(**kwargs), + ) self.list_bulk_imports = _Endpoint( settings={ - 'response_type': (ListImportsResponse,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/bulk/imports', - 'operation_id': 'list_bulk_imports', - 'http_method': 'GET', - 'servers': None, + "response_type": (ListImportsResponse,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/bulk/imports", + "operation_id": "list_bulk_imports", + "http_method": "GET", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'limit', - 'pagination_token', - ], - 'required': [ - 'x_pinecone_api_version', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'limit', - ] + "all": ["x_pinecone_api_version", "limit", "pagination_token"], + "required": ["x_pinecone_api_version"], + "nullable": [], + "enum": [], + "validation": ["limit"], }, root_map={ - 'validations': { - ('limit',): { - - 'inclusive_maximum': 100, - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - }, - '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': [], - }, + "validations": {("limit",): {"inclusive_maximum": 100, "inclusive_minimum": 1}}, + "allowed_values": {}, + "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": []}, api_client=api_client, - callable=__list_bulk_imports + callable=__list_bulk_imports, ) def __start_bulk_import( self, start_import_request, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict + **kwargs: ExtraOpenApiKwargsTypedDict, ) -> StartImportResponse | ApplyResult[StartImportResponse]: """Start import # noqa: E501 @@ -431,74 +325,49 @@ def __start_bulk_import( thread. """ kwargs = self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['start_import_request'] = \ - start_import_request - return cast(StartImportResponse | ApplyResult[StartImportResponse], self.call_with_http_info(**kwargs)) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["start_import_request"] = start_import_request + return cast( + StartImportResponse | ApplyResult[StartImportResponse], + self.call_with_http_info(**kwargs), + ) self.start_bulk_import = _Endpoint( settings={ - 'response_type': (StartImportResponse,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/bulk/imports', - 'operation_id': 'start_bulk_import', - 'http_method': 'POST', - 'servers': None, + "response_type": (StartImportResponse,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/bulk/imports", + "operation_id": "start_bulk_import", + "http_method": "POST", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'start_import_request', - ], - 'required': [ - 'x_pinecone_api_version', - 'start_import_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "start_import_request"], + "required": ["x_pinecone_api_version", "start_import_request"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "start_import_request": (StartImportRequest,), }, - '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", }, - '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' - ] + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__start_bulk_import + callable=__start_bulk_import, ) - class AsyncioBulkOperationsApi: """NOTE: This class is @generated using OpenAPI @@ -511,10 +380,7 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client async def __cancel_bulk_import( - self, - id, - x_pinecone_api_version="2025-10", - **kwargs + self, id, x_pinecone_api_version="2025-10", **kwargs ) -> Dict[str, Any]: """Cancel an import # noqa: E501 @@ -546,81 +412,41 @@ async def __cancel_bulk_import( Dict[str, Any] """ self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['id'] = \ - id + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["id"] = id return cast(Dict[str, Any], await self.call_with_http_info(**kwargs)) self.cancel_bulk_import = _AsyncioEndpoint( settings={ - 'response_type': (Dict[str, Any],), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/bulk/imports/{id}', - 'operation_id': 'cancel_bulk_import', - 'http_method': 'DELETE', - 'servers': None, + "response_type": (Dict[str, Any],), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/bulk/imports/{id}", + "operation_id": "cancel_bulk_import", + "http_method": "DELETE", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'id', - ], - 'required': [ - 'x_pinecone_api_version', - 'id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'id', - ] + "all": ["x_pinecone_api_version", "id"], + "required": ["x_pinecone_api_version", "id"], + "nullable": [], + "enum": [], + "validation": ["id"], }, root_map={ - 'validations': { - ('id',): { - 'max_length': 1000, - 'min_length': 1, - }, - }, - 'allowed_values': { - }, - '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': [], - }, + "validations": {("id",): {"max_length": 1000, "min_length": 1}}, + "allowed_values": {}, + "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": []}, api_client=api_client, - callable=__cancel_bulk_import + callable=__cancel_bulk_import, ) async def __describe_bulk_import( - self, - id, - x_pinecone_api_version="2025-10", - **kwargs + self, id, x_pinecone_api_version="2025-10", **kwargs ) -> ImportModel: """Describe an import # noqa: E501 @@ -652,80 +478,41 @@ async def __describe_bulk_import( ImportModel """ self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['id'] = \ - id + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["id"] = id return cast(ImportModel, await self.call_with_http_info(**kwargs)) self.describe_bulk_import = _AsyncioEndpoint( settings={ - 'response_type': (ImportModel,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/bulk/imports/{id}', - 'operation_id': 'describe_bulk_import', - 'http_method': 'GET', - 'servers': None, + "response_type": (ImportModel,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/bulk/imports/{id}", + "operation_id": "describe_bulk_import", + "http_method": "GET", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'id', - ], - 'required': [ - 'x_pinecone_api_version', - 'id', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'id', - ] + "all": ["x_pinecone_api_version", "id"], + "required": ["x_pinecone_api_version", "id"], + "nullable": [], + "enum": [], + "validation": ["id"], }, root_map={ - 'validations': { - ('id',): { - 'max_length': 1000, - 'min_length': 1, - }, - }, - 'allowed_values': { - }, - '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': [], - }, + "validations": {("id",): {"max_length": 1000, "min_length": 1}}, + "allowed_values": {}, + "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": []}, api_client=api_client, - callable=__describe_bulk_import + callable=__describe_bulk_import, ) async def __list_bulk_imports( - self, - x_pinecone_api_version="2025-10", - **kwargs + self, x_pinecone_api_version="2025-10", **kwargs ) -> ListImportsResponse: """List imports # noqa: E501 @@ -758,84 +545,52 @@ async def __list_bulk_imports( ListImportsResponse """ self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version + kwargs["x_pinecone_api_version"] = x_pinecone_api_version return cast(ListImportsResponse, await self.call_with_http_info(**kwargs)) self.list_bulk_imports = _AsyncioEndpoint( settings={ - 'response_type': (ListImportsResponse,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/bulk/imports', - 'operation_id': 'list_bulk_imports', - 'http_method': 'GET', - 'servers': None, + "response_type": (ListImportsResponse,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/bulk/imports", + "operation_id": "list_bulk_imports", + "http_method": "GET", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'limit', - 'pagination_token', - ], - 'required': [ - 'x_pinecone_api_version', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - 'limit', - ] + "all": ["x_pinecone_api_version", "limit", "pagination_token"], + "required": ["x_pinecone_api_version"], + "nullable": [], + "enum": [], + "validation": ["limit"], }, root_map={ - 'validations': { - ('limit',): { - - 'inclusive_maximum': 100, - 'inclusive_minimum': 1, - }, - }, - 'allowed_values': { - }, - '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': [], - }, + "validations": {("limit",): {"inclusive_maximum": 100, "inclusive_minimum": 1}}, + "allowed_values": {}, + "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": []}, api_client=api_client, - callable=__list_bulk_imports + callable=__list_bulk_imports, ) async def __start_bulk_import( - self, - start_import_request, - x_pinecone_api_version="2025-10", - **kwargs + self, start_import_request, x_pinecone_api_version="2025-10", **kwargs ) -> StartImportResponse: """Start import # noqa: E501 @@ -867,68 +622,41 @@ async def __start_bulk_import( StartImportResponse """ self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['start_import_request'] = \ - start_import_request + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["start_import_request"] = start_import_request return cast(StartImportResponse, await self.call_with_http_info(**kwargs)) self.start_bulk_import = _AsyncioEndpoint( settings={ - 'response_type': (StartImportResponse,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/bulk/imports', - 'operation_id': 'start_bulk_import', - 'http_method': 'POST', - 'servers': None, + "response_type": (StartImportResponse,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/bulk/imports", + "operation_id": "start_bulk_import", + "http_method": "POST", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'start_import_request', - ], - 'required': [ - 'x_pinecone_api_version', - 'start_import_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "start_import_request"], + "required": ["x_pinecone_api_version", "start_import_request"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "start_import_request": (StartImportRequest,), }, - 'allowed_values': { + "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, + "location_map": { + "x_pinecone_api_version": "header", + "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' - ] + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__start_bulk_import + callable=__start_bulk_import, ) 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 e9e007989..733bfa7c7 100644 --- a/pinecone/core/openapi/db_data/api/namespace_operations_api.py +++ b/pinecone/core/openapi/db_data/api/namespace_operations_api.py @@ -1,24 +1,24 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from __future__ import annotations from typing import TYPE_CHECKING, Any, Dict, cast - -if TYPE_CHECKING: - from multiprocessing.pool import ApplyResult +from multiprocessing.pool import ApplyResult from pinecone.openapi_support import ApiClient, AsyncioApiClient -from pinecone.openapi_support.endpoint_utils import ExtraOpenApiKwargsTypedDict, KwargsWithOpenApiKwargDefaultsTypedDict +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 @@ -26,7 +26,7 @@ datetime, file_type, none_type, - validate_and_convert_types + 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 @@ -49,7 +49,7 @@ def __create_namespace( self, create_namespace_request, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict + **kwargs: ExtraOpenApiKwargsTypedDict, ) -> NamespaceDescription | ApplyResult[NamespaceDescription]: """Create a namespace # noqa: E501 @@ -88,77 +88,50 @@ def __create_namespace( thread. """ kwargs = self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['create_namespace_request'] = \ - create_namespace_request - return cast(NamespaceDescription | ApplyResult[NamespaceDescription], self.call_with_http_info(**kwargs)) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["create_namespace_request"] = create_namespace_request + return cast( + NamespaceDescription | ApplyResult[NamespaceDescription], + 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, + "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': [ - ] + "all": ["x_pinecone_api_version", "create_namespace_request"], + "required": ["x_pinecone_api_version", "create_namespace_request"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "create_namespace_request": (CreateNamespaceRequest,), }, - '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", }, - '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' - ] + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__create_namespace + callable=__create_namespace, ) def __delete_namespace( - self, - namespace, - x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict + self, namespace, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict ) -> Dict[str, Any] | ApplyResult[Dict[str, Any]]: """Delete a namespace # noqa: E501 @@ -197,76 +170,46 @@ def __delete_namespace( thread. """ kwargs = self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['namespace'] = \ - namespace - return cast(Dict[str, Any] | ApplyResult[Dict[str, Any]], self.call_with_http_info(**kwargs)) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["namespace"] = namespace + return cast( + Dict[str, Any] | ApplyResult[Dict[str, Any]], self.call_with_http_info(**kwargs) + ) self.delete_namespace = _Endpoint( settings={ - 'response_type': (Dict[str, Any],), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/namespaces/{namespace}', - 'operation_id': 'delete_namespace', - 'http_method': 'DELETE', - 'servers': None, + "response_type": (Dict[str, Any],), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/namespaces/{namespace}", + "operation_id": "delete_namespace", + "http_method": "DELETE", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'namespace', - ], - 'required': [ - 'x_pinecone_api_version', - 'namespace', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "namespace"], + "required": ["x_pinecone_api_version", "namespace"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_pinecone_api_version': - (str,), - 'namespace': - (str,), - }, - 'attribute_map': { - 'x_pinecone_api_version': 'X-Pinecone-Api-Version', - 'namespace': 'namespace', + "validations": {}, + "allowed_values": {}, + "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': [], + "location_map": {"x_pinecone_api_version": "header", "namespace": "path"}, + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__delete_namespace + callable=__delete_namespace, ) def __describe_namespace( - self, - namespace, - x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict + self, namespace, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict ) -> NamespaceDescription | ApplyResult[NamespaceDescription]: """Describe a namespace # noqa: E501 @@ -305,75 +248,47 @@ def __describe_namespace( thread. """ kwargs = self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['namespace'] = \ - namespace - return cast(NamespaceDescription | ApplyResult[NamespaceDescription], self.call_with_http_info(**kwargs)) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["namespace"] = namespace + return cast( + NamespaceDescription | ApplyResult[NamespaceDescription], + self.call_with_http_info(**kwargs), + ) self.describe_namespace = _Endpoint( settings={ - 'response_type': (NamespaceDescription,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/namespaces/{namespace}', - 'operation_id': 'describe_namespace', - 'http_method': 'GET', - 'servers': None, + "response_type": (NamespaceDescription,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/namespaces/{namespace}", + "operation_id": "describe_namespace", + "http_method": "GET", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'namespace', - ], - 'required': [ - 'x_pinecone_api_version', - 'namespace', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "namespace"], + "required": ["x_pinecone_api_version", "namespace"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { + "validations": {}, + "allowed_values": {}, + "openapi_types": {"x_pinecone_api_version": (str,), "namespace": (str,)}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "namespace": "namespace", }, - 'allowed_values': { - }, - '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': [], + "location_map": {"x_pinecone_api_version": "header", "namespace": "path"}, + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__describe_namespace + callable=__describe_namespace, ) def __list_namespaces_operation( - self, - x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict + self, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict ) -> ListNamespacesResponse | ApplyResult[ListNamespacesResponse]: """List namespaces # noqa: E501 @@ -414,80 +329,57 @@ def __list_namespaces_operation( thread. """ kwargs = self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - return cast(ListNamespacesResponse | ApplyResult[ListNamespacesResponse], self.call_with_http_info(**kwargs)) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + return cast( + ListNamespacesResponse | ApplyResult[ListNamespacesResponse], + self.call_with_http_info(**kwargs), + ) self.list_namespaces_operation = _Endpoint( settings={ - 'response_type': (ListNamespacesResponse,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/namespaces', - 'operation_id': 'list_namespaces_operation', - 'http_method': 'GET', - 'servers': None, + "response_type": (ListNamespacesResponse,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/namespaces", + "operation_id": "list_namespaces_operation", + "http_method": "GET", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'limit', - 'pagination_token', - 'prefix', - ], - 'required': [ - 'x_pinecone_api_version', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "limit", "pagination_token", "prefix"], + "required": ["x_pinecone_api_version"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { - }, - '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': [], - }, + "validations": {}, + "allowed_values": {}, + "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": []}, api_client=api_client, - callable=__list_namespaces_operation + callable=__list_namespaces_operation, ) - class AsyncioNamespaceOperationsApi: """NOTE: This class is @generated using OpenAPI @@ -500,10 +392,7 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client async def __create_namespace( - self, - create_namespace_request, - x_pinecone_api_version="2025-10", - **kwargs + self, create_namespace_request, x_pinecone_api_version="2025-10", **kwargs ) -> NamespaceDescription: """Create a namespace # noqa: E501 @@ -535,77 +424,47 @@ async def __create_namespace( NamespaceDescription """ self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['create_namespace_request'] = \ - create_namespace_request + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["create_namespace_request"] = create_namespace_request return cast(NamespaceDescription, 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, + "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': [ - ] + "all": ["x_pinecone_api_version", "create_namespace_request"], + "required": ["x_pinecone_api_version", "create_namespace_request"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "create_namespace_request": (CreateNamespaceRequest,), }, - '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", }, - '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' - ] + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__create_namespace + callable=__create_namespace, ) async def __delete_namespace( - self, - namespace, - x_pinecone_api_version="2025-10", - **kwargs + self, namespace, x_pinecone_api_version="2025-10", **kwargs ) -> Dict[str, Any]: """Delete a namespace # noqa: E501 @@ -637,76 +496,44 @@ async def __delete_namespace( Dict[str, Any] """ self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['namespace'] = \ - namespace + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["namespace"] = namespace return cast(Dict[str, Any], await self.call_with_http_info(**kwargs)) self.delete_namespace = _AsyncioEndpoint( settings={ - 'response_type': (Dict[str, Any],), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/namespaces/{namespace}', - 'operation_id': 'delete_namespace', - 'http_method': 'DELETE', - 'servers': None, + "response_type": (Dict[str, Any],), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/namespaces/{namespace}", + "operation_id": "delete_namespace", + "http_method": "DELETE", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'namespace', - ], - 'required': [ - 'x_pinecone_api_version', - 'namespace', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "namespace"], + "required": ["x_pinecone_api_version", "namespace"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_pinecone_api_version': - (str,), - 'namespace': - (str,), - }, - 'attribute_map': { - 'x_pinecone_api_version': 'X-Pinecone-Api-Version', - 'namespace': 'namespace', + "validations": {}, + "allowed_values": {}, + "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': [], + "location_map": {"x_pinecone_api_version": "header", "namespace": "path"}, + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__delete_namespace + callable=__delete_namespace, ) async def __describe_namespace( - self, - namespace, - x_pinecone_api_version="2025-10", - **kwargs + self, namespace, x_pinecone_api_version="2025-10", **kwargs ) -> NamespaceDescription: """Describe a namespace # noqa: E501 @@ -738,75 +565,44 @@ async def __describe_namespace( NamespaceDescription """ self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['namespace'] = \ - namespace + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["namespace"] = namespace return cast(NamespaceDescription, await self.call_with_http_info(**kwargs)) self.describe_namespace = _AsyncioEndpoint( settings={ - 'response_type': (NamespaceDescription,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/namespaces/{namespace}', - 'operation_id': 'describe_namespace', - 'http_method': 'GET', - 'servers': None, + "response_type": (NamespaceDescription,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/namespaces/{namespace}", + "operation_id": "describe_namespace", + "http_method": "GET", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'namespace', - ], - 'required': [ - 'x_pinecone_api_version', - 'namespace', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "namespace"], + "required": ["x_pinecone_api_version", "namespace"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_pinecone_api_version': - (str,), - 'namespace': - (str,), - }, - 'attribute_map': { - 'x_pinecone_api_version': 'X-Pinecone-Api-Version', - 'namespace': 'namespace', + "validations": {}, + "allowed_values": {}, + "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': [], + "location_map": {"x_pinecone_api_version": "header", "namespace": "path"}, + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__describe_namespace + callable=__describe_namespace, ) async def __list_namespaces_operation( - self, - x_pinecone_api_version="2025-10", - **kwargs + self, x_pinecone_api_version="2025-10", **kwargs ) -> ListNamespacesResponse: """List namespaces # noqa: E501 @@ -840,74 +636,49 @@ async def __list_namespaces_operation( ListNamespacesResponse """ self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version + kwargs["x_pinecone_api_version"] = x_pinecone_api_version return cast(ListNamespacesResponse, await self.call_with_http_info(**kwargs)) self.list_namespaces_operation = _AsyncioEndpoint( settings={ - 'response_type': (ListNamespacesResponse,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/namespaces', - 'operation_id': 'list_namespaces_operation', - 'http_method': 'GET', - 'servers': None, + "response_type": (ListNamespacesResponse,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/namespaces", + "operation_id": "list_namespaces_operation", + "http_method": "GET", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'limit', - 'pagination_token', - 'prefix', - ], - 'required': [ - 'x_pinecone_api_version', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "limit", "pagination_token", "prefix"], + "required": ["x_pinecone_api_version"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { - }, - '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': [], - }, + "validations": {}, + "allowed_values": {}, + "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": []}, api_client=api_client, - callable=__list_namespaces_operation + callable=__list_namespaces_operation, ) 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 e925b794b..a317ca445 100644 --- a/pinecone/core/openapi/db_data/api/vector_operations_api.py +++ b/pinecone/core/openapi/db_data/api/vector_operations_api.py @@ -1,24 +1,24 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from __future__ import annotations from typing import TYPE_CHECKING, Any, Dict, cast - -if TYPE_CHECKING: - from multiprocessing.pool import ApplyResult +from multiprocessing.pool import ApplyResult from pinecone.openapi_support import ApiClient, AsyncioApiClient -from pinecone.openapi_support.endpoint_utils import ExtraOpenApiKwargsTypedDict, KwargsWithOpenApiKwargDefaultsTypedDict +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 @@ -26,10 +26,12 @@ datetime, file_type, none_type, - validate_and_convert_types + validate_and_convert_types, ) 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.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 @@ -62,7 +64,7 @@ def __delete_vectors( self, delete_request, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict + **kwargs: ExtraOpenApiKwargsTypedDict, ) -> Dict[str, Any] | ApplyResult[Dict[str, Any]]: """Delete vectors # noqa: E501 @@ -101,77 +103,49 @@ def __delete_vectors( thread. """ kwargs = self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['delete_request'] = \ - delete_request - return cast(Dict[str, Any] | ApplyResult[Dict[str, Any]], self.call_with_http_info(**kwargs)) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["delete_request"] = delete_request + return cast( + Dict[str, Any] | ApplyResult[Dict[str, Any]], self.call_with_http_info(**kwargs) + ) self.delete_vectors = _Endpoint( settings={ - 'response_type': (Dict[str, Any],), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/vectors/delete', - 'operation_id': 'delete_vectors', - 'http_method': 'POST', - 'servers': None, + "response_type": (Dict[str, Any],), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/vectors/delete", + "operation_id": "delete_vectors", + "http_method": "POST", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'delete_request', - ], - 'required': [ - 'x_pinecone_api_version', - 'delete_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "delete_request"], + "required": ["x_pinecone_api_version", "delete_request"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_pinecone_api_version': - (str,), - 'delete_request': - (DeleteRequest,), - }, - 'attribute_map': { - 'x_pinecone_api_version': 'X-Pinecone-Api-Version', + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "delete_request": (DeleteRequest,), }, - 'location_map': { - 'x_pinecone_api_version': 'header', - 'delete_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] + "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"]}, api_client=api_client, - callable=__delete_vectors + callable=__delete_vectors, ) def __describe_index_stats( self, describe_index_stats_request, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict + **kwargs: ExtraOpenApiKwargsTypedDict, ) -> IndexDescription | ApplyResult[IndexDescription]: """Get index stats # noqa: E501 @@ -210,77 +184,49 @@ 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 cast(IndexDescription | ApplyResult[IndexDescription], self.call_with_http_info(**kwargs)) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["describe_index_stats_request"] = describe_index_stats_request + return cast( + IndexDescription | ApplyResult[IndexDescription], self.call_with_http_info(**kwargs) + ) self.describe_index_stats = _Endpoint( settings={ - 'response_type': (IndexDescription,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/describe_index_stats', - 'operation_id': 'describe_index_stats', - 'http_method': 'POST', - 'servers': None, + "response_type": (IndexDescription,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/describe_index_stats", + "operation_id": "describe_index_stats", + "http_method": "POST", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'describe_index_stats_request', - ], - 'required': [ - 'x_pinecone_api_version', - 'describe_index_stats_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "describe_index_stats_request"], + "required": ["x_pinecone_api_version", "describe_index_stats_request"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "describe_index_stats_request": (DescribeIndexStatsRequest,), }, - 'allowed_values': { + "attribute_map": {"x_pinecone_api_version": "X-Pinecone-Api-Version"}, + "location_map": { + "x_pinecone_api_version": "header", + "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' - ] + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__describe_index_stats + callable=__describe_index_stats, ) def __fetch_vectors( - self, - ids, - x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict + self, ids, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict ) -> FetchResponse | ApplyResult[FetchResponse]: """Fetch vectors # noqa: E501 @@ -320,82 +266,58 @@ def __fetch_vectors( thread. """ kwargs = self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['ids'] = \ - ids - return cast(FetchResponse | ApplyResult[FetchResponse], self.call_with_http_info(**kwargs)) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["ids"] = ids + return cast( + FetchResponse | ApplyResult[FetchResponse], self.call_with_http_info(**kwargs) + ) self.fetch_vectors = _Endpoint( settings={ - 'response_type': (FetchResponse,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/vectors/fetch', - 'operation_id': 'fetch_vectors', - 'http_method': 'GET', - 'servers': None, + "response_type": (FetchResponse,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/vectors/fetch", + "operation_id": "fetch_vectors", + "http_method": "GET", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'ids', - 'namespace', - ], - 'required': [ - 'x_pinecone_api_version', - 'ids', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "ids", "namespace"], + "required": ["x_pinecone_api_version", "ids"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { - }, - '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': [], - }, + "validations": {}, + "allowed_values": {}, + "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": []}, api_client=api_client, - callable=__fetch_vectors + callable=__fetch_vectors, ) def __fetch_vectors_by_metadata( self, fetch_by_metadata_request, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict + **kwargs: ExtraOpenApiKwargsTypedDict, ) -> FetchByMetadataResponse | ApplyResult[FetchByMetadataResponse]: """Fetch vectors by metadata # noqa: E501 @@ -434,76 +356,50 @@ def __fetch_vectors_by_metadata( 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 cast(FetchByMetadataResponse | ApplyResult[FetchByMetadataResponse], self.call_with_http_info(**kwargs)) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["fetch_by_metadata_request"] = fetch_by_metadata_request + return cast( + FetchByMetadataResponse | ApplyResult[FetchByMetadataResponse], + self.call_with_http_info(**kwargs), + ) self.fetch_vectors_by_metadata = _Endpoint( settings={ - 'response_type': (FetchByMetadataResponse,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/vectors/fetch_by_metadata', - 'operation_id': 'fetch_vectors_by_metadata', - 'http_method': 'POST', - 'servers': None, + "response_type": (FetchByMetadataResponse,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/vectors/fetch_by_metadata", + "operation_id": "fetch_vectors_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': [ - ] + "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', + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "fetch_by_metadata_request": (FetchByMetadataRequest,), }, - 'location_map': { - 'x_pinecone_api_version': 'header', - 'fetch_by_metadata_request': 'body', + "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' - ] + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__fetch_vectors_by_metadata + callable=__fetch_vectors_by_metadata, ) def __list_vectors( - self, - x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict + self, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict ) -> ListResponse | ApplyResult[ListResponse]: """List vector IDs # noqa: E501 @@ -545,88 +441,69 @@ def __list_vectors( thread. """ kwargs = self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - return cast(ListResponse | ApplyResult[ListResponse], self.call_with_http_info(**kwargs)) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + return cast( + ListResponse | ApplyResult[ListResponse], self.call_with_http_info(**kwargs) + ) self.list_vectors = _Endpoint( settings={ - 'response_type': (ListResponse,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/vectors/list', - 'operation_id': 'list_vectors', - 'http_method': 'GET', - 'servers': None, + "response_type": (ListResponse,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/vectors/list", + "operation_id": "list_vectors", + "http_method": "GET", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'prefix', - 'limit', - 'pagination_token', - 'namespace', - ], - 'required': [ - 'x_pinecone_api_version', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": [ + "x_pinecone_api_version", + "prefix", + "limit", + "pagination_token", + "namespace", + ], + "required": ["x_pinecone_api_version"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - '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', - 'namespace': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, + "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", + "namespace": "query", + }, + "collection_format_map": {}, + }, + headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__list_vectors + callable=__list_vectors, ) def __query_vectors( self, query_request, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict + **kwargs: ExtraOpenApiKwargsTypedDict, ) -> QueryResponse | ApplyResult[QueryResponse]: """Search with a vector # noqa: E501 @@ -665,70 +542,42 @@ def __query_vectors( thread. """ kwargs = self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['query_request'] = \ - query_request - return cast(QueryResponse | ApplyResult[QueryResponse], self.call_with_http_info(**kwargs)) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["query_request"] = query_request + return cast( + QueryResponse | ApplyResult[QueryResponse], self.call_with_http_info(**kwargs) + ) self.query_vectors = _Endpoint( settings={ - 'response_type': (QueryResponse,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/query', - 'operation_id': 'query_vectors', - 'http_method': 'POST', - 'servers': None, + "response_type": (QueryResponse,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/query", + "operation_id": "query_vectors", + "http_method": "POST", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'query_request', - ], - 'required': [ - 'x_pinecone_api_version', - 'query_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "query_request"], + "required": ["x_pinecone_api_version", "query_request"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_pinecone_api_version': - (str,), - 'query_request': - (QueryRequest,), + "validations": {}, + "allowed_values": {}, + "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' - ] + "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"]}, api_client=api_client, - callable=__query_vectors + callable=__query_vectors, ) def __search_records_namespace( @@ -736,7 +585,7 @@ def __search_records_namespace( namespace, search_records_request, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict + **kwargs: ExtraOpenApiKwargsTypedDict, ) -> SearchRecordsResponse | ApplyResult[SearchRecordsResponse]: """Search with text # noqa: E501 @@ -776,85 +625,59 @@ 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 cast(SearchRecordsResponse | ApplyResult[SearchRecordsResponse], self.call_with_http_info(**kwargs)) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["namespace"] = namespace + kwargs["search_records_request"] = search_records_request + return cast( + SearchRecordsResponse | ApplyResult[SearchRecordsResponse], + self.call_with_http_info(**kwargs), + ) self.search_records_namespace = _Endpoint( settings={ - 'response_type': (SearchRecordsResponse,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/records/namespaces/{namespace}/search', - 'operation_id': 'search_records_namespace', - 'http_method': 'POST', - 'servers': None, + "response_type": (SearchRecordsResponse,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/records/namespaces/{namespace}/search", + "operation_id": "search_records_namespace", + "http_method": "POST", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'namespace', - 'search_records_request', - ], - 'required': [ - 'x_pinecone_api_version', - 'namespace', - 'search_records_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "namespace", "search_records_request"], + "required": ["x_pinecone_api_version", "namespace", "search_records_request"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "namespace": (str,), + "search_records_request": (SearchRecordsRequest,), }, - 'openapi_types': { - 'x_pinecone_api_version': - (str,), - 'namespace': - (str,), - 'search_records_request': - (SearchRecordsRequest,), + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "namespace": "namespace", }, - '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", }, - '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' - ] + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__search_records_namespace + callable=__search_records_namespace, ) def __update_vector( self, update_request, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict + **kwargs: ExtraOpenApiKwargsTypedDict, ) -> UpdateResponse | ApplyResult[UpdateResponse]: """Update a vector # noqa: E501 @@ -893,70 +716,42 @@ def __update_vector( thread. """ kwargs = self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['update_request'] = \ - update_request - return cast(UpdateResponse | ApplyResult[UpdateResponse], self.call_with_http_info(**kwargs)) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["update_request"] = update_request + return cast( + UpdateResponse | ApplyResult[UpdateResponse], self.call_with_http_info(**kwargs) + ) self.update_vector = _Endpoint( settings={ - 'response_type': (UpdateResponse,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/vectors/update', - 'operation_id': 'update_vector', - 'http_method': 'POST', - 'servers': None, + "response_type": (UpdateResponse,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/vectors/update", + "operation_id": "update_vector", + "http_method": "POST", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'update_request', - ], - 'required': [ - 'x_pinecone_api_version', - 'update_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "update_request"], + "required": ["x_pinecone_api_version", "update_request"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_pinecone_api_version': - (str,), - 'update_request': - (UpdateRequest,), + "validations": {}, + "allowed_values": {}, + "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' - ] + "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"]}, api_client=api_client, - callable=__update_vector + callable=__update_vector, ) def __upsert_records_namespace( @@ -964,7 +759,7 @@ def __upsert_records_namespace( namespace, upsert_record, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict + **kwargs: ExtraOpenApiKwargsTypedDict, ) -> None: """Upsert text # noqa: E501 @@ -1004,85 +799,56 @@ 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 + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["namespace"] = namespace + kwargs["upsert_record"] = upsert_record return cast(None, self.call_with_http_info(**kwargs)) self.upsert_records_namespace = _Endpoint( settings={ - 'response_type': None, - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/records/namespaces/{namespace}/upsert', - 'operation_id': 'upsert_records_namespace', - 'http_method': 'POST', - 'servers': None, + "response_type": None, + "auth": ["ApiKeyAuth"], + "endpoint_path": "/records/namespaces/{namespace}/upsert", + "operation_id": "upsert_records_namespace", + "http_method": "POST", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'namespace', - 'upsert_record', - ], - 'required': [ - 'x_pinecone_api_version', - 'namespace', - 'upsert_record', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "namespace", "upsert_record"], + "required": ["x_pinecone_api_version", "namespace", "upsert_record"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "namespace": (str,), + "upsert_record": ([UpsertRecord],), }, - 'openapi_types': { - 'x_pinecone_api_version': - (str,), - 'namespace': - (str,), - 'upsert_record': - ([UpsertRecord],), + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "namespace": "namespace", }, - 'attribute_map': { - 'x_pinecone_api_version': 'X-Pinecone-Api-Version', - 'namespace': 'namespace', + "location_map": { + "x_pinecone_api_version": "header", + "namespace": "path", + "upsert_record": "body", }, - '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' - ] + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": ["application/x-ndjson"]}, api_client=api_client, - callable=__upsert_records_namespace + callable=__upsert_records_namespace, ) def __upsert_vectors( self, upsert_request, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict + **kwargs: ExtraOpenApiKwargsTypedDict, ) -> UpsertResponse | ApplyResult[UpsertResponse]: """Upsert vectors # noqa: E501 @@ -1121,74 +887,45 @@ def __upsert_vectors( thread. """ kwargs = self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['upsert_request'] = \ - upsert_request - return cast(UpsertResponse | ApplyResult[UpsertResponse], self.call_with_http_info(**kwargs)) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["upsert_request"] = upsert_request + return cast( + UpsertResponse | ApplyResult[UpsertResponse], self.call_with_http_info(**kwargs) + ) self.upsert_vectors = _Endpoint( settings={ - 'response_type': (UpsertResponse,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/vectors/upsert', - 'operation_id': 'upsert_vectors', - 'http_method': 'POST', - 'servers': None, + "response_type": (UpsertResponse,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/vectors/upsert", + "operation_id": "upsert_vectors", + "http_method": "POST", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'upsert_request', - ], - 'required': [ - 'x_pinecone_api_version', - 'upsert_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "upsert_request"], + "required": ["x_pinecone_api_version", "upsert_request"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_pinecone_api_version': - (str,), - 'upsert_request': - (UpsertRequest,), + "validations": {}, + "allowed_values": {}, + "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' - ] + "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"]}, api_client=api_client, - callable=__upsert_vectors + callable=__upsert_vectors, ) - class AsyncioVectorOperationsApi: """NOTE: This class is @generated using OpenAPI @@ -1201,10 +938,7 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client async def __delete_vectors( - self, - delete_request, - x_pinecone_api_version="2025-10", - **kwargs + self, delete_request, x_pinecone_api_version="2025-10", **kwargs ) -> Dict[str, Any]: """Delete vectors # noqa: E501 @@ -1236,77 +970,44 @@ async def __delete_vectors( Dict[str, Any] """ self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['delete_request'] = \ - delete_request + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["delete_request"] = delete_request return cast(Dict[str, Any], await self.call_with_http_info(**kwargs)) self.delete_vectors = _AsyncioEndpoint( settings={ - 'response_type': (Dict[str, Any],), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/vectors/delete', - 'operation_id': 'delete_vectors', - 'http_method': 'POST', - 'servers': None, + "response_type": (Dict[str, Any],), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/vectors/delete", + "operation_id": "delete_vectors", + "http_method": "POST", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'delete_request', - ], - 'required': [ - 'x_pinecone_api_version', - 'delete_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "delete_request"], + "required": ["x_pinecone_api_version", "delete_request"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_pinecone_api_version': - (str,), - 'delete_request': - (DeleteRequest,), - }, - 'attribute_map': { - 'x_pinecone_api_version': 'X-Pinecone-Api-Version', + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "delete_request": (DeleteRequest,), }, - 'location_map': { - 'x_pinecone_api_version': 'header', - 'delete_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] + "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"]}, api_client=api_client, - callable=__delete_vectors + callable=__delete_vectors, ) async def __describe_index_stats( - self, - describe_index_stats_request, - x_pinecone_api_version="2025-10", - **kwargs + self, describe_index_stats_request, x_pinecone_api_version="2025-10", **kwargs ) -> IndexDescription: """Get index stats # noqa: E501 @@ -1338,77 +1039,47 @@ async def __describe_index_stats( IndexDescription """ self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['describe_index_stats_request'] = \ - describe_index_stats_request + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["describe_index_stats_request"] = describe_index_stats_request return cast(IndexDescription, await self.call_with_http_info(**kwargs)) self.describe_index_stats = _AsyncioEndpoint( settings={ - 'response_type': (IndexDescription,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/describe_index_stats', - 'operation_id': 'describe_index_stats', - 'http_method': 'POST', - 'servers': None, + "response_type": (IndexDescription,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/describe_index_stats", + "operation_id": "describe_index_stats", + "http_method": "POST", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'describe_index_stats_request', - ], - 'required': [ - 'x_pinecone_api_version', - 'describe_index_stats_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "describe_index_stats_request"], + "required": ["x_pinecone_api_version", "describe_index_stats_request"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "describe_index_stats_request": (DescribeIndexStatsRequest,), }, - '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", }, - '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' - ] + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__describe_index_stats + callable=__describe_index_stats, ) async def __fetch_vectors( - self, - ids, - x_pinecone_api_version="2025-10", - **kwargs + self, ids, x_pinecone_api_version="2025-10", **kwargs ) -> FetchResponse: """Fetch vectors # noqa: E501 @@ -1441,82 +1112,53 @@ async def __fetch_vectors( FetchResponse """ self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['ids'] = \ - ids + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["ids"] = ids return cast(FetchResponse, await self.call_with_http_info(**kwargs)) self.fetch_vectors = _AsyncioEndpoint( settings={ - 'response_type': (FetchResponse,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/vectors/fetch', - 'operation_id': 'fetch_vectors', - 'http_method': 'GET', - 'servers': None, + "response_type": (FetchResponse,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/vectors/fetch", + "operation_id": "fetch_vectors", + "http_method": "GET", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'ids', - 'namespace', - ], - 'required': [ - 'x_pinecone_api_version', - 'ids', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "ids", "namespace"], + "required": ["x_pinecone_api_version", "ids"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { - }, - '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': [], - }, + "validations": {}, + "allowed_values": {}, + "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": []}, api_client=api_client, - callable=__fetch_vectors + callable=__fetch_vectors, ) async def __fetch_vectors_by_metadata( - self, - fetch_by_metadata_request, - x_pinecone_api_version="2025-10", - **kwargs + self, fetch_by_metadata_request, x_pinecone_api_version="2025-10", **kwargs ) -> FetchByMetadataResponse: """Fetch vectors by metadata # noqa: E501 @@ -1548,77 +1190,46 @@ async def __fetch_vectors_by_metadata( FetchByMetadataResponse """ self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['fetch_by_metadata_request'] = \ - fetch_by_metadata_request + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["fetch_by_metadata_request"] = fetch_by_metadata_request return cast(FetchByMetadataResponse, await self.call_with_http_info(**kwargs)) self.fetch_vectors_by_metadata = _AsyncioEndpoint( settings={ - 'response_type': (FetchByMetadataResponse,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/vectors/fetch_by_metadata', - 'operation_id': 'fetch_vectors_by_metadata', - 'http_method': 'POST', - 'servers': None, + "response_type": (FetchByMetadataResponse,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/vectors/fetch_by_metadata", + "operation_id": "fetch_vectors_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': [ - ] + "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': { + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "fetch_by_metadata_request": (FetchByMetadataRequest,), }, - '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", }, - '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' - ] + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__fetch_vectors_by_metadata + callable=__fetch_vectors_by_metadata, ) - async def __list_vectors( - self, - x_pinecone_api_version="2025-10", - **kwargs - ) -> ListResponse: + async def __list_vectors(self, x_pinecone_api_version="2025-10", **kwargs) -> ListResponse: """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 @@ -1652,88 +1263,64 @@ async def __list_vectors( ListResponse """ self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version + kwargs["x_pinecone_api_version"] = x_pinecone_api_version return cast(ListResponse, await self.call_with_http_info(**kwargs)) self.list_vectors = _AsyncioEndpoint( settings={ - 'response_type': (ListResponse,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/vectors/list', - 'operation_id': 'list_vectors', - 'http_method': 'GET', - 'servers': None, + "response_type": (ListResponse,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/vectors/list", + "operation_id": "list_vectors", + "http_method": "GET", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'prefix', - 'limit', - 'pagination_token', - 'namespace', - ], - 'required': [ - 'x_pinecone_api_version', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": [ + "x_pinecone_api_version", + "prefix", + "limit", + "pagination_token", + "namespace", + ], + "required": ["x_pinecone_api_version"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - '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', - 'namespace': 'query', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [], - }, + "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", + "namespace": "query", + }, + "collection_format_map": {}, + }, + headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__list_vectors + callable=__list_vectors, ) async def __query_vectors( - self, - query_request, - x_pinecone_api_version="2025-10", - **kwargs + self, query_request, x_pinecone_api_version="2025-10", **kwargs ) -> QueryResponse: """Search with a vector # noqa: E501 @@ -1765,78 +1352,44 @@ async def __query_vectors( QueryResponse """ self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['query_request'] = \ - query_request + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["query_request"] = query_request return cast(QueryResponse, await self.call_with_http_info(**kwargs)) self.query_vectors = _AsyncioEndpoint( settings={ - 'response_type': (QueryResponse,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/query', - 'operation_id': 'query_vectors', - 'http_method': 'POST', - 'servers': None, + "response_type": (QueryResponse,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/query", + "operation_id": "query_vectors", + "http_method": "POST", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'query_request', - ], - 'required': [ - 'x_pinecone_api_version', - 'query_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "query_request"], + "required": ["x_pinecone_api_version", "query_request"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "query_request": (QueryRequest,), }, - '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' - ] + "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"]}, api_client=api_client, - callable=__query_vectors + callable=__query_vectors, ) async def __search_records_namespace( - self, - namespace, - search_records_request, - x_pinecone_api_version="2025-10", - **kwargs + self, namespace, search_records_request, x_pinecone_api_version="2025-10", **kwargs ) -> SearchRecordsResponse: """Search with text # noqa: E501 @@ -1869,85 +1422,53 @@ async def __search_records_namespace( 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 + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["namespace"] = namespace + kwargs["search_records_request"] = search_records_request return cast(SearchRecordsResponse, await self.call_with_http_info(**kwargs)) self.search_records_namespace = _AsyncioEndpoint( settings={ - 'response_type': (SearchRecordsResponse,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/records/namespaces/{namespace}/search', - 'operation_id': 'search_records_namespace', - 'http_method': 'POST', - 'servers': None, + "response_type": (SearchRecordsResponse,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/records/namespaces/{namespace}/search", + "operation_id": "search_records_namespace", + "http_method": "POST", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'namespace', - 'search_records_request', - ], - 'required': [ - 'x_pinecone_api_version', - 'namespace', - 'search_records_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "namespace", "search_records_request"], + "required": ["x_pinecone_api_version", "namespace", "search_records_request"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_pinecone_api_version': - (str,), - 'namespace': - (str,), - 'search_records_request': - (SearchRecordsRequest,), + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "namespace": (str,), + "search_records_request": (SearchRecordsRequest,), }, - 'attribute_map': { - 'x_pinecone_api_version': 'X-Pinecone-Api-Version', - 'namespace': 'namespace', + "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', + "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' - ] + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, api_client=api_client, - callable=__search_records_namespace + callable=__search_records_namespace, ) async def __update_vector( - self, - update_request, - x_pinecone_api_version="2025-10", - **kwargs + self, update_request, x_pinecone_api_version="2025-10", **kwargs ) -> UpdateResponse: """Update a vector # noqa: E501 @@ -1979,78 +1500,44 @@ async def __update_vector( UpdateResponse """ self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['update_request'] = \ - update_request + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["update_request"] = update_request return cast(UpdateResponse, await self.call_with_http_info(**kwargs)) self.update_vector = _AsyncioEndpoint( settings={ - 'response_type': (UpdateResponse,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/vectors/update', - 'operation_id': 'update_vector', - 'http_method': 'POST', - 'servers': None, + "response_type": (UpdateResponse,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/vectors/update", + "operation_id": "update_vector", + "http_method": "POST", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'update_request', - ], - 'required': [ - 'x_pinecone_api_version', - 'update_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "update_request"], + "required": ["x_pinecone_api_version", "update_request"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_pinecone_api_version': - (str,), - 'update_request': - (UpdateRequest,), + "validations": {}, + "allowed_values": {}, + "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' - ] + "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"]}, api_client=api_client, - callable=__update_vector + callable=__update_vector, ) async def __upsert_records_namespace( - self, - namespace, - upsert_record, - x_pinecone_api_version="2025-10", - **kwargs + self, namespace, upsert_record, x_pinecone_api_version="2025-10", **kwargs ) -> None: """Upsert text # noqa: E501 @@ -2083,85 +1570,53 @@ async def __upsert_records_namespace( None """ self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['namespace'] = \ - namespace - kwargs['upsert_record'] = \ - upsert_record + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["namespace"] = namespace + kwargs["upsert_record"] = upsert_record return cast(None, await self.call_with_http_info(**kwargs)) self.upsert_records_namespace = _AsyncioEndpoint( settings={ - 'response_type': None, - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/records/namespaces/{namespace}/upsert', - 'operation_id': 'upsert_records_namespace', - 'http_method': 'POST', - 'servers': None, + "response_type": None, + "auth": ["ApiKeyAuth"], + "endpoint_path": "/records/namespaces/{namespace}/upsert", + "operation_id": "upsert_records_namespace", + "http_method": "POST", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'namespace', - 'upsert_record', - ], - 'required': [ - 'x_pinecone_api_version', - 'namespace', - 'upsert_record', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "namespace", "upsert_record"], + "required": ["x_pinecone_api_version", "namespace", "upsert_record"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "namespace": (str,), + "upsert_record": ([UpsertRecord],), }, - 'openapi_types': { - 'x_pinecone_api_version': - (str,), - 'namespace': - (str,), - 'upsert_record': - ([UpsertRecord],), + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "namespace": "namespace", }, - 'attribute_map': { - 'x_pinecone_api_version': 'X-Pinecone-Api-Version', - 'namespace': 'namespace', + "location_map": { + "x_pinecone_api_version": "header", + "namespace": "path", + "upsert_record": "body", }, - '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' - ] + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": ["application/x-ndjson"]}, api_client=api_client, - callable=__upsert_records_namespace + callable=__upsert_records_namespace, ) async def __upsert_vectors( - self, - upsert_request, - x_pinecone_api_version="2025-10", - **kwargs + self, upsert_request, x_pinecone_api_version="2025-10", **kwargs ) -> UpsertResponse: """Upsert vectors # noqa: E501 @@ -2193,68 +1648,38 @@ async def __upsert_vectors( UpsertResponse """ self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['upsert_request'] = \ - upsert_request + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["upsert_request"] = upsert_request return cast(UpsertResponse, await self.call_with_http_info(**kwargs)) self.upsert_vectors = _AsyncioEndpoint( settings={ - 'response_type': (UpsertResponse,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/vectors/upsert', - 'operation_id': 'upsert_vectors', - 'http_method': 'POST', - 'servers': None, + "response_type": (UpsertResponse,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/vectors/upsert", + "operation_id": "upsert_vectors", + "http_method": "POST", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'upsert_request', - ], - 'required': [ - 'x_pinecone_api_version', - 'upsert_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "upsert_request"], + "required": ["x_pinecone_api_version", "upsert_request"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_pinecone_api_version': - (str,), - 'upsert_request': - (UpsertRequest,), - }, - 'attribute_map': { - 'x_pinecone_api_version': 'X-Pinecone-Api-Version', + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "upsert_request": (UpsertRequest,), }, - 'location_map': { - 'x_pinecone_api_version': 'header', - 'upsert_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] + "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"]}, api_client=api_client, - callable=__upsert_vectors + callable=__upsert_vectors, ) diff --git a/pinecone/core/openapi/db_data/apis/__init__.py b/pinecone/core/openapi/db_data/apis/__init__.py index f0a1cd81d..a5caa981e 100644 --- a/pinecone/core/openapi/db_data/apis/__init__.py +++ b/pinecone/core/openapi/db_data/apis/__init__.py @@ -1,4 +1,3 @@ - # flake8: noqa # Import all APIs into this package. diff --git a/pinecone/core/openapi/db_data/model/create_namespace_request.py b/pinecone/core/openapi/db_data/model/create_namespace_request.py index 0511c92ba..56809af25 100644 --- a/pinecone/core/openapi/db_data/model/create_namespace_request.py +++ b/pinecone/core/openapi/db_data/model/create_namespace_request.py @@ -1,15 +1,14 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -30,11 +29,17 @@ from typing import TYPE_CHECKING if TYPE_CHECKING: - from pinecone.core.openapi.db_data.model.create_namespace_request_schema import CreateNamespaceRequestSchema + from pinecone.core.openapi.db_data.model.create_namespace_request_schema import ( + CreateNamespaceRequestSchema, + ) + def lazy_import(): - from pinecone.core.openapi.db_data.model.create_namespace_request_schema import CreateNamespaceRequestSchema - globals()['CreateNamespaceRequestSchema'] = CreateNamespaceRequestSchema + 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 @@ -69,11 +74,9 @@ class CreateNamespaceRequest(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -82,7 +85,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -98,24 +101,22 @@ def openapi_types(cls): """ lazy_import() return { - 'name': (str,), # noqa: E501 - 'schema': (CreateNamespaceRequestSchema,), # noqa: E501 + "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 + "name": "name", # noqa: E501 + "schema": "schema", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of CreateNamespaceRequest. @@ -128,8 +129,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], name, *args, **kwargs) -> T: # noqa: E501 @@ -172,22 +171,20 @@ def _from_openapi_data(cls: Type[T], name, *args, **kwargs) -> T: # noqa: E501 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', ()) + _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__, - ), + "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__,), ) @@ -203,25 +200,29 @@ def _from_openapi_data(cls: Type[T], name, *args, **kwargs) -> T: # noqa: E501 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: + 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', - ]) + 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 @@ -265,19 +266,17 @@ def __init__(self, name, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -293,13 +292,17 @@ def __init__(self, name, *args, **kwargs) -> None: # noqa: E501 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: + 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.") + 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 index c9d663a7b..e8dbfb59b 100644 --- a/pinecone/core/openapi/db_data/model/create_namespace_request_schema.py +++ b/pinecone/core/openapi/db_data/model/create_namespace_request_schema.py @@ -1,15 +1,14 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -30,11 +29,17 @@ from typing import TYPE_CHECKING if TYPE_CHECKING: - from pinecone.core.openapi.db_data.model.create_namespace_request_schema_fields import CreateNamespaceRequestSchemaFields + from pinecone.core.openapi.db_data.model.create_namespace_request_schema_fields import ( + CreateNamespaceRequestSchemaFields, + ) + def lazy_import(): - from pinecone.core.openapi.db_data.model.create_namespace_request_schema_fields import CreateNamespaceRequestSchemaFields - globals()['CreateNamespaceRequestSchemaFields'] = CreateNamespaceRequestSchemaFields + 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 @@ -69,11 +74,9 @@ class CreateNamespaceRequestSchema(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -82,7 +85,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -98,22 +101,20 @@ def openapi_types(cls): """ lazy_import() return { - 'fields': ({str: (CreateNamespaceRequestSchemaFields,)},), # noqa: E501 + "fields": ({str: (CreateNamespaceRequestSchemaFields,)},) # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'fields': 'fields', # noqa: E501 + "fields": "fields" # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of CreateNamespaceRequestSchema. @@ -126,8 +127,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], fields, *args, **kwargs) -> T: # noqa: E501 @@ -169,22 +168,20 @@ def _from_openapi_data(cls: Type[T], fields, *args, **kwargs) -> T: # noqa: E50 _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', ()) + _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__, - ), + "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__,), ) @@ -200,25 +197,29 @@ def _from_openapi_data(cls: Type[T], fields, *args, **kwargs) -> T: # noqa: E50 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: + 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', - ]) + 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 @@ -261,19 +262,17 @@ def __init__(self, fields, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -289,13 +288,17 @@ def __init__(self, fields, *args, **kwargs) -> None: # noqa: E501 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: + 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.") + 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 index a7cac4cdb..421885f12 100644 --- 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 @@ -1,15 +1,14 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -28,7 +27,6 @@ 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 @@ -61,11 +59,9 @@ class CreateNamespaceRequestSchemaFields(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -73,7 +69,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 """ - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -88,22 +84,20 @@ def openapi_types(cls): and the value is attribute type. """ return { - 'filterable': (bool,), # noqa: E501 + "filterable": (bool,) # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'filterable': 'filterable', # noqa: E501 + "filterable": "filterable" # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of CreateNamespaceRequestSchemaFields. @@ -116,8 +110,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 @@ -157,22 +149,20 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 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', ()) + _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__, - ), + "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__,), ) @@ -187,25 +177,29 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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 @@ -246,19 +240,17 @@ def __init__(self, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -273,13 +265,17 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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 b67c60e89..2412ff7cd 100644 --- a/pinecone/core/openapi/db_data/model/delete_request.py +++ b/pinecone/core/openapi/db_data/model/delete_request.py @@ -1,15 +1,14 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -28,7 +27,6 @@ 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 @@ -61,13 +59,9 @@ class DeleteRequest(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ('ids',): { - }, - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {("ids",): {}} @cached_class_property def additional_properties_type(cls): @@ -75,7 +69,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 """ - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -90,28 +84,26 @@ def openapi_types(cls): and the value is attribute type. """ return { - 'ids': ([str],), # noqa: E501 - 'delete_all': (bool,), # noqa: E501 - 'namespace': (str,), # noqa: E501 - 'filter': (Dict[str, Any],), # noqa: E501 + "ids": ([str],), # noqa: E501 + "delete_all": (bool,), # noqa: E501 + "namespace": (str,), # noqa: E501 + "filter": (Dict[str, Any],), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'ids': 'ids', # noqa: E501 - 'delete_all': 'deleteAll', # noqa: E501 - 'namespace': 'namespace', # noqa: E501 - 'filter': 'filter', # noqa: E501 + "ids": "ids", # noqa: E501 + "delete_all": "deleteAll", # noqa: E501 + "namespace": "namespace", # noqa: E501 + "filter": "filter", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of DeleteRequest. @@ -124,8 +116,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 @@ -168,22 +158,20 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 filter (Dict[str, Any]): 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) - _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', ()) + _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__, - ), + "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__,), ) @@ -198,25 +186,29 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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 @@ -260,19 +252,17 @@ def __init__(self, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -287,13 +277,17 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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/describe_index_stats_request.py b/pinecone/core/openapi/db_data/model/describe_index_stats_request.py index f8917fff0..58e88b5c9 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 @@ -1,15 +1,14 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -28,7 +27,6 @@ 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 @@ -61,11 +59,9 @@ class DescribeIndexStatsRequest(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -73,7 +69,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 """ - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -88,22 +84,20 @@ def openapi_types(cls): and the value is attribute type. """ return { - 'filter': (Dict[str, Any],), # noqa: E501 + "filter": (Dict[str, Any],) # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'filter': 'filter', # noqa: E501 + "filter": "filter" # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of DescribeIndexStatsRequest. @@ -116,8 +110,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 @@ -157,22 +149,20 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 filter (Dict[str, Any]): If this parameter is present, the operation only returns statistics for vectors that satisfy the filter. See [Understanding metadata](https://docs.pinecone.io/guides/index-data/indexing-overview#metadata). Serverless indexes do not support filtering `describe_index_stats` by metadata. [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', ()) + _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__, - ), + "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__,), ) @@ -187,25 +177,29 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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 @@ -246,19 +240,17 @@ def __init__(self, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -273,13 +265,17 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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_request.py b/pinecone/core/openapi/db_data/model/fetch_by_metadata_request.py index 757fc1106..1f3a2ddef 100644 --- a/pinecone/core/openapi/db_data/model/fetch_by_metadata_request.py +++ b/pinecone/core/openapi/db_data/model/fetch_by_metadata_request.py @@ -1,15 +1,14 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -28,7 +27,6 @@ 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 @@ -61,13 +59,10 @@ class FetchByMetadataRequest(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ('limit',): { - 'inclusive_minimum': 1, - }, + ("limit",): {"inclusive_minimum": 1} } @cached_class_property @@ -76,7 +71,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 """ - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -91,28 +86,26 @@ def openapi_types(cls): and the value is attribute type. """ return { - 'namespace': (str,), # noqa: E501 - 'filter': (Dict[str, Any],), # noqa: E501 - 'limit': (int,), # noqa: E501 - 'pagination_token': (str,), # noqa: E501 + "namespace": (str,), # noqa: E501 + "filter": (Dict[str, Any],), # 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 + "namespace": "namespace", # noqa: E501 + "filter": "filter", # noqa: E501 + "limit": "limit", # noqa: E501 + "pagination_token": "paginationToken", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of FetchByMetadataRequest. @@ -125,8 +118,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 @@ -169,22 +160,20 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # 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', ()) + _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__, - ), + "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__,), ) @@ -199,25 +188,29 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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 @@ -261,19 +254,17 @@ def __init__(self, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -288,13 +279,17 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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 index 024c9bf7c..d7c2fbfb8 100644 --- a/pinecone/core/openapi/db_data/model/fetch_by_metadata_response.py +++ b/pinecone/core/openapi/db_data/model/fetch_by_metadata_response.py @@ -1,15 +1,14 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -34,13 +33,15 @@ from pinecone.core.openapi.db_data.model.usage import Usage from pinecone.core.openapi.db_data.model.vector import Vector + 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 + + globals()["Pagination"] = Pagination + globals()["Usage"] = Usage + globals()["Vector"] = Vector from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -75,11 +76,9 @@ class FetchByMetadataResponse(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -88,7 +87,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -104,28 +103,26 @@ def openapi_types(cls): """ lazy_import() return { - 'vectors': ({str: (Vector,)},), # noqa: E501 - 'namespace': (str,), # noqa: E501 - 'usage': (Usage,), # noqa: E501 - 'pagination': (Pagination,), # noqa: E501 + "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 + "vectors": "vectors", # noqa: E501 + "namespace": "namespace", # noqa: E501 + "usage": "usage", # noqa: E501 + "pagination": "pagination", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of FetchByMetadataResponse. @@ -138,8 +135,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 @@ -182,22 +177,20 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # 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', ()) + _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__, - ), + "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__,), ) @@ -212,25 +205,29 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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 @@ -274,19 +271,17 @@ def __init__(self, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -301,13 +296,17 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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 fbdd4da0d..72a4783a3 100644 --- a/pinecone/core/openapi/db_data/model/fetch_response.py +++ b/pinecone/core/openapi/db_data/model/fetch_response.py @@ -1,15 +1,14 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -33,11 +32,13 @@ from pinecone.core.openapi.db_data.model.usage import Usage from pinecone.core.openapi.db_data.model.vector import Vector + def lazy_import(): from pinecone.core.openapi.db_data.model.usage import Usage from pinecone.core.openapi.db_data.model.vector import Vector - globals()['Usage'] = Usage - globals()['Vector'] = Vector + + globals()["Usage"] = Usage + globals()["Vector"] = Vector from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -72,11 +73,9 @@ class FetchResponse(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -85,7 +84,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -101,26 +100,24 @@ def openapi_types(cls): """ lazy_import() return { - 'vectors': ({str: (Vector,)},), # noqa: E501 - 'namespace': (str,), # noqa: E501 - 'usage': (Usage,), # noqa: E501 + "vectors": ({str: (Vector,)},), # noqa: E501 + "namespace": (str,), # noqa: E501 + "usage": (Usage,), # 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 + "vectors": "vectors", # noqa: E501 + "namespace": "namespace", # noqa: E501 + "usage": "usage", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of FetchResponse. @@ -133,8 +130,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 @@ -176,22 +171,20 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 usage (Usage): [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', ()) + _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__, - ), + "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__,), ) @@ -206,25 +199,29 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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 @@ -267,19 +264,17 @@ def __init__(self, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -294,13 +289,17 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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/hit.py b/pinecone/core/openapi/db_data/model/hit.py index f389aa800..397d28f86 100644 --- a/pinecone/core/openapi/db_data/model/hit.py +++ b/pinecone/core/openapi/db_data/model/hit.py @@ -1,15 +1,14 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -28,7 +27,6 @@ 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 @@ -61,11 +59,9 @@ class Hit(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -73,7 +69,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 """ - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -88,26 +84,24 @@ def openapi_types(cls): and the value is attribute type. """ return { - '_id': (str,), # noqa: E501 - '_score': (float,), # noqa: E501 - 'fields': (Dict[str, Any],), # noqa: E501 + "_id": (str,), # noqa: E501 + "_score": (float,), # noqa: E501 + "fields": (Dict[str, Any],), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - '_id': '_id', # noqa: E501 - '_score': '_score', # noqa: E501 - 'fields': 'fields', # noqa: E501 + "_id": "_id", # noqa: E501 + "_score": "_score", # noqa: E501 + "fields": "fields", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of Hit. @@ -120,8 +114,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], _id, _score, fields, *args, **kwargs) -> T: # noqa: E501 @@ -165,22 +157,20 @@ def _from_openapi_data(cls: Type[T], _id, _score, fields, *args, **kwargs) -> T: _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', ()) + _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__, - ), + "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__,), ) @@ -198,25 +188,29 @@ def _from_openapi_data(cls: Type[T], _id, _score, fields, *args, **kwargs) -> T: self._score = _score 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: + 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', - ]) + 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, _score, fields, *args, **kwargs) -> None: # noqa: E501 @@ -261,19 +255,17 @@ def __init__(self, _id, _score, fields, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -291,13 +283,17 @@ def __init__(self, _id, _score, fields, *args, **kwargs) -> None: # noqa: E501 self._score = _score 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: + 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.") + 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/import_error_mode.py b/pinecone/core/openapi/db_data/model/import_error_mode.py index 2aee4a2e4..a06e01640 100644 --- a/pinecone/core/openapi/db_data/model/import_error_mode.py +++ b/pinecone/core/openapi/db_data/model/import_error_mode.py @@ -1,15 +1,14 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -28,7 +27,6 @@ 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 @@ -61,11 +59,9 @@ class ImportErrorMode(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -73,7 +69,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 """ - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -88,22 +84,20 @@ def openapi_types(cls): and the value is attribute type. """ return { - 'on_error': (str,), # noqa: E501 + "on_error": (str,) # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'on_error': 'onError', # noqa: E501 + "on_error": "onError" # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ImportErrorMode. @@ -116,8 +110,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 @@ -157,22 +149,20 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # 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) - _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', ()) + _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__, - ), + "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__,), ) @@ -187,25 +177,29 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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 @@ -246,19 +240,17 @@ def __init__(self, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -273,13 +265,17 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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/import_model.py b/pinecone/core/openapi/db_data/model/import_model.py index ee6b049cd..98333a825 100644 --- a/pinecone/core/openapi/db_data/model/import_model.py +++ b/pinecone/core/openapi/db_data/model/import_model.py @@ -1,15 +1,14 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -28,7 +27,6 @@ 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 @@ -61,18 +59,11 @@ class ImportModel(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ('id',): { - 'max_length': 1000, - 'min_length': 1, - }, - ('percent_complete',): { - 'inclusive_maximum': 100.0, - 'inclusive_minimum': 0.0, - }, + ("id",): {"max_length": 1000, "min_length": 1}, + ("percent_complete",): {"inclusive_maximum": 100.0, "inclusive_minimum": 0.0}, } @cached_class_property @@ -81,7 +72,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 """ - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -96,36 +87,34 @@ def openapi_types(cls): and the value is attribute type. """ return { - 'id': (str,), # noqa: E501 - 'uri': (str,), # noqa: E501 - 'status': (str,), # noqa: E501 - 'created_at': (datetime,), # noqa: E501 - 'finished_at': (datetime,), # noqa: E501 - 'percent_complete': (float,), # noqa: E501 - 'records_imported': (int,), # noqa: E501 - 'error': (str,), # noqa: E501 + "id": (str,), # noqa: E501 + "uri": (str,), # noqa: E501 + "status": (str,), # noqa: E501 + "created_at": (datetime,), # noqa: E501 + "finished_at": (datetime,), # noqa: E501 + "percent_complete": (float,), # noqa: E501 + "records_imported": (int,), # noqa: E501 + "error": (str,), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'id': 'id', # noqa: E501 - 'uri': 'uri', # noqa: E501 - 'status': 'status', # noqa: E501 - 'created_at': 'createdAt', # noqa: E501 - 'finished_at': 'finishedAt', # noqa: E501 - 'percent_complete': 'percentComplete', # noqa: E501 - 'records_imported': 'recordsImported', # noqa: E501 - 'error': 'error', # noqa: E501 + "id": "id", # noqa: E501 + "uri": "uri", # noqa: E501 + "status": "status", # noqa: E501 + "created_at": "createdAt", # noqa: E501 + "finished_at": "finishedAt", # noqa: E501 + "percent_complete": "percentComplete", # noqa: E501 + "records_imported": "recordsImported", # noqa: E501 + "error": "error", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ImportModel. @@ -138,8 +127,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 @@ -186,22 +173,20 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 error (str): The error message if the import process failed. [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', ()) + _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__, - ), + "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__,), ) @@ -216,25 +201,29 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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 @@ -282,19 +271,17 @@ def __init__(self, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -309,13 +296,17 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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/index_description.py b/pinecone/core/openapi/db_data/model/index_description.py index 5b63aabbf..0dbc89bc0 100644 --- a/pinecone/core/openapi/db_data/model/index_description.py +++ b/pinecone/core/openapi/db_data/model/index_description.py @@ -1,15 +1,14 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -32,9 +31,11 @@ if TYPE_CHECKING: from pinecone.core.openapi.db_data.model.namespace_summary import NamespaceSummary + def lazy_import(): from pinecone.core.openapi.db_data.model.namespace_summary import NamespaceSummary - globals()['NamespaceSummary'] = NamespaceSummary + + globals()["NamespaceSummary"] = NamespaceSummary from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -69,11 +70,9 @@ class IndexDescription(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -82,7 +81,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -98,36 +97,34 @@ def openapi_types(cls): """ lazy_import() return { - 'namespaces': ({str: (NamespaceSummary,)},), # noqa: E501 - 'dimension': (int,), # noqa: E501 - 'index_fullness': (float,), # noqa: E501 - '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 + "namespaces": ({str: (NamespaceSummary,)},), # noqa: E501 + "dimension": (int,), # noqa: E501 + "index_fullness": (float,), # noqa: E501 + "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 def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'namespaces': 'namespaces', # noqa: E501 - 'dimension': 'dimension', # noqa: E501 - 'index_fullness': 'indexFullness', # noqa: E501 - '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 + "namespaces": "namespaces", # noqa: E501 + "dimension": "dimension", # noqa: E501 + "index_fullness": "indexFullness", # noqa: E501 + "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([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of IndexDescription. @@ -140,8 +137,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 @@ -188,22 +183,20 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # 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) - _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', ()) + _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__, - ), + "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__,), ) @@ -218,25 +211,29 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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 @@ -284,19 +281,17 @@ def __init__(self, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -311,13 +306,17 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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/list_imports_response.py b/pinecone/core/openapi/db_data/model/list_imports_response.py index 7aa20d888..b3cc47177 100644 --- a/pinecone/core/openapi/db_data/model/list_imports_response.py +++ b/pinecone/core/openapi/db_data/model/list_imports_response.py @@ -1,15 +1,14 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -33,11 +32,13 @@ from pinecone.core.openapi.db_data.model.import_model import ImportModel from pinecone.core.openapi.db_data.model.pagination import Pagination + def lazy_import(): from pinecone.core.openapi.db_data.model.import_model import ImportModel from pinecone.core.openapi.db_data.model.pagination import Pagination - globals()['ImportModel'] = ImportModel - globals()['Pagination'] = Pagination + + globals()["ImportModel"] = ImportModel + globals()["Pagination"] = Pagination from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -72,11 +73,9 @@ class ListImportsResponse(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -85,7 +84,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -101,24 +100,22 @@ def openapi_types(cls): """ lazy_import() return { - 'data': ([ImportModel],), # noqa: E501 - 'pagination': (Pagination,), # noqa: E501 + "data": ([ImportModel],), # noqa: E501 + "pagination": (Pagination,), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'data': 'data', # noqa: E501 - 'pagination': 'pagination', # noqa: E501 + "data": "data", # noqa: E501 + "pagination": "pagination", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ListImportsResponse. @@ -131,8 +128,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 @@ -173,22 +168,20 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # 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', ()) + _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__, - ), + "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__,), ) @@ -203,25 +196,29 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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 @@ -263,19 +260,17 @@ def __init__(self, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -290,13 +285,17 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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/list_item.py b/pinecone/core/openapi/db_data/model/list_item.py index 90e9b99a7..6fd00f857 100644 --- a/pinecone/core/openapi/db_data/model/list_item.py +++ b/pinecone/core/openapi/db_data/model/list_item.py @@ -1,15 +1,14 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -28,7 +27,6 @@ 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 @@ -61,11 +59,9 @@ class ListItem(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -73,7 +69,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 """ - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -88,22 +84,20 @@ def openapi_types(cls): and the value is attribute type. """ return { - 'id': (str,), # noqa: E501 + "id": (str,) # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'id': 'id', # noqa: E501 + "id": "id" # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ListItem. @@ -116,8 +110,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 @@ -157,22 +149,20 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 id (str): [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', ()) + _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__, - ), + "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__,), ) @@ -187,25 +177,29 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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 @@ -246,19 +240,17 @@ def __init__(self, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -273,13 +265,17 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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/list_namespaces_response.py b/pinecone/core/openapi/db_data/model/list_namespaces_response.py index f5eca2910..54037cf65 100644 --- a/pinecone/core/openapi/db_data/model/list_namespaces_response.py +++ b/pinecone/core/openapi/db_data/model/list_namespaces_response.py @@ -1,15 +1,14 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -33,11 +32,13 @@ from pinecone.core.openapi.db_data.model.namespace_description import NamespaceDescription from pinecone.core.openapi.db_data.model.pagination import Pagination + def lazy_import(): from pinecone.core.openapi.db_data.model.namespace_description import NamespaceDescription from pinecone.core.openapi.db_data.model.pagination import Pagination - globals()['NamespaceDescription'] = NamespaceDescription - globals()['Pagination'] = Pagination + + globals()["NamespaceDescription"] = NamespaceDescription + globals()["Pagination"] = Pagination from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -72,11 +73,9 @@ class ListNamespacesResponse(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -85,7 +84,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -101,26 +100,24 @@ def openapi_types(cls): """ lazy_import() return { - 'namespaces': ([NamespaceDescription],), # noqa: E501 - 'pagination': (Pagination,), # noqa: E501 - 'total_count': (int,), # noqa: E501 + "namespaces": ([NamespaceDescription],), # noqa: E501 + "pagination": (Pagination,), # noqa: E501 + "total_count": (int,), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'namespaces': 'namespaces', # noqa: E501 - 'pagination': 'pagination', # noqa: E501 - 'total_count': 'total_count', # noqa: E501 + "namespaces": "namespaces", # noqa: E501 + "pagination": "pagination", # noqa: E501 + "total_count": "total_count", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ListNamespacesResponse. @@ -133,8 +130,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 @@ -176,22 +171,20 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # 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) - _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', ()) + _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__, - ), + "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__,), ) @@ -206,25 +199,29 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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 @@ -267,19 +264,17 @@ def __init__(self, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -294,13 +289,17 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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/list_response.py b/pinecone/core/openapi/db_data/model/list_response.py index 129c2df91..c599e9a0e 100644 --- a/pinecone/core/openapi/db_data/model/list_response.py +++ b/pinecone/core/openapi/db_data/model/list_response.py @@ -1,15 +1,14 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -34,13 +33,15 @@ from pinecone.core.openapi.db_data.model.pagination import Pagination from pinecone.core.openapi.db_data.model.usage import Usage + def lazy_import(): from pinecone.core.openapi.db_data.model.list_item import ListItem from pinecone.core.openapi.db_data.model.pagination import Pagination from pinecone.core.openapi.db_data.model.usage import Usage - globals()['ListItem'] = ListItem - globals()['Pagination'] = Pagination - globals()['Usage'] = Usage + + globals()["ListItem"] = ListItem + globals()["Pagination"] = Pagination + globals()["Usage"] = Usage from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -75,11 +76,9 @@ class ListResponse(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -88,7 +87,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -104,28 +103,26 @@ def openapi_types(cls): """ lazy_import() return { - 'vectors': ([ListItem],), # noqa: E501 - 'pagination': (Pagination,), # noqa: E501 - 'namespace': (str,), # noqa: E501 - 'usage': (Usage,), # noqa: E501 + "vectors": ([ListItem],), # noqa: E501 + "pagination": (Pagination,), # noqa: E501 + "namespace": (str,), # noqa: E501 + "usage": (Usage,), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'vectors': 'vectors', # noqa: E501 - 'pagination': 'pagination', # noqa: E501 - 'namespace': 'namespace', # noqa: E501 - 'usage': 'usage', # noqa: E501 + "vectors": "vectors", # noqa: E501 + "pagination": "pagination", # noqa: E501 + "namespace": "namespace", # noqa: E501 + "usage": "usage", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ListResponse. @@ -138,8 +135,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 @@ -182,22 +177,20 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 usage (Usage): [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', ()) + _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__, - ), + "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__,), ) @@ -212,25 +205,29 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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 @@ -274,19 +271,17 @@ def __init__(self, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -301,13 +296,17 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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/namespace_description.py b/pinecone/core/openapi/db_data/model/namespace_description.py index 42c7022ed..f419983b0 100644 --- a/pinecone/core/openapi/db_data/model/namespace_description.py +++ b/pinecone/core/openapi/db_data/model/namespace_description.py @@ -1,15 +1,14 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -30,14 +29,24 @@ from typing import TYPE_CHECKING if TYPE_CHECKING: - from pinecone.core.openapi.db_data.model.create_namespace_request_schema import CreateNamespaceRequestSchema - from pinecone.core.openapi.db_data.model.namespace_description_indexed_fields import NamespaceDescriptionIndexedFields + from pinecone.core.openapi.db_data.model.create_namespace_request_schema import ( + CreateNamespaceRequestSchema, + ) + from pinecone.core.openapi.db_data.model.namespace_description_indexed_fields import ( + NamespaceDescriptionIndexedFields, + ) + def lazy_import(): - from pinecone.core.openapi.db_data.model.create_namespace_request_schema import CreateNamespaceRequestSchema - from pinecone.core.openapi.db_data.model.namespace_description_indexed_fields import NamespaceDescriptionIndexedFields - globals()['CreateNamespaceRequestSchema'] = CreateNamespaceRequestSchema - globals()['NamespaceDescriptionIndexedFields'] = NamespaceDescriptionIndexedFields + from pinecone.core.openapi.db_data.model.create_namespace_request_schema import ( + CreateNamespaceRequestSchema, + ) + from pinecone.core.openapi.db_data.model.namespace_description_indexed_fields import ( + NamespaceDescriptionIndexedFields, + ) + + globals()["CreateNamespaceRequestSchema"] = CreateNamespaceRequestSchema + globals()["NamespaceDescriptionIndexedFields"] = NamespaceDescriptionIndexedFields from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -72,11 +81,9 @@ class NamespaceDescription(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -85,7 +92,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -101,28 +108,26 @@ def openapi_types(cls): """ lazy_import() return { - 'name': (str,), # noqa: E501 - 'record_count': (int,), # noqa: E501 - 'schema': (CreateNamespaceRequestSchema,), # noqa: E501 - 'indexed_fields': (NamespaceDescriptionIndexedFields,), # noqa: E501 + "name": (str,), # noqa: E501 + "record_count": (int,), # noqa: E501 + "schema": (CreateNamespaceRequestSchema,), # noqa: E501 + "indexed_fields": (NamespaceDescriptionIndexedFields,), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'name': 'name', # noqa: E501 - 'record_count': 'record_count', # noqa: E501 - 'schema': 'schema', # noqa: E501 - 'indexed_fields': 'indexed_fields', # noqa: E501 + "name": "name", # noqa: E501 + "record_count": "record_count", # noqa: E501 + "schema": "schema", # noqa: E501 + "indexed_fields": "indexed_fields", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of NamespaceDescription. @@ -135,8 +140,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 @@ -179,22 +182,20 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 indexed_fields (NamespaceDescriptionIndexedFields): [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', ()) + _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__, - ), + "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__,), ) @@ -209,25 +210,29 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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 @@ -271,19 +276,17 @@ def __init__(self, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -298,13 +301,17 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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/namespace_description_indexed_fields.py b/pinecone/core/openapi/db_data/model/namespace_description_indexed_fields.py index d235fb8da..1272d78f9 100644 --- a/pinecone/core/openapi/db_data/model/namespace_description_indexed_fields.py +++ b/pinecone/core/openapi/db_data/model/namespace_description_indexed_fields.py @@ -1,15 +1,14 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -28,7 +27,6 @@ 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 @@ -61,11 +59,9 @@ class NamespaceDescriptionIndexedFields(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -73,7 +69,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 """ - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -88,22 +84,20 @@ def openapi_types(cls): and the value is attribute type. """ return { - 'fields': ([str],), # noqa: E501 + "fields": ([str],) # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'fields': 'fields', # noqa: E501 + "fields": "fields" # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of NamespaceDescriptionIndexedFields. @@ -116,8 +110,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 @@ -157,22 +149,20 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 fields ([str]): [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', ()) + _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__, - ), + "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__,), ) @@ -187,25 +177,29 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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 @@ -246,19 +240,17 @@ def __init__(self, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -273,13 +265,17 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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/namespace_summary.py b/pinecone/core/openapi/db_data/model/namespace_summary.py index 310a1e4b2..a7f1ad9df 100644 --- a/pinecone/core/openapi/db_data/model/namespace_summary.py +++ b/pinecone/core/openapi/db_data/model/namespace_summary.py @@ -1,15 +1,14 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -28,7 +27,6 @@ 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 @@ -61,11 +59,9 @@ class NamespaceSummary(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -73,7 +69,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 """ - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -88,22 +84,20 @@ def openapi_types(cls): and the value is attribute type. """ return { - 'vector_count': (int,), # noqa: E501 + "vector_count": (int,) # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'vector_count': 'vectorCount', # noqa: E501 + "vector_count": "vectorCount" # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of NamespaceSummary. @@ -116,8 +110,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 @@ -157,22 +149,20 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 vector_count (int): The number of vectors stored in this namespace. Note that updates to this field may lag behind updates to the underlying index and corresponding query results, etc. [optional] # noqa: E501 """ - _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', ()) + _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__, - ), + "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__,), ) @@ -187,25 +177,29 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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 @@ -246,19 +240,17 @@ def __init__(self, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -273,13 +265,17 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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/pagination.py b/pinecone/core/openapi/db_data/model/pagination.py index 7c79aa03e..70492aca3 100644 --- a/pinecone/core/openapi/db_data/model/pagination.py +++ b/pinecone/core/openapi/db_data/model/pagination.py @@ -1,15 +1,14 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -28,7 +27,6 @@ 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 @@ -61,11 +59,9 @@ class Pagination(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -73,7 +69,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 """ - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -88,22 +84,20 @@ def openapi_types(cls): and the value is attribute type. """ return { - 'next': (str,), # noqa: E501 + "next": (str,) # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'next': 'next', # noqa: E501 + "next": "next" # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of Pagination. @@ -116,8 +110,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 @@ -157,22 +149,20 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 next (str): [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', ()) + _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__, - ), + "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__,), ) @@ -187,25 +177,29 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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 @@ -246,19 +240,17 @@ def __init__(self, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -273,13 +265,17 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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/protobuf_any.py b/pinecone/core/openapi/db_data/model/protobuf_any.py index 825e985e2..20e694821 100644 --- a/pinecone/core/openapi/db_data/model/protobuf_any.py +++ b/pinecone/core/openapi/db_data/model/protobuf_any.py @@ -1,15 +1,14 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -28,7 +27,6 @@ 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 @@ -61,11 +59,9 @@ class ProtobufAny(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -73,7 +69,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 """ - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -88,24 +84,22 @@ def openapi_types(cls): and the value is attribute type. """ return { - 'type_url': (str,), # noqa: E501 - 'value': (str,), # noqa: E501 + "type_url": (str,), # noqa: E501 + "value": (str,), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'type_url': 'typeUrl', # noqa: E501 - 'value': 'value', # noqa: E501 + "type_url": "typeUrl", # noqa: E501 + "value": "value", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ProtobufAny. @@ -118,8 +112,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 @@ -160,22 +152,20 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 value (str): [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', ()) + _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__, - ), + "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__,), ) @@ -190,25 +180,29 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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 @@ -250,19 +244,17 @@ def __init__(self, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -277,13 +269,17 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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/query_request.py b/pinecone/core/openapi/db_data/model/query_request.py index e547fc67e..9d4cef11b 100644 --- a/pinecone/core/openapi/db_data/model/query_request.py +++ b/pinecone/core/openapi/db_data/model/query_request.py @@ -1,15 +1,14 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -33,11 +32,13 @@ from pinecone.core.openapi.db_data.model.query_vector import QueryVector from pinecone.core.openapi.db_data.model.sparse_values import SparseValues + def lazy_import(): from pinecone.core.openapi.db_data.model.query_vector import QueryVector from pinecone.core.openapi.db_data.model.sparse_values import SparseValues - globals()['QueryVector'] = QueryVector - globals()['SparseValues'] = SparseValues + + globals()["QueryVector"] = QueryVector + globals()["SparseValues"] = SparseValues from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -72,21 +73,13 @@ class QueryRequest(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ('top_k',): { - 'inclusive_maximum': 10000, - 'inclusive_minimum': 1, - }, - ('queries',): { - }, - ('vector',): { - }, - ('id',): { - 'max_length': 512, - }, + ("top_k",): {"inclusive_maximum": 10000, "inclusive_minimum": 1}, + ("queries",): {}, + ("vector",): {}, + ("id",): {"max_length": 512}, } @cached_class_property @@ -96,7 +89,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -112,38 +105,36 @@ def openapi_types(cls): """ lazy_import() return { - 'top_k': (int,), # noqa: E501 - 'namespace': (str,), # noqa: E501 - 'filter': (Dict[str, Any],), # noqa: E501 - 'include_values': (bool,), # noqa: E501 - 'include_metadata': (bool,), # noqa: E501 - 'queries': ([QueryVector],), # noqa: E501 - 'vector': ([float],), # noqa: E501 - 'sparse_vector': (SparseValues,), # noqa: E501 - 'id': (str,), # noqa: E501 + "top_k": (int,), # noqa: E501 + "namespace": (str,), # noqa: E501 + "filter": (Dict[str, Any],), # noqa: E501 + "include_values": (bool,), # noqa: E501 + "include_metadata": (bool,), # noqa: E501 + "queries": ([QueryVector],), # noqa: E501 + "vector": ([float],), # noqa: E501 + "sparse_vector": (SparseValues,), # noqa: E501 + "id": (str,), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'top_k': 'topK', # noqa: E501 - 'namespace': 'namespace', # noqa: E501 - 'filter': 'filter', # noqa: E501 - 'include_values': 'includeValues', # noqa: E501 - 'include_metadata': 'includeMetadata', # noqa: E501 - 'queries': 'queries', # noqa: E501 - 'vector': 'vector', # noqa: E501 - 'sparse_vector': 'sparseVector', # noqa: E501 - 'id': 'id', # noqa: E501 + "top_k": "topK", # noqa: E501 + "namespace": "namespace", # noqa: E501 + "filter": "filter", # noqa: E501 + "include_values": "includeValues", # noqa: E501 + "include_metadata": "includeMetadata", # noqa: E501 + "queries": "queries", # noqa: E501 + "vector": "vector", # noqa: E501 + "sparse_vector": "sparseVector", # noqa: E501 + "id": "id", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of QueryRequest. @@ -156,8 +147,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], top_k, *args, **kwargs) -> T: # noqa: E501 @@ -207,22 +196,20 @@ def _from_openapi_data(cls: Type[T], top_k, *args, **kwargs) -> T: # noqa: E501 id (str): The unique ID of the vector to be used as a query vector. Each request can contain either the `vector` or `id` parameter. [optional] # noqa: E501 """ - _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', ()) + _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__, - ), + "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__,), ) @@ -238,25 +225,29 @@ def _from_openapi_data(cls: Type[T], top_k, *args, **kwargs) -> T: # noqa: E501 self.top_k = top_k for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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, top_k, *args, **kwargs) -> None: # noqa: E501 @@ -307,19 +298,17 @@ def __init__(self, top_k, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -335,13 +324,17 @@ def __init__(self, top_k, *args, **kwargs) -> None: # noqa: E501 self.top_k = top_k for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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/query_response.py b/pinecone/core/openapi/db_data/model/query_response.py index 53c7fbc72..e9f19c72d 100644 --- a/pinecone/core/openapi/db_data/model/query_response.py +++ b/pinecone/core/openapi/db_data/model/query_response.py @@ -1,15 +1,14 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -34,13 +33,15 @@ from pinecone.core.openapi.db_data.model.single_query_results import SingleQueryResults from pinecone.core.openapi.db_data.model.usage import Usage + def lazy_import(): from pinecone.core.openapi.db_data.model.scored_vector import ScoredVector from pinecone.core.openapi.db_data.model.single_query_results import SingleQueryResults from pinecone.core.openapi.db_data.model.usage import Usage - globals()['ScoredVector'] = ScoredVector - globals()['SingleQueryResults'] = SingleQueryResults - globals()['Usage'] = Usage + + globals()["ScoredVector"] = ScoredVector + globals()["SingleQueryResults"] = SingleQueryResults + globals()["Usage"] = Usage from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -75,11 +76,9 @@ class QueryResponse(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -88,7 +87,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -104,28 +103,26 @@ def openapi_types(cls): """ lazy_import() return { - 'results': ([SingleQueryResults],), # noqa: E501 - 'matches': ([ScoredVector],), # noqa: E501 - 'namespace': (str,), # noqa: E501 - 'usage': (Usage,), # noqa: E501 + "results": ([SingleQueryResults],), # noqa: E501 + "matches": ([ScoredVector],), # noqa: E501 + "namespace": (str,), # noqa: E501 + "usage": (Usage,), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'results': 'results', # noqa: E501 - 'matches': 'matches', # noqa: E501 - 'namespace': 'namespace', # noqa: E501 - 'usage': 'usage', # noqa: E501 + "results": "results", # noqa: E501 + "matches": "matches", # noqa: E501 + "namespace": "namespace", # noqa: E501 + "usage": "usage", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of QueryResponse. @@ -138,8 +135,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 @@ -182,22 +177,20 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 usage (Usage): [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', ()) + _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__, - ), + "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__,), ) @@ -212,25 +205,29 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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 @@ -274,19 +271,17 @@ def __init__(self, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -301,13 +296,17 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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/query_vector.py b/pinecone/core/openapi/db_data/model/query_vector.py index d55f8c6c3..d40d59736 100644 --- a/pinecone/core/openapi/db_data/model/query_vector.py +++ b/pinecone/core/openapi/db_data/model/query_vector.py @@ -1,15 +1,14 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -32,9 +31,11 @@ if TYPE_CHECKING: from pinecone.core.openapi.db_data.model.sparse_values import SparseValues + def lazy_import(): from pinecone.core.openapi.db_data.model.sparse_values import SparseValues - globals()['SparseValues'] = SparseValues + + globals()["SparseValues"] = SparseValues from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -69,16 +70,11 @@ class QueryVector(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ('values',): { - }, - ('top_k',): { - 'inclusive_maximum': 10000, - 'inclusive_minimum': 1, - }, + ("values",): {}, + ("top_k",): {"inclusive_maximum": 10000, "inclusive_minimum": 1}, } @cached_class_property @@ -88,7 +84,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -104,30 +100,28 @@ def openapi_types(cls): """ lazy_import() return { - 'values': ([float],), # noqa: E501 - 'sparse_values': (SparseValues,), # noqa: E501 - 'top_k': (int,), # noqa: E501 - 'namespace': (str,), # noqa: E501 - 'filter': (Dict[str, Any],), # noqa: E501 + "values": ([float],), # noqa: E501 + "sparse_values": (SparseValues,), # noqa: E501 + "top_k": (int,), # noqa: E501 + "namespace": (str,), # noqa: E501 + "filter": (Dict[str, Any],), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'values': 'values', # noqa: E501 - 'sparse_values': 'sparseValues', # noqa: E501 - 'top_k': 'topK', # noqa: E501 - 'namespace': 'namespace', # noqa: E501 - 'filter': 'filter', # noqa: E501 + "values": "values", # noqa: E501 + "sparse_values": "sparseValues", # noqa: E501 + "top_k": "topK", # noqa: E501 + "namespace": "namespace", # noqa: E501 + "filter": "filter", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of QueryVector. @@ -140,8 +134,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], values, *args, **kwargs) -> T: # noqa: E501 @@ -187,22 +179,20 @@ def _from_openapi_data(cls: Type[T], values, *args, **kwargs) -> T: # noqa: E50 filter (Dict[str, Any]): An override for the metadata filter to apply. This replaces the request-level filter. [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', ()) + _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__, - ), + "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__,), ) @@ -218,25 +208,29 @@ def _from_openapi_data(cls: Type[T], values, *args, **kwargs) -> T: # noqa: E50 self.values = values for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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, values, *args, **kwargs) -> None: # noqa: E501 @@ -283,19 +277,17 @@ def __init__(self, values, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -311,13 +303,17 @@ def __init__(self, values, *args, **kwargs) -> None: # noqa: E501 self.values = values for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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/rpc_status.py b/pinecone/core/openapi/db_data/model/rpc_status.py index fe99c1843..ef015f5d9 100644 --- a/pinecone/core/openapi/db_data/model/rpc_status.py +++ b/pinecone/core/openapi/db_data/model/rpc_status.py @@ -1,15 +1,14 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -32,9 +31,11 @@ if TYPE_CHECKING: from pinecone.core.openapi.db_data.model.protobuf_any import ProtobufAny + def lazy_import(): from pinecone.core.openapi.db_data.model.protobuf_any import ProtobufAny - globals()['ProtobufAny'] = ProtobufAny + + globals()["ProtobufAny"] = ProtobufAny from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -69,11 +70,9 @@ class RpcStatus(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -82,7 +81,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -98,26 +97,24 @@ def openapi_types(cls): """ lazy_import() return { - 'code': (int,), # noqa: E501 - 'message': (str,), # noqa: E501 - 'details': ([ProtobufAny],), # noqa: E501 + "code": (int,), # noqa: E501 + "message": (str,), # noqa: E501 + "details": ([ProtobufAny],), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'code': 'code', # noqa: E501 - 'message': 'message', # noqa: E501 - 'details': 'details', # noqa: E501 + "code": "code", # noqa: E501 + "message": "message", # noqa: E501 + "details": "details", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of RpcStatus. @@ -130,8 +127,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 @@ -173,22 +168,20 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 details ([ProtobufAny]): [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', ()) + _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__, - ), + "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__,), ) @@ -203,25 +196,29 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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 @@ -264,19 +261,17 @@ def __init__(self, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -291,13 +286,17 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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/scored_vector.py b/pinecone/core/openapi/db_data/model/scored_vector.py index bd17bed37..2c664318c 100644 --- a/pinecone/core/openapi/db_data/model/scored_vector.py +++ b/pinecone/core/openapi/db_data/model/scored_vector.py @@ -1,15 +1,14 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -32,9 +31,11 @@ if TYPE_CHECKING: from pinecone.core.openapi.db_data.model.sparse_values import SparseValues + def lazy_import(): from pinecone.core.openapi.db_data.model.sparse_values import SparseValues - globals()['SparseValues'] = SparseValues + + globals()["SparseValues"] = SparseValues from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -69,14 +70,10 @@ class ScoredVector(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ('id',): { - 'max_length': 512, - 'min_length': 1, - }, + ("id",): {"max_length": 512, "min_length": 1} } @cached_class_property @@ -86,7 +83,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -102,30 +99,28 @@ def openapi_types(cls): """ lazy_import() return { - 'id': (str,), # noqa: E501 - 'score': (float,), # noqa: E501 - 'values': ([float],), # noqa: E501 - 'sparse_values': (SparseValues,), # noqa: E501 - 'metadata': (Dict[str, Any],), # noqa: E501 + "id": (str,), # noqa: E501 + "score": (float,), # noqa: E501 + "values": ([float],), # noqa: E501 + "sparse_values": (SparseValues,), # noqa: E501 + "metadata": (Dict[str, Any],), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'id': 'id', # noqa: E501 - 'score': 'score', # noqa: E501 - 'values': 'values', # noqa: E501 - 'sparse_values': 'sparseValues', # noqa: E501 - 'metadata': 'metadata', # noqa: E501 + "id": "id", # noqa: E501 + "score": "score", # noqa: E501 + "values": "values", # noqa: E501 + "sparse_values": "sparseValues", # noqa: E501 + "metadata": "metadata", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ScoredVector. @@ -138,8 +133,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], id, *args, **kwargs) -> T: # noqa: E501 @@ -185,22 +178,20 @@ def _from_openapi_data(cls: Type[T], id, *args, **kwargs) -> T: # noqa: E501 metadata (Dict[str, Any]): This is the metadata, if it is requested. [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', ()) + _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__, - ), + "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__,), ) @@ -216,25 +207,29 @@ def _from_openapi_data(cls: Type[T], id, *args, **kwargs) -> T: # noqa: E501 self.id = id for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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, *args, **kwargs) -> None: # noqa: E501 @@ -281,19 +276,17 @@ def __init__(self, id, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -309,13 +302,17 @@ def __init__(self, id, *args, **kwargs) -> None: # noqa: E501 self.id = id for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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_match_terms.py b/pinecone/core/openapi/db_data/model/search_match_terms.py index bb9fbf7ae..605b2093a 100644 --- a/pinecone/core/openapi/db_data/model/search_match_terms.py +++ b/pinecone/core/openapi/db_data/model/search_match_terms.py @@ -1,15 +1,14 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -28,7 +27,6 @@ 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 @@ -61,11 +59,9 @@ class SearchMatchTerms(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -73,7 +69,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 """ - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -88,24 +84,22 @@ def openapi_types(cls): and the value is attribute type. """ return { - 'strategy': (str,), # noqa: E501 - 'terms': ([str],), # noqa: E501 + "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 + "strategy": "strategy", # noqa: E501 + "terms": "terms", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of SearchMatchTerms. @@ -118,8 +112,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 @@ -160,22 +152,20 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # 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', ()) + _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__, - ), + "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__,), ) @@ -190,25 +180,29 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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 @@ -250,19 +244,17 @@ def __init__(self, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -277,13 +269,17 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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 4ff9e3d3a..9505a80dc 100644 --- a/pinecone/core/openapi/db_data/model/search_records_request.py +++ b/pinecone/core/openapi/db_data/model/search_records_request.py @@ -1,15 +1,14 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -30,14 +29,24 @@ from typing import TYPE_CHECKING if TYPE_CHECKING: - from pinecone.core.openapi.db_data.model.search_records_request_query import SearchRecordsRequestQuery - from pinecone.core.openapi.db_data.model.search_records_request_rerank import SearchRecordsRequestRerank + from pinecone.core.openapi.db_data.model.search_records_request_query import ( + SearchRecordsRequestQuery, + ) + from pinecone.core.openapi.db_data.model.search_records_request_rerank import ( + SearchRecordsRequestRerank, + ) + def lazy_import(): - from pinecone.core.openapi.db_data.model.search_records_request_query import SearchRecordsRequestQuery - from pinecone.core.openapi.db_data.model.search_records_request_rerank import SearchRecordsRequestRerank - globals()['SearchRecordsRequestQuery'] = SearchRecordsRequestQuery - globals()['SearchRecordsRequestRerank'] = SearchRecordsRequestRerank + from pinecone.core.openapi.db_data.model.search_records_request_query import ( + SearchRecordsRequestQuery, + ) + from pinecone.core.openapi.db_data.model.search_records_request_rerank import ( + SearchRecordsRequestRerank, + ) + + globals()["SearchRecordsRequestQuery"] = SearchRecordsRequestQuery + globals()["SearchRecordsRequestRerank"] = SearchRecordsRequestRerank from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -72,13 +81,9 @@ class SearchRecordsRequest(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ('fields',): { - }, - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {("fields",): {}} @cached_class_property def additional_properties_type(cls): @@ -87,7 +92,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -103,26 +108,24 @@ def openapi_types(cls): """ lazy_import() return { - 'query': (SearchRecordsRequestQuery,), # noqa: E501 - 'fields': ([str],), # noqa: E501 - 'rerank': (SearchRecordsRequestRerank,), # noqa: E501 + "query": (SearchRecordsRequestQuery,), # noqa: E501 + "fields": ([str],), # noqa: E501 + "rerank": (SearchRecordsRequestRerank,), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'query': 'query', # noqa: E501 - 'fields': 'fields', # noqa: E501 - 'rerank': 'rerank', # noqa: E501 + "query": "query", # noqa: E501 + "fields": "fields", # noqa: E501 + "rerank": "rerank", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of SearchRecordsRequest. @@ -135,8 +138,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], query, *args, **kwargs) -> T: # noqa: E501 @@ -180,22 +181,20 @@ def _from_openapi_data(cls: Type[T], query, *args, **kwargs) -> T: # noqa: E501 rerank (SearchRecordsRequestRerank): [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', ()) + _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__, - ), + "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__,), ) @@ -211,25 +210,29 @@ def _from_openapi_data(cls: Type[T], query, *args, **kwargs) -> T: # noqa: E501 self.query = query for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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, query, *args, **kwargs) -> None: # noqa: E501 @@ -274,19 +277,17 @@ def __init__(self, query, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -302,13 +303,17 @@ def __init__(self, query, *args, **kwargs) -> None: # noqa: E501 self.query = query for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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_query.py b/pinecone/core/openapi/db_data/model/search_records_request_query.py index 67f365029..b77aedf85 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 @@ -1,15 +1,14 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -33,11 +32,13 @@ from pinecone.core.openapi.db_data.model.search_match_terms import SearchMatchTerms from pinecone.core.openapi.db_data.model.search_records_vector import SearchRecordsVector + 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 + + globals()["SearchMatchTerms"] = SearchMatchTerms + globals()["SearchRecordsVector"] = SearchRecordsVector from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -72,14 +73,9 @@ class SearchRecordsRequestQuery(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ('id',): { - 'max_length': 512, - }, - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {("id",): {"max_length": 512}} @cached_class_property def additional_properties_type(cls): @@ -88,7 +84,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -104,32 +100,30 @@ def openapi_types(cls): """ lazy_import() return { - 'top_k': (int,), # noqa: E501 - 'filter': (Dict[str, Any],), # noqa: E501 - 'inputs': (Dict[str, Any],), # noqa: E501 - 'vector': (SearchRecordsVector,), # noqa: E501 - 'id': (str,), # noqa: E501 - 'match_terms': (SearchMatchTerms,), # noqa: E501 + "top_k": (int,), # noqa: E501 + "filter": (Dict[str, Any],), # noqa: E501 + "inputs": (Dict[str, Any],), # noqa: E501 + "vector": (SearchRecordsVector,), # noqa: E501 + "id": (str,), # noqa: E501 + "match_terms": (SearchMatchTerms,), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'top_k': 'top_k', # noqa: E501 - 'filter': 'filter', # noqa: E501 - 'inputs': 'inputs', # noqa: E501 - 'vector': 'vector', # noqa: E501 - 'id': 'id', # noqa: E501 - 'match_terms': 'match_terms', # noqa: E501 + "top_k": "top_k", # noqa: E501 + "filter": "filter", # noqa: E501 + "inputs": "inputs", # noqa: E501 + "vector": "vector", # noqa: E501 + "id": "id", # noqa: E501 + "match_terms": "match_terms", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of SearchRecordsRequestQuery. @@ -142,8 +136,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], top_k, *args, **kwargs) -> T: # noqa: E501 @@ -190,22 +182,20 @@ def _from_openapi_data(cls: Type[T], top_k, *args, **kwargs) -> T: # noqa: E501 match_terms (SearchMatchTerms): [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', ()) + _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__, - ), + "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__,), ) @@ -221,25 +211,29 @@ def _from_openapi_data(cls: Type[T], top_k, *args, **kwargs) -> T: # noqa: E501 self.top_k = top_k for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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, top_k, *args, **kwargs) -> None: # noqa: E501 @@ -287,19 +281,17 @@ def __init__(self, top_k, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -315,13 +307,17 @@ def __init__(self, top_k, *args, **kwargs) -> None: # noqa: E501 self.top_k = top_k for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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_rerank.py b/pinecone/core/openapi/db_data/model/search_records_request_rerank.py index e84a79789..81cd31a1d 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 @@ -1,15 +1,14 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -28,7 +27,6 @@ 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 @@ -61,11 +59,9 @@ class SearchRecordsRequestRerank(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -73,7 +69,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 """ - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -88,30 +84,28 @@ def openapi_types(cls): and the value is attribute type. """ return { - 'model': (str,), # noqa: E501 - 'rank_fields': ([str],), # noqa: E501 - 'top_n': (int,), # noqa: E501 - 'parameters': (Dict[str, Any],), # noqa: E501 - 'query': (str,), # noqa: E501 + "model": (str,), # noqa: E501 + "rank_fields": ([str],), # noqa: E501 + "top_n": (int,), # noqa: E501 + "parameters": (Dict[str, Any],), # noqa: E501 + "query": (str,), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'model': 'model', # noqa: E501 - 'rank_fields': 'rank_fields', # noqa: E501 - 'top_n': 'top_n', # noqa: E501 - 'parameters': 'parameters', # noqa: E501 - 'query': 'query', # noqa: E501 + "model": "model", # noqa: E501 + "rank_fields": "rank_fields", # noqa: E501 + "top_n": "top_n", # noqa: E501 + "parameters": "parameters", # noqa: E501 + "query": "query", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of SearchRecordsRequestRerank. @@ -124,8 +118,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], model, rank_fields, *args, **kwargs) -> T: # noqa: E501 @@ -171,22 +163,20 @@ def _from_openapi_data(cls: Type[T], model, rank_fields, *args, **kwargs) -> T: query (str): The query to rerank documents against. If a specific rerank query is specified, it overwrites the query input that was provided at the top level. [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', ()) + _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__, - ), + "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__,), ) @@ -203,25 +193,29 @@ def _from_openapi_data(cls: Type[T], model, rank_fields, *args, **kwargs) -> T: self.model = model self.rank_fields = rank_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: + 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', - ]) + 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, model, rank_fields, *args, **kwargs) -> None: # noqa: E501 @@ -268,19 +262,17 @@ def __init__(self, model, rank_fields, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -297,13 +289,17 @@ def __init__(self, model, rank_fields, *args, **kwargs) -> None: # noqa: E501 self.model = model self.rank_fields = rank_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: + 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.") + 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_response.py b/pinecone/core/openapi/db_data/model/search_records_response.py index 3e67bffcb..c5ea7524a 100644 --- a/pinecone/core/openapi/db_data/model/search_records_response.py +++ b/pinecone/core/openapi/db_data/model/search_records_response.py @@ -1,15 +1,14 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -30,14 +29,20 @@ from typing import TYPE_CHECKING if TYPE_CHECKING: - from pinecone.core.openapi.db_data.model.search_records_response_result import SearchRecordsResponseResult + from pinecone.core.openapi.db_data.model.search_records_response_result import ( + SearchRecordsResponseResult, + ) from pinecone.core.openapi.db_data.model.search_usage import SearchUsage + def lazy_import(): - from pinecone.core.openapi.db_data.model.search_records_response_result import SearchRecordsResponseResult + from pinecone.core.openapi.db_data.model.search_records_response_result import ( + SearchRecordsResponseResult, + ) from pinecone.core.openapi.db_data.model.search_usage import SearchUsage - globals()['SearchRecordsResponseResult'] = SearchRecordsResponseResult - globals()['SearchUsage'] = SearchUsage + + globals()["SearchRecordsResponseResult"] = SearchRecordsResponseResult + globals()["SearchUsage"] = SearchUsage from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -72,11 +77,9 @@ class SearchRecordsResponse(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -85,7 +88,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -101,24 +104,22 @@ def openapi_types(cls): """ lazy_import() return { - 'result': (SearchRecordsResponseResult,), # noqa: E501 - 'usage': (SearchUsage,), # noqa: E501 + "result": (SearchRecordsResponseResult,), # noqa: E501 + "usage": (SearchUsage,), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'result': 'result', # noqa: E501 - 'usage': 'usage', # noqa: E501 + "result": "result", # noqa: E501 + "usage": "usage", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of SearchRecordsResponse. @@ -131,8 +132,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], result, usage, *args, **kwargs) -> T: # noqa: E501 @@ -175,22 +174,20 @@ def _from_openapi_data(cls: Type[T], result, usage, *args, **kwargs) -> T: # no _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', ()) + _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__, - ), + "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__,), ) @@ -207,25 +204,29 @@ def _from_openapi_data(cls: Type[T], result, usage, *args, **kwargs) -> T: # no self.result = result self.usage = usage for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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, result, usage, *args, **kwargs) -> None: # noqa: E501 @@ -269,19 +270,17 @@ def __init__(self, result, usage, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -298,13 +297,17 @@ def __init__(self, result, usage, *args, **kwargs) -> None: # noqa: E501 self.result = result self.usage = usage for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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_response_result.py b/pinecone/core/openapi/db_data/model/search_records_response_result.py index 156d64f25..0407075ef 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 @@ -1,15 +1,14 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -32,9 +31,11 @@ if TYPE_CHECKING: from pinecone.core.openapi.db_data.model.hit import Hit + def lazy_import(): from pinecone.core.openapi.db_data.model.hit import Hit - globals()['Hit'] = Hit + + globals()["Hit"] = Hit from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -69,11 +70,9 @@ class SearchRecordsResponseResult(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -82,7 +81,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -98,22 +97,20 @@ def openapi_types(cls): """ lazy_import() return { - 'hits': ([Hit],), # noqa: E501 + "hits": ([Hit],) # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'hits': 'hits', # noqa: E501 + "hits": "hits" # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of SearchRecordsResponseResult. @@ -126,8 +123,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], hits, *args, **kwargs) -> T: # noqa: E501 @@ -169,22 +164,20 @@ def _from_openapi_data(cls: Type[T], hits, *args, **kwargs) -> T: # noqa: E501 _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', ()) + _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__, - ), + "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__,), ) @@ -200,25 +193,29 @@ def _from_openapi_data(cls: Type[T], hits, *args, **kwargs) -> T: # noqa: E501 self.hits = hits for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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, hits, *args, **kwargs) -> None: # noqa: E501 @@ -261,19 +258,17 @@ def __init__(self, hits, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -289,13 +284,17 @@ def __init__(self, hits, *args, **kwargs) -> None: # noqa: E501 self.hits = hits for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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_vector.py b/pinecone/core/openapi/db_data/model/search_records_vector.py index 420e6bd0c..09729daef 100644 --- a/pinecone/core/openapi/db_data/model/search_records_vector.py +++ b/pinecone/core/openapi/db_data/model/search_records_vector.py @@ -1,15 +1,14 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -32,9 +31,11 @@ if TYPE_CHECKING: from pinecone.core.openapi.db_data.model.vector_values import VectorValues + def lazy_import(): from pinecone.core.openapi.db_data.model.vector_values import VectorValues - globals()['VectorValues'] = VectorValues + + globals()["VectorValues"] = VectorValues from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -69,11 +70,9 @@ class SearchRecordsVector(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -82,7 +81,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -98,26 +97,24 @@ def openapi_types(cls): """ lazy_import() return { - 'values': (VectorValues,), # noqa: E501 - 'sparse_values': ([float],), # noqa: E501 - 'sparse_indices': ([int],), # noqa: E501 + "values": (VectorValues,), # noqa: E501 + "sparse_values": ([float],), # noqa: E501 + "sparse_indices": ([int],), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'values': 'values', # noqa: E501 - 'sparse_values': 'sparse_values', # noqa: E501 - 'sparse_indices': 'sparse_indices', # noqa: E501 + "values": "values", # noqa: E501 + "sparse_values": "sparse_values", # noqa: E501 + "sparse_indices": "sparse_indices", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of SearchRecordsVector. @@ -130,8 +127,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 @@ -173,22 +168,20 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 sparse_indices ([int]): The sparse embedding indices. [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', ()) + _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__, - ), + "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__,), ) @@ -203,25 +196,29 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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 @@ -264,19 +261,17 @@ def __init__(self, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -291,13 +286,17 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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_usage.py b/pinecone/core/openapi/db_data/model/search_usage.py index 07341c967..2de18f899 100644 --- a/pinecone/core/openapi/db_data/model/search_usage.py +++ b/pinecone/core/openapi/db_data/model/search_usage.py @@ -1,15 +1,14 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -28,7 +27,6 @@ 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 @@ -61,19 +59,12 @@ class SearchUsage(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ('read_units',): { - 'inclusive_minimum': 0, - }, - ('embed_total_tokens',): { - 'inclusive_minimum': 0, - }, - ('rerank_units',): { - 'inclusive_minimum': 0, - }, + ("read_units",): {"inclusive_minimum": 0}, + ("embed_total_tokens",): {"inclusive_minimum": 0}, + ("rerank_units",): {"inclusive_minimum": 0}, } @cached_class_property @@ -82,7 +73,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 """ - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -97,26 +88,24 @@ def openapi_types(cls): and the value is attribute type. """ return { - 'read_units': (int,), # noqa: E501 - 'embed_total_tokens': (int,), # noqa: E501 - 'rerank_units': (int,), # noqa: E501 + "read_units": (int,), # noqa: E501 + "embed_total_tokens": (int,), # noqa: E501 + "rerank_units": (int,), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'read_units': 'read_units', # noqa: E501 - 'embed_total_tokens': 'embed_total_tokens', # noqa: E501 - 'rerank_units': 'rerank_units', # noqa: E501 + "read_units": "read_units", # noqa: E501 + "embed_total_tokens": "embed_total_tokens", # noqa: E501 + "rerank_units": "rerank_units", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of SearchUsage. @@ -129,8 +118,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], read_units, *args, **kwargs) -> T: # noqa: E501 @@ -174,22 +161,20 @@ def _from_openapi_data(cls: Type[T], read_units, *args, **kwargs) -> T: # noqa: rerank_units (int): The number of rerank units consumed by this 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', ()) + _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__, - ), + "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__,), ) @@ -205,25 +190,29 @@ def _from_openapi_data(cls: Type[T], read_units, *args, **kwargs) -> T: # noqa: self.read_units = read_units for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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, read_units, *args, **kwargs) -> None: # noqa: E501 @@ -268,19 +257,17 @@ def __init__(self, read_units, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -296,13 +283,17 @@ def __init__(self, read_units, *args, **kwargs) -> None: # noqa: E501 self.read_units = read_units for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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/single_query_results.py b/pinecone/core/openapi/db_data/model/single_query_results.py index e3e1288c2..1dbf183b1 100644 --- a/pinecone/core/openapi/db_data/model/single_query_results.py +++ b/pinecone/core/openapi/db_data/model/single_query_results.py @@ -1,15 +1,14 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -32,9 +31,11 @@ if TYPE_CHECKING: from pinecone.core.openapi.db_data.model.scored_vector import ScoredVector + def lazy_import(): from pinecone.core.openapi.db_data.model.scored_vector import ScoredVector - globals()['ScoredVector'] = ScoredVector + + globals()["ScoredVector"] = ScoredVector from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -69,11 +70,9 @@ class SingleQueryResults(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -82,7 +81,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -98,24 +97,22 @@ def openapi_types(cls): """ lazy_import() return { - 'matches': ([ScoredVector],), # noqa: E501 - 'namespace': (str,), # noqa: E501 + "matches": ([ScoredVector],), # noqa: E501 + "namespace": (str,), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'matches': 'matches', # noqa: E501 - 'namespace': 'namespace', # noqa: E501 + "matches": "matches", # noqa: E501 + "namespace": "namespace", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of SingleQueryResults. @@ -128,8 +125,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 @@ -170,22 +165,20 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 namespace (str): The namespace for the vectors. [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', ()) + _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__, - ), + "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__,), ) @@ -200,25 +193,29 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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 @@ -260,19 +257,17 @@ def __init__(self, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -287,13 +282,17 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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/sparse_values.py b/pinecone/core/openapi/db_data/model/sparse_values.py index aeaceb32f..541e3e18a 100644 --- a/pinecone/core/openapi/db_data/model/sparse_values.py +++ b/pinecone/core/openapi/db_data/model/sparse_values.py @@ -1,15 +1,14 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -28,7 +27,6 @@ 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 @@ -61,14 +59,11 @@ class SparseValues(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ('indices',): { - }, - ('values',): { - }, + ("indices",): {}, + ("values",): {}, } @cached_class_property @@ -77,7 +72,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 """ - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -92,24 +87,22 @@ def openapi_types(cls): and the value is attribute type. """ return { - 'indices': ([int],), # noqa: E501 - 'values': ([float],), # noqa: E501 + "indices": ([int],), # noqa: E501 + "values": ([float],), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'indices': 'indices', # noqa: E501 - 'values': 'values', # noqa: E501 + "indices": "indices", # noqa: E501 + "values": "values", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of SparseValues. @@ -122,8 +115,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], indices, values, *args, **kwargs) -> T: # noqa: E501 @@ -166,22 +157,20 @@ def _from_openapi_data(cls: Type[T], indices, values, *args, **kwargs) -> T: # _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', ()) + _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__, - ), + "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__,), ) @@ -198,25 +187,29 @@ def _from_openapi_data(cls: Type[T], indices, values, *args, **kwargs) -> T: # self.indices = indices self.values = values for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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, indices, values, *args, **kwargs) -> None: # noqa: E501 @@ -260,19 +253,17 @@ def __init__(self, indices, values, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -289,13 +280,17 @@ def __init__(self, indices, values, *args, **kwargs) -> None: # noqa: E501 self.indices = indices self.values = values for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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/start_import_request.py b/pinecone/core/openapi/db_data/model/start_import_request.py index b91e4a769..28ab505d8 100644 --- a/pinecone/core/openapi/db_data/model/start_import_request.py +++ b/pinecone/core/openapi/db_data/model/start_import_request.py @@ -1,15 +1,14 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -32,9 +31,11 @@ if TYPE_CHECKING: from pinecone.core.openapi.db_data.model.import_error_mode import ImportErrorMode + def lazy_import(): from pinecone.core.openapi.db_data.model.import_error_mode import ImportErrorMode - globals()['ImportErrorMode'] = ImportErrorMode + + globals()["ImportErrorMode"] = ImportErrorMode from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -69,17 +70,11 @@ class StartImportRequest(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ('uri',): { - 'max_length': 1500, - 'min_length': 1, - }, - ('integration_id',): { - 'max_length': 1000, - }, + ("uri",): {"max_length": 1500, "min_length": 1}, + ("integration_id",): {"max_length": 1000}, } @cached_class_property @@ -89,7 +84,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -105,26 +100,24 @@ def openapi_types(cls): """ lazy_import() return { - 'uri': (str,), # noqa: E501 - 'integration_id': (str,), # noqa: E501 - 'error_mode': (ImportErrorMode,), # noqa: E501 + "uri": (str,), # noqa: E501 + "integration_id": (str,), # noqa: E501 + "error_mode": (ImportErrorMode,), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'uri': 'uri', # noqa: E501 - 'integration_id': 'integrationId', # noqa: E501 - 'error_mode': 'errorMode', # noqa: E501 + "uri": "uri", # noqa: E501 + "integration_id": "integrationId", # noqa: E501 + "error_mode": "errorMode", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of StartImportRequest. @@ -137,8 +130,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], uri, *args, **kwargs) -> T: # noqa: E501 @@ -182,22 +173,20 @@ def _from_openapi_data(cls: Type[T], uri, *args, **kwargs) -> T: # noqa: E501 error_mode (ImportErrorMode): [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', ()) + _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__, - ), + "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__,), ) @@ -213,25 +202,29 @@ def _from_openapi_data(cls: Type[T], uri, *args, **kwargs) -> T: # noqa: E501 self.uri = uri for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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, uri, *args, **kwargs) -> None: # noqa: E501 @@ -276,19 +269,17 @@ def __init__(self, uri, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -304,13 +295,17 @@ def __init__(self, uri, *args, **kwargs) -> None: # noqa: E501 self.uri = uri for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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/start_import_response.py b/pinecone/core/openapi/db_data/model/start_import_response.py index 38d82937c..3e3115b07 100644 --- a/pinecone/core/openapi/db_data/model/start_import_response.py +++ b/pinecone/core/openapi/db_data/model/start_import_response.py @@ -1,15 +1,14 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -28,7 +27,6 @@ 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 @@ -61,14 +59,10 @@ class StartImportResponse(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ('id',): { - 'max_length': 1000, - 'min_length': 1, - }, + ("id",): {"max_length": 1000, "min_length": 1} } @cached_class_property @@ -77,7 +71,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 """ - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -92,22 +86,20 @@ def openapi_types(cls): and the value is attribute type. """ return { - 'id': (str,), # noqa: E501 + "id": (str,) # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'id': 'id', # noqa: E501 + "id": "id" # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of StartImportResponse. @@ -120,8 +112,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 @@ -161,22 +151,20 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 id (str): Unique identifier for the import 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', ()) + _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__, - ), + "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__,), ) @@ -191,25 +179,29 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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 @@ -250,19 +242,17 @@ def __init__(self, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -277,13 +267,17 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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/update_request.py b/pinecone/core/openapi/db_data/model/update_request.py index 6a4f58540..79ff7c599 100644 --- a/pinecone/core/openapi/db_data/model/update_request.py +++ b/pinecone/core/openapi/db_data/model/update_request.py @@ -1,15 +1,14 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -32,9 +31,11 @@ if TYPE_CHECKING: from pinecone.core.openapi.db_data.model.sparse_values import SparseValues + def lazy_import(): from pinecone.core.openapi.db_data.model.sparse_values import SparseValues - globals()['SparseValues'] = SparseValues + + globals()["SparseValues"] = SparseValues from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -69,16 +70,11 @@ class UpdateRequest(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ('id',): { - 'max_length': 512, - 'min_length': 1, - }, - ('values',): { - }, + ("id",): {"max_length": 512, "min_length": 1}, + ("values",): {}, } @cached_class_property @@ -88,7 +84,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -104,34 +100,32 @@ def openapi_types(cls): """ lazy_import() return { - 'id': (str,), # noqa: E501 - 'values': ([float],), # noqa: E501 - 'sparse_values': (SparseValues,), # noqa: E501 - 'set_metadata': (Dict[str, Any],), # noqa: E501 - 'namespace': (str,), # noqa: E501 - 'filter': (Dict[str, Any],), # noqa: E501 - 'dry_run': (bool,), # noqa: E501 + "id": (str,), # noqa: E501 + "values": ([float],), # noqa: E501 + "sparse_values": (SparseValues,), # noqa: E501 + "set_metadata": (Dict[str, Any],), # noqa: E501 + "namespace": (str,), # noqa: E501 + "filter": (Dict[str, Any],), # noqa: E501 + "dry_run": (bool,), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'id': 'id', # noqa: E501 - 'values': 'values', # noqa: E501 - 'sparse_values': 'sparseValues', # noqa: E501 - 'set_metadata': 'setMetadata', # noqa: E501 - 'namespace': 'namespace', # noqa: E501 - 'filter': 'filter', # noqa: E501 - 'dry_run': 'dryRun', # noqa: E501 + "id": "id", # noqa: E501 + "values": "values", # noqa: E501 + "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([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of UpdateRequest. @@ -144,8 +138,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 @@ -191,22 +183,20 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # 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) - _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', ()) + _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__, - ), + "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__,), ) @@ -221,25 +211,29 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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 @@ -286,19 +280,17 @@ def __init__(self, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -313,13 +305,17 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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/update_response.py b/pinecone/core/openapi/db_data/model/update_response.py index 81fad8793..61c8d6674 100644 --- a/pinecone/core/openapi/db_data/model/update_response.py +++ b/pinecone/core/openapi/db_data/model/update_response.py @@ -1,15 +1,14 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -28,7 +27,6 @@ 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 @@ -61,11 +59,9 @@ class UpdateResponse(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -73,7 +69,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 """ - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -88,22 +84,20 @@ def openapi_types(cls): and the value is attribute type. """ return { - 'matched_records': (int,), # noqa: E501 + "matched_records": (int,) # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'matched_records': 'matchedRecords', # noqa: E501 + "matched_records": "matchedRecords" # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of UpdateResponse. @@ -116,8 +110,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 @@ -157,22 +149,20 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # 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) - _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', ()) + _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__, - ), + "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__,), ) @@ -187,25 +177,29 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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 @@ -246,19 +240,17 @@ def __init__(self, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -273,13 +265,17 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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/upsert_record.py b/pinecone/core/openapi/db_data/model/upsert_record.py index 32bf40122..62e9322d3 100644 --- a/pinecone/core/openapi/db_data/model/upsert_record.py +++ b/pinecone/core/openapi/db_data/model/upsert_record.py @@ -1,15 +1,14 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -28,7 +27,6 @@ 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 @@ -61,11 +59,9 @@ class UpsertRecord(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -73,7 +69,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 """ - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -88,22 +84,20 @@ def openapi_types(cls): and the value is attribute type. """ return { - '_id': (str,), # noqa: E501 + "_id": (str,) # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - '_id': '_id', # noqa: E501 + "_id": "_id" # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of UpsertRecord. @@ -116,8 +110,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], _id, *args, **kwargs) -> T: # noqa: E501 @@ -159,22 +151,20 @@ def _from_openapi_data(cls: Type[T], _id, *args, **kwargs) -> T: # noqa: E501 _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', ()) + _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__, - ), + "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__,), ) @@ -190,25 +180,29 @@ def _from_openapi_data(cls: Type[T], _id, *args, **kwargs) -> T: # noqa: E501 self._id = _id for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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, *args, **kwargs) -> None: # noqa: E501 @@ -251,19 +245,17 @@ def __init__(self, _id, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -279,13 +271,17 @@ def __init__(self, _id, *args, **kwargs) -> None: # noqa: E501 self._id = _id for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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/upsert_request.py b/pinecone/core/openapi/db_data/model/upsert_request.py index 7778f7273..94739ac6f 100644 --- a/pinecone/core/openapi/db_data/model/upsert_request.py +++ b/pinecone/core/openapi/db_data/model/upsert_request.py @@ -1,15 +1,14 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -32,9 +31,11 @@ if TYPE_CHECKING: from pinecone.core.openapi.db_data.model.vector import Vector + def lazy_import(): from pinecone.core.openapi.db_data.model.vector import Vector - globals()['Vector'] = Vector + + globals()["Vector"] = Vector from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -69,13 +70,9 @@ class UpsertRequest(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ('vectors',): { - }, - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {("vectors",): {}} @cached_class_property def additional_properties_type(cls): @@ -84,7 +81,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -100,24 +97,22 @@ def openapi_types(cls): """ lazy_import() return { - 'vectors': ([Vector],), # noqa: E501 - 'namespace': (str,), # noqa: E501 + "vectors": ([Vector],), # noqa: E501 + "namespace": (str,), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'vectors': 'vectors', # noqa: E501 - 'namespace': 'namespace', # noqa: E501 + "vectors": "vectors", # noqa: E501 + "namespace": "namespace", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of UpsertRequest. @@ -130,8 +125,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], vectors, *args, **kwargs) -> T: # noqa: E501 @@ -174,22 +167,20 @@ def _from_openapi_data(cls: Type[T], vectors, *args, **kwargs) -> T: # noqa: E5 namespace (str): The namespace where you upsert vectors. [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', ()) + _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__, - ), + "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__,), ) @@ -205,25 +196,29 @@ def _from_openapi_data(cls: Type[T], vectors, *args, **kwargs) -> T: # noqa: E5 self.vectors = vectors for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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, vectors, *args, **kwargs) -> None: # noqa: E501 @@ -267,19 +262,17 @@ def __init__(self, vectors, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -295,13 +288,17 @@ def __init__(self, vectors, *args, **kwargs) -> None: # noqa: E501 self.vectors = vectors for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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/upsert_response.py b/pinecone/core/openapi/db_data/model/upsert_response.py index 5c74b419d..0e2c7c4ac 100644 --- a/pinecone/core/openapi/db_data/model/upsert_response.py +++ b/pinecone/core/openapi/db_data/model/upsert_response.py @@ -1,15 +1,14 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -28,7 +27,6 @@ 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 @@ -61,11 +59,9 @@ class UpsertResponse(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -73,7 +69,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 """ - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -88,22 +84,20 @@ def openapi_types(cls): and the value is attribute type. """ return { - 'upserted_count': (int,), # noqa: E501 + "upserted_count": (int,) # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'upserted_count': 'upsertedCount', # noqa: E501 + "upserted_count": "upsertedCount" # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of UpsertResponse. @@ -116,8 +110,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 @@ -157,22 +149,20 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 upserted_count (int): The number of vectors upserted. [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', ()) + _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__, - ), + "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__,), ) @@ -187,25 +177,29 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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 @@ -246,19 +240,17 @@ def __init__(self, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -273,13 +265,17 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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/usage.py b/pinecone/core/openapi/db_data/model/usage.py index c9edae90a..a8c04bc45 100644 --- a/pinecone/core/openapi/db_data/model/usage.py +++ b/pinecone/core/openapi/db_data/model/usage.py @@ -1,15 +1,14 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -28,7 +27,6 @@ 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 @@ -61,11 +59,9 @@ class Usage(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -73,7 +69,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 """ - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -88,22 +84,20 @@ def openapi_types(cls): and the value is attribute type. """ return { - 'read_units': (int,), # noqa: E501 + "read_units": (int,) # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'read_units': 'readUnits', # noqa: E501 + "read_units": "readUnits" # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of Usage. @@ -116,8 +110,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 @@ -157,22 +149,20 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 read_units (int): The number of read units consumed by this 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', ()) + _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__, - ), + "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__,), ) @@ -187,25 +177,29 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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 @@ -246,19 +240,17 @@ def __init__(self, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -273,13 +265,17 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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/vector.py b/pinecone/core/openapi/db_data/model/vector.py index 80ceddc34..453552b09 100644 --- a/pinecone/core/openapi/db_data/model/vector.py +++ b/pinecone/core/openapi/db_data/model/vector.py @@ -1,15 +1,14 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -32,9 +31,11 @@ if TYPE_CHECKING: from pinecone.core.openapi.db_data.model.sparse_values import SparseValues + def lazy_import(): from pinecone.core.openapi.db_data.model.sparse_values import SparseValues - globals()['SparseValues'] = SparseValues + + globals()["SparseValues"] = SparseValues from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -69,16 +70,11 @@ class Vector(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ('id',): { - 'max_length': 512, - 'min_length': 1, - }, - ('values',): { - }, + ("id",): {"max_length": 512, "min_length": 1}, + ("values",): {}, } @cached_class_property @@ -88,7 +84,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -104,28 +100,26 @@ def openapi_types(cls): """ lazy_import() return { - 'id': (str,), # noqa: E501 - 'values': ([float],), # noqa: E501 - 'sparse_values': (SparseValues,), # noqa: E501 - 'metadata': (Dict[str, Any],), # noqa: E501 + "id": (str,), # noqa: E501 + "values": ([float],), # noqa: E501 + "sparse_values": (SparseValues,), # noqa: E501 + "metadata": (Dict[str, Any],), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'id': 'id', # noqa: E501 - 'values': 'values', # noqa: E501 - 'sparse_values': 'sparseValues', # noqa: E501 - 'metadata': 'metadata', # noqa: E501 + "id": "id", # noqa: E501 + "values": "values", # noqa: E501 + "sparse_values": "sparseValues", # noqa: E501 + "metadata": "metadata", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of Vector. @@ -138,8 +132,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], id, *args, **kwargs) -> T: # noqa: E501 @@ -184,22 +176,20 @@ def _from_openapi_data(cls: Type[T], id, *args, **kwargs) -> T: # noqa: E501 metadata (Dict[str, Any]): This is the metadata included in the request. [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', ()) + _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__, - ), + "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__,), ) @@ -215,25 +205,29 @@ def _from_openapi_data(cls: Type[T], id, *args, **kwargs) -> T: # noqa: E501 self.id = id for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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, *args, **kwargs) -> None: # noqa: E501 @@ -279,19 +273,17 @@ def __init__(self, id, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -307,13 +299,17 @@ def __init__(self, id, *args, **kwargs) -> None: # noqa: E501 self.id = id for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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/vector_values.py b/pinecone/core/openapi/db_data/model/vector_values.py index 7a700830e..0175fda4c 100644 --- a/pinecone/core/openapi/db_data/model/vector_values.py +++ b/pinecone/core/openapi/db_data/model/vector_values.py @@ -1,15 +1,14 @@ """ - Pinecone Data Plane API +Pinecone Data Plane API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -28,7 +27,6 @@ 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 @@ -57,13 +55,9 @@ class VectorValues(ModelSimple): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ('value',): { - }, - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {("value",): {}} @cached_class_property def additional_properties_type(cls): @@ -71,7 +65,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 """ - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -85,31 +79,30 @@ def openapi_types(cls): openapi_types (dict): The key is attribute name and the value is attribute type. """ - return { - 'value': ([float],), - } + return {"value": ([float],)} @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', - ]) + 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: @@ -154,21 +147,19 @@ def __init__(self, *args, **kwargs) -> None: _visited_composed_classes = (Animal,) """ # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) + _path_to_item = kwargs.pop("_path_to_item", ()) value = None - if 'value' in kwargs: - value = kwargs.pop('value') + 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__, - ), + "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__,), ) @@ -180,13 +171,12 @@ def __init__(self, *args, **kwargs) -> None: 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', ()) + _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 @@ -199,10 +189,8 @@ def __init__(self, *args, **kwargs) -> None: self.value = value if kwargs: raise PineconeApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), + "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__,), ) @@ -251,23 +239,21 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: _visited_composed_classes = (Animal,) """ # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) + _path_to_item = kwargs.pop("_path_to_item", ()) self = super(OpenApiModel, cls).__new__(cls) value = None - if 'value' in kwargs: - value = kwargs.pop('value') + 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__, - ), + "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__,), ) @@ -279,13 +265,12 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: 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', ()) + _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 @@ -298,10 +283,8 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: self.value = value if kwargs: raise PineconeApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), + "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__,), ) diff --git a/pinecone/core/openapi/db_data/models/__init__.py b/pinecone/core/openapi/db_data/models/__init__.py index 8bab597bb..e3b28075a 100644 --- a/pinecone/core/openapi/db_data/models/__init__.py +++ b/pinecone/core/openapi/db_data/models/__init__.py @@ -10,10 +10,16 @@ # 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.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.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 @@ -26,7 +32,9 @@ from pinecone.core.openapi.db_data.model.list_namespaces_response import ListNamespacesResponse from pinecone.core.openapi.db_data.model.list_response import ListResponse from pinecone.core.openapi.db_data.model.namespace_description import NamespaceDescription -from pinecone.core.openapi.db_data.model.namespace_description_indexed_fields import NamespaceDescriptionIndexedFields +from pinecone.core.openapi.db_data.model.namespace_description_indexed_fields import ( + NamespaceDescriptionIndexedFields, +) 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 @@ -37,10 +45,16 @@ 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 -from pinecone.core.openapi.db_data.model.search_records_request_rerank import SearchRecordsRequestRerank +from pinecone.core.openapi.db_data.model.search_records_request_query import ( + SearchRecordsRequestQuery, +) +from pinecone.core.openapi.db_data.model.search_records_request_rerank import ( + SearchRecordsRequestRerank, +) from pinecone.core.openapi.db_data.model.search_records_response import SearchRecordsResponse -from pinecone.core.openapi.db_data.model.search_records_response_result import SearchRecordsResponseResult +from pinecone.core.openapi.db_data.model.search_records_response_result import ( + SearchRecordsResponseResult, +) 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.single_query_results import SingleQueryResults diff --git a/pinecone/core/openapi/inference/__init__.py b/pinecone/core/openapi/inference/__init__.py index 4a9d16dbb..e483fc73f 100644 --- a/pinecone/core/openapi/inference/__init__.py +++ b/pinecone/core/openapi/inference/__init__.py @@ -1,17 +1,16 @@ # flake8: noqa """ - Pinecone Inference API +Pinecone Inference API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - __version__ = "1.0.0" # import ApiClient @@ -27,4 +26,5 @@ from pinecone.openapi_support.exceptions import PineconeApiValueError from pinecone.openapi_support.exceptions import PineconeApiKeyError from pinecone.openapi_support.exceptions import PineconeApiException -API_VERSION = '2025-10' + +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 f72f183f4..1e38938f8 100644 --- a/pinecone/core/openapi/inference/api/inference_api.py +++ b/pinecone/core/openapi/inference/api/inference_api.py @@ -1,24 +1,24 @@ """ - Pinecone Inference API +Pinecone Inference API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from __future__ import annotations from typing import TYPE_CHECKING, Any, Dict, cast - -if TYPE_CHECKING: - from multiprocessing.pool import ApplyResult +from multiprocessing.pool import ApplyResult from pinecone.openapi_support import ApiClient, AsyncioApiClient -from pinecone.openapi_support.endpoint_utils import ExtraOpenApiKwargsTypedDict, KwargsWithOpenApiKwargDefaultsTypedDict +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 @@ -26,7 +26,7 @@ datetime, file_type, none_type, - validate_and_convert_types + validate_and_convert_types, ) from pinecone.core.openapi.inference.model.embed_request import EmbedRequest from pinecone.core.openapi.inference.model.embeddings_list import EmbeddingsList @@ -49,9 +49,7 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client def __embed( - self, - x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict + self, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict ) -> EmbeddingsList | ApplyResult[EmbeddingsList]: """Generate vectors # noqa: E501 @@ -90,74 +88,48 @@ def __embed( thread. """ kwargs = self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - return cast(EmbeddingsList | ApplyResult[EmbeddingsList], self.call_with_http_info(**kwargs)) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + return cast( + EmbeddingsList | ApplyResult[EmbeddingsList], self.call_with_http_info(**kwargs) + ) self.embed = _Endpoint( settings={ - 'response_type': (EmbeddingsList,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/embed', - 'operation_id': 'embed', - 'http_method': 'POST', - 'servers': None, + "response_type": (EmbeddingsList,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/embed", + "operation_id": "embed", + "http_method": "POST", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'embed_request', - ], - 'required': [ - 'x_pinecone_api_version', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "embed_request"], + "required": ["x_pinecone_api_version"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_pinecone_api_version': - (str,), - 'embed_request': - (EmbedRequest,), - }, - 'attribute_map': { - 'x_pinecone_api_version': 'X-Pinecone-Api-Version', + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "embed_request": (EmbedRequest,), }, - 'location_map': { - 'x_pinecone_api_version': 'header', - 'embed_request': 'body', - }, - 'collection_format_map': { - } - }, - headers_map={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json' - ] + "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"]}, api_client=api_client, - callable=__embed + callable=__embed, ) def __get_model( self, model_name, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict + **kwargs: ExtraOpenApiKwargsTypedDict, ) -> ModelInfo | ApplyResult[ModelInfo]: """Describe a model # noqa: E501 @@ -196,75 +168,44 @@ def __get_model( thread. """ kwargs = self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['model_name'] = \ - model_name + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["model_name"] = model_name return cast(ModelInfo | ApplyResult[ModelInfo], self.call_with_http_info(**kwargs)) self.get_model = _Endpoint( settings={ - 'response_type': (ModelInfo,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/models/{model_name}', - 'operation_id': 'get_model', - 'http_method': 'GET', - 'servers': None, + "response_type": (ModelInfo,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/models/{model_name}", + "operation_id": "get_model", + "http_method": "GET", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'model_name', - ], - 'required': [ - 'x_pinecone_api_version', - 'model_name', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "model_name"], + "required": ["x_pinecone_api_version", "model_name"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_pinecone_api_version': - (str,), - 'model_name': - (str,), + "validations": {}, + "allowed_values": {}, + "openapi_types": {"x_pinecone_api_version": (str,), "model_name": (str,)}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "model_name": "model_name", }, - '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': [], + "location_map": {"x_pinecone_api_version": "header", "model_name": "path"}, + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__get_model + callable=__get_model, ) def __list_models( - self, - x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict + self, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict ) -> ModelInfoList | ApplyResult[ModelInfoList]: """List available models # noqa: E501 @@ -304,77 +245,54 @@ def __list_models( thread. """ kwargs = self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - return cast(ModelInfoList | ApplyResult[ModelInfoList], self.call_with_http_info(**kwargs)) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + return cast( + ModelInfoList | ApplyResult[ModelInfoList], self.call_with_http_info(**kwargs) + ) self.list_models = _Endpoint( settings={ - 'response_type': (ModelInfoList,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/models', - 'operation_id': 'list_models', - 'http_method': 'GET', - 'servers': None, + "response_type": (ModelInfoList,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/models", + "operation_id": "list_models", + "http_method": "GET", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'type', - 'vector_type', - ], - 'required': [ - 'x_pinecone_api_version', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "type", "vector_type"], + "required": ["x_pinecone_api_version"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { - }, - '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': [], - }, + "validations": {}, + "allowed_values": {}, + "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": []}, api_client=api_client, - callable=__list_models + callable=__list_models, ) def __rerank( - self, - x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict + self, x_pinecone_api_version="2025-10", **kwargs: ExtraOpenApiKwargsTypedDict ) -> RerankResult | ApplyResult[RerankResult]: """Rerank results # noqa: E501 @@ -413,71 +331,44 @@ def __rerank( thread. """ kwargs = self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - return cast(RerankResult | ApplyResult[RerankResult], self.call_with_http_info(**kwargs)) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + return cast( + RerankResult | ApplyResult[RerankResult], self.call_with_http_info(**kwargs) + ) self.rerank = _Endpoint( settings={ - 'response_type': (RerankResult,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/rerank', - 'operation_id': 'rerank', - 'http_method': 'POST', - 'servers': None, + "response_type": (RerankResult,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/rerank", + "operation_id": "rerank", + "http_method": "POST", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'rerank_request', - ], - 'required': [ - 'x_pinecone_api_version', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "rerank_request"], + "required": ["x_pinecone_api_version"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_pinecone_api_version': - (str,), - 'rerank_request': - (RerankRequest,), + "validations": {}, + "allowed_values": {}, + "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' - ] + "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"]}, api_client=api_client, - callable=__rerank + callable=__rerank, ) - class AsyncioInferenceApi: """NOTE: This class is @generated using OpenAPI @@ -489,11 +380,7 @@ def __init__(self, api_client=None) -> None: api_client = AsyncioApiClient() self.api_client = api_client - async def __embed( - self, - x_pinecone_api_version="2025-10", - **kwargs - ) -> EmbeddingsList: + async def __embed(self, x_pinecone_api_version="2025-10", **kwargs) -> EmbeddingsList: """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 @@ -524,74 +411,43 @@ async def __embed( EmbeddingsList """ self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version + kwargs["x_pinecone_api_version"] = x_pinecone_api_version return cast(EmbeddingsList, await self.call_with_http_info(**kwargs)) self.embed = _AsyncioEndpoint( settings={ - 'response_type': (EmbeddingsList,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/embed', - 'operation_id': 'embed', - 'http_method': 'POST', - 'servers': None, + "response_type": (EmbeddingsList,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/embed", + "operation_id": "embed", + "http_method": "POST", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'embed_request', - ], - 'required': [ - 'x_pinecone_api_version', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "embed_request"], + "required": ["x_pinecone_api_version"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_pinecone_api_version': - (str,), - 'embed_request': - (EmbedRequest,), + "validations": {}, + "allowed_values": {}, + "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' - ] + "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"]}, api_client=api_client, - callable=__embed + callable=__embed, ) async def __get_model( - self, - model_name, - x_pinecone_api_version="2025-10", - **kwargs + self, model_name, x_pinecone_api_version="2025-10", **kwargs ) -> ModelInfo: """Describe a model # noqa: E501 @@ -623,76 +479,43 @@ async def __get_model( ModelInfo """ self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['model_name'] = \ - model_name + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["model_name"] = model_name return cast(ModelInfo, await self.call_with_http_info(**kwargs)) self.get_model = _AsyncioEndpoint( settings={ - 'response_type': (ModelInfo,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/models/{model_name}', - 'operation_id': 'get_model', - 'http_method': 'GET', - 'servers': None, + "response_type": (ModelInfo,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/models/{model_name}", + "operation_id": "get_model", + "http_method": "GET", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'model_name', - ], - 'required': [ - 'x_pinecone_api_version', - 'model_name', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "model_name"], + "required": ["x_pinecone_api_version", "model_name"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_pinecone_api_version': - (str,), - 'model_name': - (str,), + "validations": {}, + "allowed_values": {}, + "openapi_types": {"x_pinecone_api_version": (str,), "model_name": (str,)}, + "attribute_map": { + "x_pinecone_api_version": "X-Pinecone-Api-Version", + "model_name": "model_name", }, - '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': [], + "location_map": {"x_pinecone_api_version": "header", "model_name": "path"}, + "collection_format_map": {}, }, + headers_map={"accept": ["application/json"], "content_type": []}, api_client=api_client, - callable=__get_model + callable=__get_model, ) - async def __list_models( - self, - x_pinecone_api_version="2025-10", - **kwargs - ) -> ModelInfoList: + async def __list_models(self, x_pinecone_api_version="2025-10", **kwargs) -> ModelInfoList: """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 @@ -724,78 +547,51 @@ async def __list_models( ModelInfoList """ self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version + kwargs["x_pinecone_api_version"] = x_pinecone_api_version return cast(ModelInfoList, await self.call_with_http_info(**kwargs)) self.list_models = _AsyncioEndpoint( settings={ - 'response_type': (ModelInfoList,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/models', - 'operation_id': 'list_models', - 'http_method': 'GET', - 'servers': None, + "response_type": (ModelInfoList,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/models", + "operation_id": "list_models", + "http_method": "GET", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'type', - 'vector_type', - ], - 'required': [ - 'x_pinecone_api_version', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "type", "vector_type"], + "required": ["x_pinecone_api_version"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { - }, - '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': [], - }, + "validations": {}, + "allowed_values": {}, + "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": []}, api_client=api_client, - callable=__list_models + callable=__list_models, ) - async def __rerank( - self, - x_pinecone_api_version="2025-10", - **kwargs - ) -> RerankResult: + async def __rerank(self, x_pinecone_api_version="2025-10", **kwargs) -> RerankResult: """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 @@ -826,65 +622,37 @@ async def __rerank( RerankResult """ self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version + kwargs["x_pinecone_api_version"] = x_pinecone_api_version return cast(RerankResult, await self.call_with_http_info(**kwargs)) self.rerank = _AsyncioEndpoint( settings={ - 'response_type': (RerankResult,), - 'auth': [ - 'ApiKeyAuth' - ], - 'endpoint_path': '/rerank', - 'operation_id': 'rerank', - 'http_method': 'POST', - 'servers': None, + "response_type": (RerankResult,), + "auth": ["ApiKeyAuth"], + "endpoint_path": "/rerank", + "operation_id": "rerank", + "http_method": "POST", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'rerank_request', - ], - 'required': [ - 'x_pinecone_api_version', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "rerank_request"], + "required": ["x_pinecone_api_version"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { - }, - 'openapi_types': { - 'x_pinecone_api_version': - (str,), - 'rerank_request': - (RerankRequest,), + "validations": {}, + "allowed_values": {}, + "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' - ] + "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"]}, api_client=api_client, - callable=__rerank + callable=__rerank, ) diff --git a/pinecone/core/openapi/inference/apis/__init__.py b/pinecone/core/openapi/inference/apis/__init__.py index ca637bf77..647ee6f2e 100644 --- a/pinecone/core/openapi/inference/apis/__init__.py +++ b/pinecone/core/openapi/inference/apis/__init__.py @@ -1,4 +1,3 @@ - # flake8: noqa # Import all APIs into this package. diff --git a/pinecone/core/openapi/inference/model/dense_embedding.py b/pinecone/core/openapi/inference/model/dense_embedding.py index 560c88220..fc6149be9 100644 --- a/pinecone/core/openapi/inference/model/dense_embedding.py +++ b/pinecone/core/openapi/inference/model/dense_embedding.py @@ -1,15 +1,14 @@ """ - Pinecone Inference API +Pinecone Inference API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -28,7 +27,6 @@ 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 @@ -61,11 +59,9 @@ class DenseEmbedding(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -73,7 +69,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 """ - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -88,24 +84,22 @@ def openapi_types(cls): and the value is attribute type. """ return { - 'values': ([float],), # noqa: E501 - 'vector_type': (str,), # noqa: E501 + "values": ([float],), # noqa: E501 + "vector_type": (str,), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'values': 'values', # noqa: E501 - 'vector_type': 'vector_type', # noqa: E501 + "values": "values", # noqa: E501 + "vector_type": "vector_type", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of DenseEmbedding. @@ -118,8 +112,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], values, vector_type, *args, **kwargs) -> T: # noqa: E501 @@ -162,22 +154,20 @@ def _from_openapi_data(cls: Type[T], values, vector_type, *args, **kwargs) -> T: _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', ()) + _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__, - ), + "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__,), ) @@ -194,25 +184,29 @@ def _from_openapi_data(cls: Type[T], values, vector_type, *args, **kwargs) -> T: self.values = values self.vector_type = vector_type for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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, values, vector_type, *args, **kwargs) -> None: # noqa: E501 @@ -256,19 +250,17 @@ def __init__(self, values, vector_type, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -285,13 +277,17 @@ def __init__(self, values, vector_type, *args, **kwargs) -> None: # noqa: E501 self.values = values self.vector_type = vector_type for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + raise PineconeApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/pinecone/core/openapi/inference/model/document.py b/pinecone/core/openapi/inference/model/document.py index 1ca0785f3..7aaa39df7 100644 --- a/pinecone/core/openapi/inference/model/document.py +++ b/pinecone/core/openapi/inference/model/document.py @@ -1,15 +1,14 @@ """ - Pinecone Inference API +Pinecone Inference API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -28,7 +27,6 @@ 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 @@ -61,11 +59,9 @@ class Document(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -73,7 +69,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 """ - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -87,21 +83,17 @@ def openapi_types(cls): openapi_types (dict): The key is attribute name and the value is attribute type. """ - return { - } + return {} @cached_class_property def discriminator(cls): return None + attribute_map: Dict[str, str] = {} - attribute_map: Dict[str, str] = { - } - - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of Document. @@ -114,8 +106,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 @@ -154,22 +144,20 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 _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', ()) + _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__, - ), + "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__,), ) @@ -184,25 +172,29 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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 @@ -242,19 +234,17 @@ def __init__(self, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -269,13 +259,17 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + raise PineconeApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/pinecone/core/openapi/inference/model/embed_request.py b/pinecone/core/openapi/inference/model/embed_request.py index e15f69080..aa74684c9 100644 --- a/pinecone/core/openapi/inference/model/embed_request.py +++ b/pinecone/core/openapi/inference/model/embed_request.py @@ -1,15 +1,14 @@ """ - Pinecone Inference API +Pinecone Inference API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -32,9 +31,11 @@ if TYPE_CHECKING: from pinecone.core.openapi.inference.model.embed_request_inputs import EmbedRequestInputs + def lazy_import(): from pinecone.core.openapi.inference.model.embed_request_inputs import EmbedRequestInputs - globals()['EmbedRequestInputs'] = EmbedRequestInputs + + globals()["EmbedRequestInputs"] = EmbedRequestInputs from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -69,11 +70,9 @@ class EmbedRequest(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -82,7 +81,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -98,26 +97,24 @@ def openapi_types(cls): """ lazy_import() return { - 'model': (str,), # noqa: E501 - 'inputs': ([EmbedRequestInputs],), # noqa: E501 - 'parameters': (Dict[str, Any],), # noqa: E501 + "model": (str,), # noqa: E501 + "inputs": ([EmbedRequestInputs],), # noqa: E501 + "parameters": (Dict[str, Any],), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'model': 'model', # noqa: E501 - 'inputs': 'inputs', # noqa: E501 - 'parameters': 'parameters', # noqa: E501 + "model": "model", # noqa: E501 + "inputs": "inputs", # noqa: E501 + "parameters": "parameters", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of EmbedRequest. @@ -130,8 +127,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], model, inputs, *args, **kwargs) -> T: # noqa: E501 @@ -175,22 +170,20 @@ def _from_openapi_data(cls: Type[T], model, inputs, *args, **kwargs) -> T: # no parameters (Dict[str, Any]): Additional model-specific parameters. Refer to the [model guide](https://docs.pinecone.io/guides/index-data/create-an-index#embedding-models) for available model parameters. [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', ()) + _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__, - ), + "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__,), ) @@ -207,25 +200,29 @@ def _from_openapi_data(cls: Type[T], model, inputs, *args, **kwargs) -> T: # no self.model = model self.inputs = inputs for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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, model, inputs, *args, **kwargs) -> None: # noqa: E501 @@ -270,19 +267,17 @@ def __init__(self, model, inputs, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -299,13 +294,17 @@ def __init__(self, model, inputs, *args, **kwargs) -> None: # noqa: E501 self.model = model self.inputs = inputs for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + raise PineconeApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/pinecone/core/openapi/inference/model/embed_request_inputs.py b/pinecone/core/openapi/inference/model/embed_request_inputs.py index 1432066ed..6833bef78 100644 --- a/pinecone/core/openapi/inference/model/embed_request_inputs.py +++ b/pinecone/core/openapi/inference/model/embed_request_inputs.py @@ -1,15 +1,14 @@ """ - Pinecone Inference API +Pinecone Inference API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -28,7 +27,6 @@ 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 @@ -61,11 +59,9 @@ class EmbedRequestInputs(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -73,7 +69,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 """ - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -88,22 +84,20 @@ def openapi_types(cls): and the value is attribute type. """ return { - 'text': (str,), # noqa: E501 + "text": (str,) # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'text': 'text', # noqa: E501 + "text": "text" # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of EmbedRequestInputs. @@ -116,8 +110,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 @@ -157,22 +149,20 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 text (str): The text input to generate embeddings for. [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', ()) + _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__, - ), + "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__,), ) @@ -187,25 +177,29 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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 @@ -246,19 +240,17 @@ def __init__(self, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -273,13 +265,17 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + raise PineconeApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/pinecone/core/openapi/inference/model/embedding.py b/pinecone/core/openapi/inference/model/embedding.py index 630f75c3b..5e6ee1be5 100644 --- a/pinecone/core/openapi/inference/model/embedding.py +++ b/pinecone/core/openapi/inference/model/embedding.py @@ -1,15 +1,14 @@ """ - Pinecone Inference API +Pinecone Inference API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -33,11 +32,13 @@ from pinecone.core.openapi.inference.model.dense_embedding import DenseEmbedding from pinecone.core.openapi.inference.model.sparse_embedding import SparseEmbedding + def lazy_import(): from pinecone.core.openapi.inference.model.dense_embedding import DenseEmbedding from pinecone.core.openapi.inference.model.sparse_embedding import SparseEmbedding - globals()['DenseEmbedding'] = DenseEmbedding - globals()['SparseEmbedding'] = SparseEmbedding + + globals()["DenseEmbedding"] = DenseEmbedding + globals()["SparseEmbedding"] = SparseEmbedding from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -72,11 +73,9 @@ class Embedding(ModelComposed): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -85,7 +84,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -101,36 +100,35 @@ def openapi_types(cls): """ lazy_import() return { - 'vector_type': (str,), # noqa: E501 - 'sparse_tokens': ([str],), # noqa: E501 - 'values': ([float],), # noqa: E501 - 'sparse_values': ([float],), # noqa: E501 - 'sparse_indices': ([int],), # noqa: E501 + "vector_type": (str,), # noqa: E501 + "sparse_tokens": ([str],), # noqa: E501 + "values": ([float],), # noqa: E501 + "sparse_values": ([float],), # noqa: E501 + "sparse_indices": ([int],), # noqa: E501 } @cached_class_property def discriminator(cls): lazy_import() val = { - 'DenseEmbedding': DenseEmbedding, - 'SparseEmbedding': SparseEmbedding, - 'dense': DenseEmbedding, - 'sparse': SparseEmbedding, + "DenseEmbedding": DenseEmbedding, + "SparseEmbedding": SparseEmbedding, + "dense": DenseEmbedding, + "sparse": SparseEmbedding, } if not val: return None - return {'vector_type': val} + return {"vector_type": val} attribute_map: Dict[str, str] = { - 'vector_type': 'vector_type', # noqa: E501 - 'sparse_tokens': 'sparse_tokens', # noqa: E501 - 'values': 'values', # noqa: E501 - 'sparse_values': 'sparse_values', # noqa: E501 - 'sparse_indices': 'sparse_indices', # noqa: E501 + "vector_type": "vector_type", # noqa: E501 + "sparse_tokens": "sparse_tokens", # noqa: E501 + "values": "values", # noqa: E501 + "sparse_values": "sparse_values", # noqa: E501 + "sparse_indices": "sparse_indices", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) @classmethod @convert_js_args_to_python_args @@ -175,20 +173,18 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 sparse_indices ([int]): The sparse embedding indices. [optional] # noqa: E501 """ - _check_type = kwargs.pop('_check_type', True) - _spec_property_naming = kwargs.pop('_spec_property_naming', False) - _path_to_item = kwargs.pop('_path_to_item', ()) - _configuration = kwargs.pop('_configuration', None) - _visited_composed_classes = kwargs.pop('_visited_composed_classes', ()) + _check_type = kwargs.pop("_check_type", True) + _spec_property_naming = kwargs.pop("_spec_property_naming", False) + _path_to_item = kwargs.pop("_path_to_item", ()) + _configuration = kwargs.pop("_configuration", None) + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) self = super(OpenApiModel, cls).__new__(cls) if args: raise PineconeApiTypeError( - "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % ( - args, - self.__class__.__name__, - ), + "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__,), ) @@ -201,43 +197,46 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 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, + "_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) + 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: + 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', - ]) + 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 @@ -281,20 +280,18 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 sparse_indices ([int]): The sparse embedding indices. [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', ()) + _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__, - ), + "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__,), ) @@ -309,30 +306,33 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 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, + "_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) + 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: + 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.") + 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(): @@ -344,13 +344,4 @@ def _composed_schemas(): # classes don't exist yet because their module has not finished # loading lazy_import() - return { - 'anyOf': [ - ], - 'allOf': [ - ], - 'oneOf': [ - DenseEmbedding, - SparseEmbedding, - ], - } + return {"anyOf": [], "allOf": [], "oneOf": [DenseEmbedding, SparseEmbedding]} diff --git a/pinecone/core/openapi/inference/model/embeddings_list.py b/pinecone/core/openapi/inference/model/embeddings_list.py index 70659abd6..a73535370 100644 --- a/pinecone/core/openapi/inference/model/embeddings_list.py +++ b/pinecone/core/openapi/inference/model/embeddings_list.py @@ -1,15 +1,14 @@ """ - Pinecone Inference API +Pinecone Inference API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -33,11 +32,13 @@ from pinecone.core.openapi.inference.model.embedding import Embedding from pinecone.core.openapi.inference.model.embeddings_list_usage import EmbeddingsListUsage + def lazy_import(): from pinecone.core.openapi.inference.model.embedding import Embedding from pinecone.core.openapi.inference.model.embeddings_list_usage import EmbeddingsListUsage - globals()['Embedding'] = Embedding - globals()['EmbeddingsListUsage'] = EmbeddingsListUsage + + globals()["Embedding"] = Embedding + globals()["EmbeddingsListUsage"] = EmbeddingsListUsage from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -72,11 +73,9 @@ class EmbeddingsList(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -85,7 +84,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -101,28 +100,26 @@ def openapi_types(cls): """ lazy_import() return { - 'model': (str,), # noqa: E501 - 'vector_type': (str,), # noqa: E501 - 'data': ([Embedding],), # noqa: E501 - 'usage': (EmbeddingsListUsage,), # noqa: E501 + "model": (str,), # noqa: E501 + "vector_type": (str,), # noqa: E501 + "data": ([Embedding],), # noqa: E501 + "usage": (EmbeddingsListUsage,), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'model': 'model', # noqa: E501 - 'vector_type': 'vector_type', # noqa: E501 - 'data': 'data', # noqa: E501 - 'usage': 'usage', # noqa: E501 + "model": "model", # noqa: E501 + "vector_type": "vector_type", # noqa: E501 + "data": "data", # noqa: E501 + "usage": "usage", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of EmbeddingsList. @@ -135,8 +132,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], model, vector_type, data, usage, *args, **kwargs) -> T: # noqa: E501 @@ -181,22 +176,20 @@ def _from_openapi_data(cls: Type[T], model, vector_type, data, usage, *args, **k _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', ()) + _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__, - ), + "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__,), ) @@ -215,25 +208,29 @@ def _from_openapi_data(cls: Type[T], model, vector_type, data, usage, *args, **k self.data = data self.usage = usage for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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, model, vector_type, data, usage, *args, **kwargs) -> None: # noqa: E501 @@ -279,19 +276,17 @@ def __init__(self, model, vector_type, data, usage, *args, **kwargs) -> None: # """ _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', ()) + _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__, - ), + "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__,), ) @@ -310,13 +305,17 @@ def __init__(self, model, vector_type, data, usage, *args, **kwargs) -> None: # self.data = data self.usage = usage for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + raise PineconeApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/pinecone/core/openapi/inference/model/embeddings_list_usage.py b/pinecone/core/openapi/inference/model/embeddings_list_usage.py index 902ce69b8..dfe86eeab 100644 --- a/pinecone/core/openapi/inference/model/embeddings_list_usage.py +++ b/pinecone/core/openapi/inference/model/embeddings_list_usage.py @@ -1,15 +1,14 @@ """ - Pinecone Inference API +Pinecone Inference API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -28,7 +27,6 @@ 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 @@ -61,13 +59,10 @@ class EmbeddingsListUsage(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ('total_tokens',): { - 'inclusive_minimum': 0, - }, + ("total_tokens",): {"inclusive_minimum": 0} } @cached_class_property @@ -76,7 +71,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 """ - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -91,22 +86,20 @@ def openapi_types(cls): and the value is attribute type. """ return { - 'total_tokens': (int,), # noqa: E501 + "total_tokens": (int,) # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'total_tokens': 'total_tokens', # noqa: E501 + "total_tokens": "total_tokens" # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of EmbeddingsListUsage. @@ -119,8 +112,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 @@ -160,22 +151,20 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 total_tokens (int): Total number of tokens consumed across all inputs. [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', ()) + _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__, - ), + "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__,), ) @@ -190,25 +179,29 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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 @@ -249,19 +242,17 @@ def __init__(self, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -276,13 +267,17 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + raise PineconeApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/pinecone/core/openapi/inference/model/error_response.py b/pinecone/core/openapi/inference/model/error_response.py index 1307b6b63..9ebabe1ad 100644 --- a/pinecone/core/openapi/inference/model/error_response.py +++ b/pinecone/core/openapi/inference/model/error_response.py @@ -1,15 +1,14 @@ """ - Pinecone Inference API +Pinecone Inference API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -32,9 +31,11 @@ if TYPE_CHECKING: from pinecone.core.openapi.inference.model.error_response_error import ErrorResponseError + def lazy_import(): from pinecone.core.openapi.inference.model.error_response_error import ErrorResponseError - globals()['ErrorResponseError'] = ErrorResponseError + + globals()["ErrorResponseError"] = ErrorResponseError from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -69,11 +70,9 @@ class ErrorResponse(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -82,7 +81,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -98,24 +97,22 @@ def openapi_types(cls): """ lazy_import() return { - 'status': (int,), # noqa: E501 - 'error': (ErrorResponseError,), # noqa: E501 + "status": (int,), # noqa: E501 + "error": (ErrorResponseError,), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'status': 'status', # noqa: E501 - 'error': 'error', # noqa: E501 + "status": "status", # noqa: E501 + "error": "error", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ErrorResponse. @@ -128,8 +125,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], status, error, *args, **kwargs) -> T: # noqa: E501 @@ -172,22 +167,20 @@ def _from_openapi_data(cls: Type[T], status, error, *args, **kwargs) -> T: # no _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', ()) + _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__, - ), + "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__,), ) @@ -204,25 +197,29 @@ def _from_openapi_data(cls: Type[T], status, error, *args, **kwargs) -> T: # no self.status = status self.error = error for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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, status, error, *args, **kwargs) -> None: # noqa: E501 @@ -266,19 +263,17 @@ def __init__(self, status, error, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -295,13 +290,17 @@ def __init__(self, status, error, *args, **kwargs) -> None: # noqa: E501 self.status = status self.error = error for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + raise PineconeApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/pinecone/core/openapi/inference/model/error_response_error.py b/pinecone/core/openapi/inference/model/error_response_error.py index 91703a1d5..d2eea8d64 100644 --- a/pinecone/core/openapi/inference/model/error_response_error.py +++ b/pinecone/core/openapi/inference/model/error_response_error.py @@ -1,15 +1,14 @@ """ - Pinecone Inference API +Pinecone Inference API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -28,7 +27,6 @@ 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 @@ -61,11 +59,9 @@ class ErrorResponseError(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -73,7 +69,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 """ - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -88,26 +84,24 @@ def openapi_types(cls): and the value is attribute type. """ return { - 'code': (str,), # noqa: E501 - 'message': (str,), # noqa: E501 - 'details': (Dict[str, Any],), # noqa: E501 + "code": (str,), # noqa: E501 + "message": (str,), # noqa: E501 + "details": (Dict[str, Any],), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'code': 'code', # noqa: E501 - 'message': 'message', # noqa: E501 - 'details': 'details', # noqa: E501 + "code": "code", # noqa: E501 + "message": "message", # noqa: E501 + "details": "details", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ErrorResponseError. @@ -120,8 +114,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], code, message, *args, **kwargs) -> T: # noqa: E501 @@ -165,22 +157,20 @@ def _from_openapi_data(cls: Type[T], code, message, *args, **kwargs) -> T: # no details (Dict[str, Any]): Additional information about the error. This field is not guaranteed to be present. [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', ()) + _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__, - ), + "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__,), ) @@ -197,25 +187,29 @@ def _from_openapi_data(cls: Type[T], code, message, *args, **kwargs) -> T: # no self.code = code self.message = message for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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, code, message, *args, **kwargs) -> None: # noqa: E501 @@ -260,19 +254,17 @@ def __init__(self, code, message, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -289,13 +281,17 @@ def __init__(self, code, message, *args, **kwargs) -> None: # noqa: E501 self.code = code self.message = message for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + raise PineconeApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/pinecone/core/openapi/inference/model/model_info.py b/pinecone/core/openapi/inference/model/model_info.py index 85b5f19bd..387422d6c 100644 --- a/pinecone/core/openapi/inference/model/model_info.py +++ b/pinecone/core/openapi/inference/model/model_info.py @@ -1,15 +1,14 @@ """ - Pinecone Inference API +Pinecone Inference API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -30,14 +29,24 @@ from typing import TYPE_CHECKING if TYPE_CHECKING: - from pinecone.core.openapi.inference.model.model_info_supported_metrics import ModelInfoSupportedMetrics - from pinecone.core.openapi.inference.model.model_info_supported_parameter import ModelInfoSupportedParameter + from pinecone.core.openapi.inference.model.model_info_supported_metrics import ( + ModelInfoSupportedMetrics, + ) + from pinecone.core.openapi.inference.model.model_info_supported_parameter import ( + ModelInfoSupportedParameter, + ) + def lazy_import(): - from pinecone.core.openapi.inference.model.model_info_supported_metrics import ModelInfoSupportedMetrics - from pinecone.core.openapi.inference.model.model_info_supported_parameter import ModelInfoSupportedParameter - globals()['ModelInfoSupportedMetrics'] = ModelInfoSupportedMetrics - globals()['ModelInfoSupportedParameter'] = ModelInfoSupportedParameter + from pinecone.core.openapi.inference.model.model_info_supported_metrics import ( + ModelInfoSupportedMetrics, + ) + from pinecone.core.openapi.inference.model.model_info_supported_parameter import ( + ModelInfoSupportedParameter, + ) + + globals()["ModelInfoSupportedMetrics"] = ModelInfoSupportedMetrics + globals()["ModelInfoSupportedParameter"] = ModelInfoSupportedParameter from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -72,20 +81,12 @@ class ModelInfo(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ('default_dimension',): { - 'inclusive_maximum': 20000, - 'inclusive_minimum': 1, - }, - ('max_sequence_length',): { - 'inclusive_minimum': 1, - }, - ('max_batch_size',): { - 'inclusive_minimum': 1, - }, + ("default_dimension",): {"inclusive_maximum": 20000, "inclusive_minimum": 1}, + ("max_sequence_length",): {"inclusive_minimum": 1}, + ("max_batch_size",): {"inclusive_minimum": 1}, } @cached_class_property @@ -95,7 +96,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -111,44 +112,42 @@ def openapi_types(cls): """ lazy_import() return { - 'model': (str,), # noqa: E501 - 'short_description': (str,), # noqa: E501 - 'type': (str,), # noqa: E501 - 'supported_parameters': ([ModelInfoSupportedParameter],), # noqa: E501 - 'vector_type': (str,), # noqa: E501 - 'default_dimension': (int,), # noqa: E501 - 'modality': (str,), # noqa: E501 - 'max_sequence_length': (int,), # noqa: E501 - 'max_batch_size': (int,), # noqa: E501 - 'provider_name': (str,), # noqa: E501 - 'supported_dimensions': ([int],), # noqa: E501 - 'supported_metrics': (ModelInfoSupportedMetrics,), # noqa: E501 + "model": (str,), # noqa: E501 + "short_description": (str,), # noqa: E501 + "type": (str,), # noqa: E501 + "supported_parameters": ([ModelInfoSupportedParameter],), # noqa: E501 + "vector_type": (str,), # noqa: E501 + "default_dimension": (int,), # noqa: E501 + "modality": (str,), # noqa: E501 + "max_sequence_length": (int,), # noqa: E501 + "max_batch_size": (int,), # noqa: E501 + "provider_name": (str,), # noqa: E501 + "supported_dimensions": ([int],), # noqa: E501 + "supported_metrics": (ModelInfoSupportedMetrics,), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'model': 'model', # noqa: E501 - 'short_description': 'short_description', # noqa: E501 - 'type': 'type', # noqa: E501 - 'supported_parameters': 'supported_parameters', # noqa: E501 - 'vector_type': 'vector_type', # noqa: E501 - 'default_dimension': 'default_dimension', # noqa: E501 - 'modality': 'modality', # noqa: E501 - 'max_sequence_length': 'max_sequence_length', # noqa: E501 - 'max_batch_size': 'max_batch_size', # noqa: E501 - 'provider_name': 'provider_name', # noqa: E501 - 'supported_dimensions': 'supported_dimensions', # noqa: E501 - 'supported_metrics': 'supported_metrics', # noqa: E501 + "model": "model", # noqa: E501 + "short_description": "short_description", # noqa: E501 + "type": "type", # noqa: E501 + "supported_parameters": "supported_parameters", # noqa: E501 + "vector_type": "vector_type", # noqa: E501 + "default_dimension": "default_dimension", # noqa: E501 + "modality": "modality", # noqa: E501 + "max_sequence_length": "max_sequence_length", # noqa: E501 + "max_batch_size": "max_batch_size", # noqa: E501 + "provider_name": "provider_name", # noqa: E501 + "supported_dimensions": "supported_dimensions", # noqa: E501 + "supported_metrics": "supported_metrics", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ModelInfo. @@ -161,11 +160,11 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args - def _from_openapi_data(cls: Type[T], model, short_description, type, supported_parameters, *args, **kwargs) -> T: # noqa: E501 + def _from_openapi_data( + cls: Type[T], model, short_description, type, supported_parameters, *args, **kwargs + ) -> T: # noqa: E501 """ModelInfo - a model defined in OpenAPI Args: @@ -215,22 +214,20 @@ def _from_openapi_data(cls: Type[T], model, short_description, type, supported_p supported_metrics (ModelInfoSupportedMetrics): [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', ()) + _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__, - ), + "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__,), ) @@ -249,28 +246,34 @@ def _from_openapi_data(cls: Type[T], model, short_description, type, supported_p self.type = type self.supported_parameters = supported_parameters for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + 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', - ]) + 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, model, short_description, type, supported_parameters, *args, **kwargs) -> None: # noqa: E501 + def __init__( + self, model, short_description, type, supported_parameters, *args, **kwargs + ) -> None: # noqa: E501 """ModelInfo - a model defined in OpenAPI Args: @@ -321,19 +324,17 @@ def __init__(self, model, short_description, type, supported_parameters, *args, """ _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', ()) + _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__, - ), + "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__,), ) @@ -352,13 +353,17 @@ def __init__(self, model, short_description, type, supported_parameters, *args, self.type = type self.supported_parameters = supported_parameters for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + 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.") + raise PineconeApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/pinecone/core/openapi/inference/model/model_info_list.py b/pinecone/core/openapi/inference/model/model_info_list.py index ea2c70472..8452cf108 100644 --- a/pinecone/core/openapi/inference/model/model_info_list.py +++ b/pinecone/core/openapi/inference/model/model_info_list.py @@ -1,15 +1,14 @@ """ - Pinecone Inference API +Pinecone Inference API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -32,9 +31,11 @@ if TYPE_CHECKING: from pinecone.core.openapi.inference.model.model_info import ModelInfo + def lazy_import(): from pinecone.core.openapi.inference.model.model_info import ModelInfo - globals()['ModelInfo'] = ModelInfo + + globals()["ModelInfo"] = ModelInfo from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -69,11 +70,9 @@ class ModelInfoList(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -82,7 +81,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -98,22 +97,20 @@ def openapi_types(cls): """ lazy_import() return { - 'models': ([ModelInfo],), # noqa: E501 + "models": ([ModelInfo],) # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'models': 'models', # noqa: E501 + "models": "models" # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ModelInfoList. @@ -126,8 +123,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 @@ -167,22 +162,20 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 models ([ModelInfo]): List of available models. [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', ()) + _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__, - ), + "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__,), ) @@ -197,25 +190,29 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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 @@ -256,19 +253,17 @@ def __init__(self, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -283,13 +278,17 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + raise PineconeApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/pinecone/core/openapi/inference/model/model_info_supported_metrics.py b/pinecone/core/openapi/inference/model/model_info_supported_metrics.py index 38c7297ad..ff34dfed3 100644 --- a/pinecone/core/openapi/inference/model/model_info_supported_metrics.py +++ b/pinecone/core/openapi/inference/model/model_info_supported_metrics.py @@ -1,15 +1,14 @@ """ - Pinecone Inference API +Pinecone Inference API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -28,7 +27,6 @@ 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 @@ -57,11 +55,9 @@ class ModelInfoSupportedMetrics(ModelSimple): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -69,7 +65,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 """ - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -83,31 +79,30 @@ def openapi_types(cls): openapi_types (dict): The key is attribute name and the value is attribute type. """ - return { - 'value': ([str],), - } + 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', - ]) + 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: @@ -152,21 +147,19 @@ def __init__(self, *args, **kwargs) -> None: _visited_composed_classes = (Animal,) """ # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) + _path_to_item = kwargs.pop("_path_to_item", ()) value = None - if 'value' in kwargs: - value = kwargs.pop('value') + 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__, - ), + "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__,), ) @@ -178,13 +171,12 @@ def __init__(self, *args, **kwargs) -> None: 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', ()) + _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 @@ -197,10 +189,8 @@ def __init__(self, *args, **kwargs) -> None: self.value = value if kwargs: raise PineconeApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), + "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__,), ) @@ -249,23 +239,21 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: _visited_composed_classes = (Animal,) """ # required up here when default value is not given - _path_to_item = kwargs.pop('_path_to_item', ()) + _path_to_item = kwargs.pop("_path_to_item", ()) self = super(OpenApiModel, cls).__new__(cls) value = None - if 'value' in kwargs: - value = kwargs.pop('value') + 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__, - ), + "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__,), ) @@ -277,13 +265,12 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: 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', ()) + _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 @@ -296,10 +283,8 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: self.value = value if kwargs: raise PineconeApiTypeError( - "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % ( - kwargs, - self.__class__.__name__, - ), + "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__,), ) 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 0cd57c188..df9add2b7 100644 --- a/pinecone/core/openapi/inference/model/model_info_supported_parameter.py +++ b/pinecone/core/openapi/inference/model/model_info_supported_parameter.py @@ -1,15 +1,14 @@ """ - Pinecone Inference API +Pinecone Inference API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -28,7 +27,6 @@ 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 @@ -61,11 +59,9 @@ class ModelInfoSupportedParameter(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -73,7 +69,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 """ - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -88,36 +84,34 @@ def openapi_types(cls): and the value is attribute type. """ return { - 'parameter': (str,), # noqa: E501 - 'type': (str,), # noqa: E501 - 'value_type': (str,), # noqa: E501 - 'required': (bool,), # noqa: E501 - 'allowed_values': ([dict],), # noqa: E501 - 'min': (float,), # noqa: E501 - 'max': (float,), # noqa: E501 - 'default': (dict,), # noqa: E501 + "parameter": (str,), # noqa: E501 + "type": (str,), # noqa: E501 + "value_type": (str,), # noqa: E501 + "required": (bool,), # noqa: E501 + "allowed_values": ([dict],), # noqa: E501 + "min": (float,), # noqa: E501 + "max": (float,), # noqa: E501 + "default": (dict,), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'parameter': 'parameter', # noqa: E501 - 'type': 'type', # noqa: E501 - 'value_type': 'value_type', # noqa: E501 - 'required': 'required', # noqa: E501 - 'allowed_values': 'allowed_values', # noqa: E501 - 'min': 'min', # noqa: E501 - 'max': 'max', # noqa: E501 - 'default': 'default', # noqa: E501 + "parameter": "parameter", # noqa: E501 + "type": "type", # noqa: E501 + "value_type": "value_type", # noqa: E501 + "required": "required", # noqa: E501 + "allowed_values": "allowed_values", # noqa: E501 + "min": "min", # noqa: E501 + "max": "max", # noqa: E501 + "default": "default", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ModelInfoSupportedParameter. @@ -130,11 +124,11 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args - def _from_openapi_data(cls: Type[T], parameter, type, value_type, required, *args, **kwargs) -> T: # noqa: E501 + def _from_openapi_data( + cls: Type[T], parameter, type, value_type, required, *args, **kwargs + ) -> T: # noqa: E501 """ModelInfoSupportedParameter - a model defined in OpenAPI Args: @@ -180,22 +174,20 @@ def _from_openapi_data(cls: Type[T], parameter, type, value_type, required, *arg default (dict): The default value for the parameter when a parameter is optional. [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', ()) + _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__, - ), + "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__,), ) @@ -214,25 +206,29 @@ def _from_openapi_data(cls: Type[T], parameter, type, value_type, required, *arg self.value_type = value_type self.required = required for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + 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', - ]) + 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, parameter, type, value_type, required, *args, **kwargs) -> None: # noqa: E501 @@ -282,19 +278,17 @@ def __init__(self, parameter, type, value_type, required, *args, **kwargs) -> No """ _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', ()) + _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__, - ), + "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__,), ) @@ -313,13 +307,17 @@ def __init__(self, parameter, type, value_type, required, *args, **kwargs) -> No self.value_type = value_type self.required = required for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + 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.") + raise PineconeApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/pinecone/core/openapi/inference/model/ranked_document.py b/pinecone/core/openapi/inference/model/ranked_document.py index 4456dfeb4..e9687b7ce 100644 --- a/pinecone/core/openapi/inference/model/ranked_document.py +++ b/pinecone/core/openapi/inference/model/ranked_document.py @@ -1,15 +1,14 @@ """ - Pinecone Inference API +Pinecone Inference API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -32,9 +31,11 @@ if TYPE_CHECKING: from pinecone.core.openapi.inference.model.document import Document + def lazy_import(): from pinecone.core.openapi.inference.model.document import Document - globals()['Document'] = Document + + globals()["Document"] = Document from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -69,11 +70,9 @@ class RankedDocument(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -82,7 +81,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -98,26 +97,24 @@ def openapi_types(cls): """ lazy_import() return { - 'index': (int,), # noqa: E501 - 'score': (float,), # noqa: E501 - 'document': (Document,), # noqa: E501 + "index": (int,), # noqa: E501 + "score": (float,), # noqa: E501 + "document": (Document,), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'index': 'index', # noqa: E501 - 'score': 'score', # noqa: E501 - 'document': 'document', # noqa: E501 + "index": "index", # noqa: E501 + "score": "score", # noqa: E501 + "document": "document", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of RankedDocument. @@ -130,8 +127,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], index, score, *args, **kwargs) -> T: # noqa: E501 @@ -175,22 +170,20 @@ def _from_openapi_data(cls: Type[T], index, score, *args, **kwargs) -> T: # noq document (Document): [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', ()) + _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__, - ), + "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__,), ) @@ -207,25 +200,29 @@ def _from_openapi_data(cls: Type[T], index, score, *args, **kwargs) -> T: # noq self.index = index self.score = score for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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, index, score, *args, **kwargs) -> None: # noqa: E501 @@ -270,19 +267,17 @@ def __init__(self, index, score, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -299,13 +294,17 @@ def __init__(self, index, score, *args, **kwargs) -> None: # noqa: E501 self.index = index self.score = score for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + raise PineconeApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/pinecone/core/openapi/inference/model/rerank_request.py b/pinecone/core/openapi/inference/model/rerank_request.py index 56a47c355..60e7856a9 100644 --- a/pinecone/core/openapi/inference/model/rerank_request.py +++ b/pinecone/core/openapi/inference/model/rerank_request.py @@ -1,15 +1,14 @@ """ - Pinecone Inference API +Pinecone Inference API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -32,9 +31,11 @@ if TYPE_CHECKING: from pinecone.core.openapi.inference.model.document import Document + def lazy_import(): from pinecone.core.openapi.inference.model.document import Document - globals()['Document'] = Document + + globals()["Document"] = Document from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -69,11 +70,9 @@ class RerankRequest(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -82,7 +81,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -98,34 +97,32 @@ def openapi_types(cls): """ lazy_import() return { - 'model': (str,), # noqa: E501 - 'query': (str,), # noqa: E501 - 'documents': ([Document],), # noqa: E501 - 'top_n': (int,), # noqa: E501 - 'return_documents': (bool,), # noqa: E501 - 'rank_fields': ([str],), # noqa: E501 - 'parameters': (Dict[str, Any],), # noqa: E501 + "model": (str,), # noqa: E501 + "query": (str,), # noqa: E501 + "documents": ([Document],), # noqa: E501 + "top_n": (int,), # noqa: E501 + "return_documents": (bool,), # noqa: E501 + "rank_fields": ([str],), # noqa: E501 + "parameters": (Dict[str, Any],), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'model': 'model', # noqa: E501 - 'query': 'query', # noqa: E501 - 'documents': 'documents', # noqa: E501 - 'top_n': 'top_n', # noqa: E501 - 'return_documents': 'return_documents', # noqa: E501 - 'rank_fields': 'rank_fields', # noqa: E501 - 'parameters': 'parameters', # noqa: E501 + "model": "model", # noqa: E501 + "query": "query", # noqa: E501 + "documents": "documents", # noqa: E501 + "top_n": "top_n", # noqa: E501 + "return_documents": "return_documents", # noqa: E501 + "rank_fields": "rank_fields", # noqa: E501 + "parameters": "parameters", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of RerankRequest. @@ -138,8 +135,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], model, query, documents, *args, **kwargs) -> T: # noqa: E501 @@ -187,22 +182,20 @@ def _from_openapi_data(cls: Type[T], model, query, documents, *args, **kwargs) - parameters (Dict[str, Any]): Additional model-specific parameters. Refer to the [model guide](https://docs.pinecone.io/guides/search/rerank-results#reranking-models) for available model parameters. [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', ()) + _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__, - ), + "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__,), ) @@ -220,25 +213,29 @@ def _from_openapi_data(cls: Type[T], model, query, documents, *args, **kwargs) - self.query = query self.documents = documents for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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, model, query, documents, *args, **kwargs) -> None: # noqa: E501 @@ -287,19 +284,17 @@ def __init__(self, model, query, documents, *args, **kwargs) -> None: # noqa: E """ _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', ()) + _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__, - ), + "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__,), ) @@ -317,13 +312,17 @@ def __init__(self, model, query, documents, *args, **kwargs) -> None: # noqa: E self.query = query self.documents = documents for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + raise PineconeApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/pinecone/core/openapi/inference/model/rerank_result.py b/pinecone/core/openapi/inference/model/rerank_result.py index 4774a5c13..5f90a2f0a 100644 --- a/pinecone/core/openapi/inference/model/rerank_result.py +++ b/pinecone/core/openapi/inference/model/rerank_result.py @@ -1,15 +1,14 @@ """ - Pinecone Inference API +Pinecone Inference API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -33,11 +32,13 @@ from pinecone.core.openapi.inference.model.ranked_document import RankedDocument from pinecone.core.openapi.inference.model.rerank_result_usage import RerankResultUsage + def lazy_import(): from pinecone.core.openapi.inference.model.ranked_document import RankedDocument from pinecone.core.openapi.inference.model.rerank_result_usage import RerankResultUsage - globals()['RankedDocument'] = RankedDocument - globals()['RerankResultUsage'] = RerankResultUsage + + globals()["RankedDocument"] = RankedDocument + globals()["RerankResultUsage"] = RerankResultUsage from typing import Dict, Literal, Tuple, Set, Any, Type, TypeVar @@ -72,11 +73,9 @@ class RerankResult(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -85,7 +84,7 @@ def additional_properties_type(cls): of type self, this must run after the class is loaded """ lazy_import() - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -101,26 +100,24 @@ def openapi_types(cls): """ lazy_import() return { - 'model': (str,), # noqa: E501 - 'data': ([RankedDocument],), # noqa: E501 - 'usage': (RerankResultUsage,), # noqa: E501 + "model": (str,), # noqa: E501 + "data": ([RankedDocument],), # noqa: E501 + "usage": (RerankResultUsage,), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'model': 'model', # noqa: E501 - 'data': 'data', # noqa: E501 - 'usage': 'usage', # noqa: E501 + "model": "model", # noqa: E501 + "data": "data", # noqa: E501 + "usage": "usage", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of RerankResult. @@ -133,8 +130,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], model, data, usage, *args, **kwargs) -> T: # noqa: E501 @@ -178,22 +173,20 @@ def _from_openapi_data(cls: Type[T], model, data, usage, *args, **kwargs) -> T: _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', ()) + _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__, - ), + "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__,), ) @@ -211,25 +204,29 @@ def _from_openapi_data(cls: Type[T], model, data, usage, *args, **kwargs) -> T: self.data = data self.usage = usage for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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, model, data, usage, *args, **kwargs) -> None: # noqa: E501 @@ -274,19 +271,17 @@ def __init__(self, model, data, usage, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -304,13 +299,17 @@ def __init__(self, model, data, usage, *args, **kwargs) -> None: # noqa: E501 self.data = data self.usage = usage for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + raise PineconeApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/pinecone/core/openapi/inference/model/rerank_result_usage.py b/pinecone/core/openapi/inference/model/rerank_result_usage.py index 2ad118648..f50b4008a 100644 --- a/pinecone/core/openapi/inference/model/rerank_result_usage.py +++ b/pinecone/core/openapi/inference/model/rerank_result_usage.py @@ -1,15 +1,14 @@ """ - Pinecone Inference API +Pinecone Inference API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -28,7 +27,6 @@ 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 @@ -61,13 +59,10 @@ class RerankResultUsage(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - ('rerank_units',): { - 'inclusive_minimum': 0, - }, + ("rerank_units",): {"inclusive_minimum": 0} } @cached_class_property @@ -76,7 +71,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 """ - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -91,22 +86,20 @@ def openapi_types(cls): and the value is attribute type. """ return { - 'rerank_units': (int,), # noqa: E501 + "rerank_units": (int,) # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'rerank_units': 'rerank_units', # noqa: E501 + "rerank_units": "rerank_units" # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of RerankResultUsage. @@ -119,8 +112,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 @@ -160,22 +151,20 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 rerank_units (int): The number of rerank units consumed by this 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', ()) + _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__, - ), + "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__,), ) @@ -190,25 +179,29 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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 @@ -249,19 +242,17 @@ def __init__(self, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -276,13 +267,17 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + raise PineconeApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/pinecone/core/openapi/inference/model/sparse_embedding.py b/pinecone/core/openapi/inference/model/sparse_embedding.py index 0c07eb36d..171201737 100644 --- a/pinecone/core/openapi/inference/model/sparse_embedding.py +++ b/pinecone/core/openapi/inference/model/sparse_embedding.py @@ -1,15 +1,14 @@ """ - Pinecone Inference API +Pinecone Inference API - Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors. # noqa: E501 +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. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -28,7 +27,6 @@ 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 @@ -61,11 +59,9 @@ class SparseEmbedding(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -73,7 +69,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 """ - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -88,28 +84,26 @@ def openapi_types(cls): and the value is attribute type. """ return { - 'sparse_values': ([float],), # noqa: E501 - 'sparse_indices': ([int],), # noqa: E501 - 'vector_type': (str,), # noqa: E501 - 'sparse_tokens': ([str],), # noqa: E501 + "sparse_values": ([float],), # noqa: E501 + "sparse_indices": ([int],), # noqa: E501 + "vector_type": (str,), # noqa: E501 + "sparse_tokens": ([str],), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'sparse_values': 'sparse_values', # noqa: E501 - 'sparse_indices': 'sparse_indices', # noqa: E501 - 'vector_type': 'vector_type', # noqa: E501 - 'sparse_tokens': 'sparse_tokens', # noqa: E501 + "sparse_values": "sparse_values", # noqa: E501 + "sparse_indices": "sparse_indices", # noqa: E501 + "vector_type": "vector_type", # noqa: E501 + "sparse_tokens": "sparse_tokens", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of SparseEmbedding. @@ -122,11 +116,11 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args - def _from_openapi_data(cls: Type[T], sparse_values, sparse_indices, vector_type, *args, **kwargs) -> T: # noqa: E501 + def _from_openapi_data( + cls: Type[T], sparse_values, sparse_indices, vector_type, *args, **kwargs + ) -> T: # noqa: E501 """SparseEmbedding - a model defined in OpenAPI Args: @@ -168,22 +162,20 @@ def _from_openapi_data(cls: Type[T], sparse_values, sparse_indices, vector_type, sparse_tokens ([str]): The normalized tokens used to create the sparse embedding. [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', ()) + _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__, - ), + "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__,), ) @@ -201,25 +193,29 @@ def _from_openapi_data(cls: Type[T], sparse_values, sparse_indices, vector_type, self.sparse_indices = sparse_indices self.vector_type = vector_type for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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, sparse_values, sparse_indices, vector_type, *args, **kwargs) -> None: # noqa: E501 @@ -265,19 +261,17 @@ def __init__(self, sparse_values, sparse_indices, vector_type, *args, **kwargs) """ _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', ()) + _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__, - ), + "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__,), ) @@ -295,13 +289,17 @@ def __init__(self, sparse_values, sparse_indices, vector_type, *args, **kwargs) self.sparse_indices = sparse_indices self.vector_type = vector_type for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + raise PineconeApiAttributeError( + f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " + f"class with read only attributes." + ) diff --git a/pinecone/core/openapi/inference/models/__init__.py b/pinecone/core/openapi/inference/models/__init__.py index c03211967..c4e2d613b 100644 --- a/pinecone/core/openapi/inference/models/__init__.py +++ b/pinecone/core/openapi/inference/models/__init__.py @@ -20,8 +20,12 @@ 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_supported_metrics import ModelInfoSupportedMetrics -from pinecone.core.openapi.inference.model.model_info_supported_parameter import ModelInfoSupportedParameter +from pinecone.core.openapi.inference.model.model_info_supported_metrics import ( + ModelInfoSupportedMetrics, +) +from pinecone.core.openapi.inference.model.model_info_supported_parameter import ( + ModelInfoSupportedParameter, +) from pinecone.core.openapi.inference.model.ranked_document import RankedDocument from pinecone.core.openapi.inference.model.rerank_request import RerankRequest from pinecone.core.openapi.inference.model.rerank_result import RerankResult diff --git a/pinecone/core/openapi/oauth/__init__.py b/pinecone/core/openapi/oauth/__init__.py index 5f85b8142..d9fb09073 100644 --- a/pinecone/core/openapi/oauth/__init__.py +++ b/pinecone/core/openapi/oauth/__init__.py @@ -1,17 +1,16 @@ # flake8: noqa """ - Pinecone OAuth API +Pinecone OAuth API - Provides an API for authenticating with Pinecone. # noqa: E501 +Provides an API for authenticating with Pinecone. # noqa: E501 - This file is @generated using OpenAPI. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - __version__ = "1.0.0" # import ApiClient @@ -27,4 +26,5 @@ from pinecone.openapi_support.exceptions import PineconeApiValueError from pinecone.openapi_support.exceptions import PineconeApiKeyError from pinecone.openapi_support.exceptions import PineconeApiException -API_VERSION = '2025-10' + +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 448b4a880..018ebde5f 100644 --- a/pinecone/core/openapi/oauth/api/o_auth_api.py +++ b/pinecone/core/openapi/oauth/api/o_auth_api.py @@ -1,24 +1,24 @@ """ - Pinecone OAuth API +Pinecone OAuth API - Provides an API for authenticating with Pinecone. # noqa: E501 +Provides an API for authenticating with Pinecone. # noqa: E501 - This file is @generated using OpenAPI. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from __future__ import annotations from typing import TYPE_CHECKING, Any, Dict, cast - -if TYPE_CHECKING: - from multiprocessing.pool import ApplyResult +from multiprocessing.pool import ApplyResult from pinecone.openapi_support import ApiClient, AsyncioApiClient -from pinecone.openapi_support.endpoint_utils import ExtraOpenApiKwargsTypedDict, KwargsWithOpenApiKwargDefaultsTypedDict +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 @@ -26,7 +26,7 @@ datetime, file_type, none_type, - validate_and_convert_types + validate_and_convert_types, ) from pinecone.core.openapi.oauth.model.error_response import ErrorResponse from pinecone.core.openapi.oauth.model.token_request import TokenRequest @@ -48,7 +48,7 @@ def __get_token( self, token_request, x_pinecone_api_version="2025-10", - **kwargs: ExtraOpenApiKwargsTypedDict + **kwargs: ExtraOpenApiKwargsTypedDict, ) -> TokenResponse | ApplyResult[TokenResponse]: """Create an access token # noqa: E501 @@ -87,73 +87,48 @@ def __get_token( thread. """ kwargs = self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['token_request'] = \ - token_request - return cast(TokenResponse | ApplyResult[TokenResponse], self.call_with_http_info(**kwargs)) + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["token_request"] = token_request + return cast( + TokenResponse | ApplyResult[TokenResponse], self.call_with_http_info(**kwargs) + ) self.get_token = _Endpoint( settings={ - 'response_type': (TokenResponse,), - 'auth': [], - 'endpoint_path': '/oauth/token', - 'operation_id': 'get_token', - 'http_method': 'POST', - 'servers': None, + "response_type": (TokenResponse,), + "auth": [], + "endpoint_path": "/oauth/token", + "operation_id": "get_token", + "http_method": "POST", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'token_request', - ], - 'required': [ - 'x_pinecone_api_version', - 'token_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "token_request"], + "required": ["x_pinecone_api_version", "token_request"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "token_request": (TokenRequest,), }, - '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': { - } + "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={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json', - 'application/x-www-form-urlencoded' - ] + "accept": ["application/json"], + "content_type": ["application/json", "application/x-www-form-urlencoded"], }, api_client=api_client, - callable=__get_token + callable=__get_token, ) - class AsyncioOAuthApi: """NOTE: This class is @generated using OpenAPI @@ -166,10 +141,7 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client async def __get_token( - self, - token_request, - x_pinecone_api_version="2025-10", - **kwargs + self, token_request, x_pinecone_api_version="2025-10", **kwargs ) -> TokenResponse: """Create an access token # noqa: E501 @@ -201,67 +173,41 @@ async def __get_token( TokenResponse """ self._process_openapi_kwargs(kwargs) - kwargs['x_pinecone_api_version'] = \ - x_pinecone_api_version - kwargs['token_request'] = \ - token_request + kwargs["x_pinecone_api_version"] = x_pinecone_api_version + kwargs["token_request"] = token_request return cast(TokenResponse, await self.call_with_http_info(**kwargs)) self.get_token = _AsyncioEndpoint( settings={ - 'response_type': (TokenResponse,), - 'auth': [], - 'endpoint_path': '/oauth/token', - 'operation_id': 'get_token', - 'http_method': 'POST', - 'servers': None, + "response_type": (TokenResponse,), + "auth": [], + "endpoint_path": "/oauth/token", + "operation_id": "get_token", + "http_method": "POST", + "servers": None, }, params_map={ - 'all': [ - 'x_pinecone_api_version', - 'token_request', - ], - 'required': [ - 'x_pinecone_api_version', - 'token_request', - ], - 'nullable': [ - ], - 'enum': [ - ], - 'validation': [ - ] + "all": ["x_pinecone_api_version", "token_request"], + "required": ["x_pinecone_api_version", "token_request"], + "nullable": [], + "enum": [], + "validation": [], }, root_map={ - 'validations': { - }, - 'allowed_values': { - }, - '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', + "validations": {}, + "allowed_values": {}, + "openapi_types": { + "x_pinecone_api_version": (str,), + "token_request": (TokenRequest,), }, - 'collection_format_map': { - } + "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={ - 'accept': [ - 'application/json' - ], - 'content_type': [ - 'application/json', - 'application/x-www-form-urlencoded' - ] + "accept": ["application/json"], + "content_type": ["application/json", "application/x-www-form-urlencoded"], }, api_client=api_client, - callable=__get_token + callable=__get_token, ) diff --git a/pinecone/core/openapi/oauth/apis/__init__.py b/pinecone/core/openapi/oauth/apis/__init__.py index 3383ac6ff..9da169522 100644 --- a/pinecone/core/openapi/oauth/apis/__init__.py +++ b/pinecone/core/openapi/oauth/apis/__init__.py @@ -1,4 +1,3 @@ - # flake8: noqa # Import all APIs into this package. diff --git a/pinecone/core/openapi/oauth/model/error_response.py b/pinecone/core/openapi/oauth/model/error_response.py index 7751ad876..2b572ab8c 100644 --- a/pinecone/core/openapi/oauth/model/error_response.py +++ b/pinecone/core/openapi/oauth/model/error_response.py @@ -1,15 +1,14 @@ """ - Pinecone OAuth API +Pinecone OAuth API - Provides an API for authenticating with Pinecone. # noqa: E501 +Provides an API for authenticating with Pinecone. # noqa: E501 - This file is @generated using OpenAPI. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -28,7 +27,6 @@ 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 @@ -61,11 +59,9 @@ class ErrorResponse(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -73,7 +69,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 """ - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -88,24 +84,22 @@ def openapi_types(cls): and the value is attribute type. """ return { - 'error': (str,), # noqa: E501 - 'error_description': (str,), # noqa: E501 + "error": (str,), # noqa: E501 + "error_description": (str,), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'error': 'error', # noqa: E501 - 'error_description': 'error_description', # noqa: E501 + "error": "error", # noqa: E501 + "error_description": "error_description", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of ErrorResponse. @@ -118,8 +112,6 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 @@ -160,22 +152,20 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 error_description (str): A human-readable description of the error. [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', ()) + _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__, - ), + "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__,), ) @@ -190,25 +180,29 @@ def _from_openapi_data(cls: Type[T], *args, **kwargs) -> T: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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 @@ -250,19 +244,17 @@ def __init__(self, *args, **kwargs) -> None: # 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', ()) + _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__, - ), + "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__,), ) @@ -277,13 +269,17 @@ def __init__(self, *args, **kwargs) -> None: # noqa: E501 self._visited_composed_classes = _visited_composed_classes + (self.__class__,) for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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/oauth/model/token_request.py b/pinecone/core/openapi/oauth/model/token_request.py index 78672a88b..8aa3b0ac7 100644 --- a/pinecone/core/openapi/oauth/model/token_request.py +++ b/pinecone/core/openapi/oauth/model/token_request.py @@ -1,15 +1,14 @@ """ - Pinecone OAuth API +Pinecone OAuth API - Provides an API for authenticating with Pinecone. # noqa: E501 +Provides an API for authenticating with Pinecone. # noqa: E501 - This file is @generated using OpenAPI. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -28,7 +27,6 @@ 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 @@ -61,11 +59,9 @@ class TokenRequest(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -73,7 +69,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 """ - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -88,28 +84,26 @@ def openapi_types(cls): and the value is attribute type. """ return { - 'client_id': (str,), # noqa: E501 - 'client_secret': (str,), # noqa: E501 - 'grant_type': (str,), # noqa: E501 - 'audience': (str,), # noqa: E501 + "client_id": (str,), # noqa: E501 + "client_secret": (str,), # noqa: E501 + "grant_type": (str,), # noqa: E501 + "audience": (str,), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'client_id': 'client_id', # noqa: E501 - 'client_secret': 'client_secret', # noqa: E501 - 'grant_type': 'grant_type', # noqa: E501 - 'audience': 'audience', # noqa: E501 + "client_id": "client_id", # noqa: E501 + "client_secret": "client_secret", # noqa: E501 + "grant_type": "grant_type", # noqa: E501 + "audience": "audience", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of TokenRequest. @@ -122,11 +116,11 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args - def _from_openapi_data(cls: Type[T], client_id, client_secret, grant_type, audience, *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: @@ -168,22 +162,20 @@ def _from_openapi_data(cls: Type[T], client_id, client_secret, grant_type, audie _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', ()) + _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__, - ), + "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__,), ) @@ -202,25 +194,29 @@ def _from_openapi_data(cls: Type[T], client_id, client_secret, grant_type, audie self.grant_type = grant_type self.audience = audience for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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, client_id, client_secret, grant_type, audience, *args, **kwargs) -> None: # noqa: E501 @@ -266,19 +262,17 @@ def __init__(self, client_id, client_secret, grant_type, audience, *args, **kwar """ _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', ()) + _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__, - ), + "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__,), ) @@ -297,13 +291,17 @@ def __init__(self, client_id, client_secret, grant_type, audience, *args, **kwar self.grant_type = grant_type self.audience = audience for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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/oauth/model/token_response.py b/pinecone/core/openapi/oauth/model/token_response.py index 43452c535..46e375512 100644 --- a/pinecone/core/openapi/oauth/model/token_response.py +++ b/pinecone/core/openapi/oauth/model/token_response.py @@ -1,15 +1,14 @@ """ - Pinecone OAuth API +Pinecone OAuth API - Provides an API for authenticating with Pinecone. # noqa: E501 +Provides an API for authenticating with Pinecone. # noqa: E501 - This file is @generated using OpenAPI. +This file is @generated using OpenAPI. - The version of the OpenAPI document: 2025-10 - Contact: support@pinecone.io +The version of the OpenAPI document: 2025-10 +Contact: support@pinecone.io """ - from pinecone.openapi_support.model_utils import ( # noqa: F401 PineconeApiTypeError, ModelComposed, @@ -28,7 +27,6 @@ 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 @@ -61,11 +59,9 @@ class TokenResponse(ModelNormal): _data_store: Dict[str, Any] _check_type: bool - allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = { - } + allowed_values: Dict[Tuple[str, ...], Dict[str, Any]] = {} - validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = { - } + validations: Dict[Tuple[str, ...], PropertyValidationTypedDict] = {} @cached_class_property def additional_properties_type(cls): @@ -73,7 +69,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 """ - return (bool, dict, float, int, list, str, none_type,) # noqa: E501 + return (bool, dict, float, int, list, str, none_type) # noqa: E501 _nullable = False @@ -88,26 +84,24 @@ def openapi_types(cls): and the value is attribute type. """ return { - 'access_token': (str,), # noqa: E501 - 'token_type': (str,), # noqa: E501 - 'expires_in': (int,), # noqa: E501 + "access_token": (str,), # noqa: E501 + "token_type": (str,), # noqa: E501 + "expires_in": (int,), # noqa: E501 } @cached_class_property def discriminator(cls): return None - attribute_map: Dict[str, str] = { - 'access_token': 'access_token', # noqa: E501 - 'token_type': 'token_type', # noqa: E501 - 'expires_in': 'expires_in', # noqa: E501 + "access_token": "access_token", # noqa: E501 + "token_type": "token_type", # noqa: E501 + "expires_in": "expires_in", # noqa: E501 } - read_only_vars: Set[str] = set([ - ]) + read_only_vars: Set[str] = set([]) - _composed_schemas: Dict[Literal['allOf', 'oneOf', 'anyOf'], Any] = {} + _composed_schemas: Dict[Literal["allOf", "oneOf", "anyOf"], Any] = {} def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: """Create a new instance of TokenResponse. @@ -120,11 +114,11 @@ def __new__(cls: Type[T], *args: Any, **kwargs: Any) -> T: instance: T = super().__new__(cls, *args, **kwargs) return instance - - @classmethod @convert_js_args_to_python_args - def _from_openapi_data(cls: Type[T], access_token, token_type, 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: @@ -165,22 +159,20 @@ def _from_openapi_data(cls: Type[T], access_token, token_type, expires_in, *args _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', ()) + _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__, - ), + "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__,), ) @@ -198,25 +190,29 @@ def _from_openapi_data(cls: Type[T], access_token, token_type, expires_in, *args self.token_type = token_type self.expires_in = expires_in for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) return self - required_properties = set([ - '_enforce_allowed_values', - '_enforce_validations', - '_data_store', - '_check_type', - '_spec_property_naming', - '_path_to_item', - '_configuration', - '_visited_composed_classes', - ]) + 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, access_token, token_type, expires_in, *args, **kwargs) -> None: # noqa: E501 @@ -261,19 +257,17 @@ def __init__(self, access_token, token_type, expires_in, *args, **kwargs) -> Non """ _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', ()) + _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__, - ), + "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__,), ) @@ -291,13 +285,17 @@ def __init__(self, access_token, token_type, expires_in, *args, **kwargs) -> Non self.token_type = token_type self.expires_in = expires_in for var_name, var_value in kwargs.items(): - if var_name not in self.attribute_map and \ - self._configuration is not None and \ - self._configuration.discard_unknown_keys and \ - self.additional_properties_type is None: + if ( + var_name not in self.attribute_map + and self._configuration is not None + and self._configuration.discard_unknown_keys + and self.additional_properties_type is None + ): # discard variable. continue setattr(self, var_name, var_value) if var_name in self.read_only_vars: - raise PineconeApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate " - f"class with read only attributes.") + 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/db_data/index.py b/pinecone/db_data/index.py index 113e15cce..3c823f3f0 100644 --- a/pinecone/db_data/index.py +++ b/pinecone/db_data/index.py @@ -100,6 +100,34 @@ def parse_query_response(response: OpenAPIQueryResponse) -> QueryResponse: ) +class UpsertResponseTransformer: + """Transformer for converting ApplyResult[OpenAPIUpsertResponse] to UpsertResponse. + + This wrapper transforms the OpenAPI response to our dataclass when .get() is called, + while delegating other methods to the underlying ApplyResult. + """ + + def __init__(self, apply_result: ApplyResult): + self._apply_result = apply_result + + def get(self, timeout=None): + openapi_response = self._apply_result.get(timeout) + from pinecone.utils.response_info import extract_response_info + + response_info = None + if hasattr(openapi_response, "_response_info"): + response_info = openapi_response._response_info + if response_info is None: + response_info = extract_response_info({}) + return UpsertResponse( + upserted_count=openapi_response.upserted_count, _response_info=response_info + ) + + def __getattr__(self, name): + # Delegate other methods to the underlying ApplyResult + return getattr(self._apply_result, name) + + class Index(PluginAware, IndexInterface): """ A client for interacting with a Pinecone index via REST API. @@ -244,29 +272,6 @@ def upsert( # If async_req=True, result is an ApplyResult[OpenAPIUpsertResponse] # We need to wrap it to convert to our dataclass when .get() is called if kwargs.get("async_req", False): - # Create a wrapper that transforms the OpenAPI response to our dataclass - class UpsertResponseTransformer: - def __init__(self, apply_result: ApplyResult): - self._apply_result = apply_result - - def get(self, timeout=None): - openapi_response = self._apply_result.get(timeout) - from pinecone.utils.response_info import extract_response_info - - response_info = None - if hasattr(openapi_response, "_response_info"): - response_info = openapi_response._response_info - if response_info is None: - response_info = extract_response_info({}) - return UpsertResponse( - upserted_count=openapi_response.upserted_count, - _response_info=response_info, - ) - - def __getattr__(self, name): - # Delegate other methods to the underlying ApplyResult - return getattr(self._apply_result, name) - # result is ApplyResult when async_req=True return UpsertResponseTransformer(result) # type: ignore[arg-type, return-value] # result is UpsertResponse when async_req=False diff --git a/pinecone/db_data/resources/sync/vector.py b/pinecone/db_data/resources/sync/vector.py index 6de666c7e..1d55b6a09 100644 --- a/pinecone/db_data/resources/sync/vector.py +++ b/pinecone/db_data/resources/sync/vector.py @@ -69,6 +69,34 @@ def parse_query_response(response: OpenAPIQueryResponse) -> QueryResponse: ) +class UpsertResponseTransformer: + """Transformer for converting ApplyResult[OpenAPIUpsertResponse] to UpsertResponse. + + This wrapper transforms the OpenAPI response to our dataclass when .get() is called, + while delegating other methods to the underlying ApplyResult. + """ + + def __init__(self, apply_result: ApplyResult): + self._apply_result = apply_result + + def get(self, timeout=None): + openapi_response = self._apply_result.get(timeout) + from pinecone.utils.response_info import extract_response_info + + response_info = None + if hasattr(openapi_response, "_response_info"): + response_info = openapi_response._response_info + if response_info is None: + response_info = extract_response_info({}) + return UpsertResponse( + upserted_count=openapi_response.upserted_count, _response_info=response_info + ) + + def __getattr__(self, name): + # Delegate other methods to the underlying ApplyResult + return getattr(self._apply_result, name) + + class VectorResource(PluginAware): """Resource for vector operations on a Pinecone index.""" @@ -140,29 +168,6 @@ def upsert( # If async_req=True, result is an ApplyResult[OpenAPIUpsertResponse] # We need to wrap it to convert to our dataclass when .get() is called if kwargs.get("async_req", False): - # Create a wrapper that transforms the OpenAPI response to our dataclass - class UpsertResponseTransformer: - def __init__(self, apply_result: ApplyResult): - self._apply_result = apply_result - - def get(self, timeout=None): - openapi_response = self._apply_result.get(timeout) - from pinecone.utils.response_info import extract_response_info - - response_info = None - if hasattr(openapi_response, "_response_info"): - response_info = openapi_response._response_info - if response_info is None: - response_info = extract_response_info({}) - return UpsertResponse( - upserted_count=openapi_response.upserted_count, - _response_info=response_info, - ) - - def __getattr__(self, name): - # Delegate other methods to the underlying ApplyResult - return getattr(self._apply_result, name) - # result is ApplyResult when async_req=True from typing import cast diff --git a/pinecone/openapi_support/model_utils.py b/pinecone/openapi_support/model_utils.py index 5c18d22e8..44825f5dc 100644 --- a/pinecone/openapi_support/model_utils.py +++ b/pinecone/openapi_support/model_utils.py @@ -1075,6 +1075,16 @@ def get_discriminated_classes(cls): def get_possible_classes(cls, from_server_context): # TODO: lru_cache this + from typing import Any + + # Handle Any specially - it accepts any type + if cls is Any: + return [Any] + + # Handle cases where cls might not be a class (e.g., None, string, etc.) + if not isinstance(cls, type): + return [cls] if cls is not None else [] + possible_classes = [cls] if from_server_context: return possible_classes @@ -1107,7 +1117,7 @@ def get_required_type_classes(required_types_mixed, spec_property_naming): child_types_mixed (list/dict/tuple): describes the valid child types """ - from typing import Any, Type + from typing import Any, Type, get_origin valid_classes: list[Type[Any]] = [] child_req_types_by_current_type: dict[Type[Any], Any] = {} @@ -1123,7 +1133,47 @@ def get_required_type_classes(required_types_mixed, spec_property_naming): valid_classes.append(dict) child_req_types_by_current_type[dict] = required_type[str] else: - valid_classes.extend(get_possible_classes(required_type, spec_property_naming)) + # Handle typing generics like Dict[str, Any], List[str], etc. + # by converting them to their built-in equivalents + # Check if it's a typing generic by looking for __origin__ or __args__ + if hasattr(required_type, "__origin__") or ( + hasattr(required_type, "__args__") and required_type.__args__ + ): + try: + origin = get_origin(required_type) + if origin is dict: + valid_classes.append(dict) + # Extract value type from Dict[K, V] - value type is args[1] + from typing import get_args + + args = get_args(required_type) + if len(args) >= 2: + # Store the value type for child type checking + child_req_types_by_current_type[dict] = (args[1],) + else: + child_req_types_by_current_type[dict] = required_type + elif origin is list: + valid_classes.append(list) + # Extract element type from List[T] - element type is args[0] + from typing import get_args + + args = get_args(required_type) + if len(args) >= 1: + child_req_types_by_current_type[list] = (args[0],) + else: + child_req_types_by_current_type[list] = required_type + elif origin is tuple: + valid_classes.append(tuple) + child_req_types_by_current_type[tuple] = required_type + else: + valid_classes.extend( + get_possible_classes(required_type, spec_property_naming) + ) + except (TypeError, AttributeError): + # Not a typing generic, treat as regular class + valid_classes.extend(get_possible_classes(required_type, spec_property_naming)) + else: + valid_classes.extend(get_possible_classes(required_type, spec_property_naming)) return tuple(valid_classes), child_req_types_by_current_type @@ -1456,6 +1506,12 @@ def is_valid_type(input_class_simple, valid_classes): Returns: bool """ + from typing import Any + + # If Any is in valid_classes, accept any type + if Any in valid_classes: + return True + valid_type = input_class_simple in valid_classes if not valid_type and ( issubclass(input_class_simple, OpenApiModel) or input_class_simple is none_type diff --git a/pinecone/openapi_support/rest_aiohttp.py b/pinecone/openapi_support/rest_aiohttp.py index 568f40941..8b84e850a 100644 --- a/pinecone/openapi_support/rest_aiohttp.py +++ b/pinecone/openapi_support/rest_aiohttp.py @@ -8,7 +8,7 @@ class AiohttpRestClient(RestClientInterface): def __init__(self, configuration: Configuration) -> None: try: - import aiohttp # type: ignore[import-not-found] + import aiohttp from aiohttp_retry import RetryClient from .retry_aiohttp import JitterRetry except ImportError: