Skip to content

Commit

Permalink
generate code based on 2025-01 api spec
Browse files Browse the repository at this point in the history
  • Loading branch information
rohanshah18 committed Jan 10, 2025
1 parent 6e109e3 commit 96421c8
Show file tree
Hide file tree
Showing 137 changed files with 7,160 additions and 649 deletions.
2 changes: 1 addition & 1 deletion codegen/apis
Submodule apis updated from 39e90e to 24c626
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public void testGenerateEmbeddings() throws ApiException {

assertNotNull(embeddings, "Expected embedding to be not null");
Assertions.assertEquals(embeddingModel, embeddings.getModel());
Assertions.assertEquals(1024, embeddings.getData().get(0).getValues().size());
Assertions.assertEquals(1024, embeddings.getData().get(0).getDenseEmbedding().getValues().size());
Assertions.assertEquals(2, embeddings.getData().size());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,32 +22,32 @@ public class RerankTest {
public void testRerank() throws ApiException {
String model = "bge-reranker-v2-m3";
String query = "The tech company Apple is known for its innovative products like the iPhone.";
List<Map<String, String>> documents = new ArrayList<>();
List<Map<String, Object>> documents = new ArrayList<>();

Map<String, String> doc1 = new HashMap<>();
Map<String, Object> doc1 = new HashMap<>();
doc1.put("id", "vec1");
doc1.put("my_field", "Apple is a popular fruit known for its sweetness and crisp texture.");
documents.add(doc1);

Map<String, String> doc2 = new HashMap<>();
Map<String, Object> doc2 = new HashMap<>();
doc2.put("id", "vec2");
doc2.put("my_field", "Many people enjoy eating apples as a healthy snack.");
documents.add(doc2);

Map<String, String> doc3 = new HashMap<>();
Map<String, Object> doc3 = new HashMap<>();
doc3.put("id", "vec3");
doc3.put("my_field", "Apple Inc. has revolutionized the tech industry with its sleek designs and user-friendly interfaces.");
documents.add(doc3);

Map<String, String> doc4 = new HashMap<>();
Map<String, Object> doc4 = new HashMap<>();
doc4.put("id", "vec4");
doc4.put("my_field", "An apple a day keeps the doctor away, as the saying goes.");
documents.add(doc4);

List<String> rankFields = Arrays.asList("my_field");
int topN = 2;
boolean returnDocuments = true;
Map<String, String> parameters = new HashMap<>();
Map<String, Object> parameters = new HashMap<>();
parameters.put("truncate", "END");

RerankResult result = inference.rerank(model, query, documents, rankFields, topN, returnDocuments, parameters);
Expand All @@ -63,24 +63,24 @@ public void testRerank() throws ApiException {
public void testRerankWithRequiredParameters() throws ApiException {
String model = "bge-reranker-v2-m3";
String query = "The tech company Apple is known for its innovative products like the iPhone.";
List<Map<String, String>> documents = new ArrayList<>();
List<Map<String, Object>> documents = new ArrayList<>();

Map<String, String> doc1 = new HashMap<>();
Map<String, Object> doc1 = new HashMap<>();
doc1.put("id", "vec1");
doc1.put("text", "Apple is a popular fruit known for its sweetness and crisp texture.");
documents.add(doc1);

Map<String, String> doc2 = new HashMap<>();
Map<String, Object> doc2 = new HashMap<>();
doc2.put("id", "vec2");
doc2.put("text", "Many people enjoy eating apples as a healthy snack.");
documents.add(doc2);

Map<String, String> doc3 = new HashMap<>();
Map<String, Object> doc3 = new HashMap<>();
doc3.put("id", "vec3");
doc3.put("text", "Apple Inc. has revolutionized the tech industry with its sleek designs and user-friendly interfaces.");
documents.add(doc3);

Map<String, String> doc4 = new HashMap<>();
Map<String, Object> doc4 = new HashMap<>();
doc4.put("id", "vec4");
doc4.put("text", "An apple a day keeps the doctor away, as the saying goes.");
documents.add(doc4);
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/io/pinecone/clients/Inference.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ public Inference(PineconeConfig config) {
* @throws ApiException If the API call fails, an ApiException is thrown.
*/
public EmbeddingsList embed(String model, Map<String, Object> parameters, List<String> inputs) throws ApiException {
EmbedRequestParameters embedRequestParameters = new EmbedRequestParameters();
parameters.forEach(embedRequestParameters::putAdditionalProperty);
// EmbedRequestParameters embedRequestParameters = new EmbedRequestParameters();
// parameters.forEach(embedRequestParameters::putAdditionalProperty);

EmbedRequest embedRequest = new EmbedRequest()
.model(model)
.parameters(embedRequestParameters)
.parameters(parameters)
.inputs(convertToEmbedInputs(inputs));

return inferenceApi.embed(embedRequest);
Expand All @@ -74,7 +74,7 @@ public EmbeddingsList embed(String model, Map<String, Object> parameters, List<S
*/
public RerankResult rerank(String model,
String query,
List<Map<String, String>> documents) throws ApiException {
List<Map<String, Object>> documents) throws ApiException {
return rerank(model,
query,
documents,
Expand All @@ -100,11 +100,11 @@ public RerankResult rerank(String model,
*/
public RerankResult rerank(String model,
String query,
List<Map<String, String>> documents,
List<Map<String, Object>> documents,
List<String> rankFields,
int topN,
boolean returnDocuments,
Map<String, String> parameters) throws ApiException {
Map<String, Object> parameters) throws ApiException {
RerankRequest rerankRequest = new RerankRequest();

rerankRequest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Pinecone Control Plane API
* Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors.
*
* The version of the OpenAPI document: 2024-10
* The version of the OpenAPI document: 2025-01
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Pinecone Control Plane API
* Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors.
*
* The version of the OpenAPI document: 2024-10
* The version of the OpenAPI document: 2025-01
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down Expand Up @@ -140,7 +140,7 @@ private void init() {
json = new JSON();

// Set default User-Agent.
setUserAgent("OpenAPI-Generator/2024-10/java");
setUserAgent("OpenAPI-Generator/2025-01/java");

authentications = new HashMap<String, Authentication>();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Pinecone Control Plane API
* Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors.
*
* The version of the OpenAPI document: 2024-10
* The version of the OpenAPI document: 2025-01
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand All @@ -21,7 +21,7 @@
* <p>ApiException class.</p>
*/
@SuppressWarnings("serial")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-23T20:47:10.542209Z[Etc/UTC]")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:18.406889Z[Etc/UTC]")
public class ApiException extends Exception {
private int code = 0;
private Map<String, List<String>> responseHeaders = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Pinecone Control Plane API
* Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors.
*
* The version of the OpenAPI document: 2024-10
* The version of the OpenAPI document: 2025-01
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Pinecone Control Plane API
* Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors.
*
* The version of the OpenAPI document: 2024-10
* The version of the OpenAPI document: 2025-01
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand All @@ -13,9 +13,9 @@

package org.openapitools.db_control.client;

@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-23T20:47:10.542209Z[Etc/UTC]")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:18.406889Z[Etc/UTC]")
public class Configuration {
public static final String VERSION = "2024-10";
public static final String VERSION = "2025-01";

private static ApiClient defaultApiClient = new ApiClient();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Pinecone Control Plane API
* Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors.
*
* The version of the OpenAPI document: 2024-10
* The version of the OpenAPI document: 2025-01
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/org/openapitools/db_control/client/JSON.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Pinecone Control Plane API
* Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors.
*
* The version of the OpenAPI document: 2024-10
* The version of the OpenAPI document: 2025-01
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down Expand Up @@ -96,9 +96,12 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.CollectionList.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.CollectionModel.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.ConfigureIndexRequest.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.ConfigureIndexRequestEmbed.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.ConfigureIndexRequestSpec.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.ConfigureIndexRequestSpecPod.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.CreateCollectionRequest.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.CreateIndexForModelRequest.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.CreateIndexForModelRequestEmbed.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.CreateIndexRequest.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.ErrorResponse.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.ErrorResponseError.CustomTypeAdapterFactory());
Expand All @@ -107,6 +110,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.IndexModelSpec.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.IndexModelStatus.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.IndexSpec.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.ModelIndexEmbed.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.PodSpec.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.PodSpecMetadataConfig.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(new org.openapitools.db_control.client.model.ServerlessSpec.CustomTypeAdapterFactory());
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/openapitools/db_control/client/Pair.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Pinecone Control Plane API
* Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors.
*
* The version of the OpenAPI document: 2024-10
* The version of the OpenAPI document: 2025-01
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand All @@ -13,7 +13,7 @@

package org.openapitools.db_control.client;

@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-23T20:47:10.542209Z[Etc/UTC]")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:18.406889Z[Etc/UTC]")
public class Pair {
private String name = "";
private String value = "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Pinecone Control Plane API
* Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors.
*
* The version of the OpenAPI document: 2024-10
* The version of the OpenAPI document: 2025-01
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Pinecone Control Plane API
* Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors.
*
* The version of the OpenAPI document: 2024-10
* The version of the OpenAPI document: 2025-01
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Pinecone Control Plane API
* Pinecone is a vector database that makes it easy to search and retrieve billions of high-dimensional vectors.
*
* The version of the OpenAPI document: 2024-10
* The version of the OpenAPI document: 2025-01
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand All @@ -16,7 +16,7 @@
import java.util.Collection;
import java.util.Iterator;

@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2024-10-23T20:47:10.542209Z[Etc/UTC]")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-01-10T18:59:18.406889Z[Etc/UTC]")
public class StringUtil {
/**
* Check if the given array contains the given value (with case-insensitive comparison).
Expand Down
Loading

0 comments on commit 96421c8

Please sign in to comment.