Skip to content
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

Add rerank #159

Merged
merged 1 commit into from
Oct 18, 2024
Merged

Add rerank #159

merged 1 commit into from
Oct 18, 2024

Conversation

rohanshah18
Copy link
Contributor

Problem

Add rerank.

Solution

  1. Added the following two methods for rerank:
    a. Method that accepts required parameters only and the optional parameters are set to default. More details on the api and its default parameters can be found here.
      rerank(String model,
                       String query,
                       List<Map<String, String>> documents)

b. Method that accepts all parameters:

      rerank(String model,
                       String query,
                       List<Map<String, String>> documents,
                       List<String> rankFields,
                       int topN,
                       boolean returnDocuments,
                       Map<String, Object> parameters)
  1. Added integration tests for both rerank methods.
  2. Added an example in the README file.

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 test.

@@ -487,7 +487,7 @@ UpdateResponse updateResponse = index.update("v1", values, "example-namespace");

# Collections

Collections fall under data plane operations.
Collections fall under control plane operations.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Error from before.

@rohanshah18 rohanshah18 changed the base branch from main to rshah/release-candidate/2024-10 October 18, 2024 19:19
@rohanshah18 rohanshah18 marked this pull request as ready for review October 18, 2024 19:34
Copy link
Contributor

@ssmith-pc ssmith-pc left a comment

Choose a reason for hiding this comment

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

LGTM!

@rohanshah18 rohanshah18 merged commit 1e8925a into rshah/release-candidate/2024-10 Oct 18, 2024
8 of 9 checks passed
@rohanshah18 rohanshah18 deleted the rshah/rerank branch October 18, 2024 20:36
rohanshah18 added a commit that referenced this pull request Oct 24, 2024
## Problem

Add rerank.

## Solution

1. Added the following two methods for rerank:
a. Method that accepts required parameters only and the optional
parameters are set to default. More details on the api and its default
parameters can be found
[here](https://docs.pinecone.io/reference/api/2024-10/inference/rerank).
```java
      rerank(String model,
                       String query,
                       List<Map<String, String>> documents)
```
b. Method that accepts all parameters:
```java
      rerank(String model,
                       String query,
                       List<Map<String, String>> documents,
                       List<String> rankFields,
                       int topN,
                       boolean returnDocuments,
                       Map<String, Object> parameters)
```
2. Added integration tests for both rerank methods.
3. Added an example in the README file.


## 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 integration test.
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.

2 participants