From 6ed8d46666dca975c5e19511e4cde81eb50d88ab Mon Sep 17 00:00:00 2001 From: Rohan Shah Date: Mon, 3 Feb 2025 14:36:44 -0500 Subject: [PATCH] Update rerank example in the README after breaking changes (#177) ## Problem Rerank endpoint is updated to accept documents as List> instead of List> and parameters now accepts Map instead of Map. ## Solution Update the example in README for rerank example ## 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) - [X] Non-code change (docs, etc) - [ ] None of the above: (explain here) ## Test Plan NA --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 679cc02..4560306 100644 --- a/README.md +++ b/README.md @@ -642,23 +642,23 @@ String model = "bge-reranker-v2-m3"; String query = "The tech company Apple is known for its innovative products like the iPhone."; // Add the documents to rerank -List> documents = new ArrayList<>(); -Map doc1 = new HashMap<>(); +List> documents = new ArrayList<>(); +Map 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 doc2 = new HashMap<>(); +Map doc2 = new HashMap<>(); doc2.put("id", "vec2"); doc2.put("my_field", "Many people enjoy eating apples as a healthy snack."); documents.add(doc2); -Map doc3 = new HashMap<>(); +Map 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 doc4 = new HashMap<>(); +Map 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); @@ -673,7 +673,7 @@ int topN = 2; boolean returnDocuments = true; // Additional model-specific parameters for the reranker -Map parameters = new HashMap<>(); +Map parameters = new HashMap<>(); parameters.put("truncate", "END"); // Send ranking request