@@ -55,7 +55,6 @@ resources on idle pools. More details on the OkHttpClient can be found [here](ht
5555
5656``` java
5757import io.pinecone.clients.Pinecone ;
58- import org.openapitools.client.model.* ;
5958
6059public class InitializeClientExample {
6160 public static void main (String [] args ) {
@@ -71,6 +70,7 @@ If you need to provide a custom `OkHttpClient`, you can do so by using the `with
7170
7271``` java
7372import io.pinecone.clients.Pinecone ;
73+ import okhttp3.OkHttpClient ;
7474
7575public class InitializeClientExample {
7676 public static void main (String [] args ) {
@@ -96,7 +96,7 @@ import io.pinecone.clients.Index;
9696import io.pinecone.clients.Pinecone ;
9797import io.pinecone.proto.UpsertResponse ;
9898import io.pinecone.unsigned_indices_model.QueryResponseWithUnsignedIndices ;
99- import org.openapitools.control .client.model.IndexModel ;
99+ import org.openapitools.db_control .client.model.IndexModel ;
100100
101101import java.util.Arrays ;
102102
@@ -169,9 +169,8 @@ serverless and regional availability, see [Understanding indexes](https://docs.p
169169
170170``` java
171171import io.pinecone.clients.Pinecone ;
172- import org.openapitools.client.model.IndexModel ;
173- import org.openapitools.control.client.model.DeletionProtection ;
174-
172+ import org.openapitools.db_control.client.model.IndexModel ;
173+ import org.openapitools.db_control.client.model.DeletionProtection ;
175174...
176175
177176Pinecone pinecone = new Pinecone .Builder (" PINECONE_API_KEY" ). build();
@@ -192,9 +191,7 @@ The following is a minimal example of creating a pod-based index. For all the po
192191
193192``` java
194193import io.pinecone.clients.Pinecone ;
195- import org.openapitools.client.model.IndexModel ;
196- import org.openapitools.control.client.model.DeletionProtection ;
197-
194+ import org.openapitools.db_control.client.model.IndexModel ;
198195...
199196
200197Pinecone pinecone = new Pinecone .Builder (" PINECONE_API_KEY" ). build();
@@ -235,7 +232,7 @@ The following example returns all indexes (and their corresponding metadata) in
235232
236233``` java
237234import io.pinecone.clients.Pinecone ;
238- import org.openapitools.client.model.IndexList ;
235+ import org.openapitools.db_control. client.model.IndexList ;
239236...
240237
241238Pinecone pinecone = new Pinecone .Builder (" PINECONE_API_KEY" ). build();
@@ -248,7 +245,7 @@ The following example returns metadata about an index.
248245
249246``` java
250247import io.pinecone.clients.Pinecone ;
251- import org.openapitools.client.model.IndexModel ;
248+ import org.openapitools.db_control. client.model.IndexModel ;
252249...
253250
254251Pinecone pinecone = new Pinecone .Builder (" PINECONE_API_KEY" ). build();
@@ -261,7 +258,8 @@ The following example deletes an index.
261258
262259``` java
263260import io.pinecone.clients.Pinecone ;
264-
261+ ...
262+
265263Pinecone pinecone = new Pinecone .Builder (" PINECONE_API_KEY" ). build();
266264pinecone. deleteIndex(" example-index" );
267265```
@@ -274,16 +272,17 @@ Note: scaling replicas is only applicable to pod-based indexes.
274272
275273``` java
276274import io.pinecone.clients.Pinecone ;
277- import org.openapitools.client.model.IndexModel ;
275+ import org.openapitools.db_control. client.model.DeletionProtection ;
278276...
279277
280278Pinecone pinecone = new Pinecone .Builder (" PINECONE_API_KEY" ). build();
281279
282280String indexName = " example-index" ;
283281String podType = " p1.x1" ;
284282int newNumberOfReplicas = 7 ;
285-
286- pinecone. configurePodsIndex(indexName, podType, newNumberOfReplicas);
283+ DeletionProtection deletionProtection = DeletionProtection . DISABLED ;
284+
285+ pinecone. configurePodsIndex(indexName, podType, newNumberOfReplicas, deletionProtection);
287286```
288287
289288## Enable deletion protection for pod index
@@ -292,11 +291,15 @@ The following example enables deletion protection for a pod-based index.
292291
293292``` java
294293import io.pinecone.clients.Pinecone ;
294+ import org.openapitools.db_control.client.model.DeletionProtection ;
295295...
296296
297297Pinecone pinecone = new Pinecone .Builder (" PINECONE_API_KEY" ). build();
298298
299- pinecone. configurePodsIndex(indexName, DeletionProtection . ENABLED );
299+ String indexName = " example-index" ;
300+ DeletionProtection deletionProtection = DeletionProtection . ENABLED ;
301+
302+ pinecone. configurePodsIndex(indexName, deletionProtection);
300303```
301304
302305## Enable deletion protection for serverless index
@@ -305,10 +308,12 @@ The following example enables deletion protection for a serverless index.
305308
306309``` java
307310import io.pinecone.clients.Pinecone ;
311+ import org.openapitools.db_control.client.model.DeletionProtection ;
308312...
309313
310314Pinecone pinecone = new Pinecone .Builder (" PINECONE_API_KEY" ). build();
311315
316+ String indexName = " example-index" ;
312317pinecone. configureServerlessIndex(indexName, DeletionProtection . ENABLED );
313318```
314319
@@ -320,7 +325,8 @@ The following example returns statistics about an index.
320325import io.pinecone.clients.Index ;
321326import io.pinecone.clients.Pinecone ;
322327import io.pinecone.proto.DescribeIndexStatsResponse ;
323-
328+ ...
329+
324330Pinecone pinecone = new Pinecone .Builder (" PINECONE_API_KEY" ). build();
325331
326332Index index = pinecone. getIndexConnection(" example-index" );
@@ -452,8 +458,8 @@ The following example lists up to 100 vector IDs from a Pinecone index.
452458
453459This method accepts optional parameters for ` namespace ` , ` prefix ` , ` limit ` , and ` paginationToken ` .
454460
455- The following
456- demonstrates how to use the ` list ` endpoint to get vector IDs from a specific ` namespace ` , filtered by a given ` prefix ` .
461+ The following demonstrates how to use the ` list ` endpoint to get vector IDs from a specific ` namespace ` , filtered by a
462+ given ` prefix ` .
457463
458464``` java
459465import io.pinecone.clients.Index ;
@@ -466,7 +472,6 @@ Index index = pinecone.getIndexConnection(indexName);
466472ListResponse listResponse = index. list(" example-namespace" , " prefix-" );
467473```
468474
469-
470475## Update vectors
471476
472477The following example updates vectors by ID.
@@ -496,7 +501,7 @@ The following example creates the collection `example-collection` from
496501
497502``` java
498503import io.pinecone.clients.Pinecone ;
499- import org.openapitools.client.model.CollectionModel ;
504+ import org.openapitools.db_control. client.model.CollectionModel ;
500505...
501506
502507Pinecone pinecone = new Pinecone .Builder (" PINECONE_API_KEY" ). build();
@@ -512,7 +517,7 @@ The following example returns a list of the collections in the current project.
512517
513518``` java
514519import io.pinecone.clients.Pinecone ;
515- import org.openapitools.client.model.CollectionModel ;
520+ import org.openapitools.db_control. client.model.CollectionModel ;
516521import java.util.List ;
517522...
518523
@@ -526,7 +531,7 @@ The following example returns a description of the collection
526531
527532``` java
528533import io.pinecone.clients.Pinecone ;
529- import org.openapitools.client.model.CollectionModel ;
534+ import org.openapitools.db_control. client.model.CollectionModel ;
530535...
531536
532537Pinecone pinecone = new Pinecone .Builder (" PINECONE_API_KEY" ). build();
@@ -550,10 +555,11 @@ pinecone.deleteCollection("example-collection");
550555The Pinecone SDK now supports creating embeddings via the [ Inference API] ( https://docs.pinecone.io/guides/inference/understanding-inference ) .
551556
552557``` java
558+ import io.pinecone.clients.Inference ;
553559import io.pinecone.clients.Pinecone ;
554- import org.openapitools.control .client.ApiException ;
555- import org.openapitools.control .client.model.Embedding ;
556- import org.openapitools.control .client.model.EmbeddingsList ;
560+ import org.openapitools.inference .client.ApiException ;
561+ import org.openapitools.inference .client.model.Embedding ;
562+ import org.openapitools.inference .client.model.EmbeddingsList ;
557563
558564import java.util.ArrayList ;
559565import java.util.HashMap ;
@@ -589,12 +595,15 @@ The following example shows how to rerank items according to their relevance to
589595``` java
590596import io.pinecone.clients.Inference ;
591597import io.pinecone.clients.Pinecone ;
598+ import org.openapitools.inference.client.ApiException ;
592599import org.openapitools.inference.client.model.RerankResult ;
593600
594601import java.util.* ;
595-
596602...
597603
604+ Pinecone pinecone = new Pinecone .Builder (System . getenv(" PINECONE_API_KEY" )). build();
605+ Inference inference = pinecone. getInferenceClient();
606+
598607// The model to use for reranking
599608String model = " bge-reranker-v2-m3" ;
600609
0 commit comments