Skip to content

Conversation

@rohanshah18
Copy link
Contributor

@rohanshah18 rohanshah18 commented May 22, 2025

Problem

Add support for models api.

Solution

This PR contains following changes:

  1. Regenerated code based on the latest changes in the 2025-04 OAS
  2. Added listProjectBackups(Integer limit, String paginationToken)
  3. Added support for models api by adding the following methods:
    1. listModels()
    2. listModels(String type)
    3. listModels(String type, String vectorType)
    4. describeModel(String modelName)
  4. Added integration test for various list and describe model methods.

Following 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);

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • 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 integration tests.

@rohanshah18 rohanshah18 marked this pull request as ready for review May 22, 2025 17:32
Copy link
Contributor

@austin-denoble austin-denoble left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just a couple nits.

@rohanshah18 rohanshah18 merged commit ffcee4b into main May 22, 2025
8 of 10 checks passed
@rohanshah18 rohanshah18 deleted the rshah/models branch May 22, 2025 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants