Skip to content

Commit

Permalink
Revert "Add LogPatternTool (opensearch-project#413) (opensearch-proje…
Browse files Browse the repository at this point in the history
…ct#418) (opensearch-project#422)"

This reverts commit 7cd2c22.
  • Loading branch information
qianheng-aws authored Oct 12, 2024
1 parent 7cd2c22 commit dc6ead6
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 359 deletions.
5 changes: 1 addition & 4 deletions src/main/java/org/opensearch/agent/ToolPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import java.util.function.Supplier;

import org.opensearch.agent.tools.CreateAnomalyDetectorTool;
import org.opensearch.agent.tools.LogPatternTool;
import org.opensearch.agent.tools.NeuralSparseSearchTool;
import org.opensearch.agent.tools.PPLTool;
import org.opensearch.agent.tools.RAGTool;
Expand Down Expand Up @@ -70,7 +69,6 @@ public Collection<Object> createComponents(
SearchAnomalyResultsTool.Factory.getInstance().init(client, namedWriteableRegistry);
SearchMonitorsTool.Factory.getInstance().init(client);
CreateAnomalyDetectorTool.Factory.getInstance().init(client);
LogPatternTool.Factory.getInstance().init(client, xContentRegistry);
return Collections.emptyList();
}

Expand All @@ -86,8 +84,7 @@ public List<Tool.Factory<? extends Tool>> getToolFactories() {
SearchAnomalyDetectorsTool.Factory.getInstance(),
SearchAnomalyResultsTool.Factory.getInstance(),
SearchMonitorsTool.Factory.getInstance(),
CreateAnomalyDetectorTool.Factory.getInstance(),
LogPatternTool.Factory.getInstance()
CreateAnomalyDetectorTool.Factory.getInstance()
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ private static Map<String, Object> processResponse(SearchHit hit) {
return docContent;
}

protected <T> SearchRequest buildSearchRequest(Map<String, String> parameters) throws IOException {
private <T> SearchRequest buildSearchRequest(Map<String, String> parameters) throws IOException {
String question = parameters.get(INPUT_FIELD);
if (StringUtils.isBlank(question)) {
throw new IllegalArgumentException("[" + INPUT_FIELD + "] is null or empty, can not process it.");
Expand All @@ -89,7 +89,8 @@ protected <T> SearchRequest buildSearchRequest(Map<String, String> parameters) t
searchSourceBuilder.parseXContent(queryParser);
searchSourceBuilder.fetchSource(sourceFields, null);
searchSourceBuilder.size(docSize);
return new SearchRequest().source(searchSourceBuilder).indices(parameters.getOrDefault(INDEX_FIELD, index));
SearchRequest searchRequest = new SearchRequest().source(searchSourceBuilder).indices(index);
return searchRequest;
}

@Override
Expand Down
295 changes: 0 additions & 295 deletions src/main/java/org/opensearch/agent/tools/LogPatternTool.java

This file was deleted.

58 changes: 0 additions & 58 deletions src/test/java/org/opensearch/agent/tools/LogPatternToolTests.java

This file was deleted.

0 comments on commit dc6ead6

Please sign in to comment.