From 12975bbfff31d23215bfb1ef23e2768e9e76f9e6 Mon Sep 17 00:00:00 2001 From: Austin Lee Date: Mon, 22 Apr 2024 17:39:42 -0700 Subject: [PATCH] Address reviewer comments. Signed-off-by: Austin Lee --- .../generative/GenerativeQAResponseProcessor.java | 14 +++++--------- .../generative/llm/DefaultLlmImpl.java | 1 - 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/search-processors/src/main/java/org/opensearch/searchpipelines/questionanswering/generative/GenerativeQAResponseProcessor.java b/search-processors/src/main/java/org/opensearch/searchpipelines/questionanswering/generative/GenerativeQAResponseProcessor.java index 1f4e755c36..7b1814c2a5 100644 --- a/search-processors/src/main/java/org/opensearch/searchpipelines/questionanswering/generative/GenerativeQAResponseProcessor.java +++ b/search-processors/src/main/java/org/opensearch/searchpipelines/questionanswering/generative/GenerativeQAResponseProcessor.java @@ -119,7 +119,7 @@ public void processResponseAsync( PipelineProcessingContext requestContext, ActionListener responseListener ) { - log.info("Entering processResponse."); + log.debug("Entering processResponse."); if (!this.featureFlagSupplier.getAsBoolean()) { throw new MLException(GenerativeQAProcessorConstants.FEATURE_NOT_ENABLED_ERROR_MSG); @@ -132,7 +132,7 @@ public void processResponseAsync( t = DEFAULT_PROCESSOR_TIME_IN_SECONDS; } final int timeout = t; - log.info("Timeout for this request: {} seconds.", timeout); + log.debug("Timeout for this request: {} seconds.", timeout); String llmQuestion = params.getLlmQuestion(); String llmModel = params.getLlmModel() == null ? this.llmModel : params.getLlmModel(); @@ -144,13 +144,12 @@ public void processResponseAsync( if (conversationId != null && !Strings.hasText(conversationId)) { throw new IllegalArgumentException("Empty conversation_id is not allowed."); } - // log.info("LLM question: {}, LLM model {}, conversation id: {}", llmQuestion, llmModel, conversationId); Instant start = Instant.now(); Integer interactionSize = params.getInteractionSize(); if (interactionSize == null || interactionSize == GenerativeQAParameters.SIZE_NULL_VALUE) { interactionSize = DEFAULT_CHAT_HISTORY_WINDOW; } - log.info("Using interaction size of {}", interactionSize); + log.debug("Using interaction size of {}", interactionSize); Integer topN = params.getContextSize(); if (topN == null) { @@ -168,9 +167,6 @@ public void processResponseAsync( effectiveUserInstructions = params.getUserInstructions(); } - // log.info("system_prompt: {}", systemPrompt); - // log.info("user_instructions: {}", userInstructions); - final List chatHistory = new ArrayList<>(); if (conversationId == null) { doChatCompletion( @@ -194,7 +190,7 @@ public void processResponseAsync( } else { final Instant memoryStart = Instant.now(); memoryClient.getInteractions(conversationId, interactionSize, ActionListener.wrap(r -> { - log.info("getInteractions complete. ({})", getDuration(memoryStart)); + log.debug("getInteractions complete. ({})", getDuration(memoryStart)); chatHistory.addAll(r); doChatCompletion( LlmIOUtil @@ -231,7 +227,7 @@ private void doChatCompletion( llm.doChatCompletion(input, new ActionListener<>() { @Override public void onResponse(ChatCompletionOutput output) { - log.info("doChatCompletion complete. ({})", getDuration(chatStart)); + log.debug("doChatCompletion complete. ({})", getDuration(chatStart)); final String answer = getAnswer(output); final String errorMessage = getError(output); diff --git a/search-processors/src/main/java/org/opensearch/searchpipelines/questionanswering/generative/llm/DefaultLlmImpl.java b/search-processors/src/main/java/org/opensearch/searchpipelines/questionanswering/generative/llm/DefaultLlmImpl.java index 87df48719c..f6cdfec816 100644 --- a/search-processors/src/main/java/org/opensearch/searchpipelines/questionanswering/generative/llm/DefaultLlmImpl.java +++ b/search-processors/src/main/java/org/opensearch/searchpipelines/questionanswering/generative/llm/DefaultLlmImpl.java @@ -89,7 +89,6 @@ public void onResponse(MLOutput mlOutput) { .getMlModelTensors() .get(0) .getDataAsMap(); - // log.info("dataAsMap: {}", dataAsMap.toString()); listener .onResponse( buildChatCompletionOutput(