Skip to content

Commit

Permalink
remove more sensitive logs in pipeline/responseProcessor logs (#2130) (
Browse files Browse the repository at this point in the history
…#2132)

Signed-off-by: Xun Zhang <[email protected]>
(cherry picked from commit 896caac)

Co-authored-by: Xun Zhang <[email protected]>
  • Loading branch information
opensearch-trigger-bot[bot] and Zhangxunmt authored Feb 19, 2024
1 parent 36106d0 commit 7722020
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ public SearchResponse processResponse(SearchRequest request, SearchResponse resp
if (timeout == null || timeout == GenerativeQAParameters.SIZE_NULL_VALUE) {
timeout = DEFAULT_PROCESSOR_TIME_IN_SECONDS;
}
log.info("Timeout for this request: {} seconds.", timeout);

String llmQuestion = params.getLlmQuestion();
String llmModel = params.getLlmModel() == null ? this.llmModel : params.getLlmModel();
Expand All @@ -129,26 +128,21 @@ public SearchResponse processResponse(SearchRequest request, SearchResponse resp
}
String conversationId = params.getConversationId();

log.info("LLM model {}, conversation id: {}", 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);
List<Interaction> chatHistory = (conversationId == null)
? Collections.emptyList()
: memoryClient.getInteractions(conversationId, interactionSize);
log.info("Retrieved chat history. ({})", getDuration(start));

Integer topN = params.getContextSize();
if (topN == null) {
topN = GenerativeQAParameters.SIZE_NULL_VALUE;
}
List<String> searchResults = getSearchResults(response, topN);

log.info("system_prompt: {}", systemPrompt);
log.info("user_instructions: {}", userInstructions);
start = Instant.now();
try {
ChatCompletionOutput output = llm
Expand Down Expand Up @@ -314,15 +308,6 @@ public SearchResponseProcessor create(
config,
GenerativeQAProcessorConstants.CONFIG_NAME_USER_INSTRUCTIONS
);
log
.info(
"model_id {}, llm_model {}, context_field_list {}, system_prompt {}, user_instructions {}",
modelId,
llmModel,
contextFields,
systemPrompt,
userInstructions
);
return new GenerativeQAResponseProcessor(
client,
tag,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,12 @@ public List<Interaction> getInteractions(String conversationId, int lastN) {
interactions.addAll(list);
from += list.size();
maxResults -= list.size();
log.info("Interactions: {}, from: {}, maxResults: {}", interactions, from, maxResults);
} else if (response.hasMorePages()) {
// If we didn't get any results back, we ignore this flag and break out of the loop
// to avoid an infinite loop.
// But in the future, we may support this mode, e.g. DynamoDB.
break;
}
log.info("Interactions: {}, from: {}, maxResults: {}", interactions, from, maxResults);
allInteractionsFetched = !response.hasMorePages();
} while (from < lastN && !allInteractionsFetched);

Expand Down

0 comments on commit 7722020

Please sign in to comment.