-
Notifications
You must be signed in to change notification settings - Fork 13
Generate code based on 2025-10 api spec #200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
rohanshah18
wants to merge
11
commits into
main
Choose a base branch
from
rshah/release-candidate/2025-10
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rohanshah18
commented
Nov 3, 2025
|
|
||
| set -eu -o pipefail | ||
|
|
||
| # Simple script to add titles to nested objects in ConfigureIndexRequest schema |
Contributor
Author
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I dont add titles, openapi generator will create ConfigureIndexRequestServerless.java and ConfigureIndexRequestServerlessServerless.java classes. And similarly for pod.
…figuration (#202) ## Problem Add Support for Dedicated Read Capacity (DRN) and Metadata Schema Configuration ## Solution This PR adds support for Dedicated Read Capacity (DRN) and Metadata Schema Configuration for serverless indexes. These features allow users to: 1. **Configure dedicated read nodes** for better performance and cost predictability 2. **Limit metadata indexing** to specific fields for improved performance 3. **Configure read capacity** on existing serverless indexes #### 1. Create Serverless Index with Read Capacity and Schema Added overloaded `createServerlessIndex` method that accepts: - `ReadCapacity` parameter for configuring OnDemand or Dedicated read capacity - `BackupModelSchema` parameter for configuring metadata schema ```java // Create index with Dedicated read capacity ScalingConfigManual manual = new ScalingConfigManual().shards(2).replicas(2); ReadCapacityDedicatedConfig dedicated = new ReadCapacityDedicatedConfig() .nodeType("t1") .scaling("Manual") .manual(manual); ReadCapacity readCapacity = new ReadCapacity( new ReadCapacityDedicatedSpec().mode("Dedicated").dedicated(dedicated)); IndexModel indexModel = pinecone.createServerlessIndex( indexName, "cosine", 1536, "aws", "us-west-2", "enabled", tags, readCapacity, null); // Create index with metadata schema Map<String, BackupModelSchemaFieldsValue> fields = new HashMap<>(); fields.put("genre", new BackupModelSchemaFieldsValue().filterable(true)); fields.put("year", new BackupModelSchemaFieldsValue().filterable(true)); BackupModelSchema schema = new BackupModelSchema().fields(fields); IndexModel indexModel = pinecone.createServerlessIndex( indexName, "cosine", 1536, "aws", "us-west-2", "enabled", tags, null, schema); ``` #### 2. Create Index for Model with Read Capacity and Schema Added overloaded `createIndexForModel` method that accepts: - `ReadCapacity` parameter - `BackupModelSchema` parameter #### 3. Configure Read Capacity on Existing Index Enhanced `configureServerlessIndex` method to accept flattened parameters for easier use: ```java // Switch to Dedicated read capacity IndexModel indexModel = pinecone.configureServerlessIndex( indexName, "enabled", tags, null, "Dedicated", "t1", 2, 2); // Switch to OnDemand read capacity IndexModel indexModel = pinecone.configureServerlessIndex( indexName, "enabled", tags, null, "OnDemand", null, null, null); ``` **Note:** Read capacity settings can only be updated once per hour per index. ### Documentation - Updated `README.md` with examples for: - Creating serverless indexes with dedicated read capacity - Creating serverless indexes with OnDemand read capacity - Creating serverless indexes with metadata schema - Configuring read capacity on existing indexes ## Type of Change - [ ] Bug fix (non-breaking change which fixes an issue) - [X] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] This change requires a documentation update - [ ] Infrastructure change (CI configs, etc) - [ ] Non-code change (docs, etc) - [ ] None of the above: (explain here) ## Test Plan - Added comprehensive integration tests in `ReadCapacityAndSchemaTest.java`: - Create serverless index with OnDemand read capacity - Create serverless index with Dedicated read capacity - Create serverless index with metadata schema - Create serverless index with both read capacity and schema - Create index for model with read capacity and schema - Configure read capacity on existing index - Added helper method `waitUntilReadCapacityIsReady()` in `TestUtilities.java` to wait for read capacity status to be "Ready" before configuring (required by API). - Note: Tests for switching read capacity modes and scaling are omitted due to API rate limits (once per hour per index).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
This PR updates the Pinecone Java client SDK to align with the 2025-10 OpenAPI specification. The update includes significant model changes, new API capabilities, and infrastructure improvements to support the latest Pinecone features.
Solution
Code Generation Updates
make_oneof_titles_unique.shto handle oneOf title uniqueness across the specadd_configure_index_request_titles.shto fix nested object titles in ConfigureIndexRequest schemaBreaking Changes and Updates
Pinecone.java:
deletionProtectionparameter type: All methods now acceptStringinstead ofDeletionProtectionenumcreateServerlessIndex()- now acceptsString deletionProtection(e.g.,"enabled"or"disabled")createSparseServelessIndex()- now acceptsString deletionProtectioncreateIndexForModel()- now acceptsString deletionProtectionandString cloud(wasCloudEnum)createPodsIndex()- all overloads now acceptString deletionProtectionconfigurePodsIndex()- overloads now acceptString deletionProtectioncloudparameter type:createIndexForModel()now acceptsString cloudinstead ofCreateIndexForModelRequest.CloudEnumcreatePodsIndex()overload that took(String, Integer, String, String, String)parametersIndex.java and AsyncIndex.java:
errorModeparameter type:startImport()method now acceptsString errorModeinstead ofImportErrorMode.OnErrorEnum"abort"or"continue"as string valuesModel Classes (If Directly Used):
IndexModel,IndexSpec, andConfigureIndexRequesthave been split into type-specific variants:IndexModelPodBased,IndexModelServerless,IndexModelBYOCIndexSpecPodBased,IndexSpecServerless,IndexSpecBYOCConfigureIndexRequestPodBased,ConfigureIndexRequestServerlessType of Change
Test Plan