Skip to content

Commit

Permalink
Revert "Add LogPatternTool (#413) (#418) (#422)"
Browse files Browse the repository at this point in the history
This reverts commit 7cd2c22.
  • Loading branch information
xinyual authored Oct 12, 2024
1 parent 7cd2c22 commit ec87ad6
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 ec87ad6

Please sign in to comment.