Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
addf057
Update parameter handling of tools (#618)
yuancu Aug 11, 2025
a33cbb3
Remove dynamic tool (#620)
zane-neo Aug 11, 2025
d1152a2
Wait until LLM setup tasks complete in ToolIntegrationTest (#623)
yuancu Aug 13, 2025
fff1ca0
Update delete_backport_branch workflow to include release-chores bran…
RileyJergerAmazon Aug 13, 2025
aa1e091
fix: Update System.env syntax for Gradle 9 compatibility (#630)
dbwiddis Aug 21, 2025
32ac215
Log patterns analysis tool (#625)
Hailong-am Sep 5, 2025
ca93fb4
Increment version to 3.3.0-SNAPSHOT (#626)
opensearch-trigger-bot[bot] Sep 17, 2025
4450039
feat: Data Distribution Tool (#634)
PauiC Sep 18, 2025
b2556bc
Add more information in ppl tool when passing to sagemaker (#636)
xinyual Sep 19, 2025
1f866c0
fix: delete-single-baseline (#641)
PauiC Sep 30, 2025
f6f9cf6
Add release notes for 3.3.0 (#642)
opensearch-ci-bot Oct 7, 2025
10d97ac
Fix websearchtool issue (#639)
zane-neo Oct 8, 2025
5a3529c
update 3.3 release note (#650)
zane-neo Oct 8, 2025
0d1bfa8
Onboarding new maven snapshots publishing to s3 (skills) (#657)
peterzhuamazon Oct 23, 2025
0952482
fix regex bypass issue (#656)
zane-neo Oct 27, 2025
6584fa5
[AUTO] Add release notes for 3.3.2 (#664)
opensearch-ci-bot Oct 28, 2025
ba0a55e
chore(deps): update gradle to v8.14.3 (#649)
mend-for-github-com[bot] Oct 30, 2025
dc07401
Increment version to 3.4.0-SNAPSHOT (#646)
opensearch-trigger-bot[bot] Dec 1, 2025
805de2d
Gradle 9.2.0 and GitHub Actions JDK 25 Upgrade (#675)
zane-neo Dec 2, 2025
7d49cee
increase max_sample_count to 5 for log insight (#677)
Hailong-am Dec 4, 2025
06525fc
[AUTO] Increment version to 3.5.0-SNAPSHOT (#683)
opensearch-trigger-bot[bot] Jan 22, 2026
054e9ed
fix LogPatternAnalysisTool missing attributes (#690)
Hailong-am Feb 5, 2026
ec18a10
feat: Add MetricChangeAnalysisTool for metric change detection (#698)
xluo-aws Feb 27, 2026
4be3a13
update tool description to be more clear (#703)
Hailong-am Mar 4, 2026
0f25162
Search around tool (#702)
Hailong-am Mar 10, 2026
e3f247c
Add filter support for LogPatternAnalysisTool (#707)
Hailong-am Mar 20, 2026
5a07968
Increment version to 3.6.0-SNAPSHOT (#693)
opensearch-trigger-bot[bot] Mar 24, 2026
d9e2e8b
fix(deps): update dependency org.apache.spark:spark-common-utils_2.13…
opensearch-trigger-bot[bot] Apr 1, 2026
18ec663
[AUTO] Add release notes for 3.6.0 (#719)
opensearch-ci-bot Apr 4, 2026
770da34
Incremented version to 3.6.1
opensearch-ci-bot Apr 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
needs: Get-CI-Image-Tag
strategy:
matrix:
java: [21, 24]
java: [21, 25]
name: Build and Test skills plugin on Linux
runs-on: ubuntu-latest
container:
Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:
build-MacOS:
strategy:
matrix:
java: [21, 24]
java: [21, 25]

name: Build and Test skills Plugin on MacOS
needs: Get-CI-Image-Tag
Expand All @@ -77,7 +77,7 @@ jobs:
build-windows:
strategy:
matrix:
java: [21, 24]
java: [21, 25]
name: Build and Test skills plugin on Windows
needs: Get-CI-Image-Tag
runs-on: windows-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/delete_backport_branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
permissions:
contents: write
if: startsWith(github.event.pull_request.head.ref,'backport/')
if: startsWith(github.event.pull_request.head.ref,'backport/') || startsWith(github.event.pull_request.head.ref,'release-chores/')
steps:
- name: Delete merged branch
uses: actions/github-script@v7
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,14 @@ jobs:
export-env: true
env:
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
SONATYPE_USERNAME: op://opensearch-infra-secrets/maven-central-portal-credentials/username
SONATYPE_PASSWORD: op://opensearch-infra-secrets/maven-central-portal-credentials/password
MAVEN_SNAPSHOTS_S3_REPO: op://opensearch-infra-secrets/maven-snapshots-s3/repo
MAVEN_SNAPSHOTS_S3_ROLE: op://opensearch-infra-secrets/maven-snapshots-s3/role

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v5
with:
role-to-assume: ${{ env.MAVEN_SNAPSHOTS_S3_ROLE }}
aws-region: us-east-1

- name: publish snapshots to maven
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
integ-test-with-security-linux:
strategy:
matrix:
java: [21, 24]
java: [21, 25]
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
name: Run Security Integration Tests on Linux
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ out/
.settings
.vscode
bin/
.factorypath
47 changes: 27 additions & 20 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import com.github.jengelman.gradle.plugins.shadow.ShadowPlugin
buildscript {
ext {
opensearch_group = "org.opensearch"
opensearch_version = System.getProperty("opensearch.version", "3.2.0-SNAPSHOT")
opensearch_version = System.getProperty("opensearch.version", "3.6.1-SNAPSHOT")
buildVersionQualifier = System.getProperty("build.version_qualifier", "")
isSnapshot = "true" == System.getProperty("build.snapshot", "true")
version_tokens = opensearch_version.tokenize('-')
Expand All @@ -31,8 +31,7 @@ buildscript {

repositories {
mavenLocal()
maven { url "https://central.sonatype.com/repository/maven-snapshots/" }
maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" }
maven { url "https://ci.opensearch.org/ci/dbc/snapshots/maven/" }
maven { url "https://plugins.gradle.org/m2/" }
mavenCentral()
}
Expand All @@ -57,8 +56,7 @@ repositories {
mavenLocal()
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
maven { url "https://central.sonatype.com/repository/maven-snapshots/" }
maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" }
maven { url "https://ci.opensearch.org/ci/dbc/snapshots/maven/" }
}

allprojects {
Expand Down Expand Up @@ -138,28 +136,36 @@ dependencies {
compileOnly "org.apache.logging.log4j:log4j-slf4j-impl:2.23.1"
compileOnly group: 'org.json', name: 'json', version: '20240303'
compileOnly("com.google.guava:guava:33.2.1-jre")
compileOnly group: 'org.apache.commons', name: 'commons-lang3', version: '3.16.0'
compileOnly group: 'org.apache.commons', name: 'commons-lang3', version: "${versions.commonslang}"
compileOnly group: 'org.apache.commons', name: 'commons-text', version: '1.12.0'
compileOnly("com.fasterxml.jackson.core:jackson-annotations:${versions.jackson}")
compileOnly group: 'org.apache.commons', name: 'commons-math3', version: '3.6.1'
compileOnly("com.fasterxml.jackson.core:jackson-annotations:${versions.jackson_annotations}")
compileOnly("com.fasterxml.jackson.core:jackson-databind:${versions.jackson_databind}")
compileOnly(group: 'org.apache.httpcomponents.core5', name: 'httpcore5', version: "${versions.httpcore5}")
compileOnly(group: 'org.apache.httpcomponents.client5', name: 'httpclient5', version: "${versions.httpclient5}")
compileOnly ('com.jayway.jsonpath:json-path:2.9.0') {
exclude group: 'net.minidev', module: 'json-smart'
}
compileOnly (group: 'software.amazon.awssdk', name: 'netty-nio-client', version: "${versions.aws}") {
exclude(group: 'org.reactivestreams', module: 'reactive-streams')
exclude(group: 'org.slf4j', module: 'slf4j-api')
}
compileOnly(group: 'software.amazon.awssdk', name: 'http-client-spi', version: "${versions.aws}")
compileOnly(group: 'software.amazon.awssdk', name: 'utils', version: "${versions.aws}")
compileOnly(group: 'software.amazon.awssdk', name: 'sdk-core', version: "${versions.aws}")

spark 'org.apache.spark:spark-sql-api_2.13:3.5.4'
spark ('org.apache.spark:spark-core_2.13:3.5.4') {
spark 'org.apache.spark:spark-sql-api_2.13:3.5.8'
spark ('org.apache.spark:spark-core_2.13:3.5.8') {
exclude group: 'org.eclipse.jetty', module: 'jetty-server'
}
spark group: 'org.apache.spark', name: 'spark-common-utils_2.13', version: '3.5.4'
spark group: 'org.apache.spark', name: 'spark-common-utils_2.13', version: '3.5.8'

implementation 'org.scala-lang:scala-library:2.13.9'
implementation group: 'org.antlr', name: 'antlr4-runtime', version: '4.9.3'
implementation("org.json4s:json4s-ast_2.13:3.7.0-M11")
implementation("org.json4s:json4s-core_2.13:3.7.0-M11")
implementation("org.json4s:json4s-jackson_2.13:3.7.0-M11")
implementation 'com.fasterxml.jackson.module:jackson-module-scala_3:2.18.2'
implementation "com.fasterxml.jackson.module:jackson-module-scala_3:${versions.jackson}"
implementation group: 'org.scala-lang', name: 'scala3-library_3', version: '3.7.0-RC1-bin-20250119-bd699fc-NIGHTLY'
implementation("com.thoughtworks.paranamer:paranamer:2.8")
implementation("org.jsoup:jsoup:1.19.1")
Expand All @@ -169,7 +175,7 @@ dependencies {
compileOnly group: 'org.opensearch', name:'opensearch-ml-spi', version: "${opensearch_build}"
compileOnly fileTree(dir: jsJarDirectory, include: ["opensearch-job-scheduler-${opensearch_build}.jar"])
implementation fileTree(dir: adJarDirectory, include: ["opensearch-anomaly-detection-${opensearch_build}.jar"])
implementation fileTree(dir: sqlJarDirectory, include: ["opensearch-sql-thin-${opensearch_build}.jar", "ppl-${opensearch_build}.jar", "protocol-${opensearch_build}.jar"])
implementation fileTree(dir: sqlJarDirectory, include: ["opensearch-sql-thin-${opensearch_build}.jar", "ppl-${opensearch_build}.jar", "protocol-${opensearch_build}.jar", "core-${opensearch_build}.jar"])
implementation fileTree(dir: sparkDir, include: ["spark*.jar"])
compileOnly "org.opensearch:common-utils:${opensearch_build}"
compileOnly "org.jetbrains.kotlin:kotlin-stdlib:${kotlin_version}"
Expand All @@ -193,7 +199,7 @@ dependencies {
testImplementation group: 'org.json', name: 'json', version: '20240303'
testImplementation group: 'org.mockito', name: 'mockito-core', version: '5.14.2'
testImplementation group: 'org.mockito', name: 'mockito-inline', version: '5.2.0'
testImplementation("net.bytebuddy:byte-buddy:1.17.5")
testImplementation("net.bytebuddy:byte-buddy:1.17.7")
testImplementation("net.bytebuddy:byte-buddy-agent:1.17.5")
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.11.2'
testImplementation 'org.mockito:mockito-junit-jupiter:5.14.2'
Expand All @@ -211,9 +217,9 @@ task addSparkJar(type: Copy) {
into sparkDir

doLast {
def jarA = file("$sparkDir/spark-sql-api_2.13-3.5.4.jar")
def jarB = file("$sparkDir/spark-core_2.13-3.5.4.jar")
def jarC = file("$sparkDir/spark-common-utils_2.13-3.5.4.jar")
def jarA = file("$sparkDir/spark-sql-api_2.13-3.5.8.jar")
def jarB = file("$sparkDir/spark-core_2.13-3.5.8.jar")
def jarC = file("$sparkDir/spark-common-utils_2.13-3.5.8.jar")

// 3a. Extract jar A to manipulate it
def jarAContents = file("$buildDir/tmp/JarAContents")
Expand Down Expand Up @@ -440,10 +446,11 @@ publishing {
repositories {
maven {
name = "Snapshots"
url = "https://central.sonatype.com/repository/maven-snapshots/"
credentials {
username "$System.env.SONATYPE_USERNAME"
password "$System.env.SONATYPE_PASSWORD"
url = System.getenv("MAVEN_SNAPSHOTS_S3_REPO")
credentials(AwsCredentials) {
accessKey = System.getenv("AWS_ACCESS_KEY_ID")
secretKey = System.getenv("AWS_SECRET_ACCESS_KEY")
sessionToken = System.getenv("AWS_SESSION_TOKEN")
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=efe9a3d147d948d7528a9887fa35abcf24ca1a43ad06439996490f77569b02d1
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-all.zip
distributionSha256Sum=16f2b95838c1ddcf7242b1c39e7bbbb43c842f1f1a1a0dc4959b6d4d68abcac3
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.0-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
19 changes: 7 additions & 12 deletions release-notes/opensearch-skills.release-notes-3.2.0.0.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
## Version 3.2.0 Release Notes
## Version 3.2.0.0 Release Notes

Compatible with OpenSearch and OpenSearch Dashboards version 3.2.0

### Features
* Support dynamic tool in agent framework ([#606](https://github.com/opensearch-project/skills/pull/606))
Compatible with OpenSearch and OpenSearch Dashboards version 3.2.0.0

### Enhancements
* Merge index schema meta ([#596](https://github.com/opensearch-project/skills/pull/596))

### Bug Fixes
* Fix attributes handling in dynamic tool ([#607](https://github.com/opensearch-project/skills/pull/607))
* Mask error message in PPLTool ([#609](https://github.com/opensearch-project/skills/pull/609))

### Infrastructure
* Update the maven snapshot publish endpoint and credential ([#601](https://github.com/opensearch-project/skills/pull/601))
* Gradle and Lombok bump, changing CI java to 24 and adjusting AD getConfigRequest ([#615](https://github.com/opensearch-project/skills/pull/615))
### Bug Fixes
* Update parameter handling of tools ([#618](https://github.com/opensearch-project/skills/pull/618))

### Maintenance
* [AUTO] Increment version to 3.2.0-SNAPSHOT ([#605](https://github.com/opensearch-project/skills/pull/605))
* Update the maven snapshot publish endpoint and credential ([#601](https://github.com/opensearch-project/skills/pull/601))
* Bump gradle, java, lombok and fix ad configrequest change ([#615](https://github.com/opensearch-project/skills/pull/615))
* Bump version to 3.2.0.0 ([#605](https://github.com/opensearch-project/skills/pull/605))
20 changes: 20 additions & 0 deletions release-notes/opensearch-skills.release-notes-3.3.0.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
## Version 3.3.0 Release Notes

Compatible with OpenSearch and OpenSearch Dashboards version 3.3.0

### Features
* Log patterns analysis tool ([#625](https://github.com/opensearch-project/skills/pull/625))
* Data Distribution Tool ([#634](https://github.com/opensearch-project/skills/pull/634))

### Enhancements
* Add more information in ppl tool when passing to sagemaker ([#636](https://github.com/opensearch-project/skills/pull/636))

### Bug Fixes
* Delete-single-baseline ([#641](https://github.com/opensearch-project/skills/pull/641))
* Fix WebSearchTool issue ([#639](https://github.com/opensearch-project/skills/pull/639))

### Infrastructure
* Update System.env syntax for Gradle 9 compatibility ([#630](https://github.com/opensearch-project/skills/pull/630))

### Maintenance
* Increment version to 3.3.0-SNAPSHOT ([#626](https://github.com/opensearch-project/skills/pull/626))
6 changes: 6 additions & 0 deletions release-notes/opensearch-skills.release-notes-3.3.2.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
## Version 3.3.2 Release Notes

Compatible with OpenSearch 3.3.2 and OpenSearch Dashboards 3.3.0

### Bug Fixes
* Fix regex bypass issue ([#656](https://github.com/opensearch-project/skills/pull/656))
17 changes: 17 additions & 0 deletions release-notes/opensearch-skills.release-notes-3.6.0.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
## Version 3.6.0 Release Notes

Compatible with OpenSearch and OpenSearch Dashboards version 3.6.0

### Features

* Add SearchAroundTool to search N documents around a given document ([#702](https://github.com/opensearch-project/skills/pull/702))
* Add MetricChangeAnalysisTool for detecting and analyzing metric changes via percentile comparison between baseline and selection periods ([#698](https://github.com/opensearch-project/skills/pull/698))

### Enhancements

* Add filter support for LogPatternAnalysisTool to enable log pattern analysis for specific services ([#707](https://github.com/opensearch-project/skills/pull/707))
* Update default tool descriptions for LogPatternAnalysisTool and DataDistributionTool to improve clarity for LLM usage ([#703](https://github.com/opensearch-project/skills/pull/703))

### Maintenance

* Update Apache Spark dependencies (spark-common-utils_2.13) from 3.5.4 to 3.5.8 ([#713](https://github.com/opensearch-project/skills/pull/713))
22 changes: 13 additions & 9 deletions src/main/java/org/opensearch/agent/ToolPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,17 @@

import org.opensearch.agent.tools.CreateAlertTool;
import org.opensearch.agent.tools.CreateAnomalyDetectorTool;
import org.opensearch.agent.tools.DynamicTool;
import org.opensearch.agent.tools.DataDistributionTool;
import org.opensearch.agent.tools.LogPatternAnalysisTool;
import org.opensearch.agent.tools.LogPatternTool;
import org.opensearch.agent.tools.MetricChangeAnalysisTool;
import org.opensearch.agent.tools.NeuralSparseSearchTool;
import org.opensearch.agent.tools.PPLTool;
import org.opensearch.agent.tools.RAGTool;
import org.opensearch.agent.tools.SearchAlertsTool;
import org.opensearch.agent.tools.SearchAnomalyDetectorsTool;
import org.opensearch.agent.tools.SearchAnomalyResultsTool;
import org.opensearch.agent.tools.SearchAroundDocumentTool;
import org.opensearch.agent.tools.SearchMonitorsTool;
import org.opensearch.agent.tools.VectorDBTool;
import org.opensearch.agent.tools.WebSearchTool;
Expand All @@ -41,8 +44,6 @@
import org.opensearch.plugins.ActionPlugin;
import org.opensearch.plugins.Plugin;
import org.opensearch.repositories.RepositoriesService;
import org.opensearch.rest.DynamicRestRequestCreator;
import org.opensearch.rest.DynamicToolExecutor;
import org.opensearch.rest.RestController;
import org.opensearch.rest.RestHandler;
import org.opensearch.script.ScriptService;
Expand All @@ -52,8 +53,6 @@
import org.opensearch.transport.client.Client;
import org.opensearch.watcher.ResourceWatcherService;

import com.google.common.collect.ImmutableList;

import lombok.SneakyThrows;

public class ToolPlugin extends Plugin implements MLCommonsExtension, ActionPlugin {
Expand Down Expand Up @@ -103,8 +102,10 @@ public Collection<Object> createComponents(
CreateAnomalyDetectorTool.Factory.getInstance().init(client);
LogPatternTool.Factory.getInstance().init(client, xContentRegistry);
WebSearchTool.Factory.getInstance().init(threadPool);
DynamicToolExecutor toolExecutor = new DynamicToolExecutor(restControllerRef, client);
DynamicTool.Factory.getInstance().init(client, toolExecutor, new DynamicRestRequestCreator(), xContentRegistry);
LogPatternAnalysisTool.Factory.getInstance().init(client);
DataDistributionTool.Factory.getInstance().init(client);
SearchAroundDocumentTool.Factory.getInstance().init(client, xContentRegistry);
MetricChangeAnalysisTool.Factory.getInstance().init(client);
return Collections.emptyList();
}

Expand All @@ -124,7 +125,10 @@ public List<Tool.Factory<? extends Tool>> getToolFactories() {
CreateAnomalyDetectorTool.Factory.getInstance(),
LogPatternTool.Factory.getInstance(),
WebSearchTool.Factory.getInstance(),
DynamicTool.Factory.getInstance()
LogPatternAnalysisTool.Factory.getInstance(),
DataDistributionTool.Factory.getInstance(),
SearchAroundDocumentTool.Factory.getInstance(),
MetricChangeAnalysisTool.Factory.getInstance()
);
}

Expand All @@ -139,7 +143,7 @@ public List<ExecutorBuilder<?>> getExecutorBuilders(Settings settings) {
false
);

return ImmutableList.of(websearchCrawlThread);
return List.of(websearchCrawlThread);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.opensearch.core.xcontent.NamedXContentRegistry;
import org.opensearch.core.xcontent.XContentParser;
import org.opensearch.ml.common.spi.tools.Tool;
import org.opensearch.ml.common.utils.ToolUtils;
import org.opensearch.search.SearchHit;
import org.opensearch.search.builder.SearchSourceBuilder;
import org.opensearch.transport.client.Client;
Expand Down Expand Up @@ -94,7 +95,8 @@ protected <T> SearchRequest buildSearchRequest(Map<String, String> parameters) t
}

@Override
public <T> void run(Map<String, String> parameters, ActionListener<T> listener) {
public <T> void run(Map<String, String> originalParameters, ActionListener<T> listener) {
Map<String, String> parameters = ToolUtils.extractInputParameters(originalParameters, attributes);
SearchRequest searchRequest;
try {
searchRequest = buildSearchRequest(parameters);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import org.opensearch.ml.common.transport.prediction.MLPredictionTaskAction;
import org.opensearch.ml.common.transport.prediction.MLPredictionTaskRequest;
import org.opensearch.ml.common.utils.StringUtils;
import org.opensearch.ml.common.utils.ToolUtils;
import org.opensearch.transport.client.Client;

import com.google.gson.reflect.TypeToken;
Expand Down Expand Up @@ -133,7 +134,8 @@ public boolean validate(Map<String, String> parameters) {
}

@Override
public <T> void run(Map<String, String> parameters, ActionListener<T> listener) {
public <T> void run(Map<String, String> originalParameters, ActionListener<T> listener) {
Map<String, String> parameters = ToolUtils.extractInputParameters(originalParameters, attributes);
Map<String, String> tmpParams = new HashMap<>(parameters);
if (!tmpParams.containsKey("indices") || Strings.isEmpty(tmpParams.get("indices"))) {
throw new IllegalArgumentException(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import org.opensearch.ml.common.spi.tools.WithModelTool;
import org.opensearch.ml.common.transport.prediction.MLPredictionTaskAction;
import org.opensearch.ml.common.transport.prediction.MLPredictionTaskRequest;
import org.opensearch.ml.common.utils.ToolUtils;
import org.opensearch.transport.client.Client;

import com.google.common.collect.ImmutableMap;
Expand Down Expand Up @@ -169,6 +170,7 @@ public CreateAnomalyDetectorTool(Client client, String modelId, String modelType
*/
@Override
public <T> void run(Map<String, String> parameters, ActionListener<T> listener) {
parameters = ToolUtils.extractInputParameters(parameters, attributes);
final String tenantId = parameters.get(TENANT_ID_FIELD);
Map<String, String> enrichedParameters = enrichParameters(parameters);
String indexName = enrichedParameters.get("index");
Expand Down
Loading
Loading