From eca844b5850c502a8acd207c2f7a0d442839bd8f Mon Sep 17 00:00:00 2001 From: Mingshi Liu Date: Tue, 13 Aug 2024 13:57:34 -0700 Subject: [PATCH] rephrase javadoc Signed-off-by: Mingshi Liu --- .../processor/MLInferenceSearchResponseProcessor.java | 11 +++++------ .../MLInferenceSearchResponseProcessorTests.java | 11 ----------- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/plugin/src/main/java/org/opensearch/ml/processor/MLInferenceSearchResponseProcessor.java b/plugin/src/main/java/org/opensearch/ml/processor/MLInferenceSearchResponseProcessor.java index b3d93c63ed..d434f01b31 100644 --- a/plugin/src/main/java/org/opensearch/ml/processor/MLInferenceSearchResponseProcessor.java +++ b/plugin/src/main/java/org/opensearch/ml/processor/MLInferenceSearchResponseProcessor.java @@ -126,12 +126,11 @@ public SearchResponse processResponse(SearchRequest request, SearchResponse resp /** * Processes the search response asynchronously by rewriting the documents with the inference results. * - * At default, process many document in one prediction through rewriteResponseDocuments method. - * but when process inference one document for one inference, - * separate one N-hits searchResponse into N one-hit search response, - * execute the same rewriteResponseDocument method, - * after N one-hit search response with inference result gets back, - * combined N one-hit search response back into one N-hits searchResponse. + * By default, it processes multiple documents in a single prediction through the rewriteResponseDocuments method. + * However, when processing one document per inference, it separates the N-hits search response into N one-hit search responses, + * executes the same rewriteResponseDocument method for each one-hit search response, + * and after receiving N one-hit search responses with inference results, + * it combines them back into a single N-hits search response. * * @param request the search request * @param response the search response diff --git a/plugin/src/test/java/org/opensearch/ml/processor/MLInferenceSearchResponseProcessorTests.java b/plugin/src/test/java/org/opensearch/ml/processor/MLInferenceSearchResponseProcessorTests.java index fb15ea943e..16ac828f9e 100644 --- a/plugin/src/test/java/org/opensearch/ml/processor/MLInferenceSearchResponseProcessorTests.java +++ b/plugin/src/test/java/org/opensearch/ml/processor/MLInferenceSearchResponseProcessorTests.java @@ -98,17 +98,6 @@ public void testProcessResponseException() throws Exception { } } - // public void testPrint(){ - // String payload = "{\"prompt\":\"\\n\\nHuman: You are a professional data analysist. You will always answer question based on the - // given context first. If the answer is not directly shown in the context, you will analyze the data and find the answer. If you do not - // know the answer, just say I do not know. Context:[\"Dr. Eric Goldberg is a fantastic doctor who has correctly diagnosed every issue - // that my wife and I have had. Unlike many of my past doctors, Dr. Goldberg is very accessible and we have been able to schedule - // appointments with him and his staff very quickly. We are happy to have him in the neighborhood and look forward to being his patients - // for many years to come.\",\"happy visit\"]. Please answer this question: \"please summerize the documents\" - // \\n\\nAssistant:\",\"max_tokens_to_sample\":300,\"temperature\":0.5,\"top_k\":250,\"top_p\":1,\"stop_sequences\":[\"\\\\n\\\\nHuman:\"]}"; - // System.out.println(payload); - // } - /** * Tests the successful processing of a response with a single pair of input and output mappings. *