This version of the Pinecone Java SDK introduces support for models api. You can now describe and list embedding models hosted by Pinecone. More details on models can be found here.
Features
Support to list and describe embedding models hosted by Pinecone.
Following methods are added:
1. listModels()
2. listModels(String type)
4. listModels(String type, String vectorType)
5. describeModel(String modelName)
Below code shows how to list and describe an embedding model:
import io.pinecone.clients.Inference;
import io.pinecone.clients.Pinecone;
import org.openapitools.inference.client.ApiException;
import org.openapitools.inference.client.model.ModelInfo;
import org.openapitools.inference.client.model.ModelInfoList;
...
Pinecone pinecone = new Pinecone
.Builder(System.getenv("PINECONE_API_KEY"))
.build();
Inference inference = pinecone.getInferenceClient();
// list models
ModelInfoList models = inference.listModels();
System.out.println(models);
// list models by filtering with type
models = inference.listModels("rerank");
System.out.println(models);
// list models by filtering with type and vectorType
models = inference.listModels("embed", "dense");
System.out.println(models);
// describe a model
ModelInfo modelInfo = inference.describeModel("llama-text-embed-v2");
System.out.println(modelInfo);
What's Changed
- Add support for models api by @rohanshah18 in #187
- Automate release process by @rohanshah18 in #188
- Replace existing OSSRH endpoint with OSSRH staging api for publishing by @rohanshah18 in #190
- Prepare to release v5.1.0 by @rohanshah18 in #191
Full Changelog: v5.0.0...v5.1.0