Skip to content

Commit

Permalink
Do not include document text in response discussion langchain4j#974
Browse files Browse the repository at this point in the history
  • Loading branch information
ksmeyers committed May 6, 2024
1 parent f3142b3 commit 8d6a66a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public Response<List<Double>> scoreAll(List<TextSegment> segments, String query)
.documents(segments.stream()
.map(TextSegment::text)
.collect(toList()))
.returnDocuments(false) //decreasing response size, do not include text in response
.build();

RerankResponse response = withRetry(() -> client.rerank(request), maxRetries);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ class RerankRequest {
private String model;
private String query;
private List<String> documents;
private Boolean returnDocuments;
}

0 comments on commit 8d6a66a

Please sign in to comment.