Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change version to 3.0 on main branch #18

Merged
merged 4 commits into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
19 changes: 13 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
buildscript {
ext {
opensearch_group = "org.opensearch"
opensearch_version = System.getProperty("opensearch.version", "2.11.0-SNAPSHOT")
opensearch_version = System.getProperty("opensearch.version", "3.0.0-SNAPSHOT")
isSnapshot = "true" == System.getProperty("build.snapshot", "true")
buildVersionQualifier = System.getProperty("build.version_qualifier", "")
}
Expand All @@ -26,7 +26,11 @@ buildscript {
plugins {
id 'java-library'
id 'com.diffplug.spotless' version '6.23.0'
id "io.freefair.lombok" version "8.0.1"
id "io.freefair.lombok" version "8.4"
}

lombok {
version = "1.18.30"
}

repositories {
Expand Down Expand Up @@ -82,6 +86,12 @@ task addJarsToClasspath(type: Copy) {
dependencies {
compileOnly group: 'org.opensearch', name:'opensearch-ml-client', version: "${version}"
compileOnly group: 'com.google.code.gson', name: 'gson', version: '2.10.1'
compileOnly "org.apache.logging.log4j:log4j-slf4j-impl:2.19.0"
compileOnly group: 'org.json', name: 'json', version: '20231013'
zipArchive group: 'org.opensearch.plugin', name:'opensearch-sql-plugin', version: "${version}"
implementation("com.google.guava:guava:32.0.1-jre")
implementation fileTree(dir: sqlJarDirectory, include: ["opensearch-sql-${version}.jar", "ppl-${version}.jar", "protocol-${version}.jar"])
compileOnly "org.opensearch:common-utils:${version}"
testImplementation "org.opensearch.test:framework:${opensearch_version}"
testImplementation "org.mockito:mockito-core:3.10.0"
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.2'
Expand All @@ -90,10 +100,6 @@ dependencies {
testImplementation "com.cronutils:cron-utils:9.1.6"
testImplementation "commons-validator:commons-validator:1.7"
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.2'
compileOnly "org.apache.logging.log4j:log4j-slf4j-impl:2.19.0"
compileOnly group: 'org.json', name: 'json', version: '20231013'
zipArchive group: 'org.opensearch.plugin', name:'opensearch-sql-plugin', version: "${version}"
implementation fileTree(dir: sqlJarDirectory, include: ["opensearch-sql-${version}.jar", "ppl-${version}.jar", "protocol-${version}.jar"])
}

task extractSqlJar(type: Copy) {
Expand All @@ -110,6 +116,7 @@ tasks.validateNebulaPom.dependsOn ':generatePomFileForPluginZipPublication'
dependencyLicenses.enabled = false
loggerUsageCheck.enabled = false
testingConventions.enabled = false
thirdPartyAudit.enabled = false

test {
useJUnitPlatform()
Expand Down
11 changes: 5 additions & 6 deletions src/main/java/org/opensearch/agent/tools/PPLTool.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@
import org.opensearch.ml.common.transport.MLTaskResponse;
import org.opensearch.ml.common.transport.prediction.MLPredictionTaskAction;
import org.opensearch.ml.common.transport.prediction.MLPredictionTaskRequest;
import org.opensearch.ml.repackage.com.google.common.collect.ImmutableMap;
import org.opensearch.search.SearchHit;
import org.opensearch.search.builder.SearchSourceBuilder;
import org.opensearch.sql.plugin.transport.PPLQueryAction;
import org.opensearch.sql.plugin.transport.TransportPPLQueryRequest;
import org.opensearch.sql.plugin.transport.TransportPPLQueryResponse;
import org.opensearch.sql.ppl.domain.PPLQueryRequest;

import com.google.common.collect.ImmutableMap;
import com.google.gson.Gson;

import lombok.Getter;
Expand Down Expand Up @@ -108,7 +108,8 @@ public <T> void run(Map<String, String> parameters, ActionListener<T> listener)
.build();
ActionRequest request = new MLPredictionTaskRequest(
modelId,
MLInput.builder().algorithm(FunctionName.REMOTE).inputDataset(inputDataSet).build()
MLInput.builder().algorithm(FunctionName.REMOTE).inputDataset(inputDataSet).build(),
null
);
client.execute(MLPredictionTaskAction.INSTANCE, request, ActionListener.<MLTaskResponse>wrap(mlTaskResponse -> {
ModelTensorOutput modelTensorOutput = (ModelTensorOutput) mlTaskResponse.getOutput();
Expand Down Expand Up @@ -317,10 +318,8 @@ private static TransportPPLQueryResponse fromActionResponse(ActionResponse actio

}

private Map<String, String> extractFromChatParameters(Map<String, String> parameters)
{
if (parameters.containsKey("input"))
{
private Map<String, String> extractFromChatParameters(Map<String, String> parameters) {
if (parameters.containsKey("input")) {
try {
Map<String, String> chatParameters = gson.fromJson(parameters.get("input"), Map.class);
parameters.putAll(chatParameters);
Expand Down
Loading