Skip to content

Commit bd26998

Browse files
committed
Formatting changes
1 parent b8d51c7 commit bd26998

File tree

6 files changed

+28
-22
lines changed

6 files changed

+28
-22
lines changed

common/src/main/java/org/opensearch/ml/common/transport/connector/MLCreateConnectorInput.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@
3131
import org.opensearch.ml.common.CommonValue;
3232
import org.opensearch.ml.common.connector.ConnectorAction;
3333
import org.opensearch.ml.common.connector.ConnectorClientConfig;
34+
import org.opensearch.ml.common.connector.ConnectorProtocols;
3435

3536
import lombok.Builder;
3637
import lombok.Data;
3738
import lombok.Setter;
38-
import org.opensearch.ml.common.connector.ConnectorProtocols;
3939

4040
@Data
4141
public class MLCreateConnectorInput implements ToXContentObject, Writeable {

common/src/test/java/org/opensearch/ml/common/agent/MLAgentTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ public void fromStream() throws IOException {
354354
@Test
355355
public void constructor_InvalidAgentType() {
356356
exceptionRule.expect(IllegalArgumentException.class);
357-
exceptionRule.expectMessage("Invalid Agent Type, Please use one of "+ Arrays.toString(MLAgentType.values()));
357+
exceptionRule.expectMessage("Invalid Agent Type, Please use one of " + Arrays.toString(MLAgentType.values()));
358358

359359
new MLAgent(
360360
"test_name",

common/src/test/java/org/opensearch/ml/common/transport/connector/MLCreateConnectorInputTests.java

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -172,20 +172,23 @@ public void constructorMLCreateConnectorInput_NullProtocol() {
172172
public void constructorMLCreateConnectorInput_InvalidProtocol() {
173173
Throwable exception = assertThrows(IllegalArgumentException.class, () -> {
174174
MLCreateConnectorInput
175-
.builder()
176-
.name(TEST_CONNECTOR_NAME)
177-
.description(TEST_CONNECTOR_DESCRIPTION)
178-
.version(TEST_CONNECTOR_VERSION)
179-
.protocol("dummy")
180-
.parameters(Map.of(TEST_PARAM_KEY, TEST_PARAM_VALUE))
181-
.credential(Map.of(TEST_CREDENTIAL_KEY, TEST_CREDENTIAL_VALUE))
182-
.actions(List.of())
183-
.access(AccessMode.PUBLIC)
184-
.backendRoles(Arrays.asList(TEST_ROLE1, TEST_ROLE2))
185-
.addAllBackendRoles(false)
186-
.build();
175+
.builder()
176+
.name(TEST_CONNECTOR_NAME)
177+
.description(TEST_CONNECTOR_DESCRIPTION)
178+
.version(TEST_CONNECTOR_VERSION)
179+
.protocol("dummy")
180+
.parameters(Map.of(TEST_PARAM_KEY, TEST_PARAM_VALUE))
181+
.credential(Map.of(TEST_CREDENTIAL_KEY, TEST_CREDENTIAL_VALUE))
182+
.actions(List.of())
183+
.access(AccessMode.PUBLIC)
184+
.backendRoles(Arrays.asList(TEST_ROLE1, TEST_ROLE2))
185+
.addAllBackendRoles(false)
186+
.build();
187187
});
188-
assertEquals( "Unsupported connector protocol. Please use one of " + Arrays.toString(VALID_PROTOCOLS.toArray(new String[0])), exception.getMessage());
188+
assertEquals(
189+
"Unsupported connector protocol. Please use one of " + Arrays.toString(VALID_PROTOCOLS.toArray(new String[0])),
190+
exception.getMessage()
191+
);
189192
}
190193

191194
@Test

ml-algorithms/src/main/java/org/opensearch/ml/engine/algorithms/agent/AgentUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -993,7 +993,7 @@ public static List<String> getToolNames(Map<String, Tool> tools) {
993993

994994
public static Tool createTool(Map<String, Tool.Factory> toolFactories, Map<String, String> executeParams, MLToolSpec toolSpec) {
995995
if (!toolFactories.containsKey(toolSpec.getType())) {
996-
throw new IllegalArgumentException("Tool type not found" );
996+
throw new IllegalArgumentException("Tool type not found");
997997
}
998998
Map<String, Object> toolParams = new HashMap<>();
999999
toolParams.putAll(executeParams);

ml-algorithms/src/main/java/org/opensearch/ml/engine/algorithms/agent/MLAgentExecutor.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -649,8 +649,7 @@ protected MLAgentRunner getAgentRunner(MLAgent mlAgent) {
649649
encryptor
650650
);
651651
default:
652-
throw new IllegalArgumentException("Unsupported agent type. Please use one of " +
653-
Arrays.toString(MLAgentType.values()));
652+
throw new IllegalArgumentException("Unsupported agent type. Please use one of " + Arrays.toString(MLAgentType.values()));
654653
}
655654
}
656655

ml-algorithms/src/main/java/org/opensearch/ml/engine/function_calling/FunctionCallingFactory.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,14 @@ public static FunctionCalling create(String llmInterface) {
2828
return new BedrockConverseDeepseekR1FunctionCalling();
2929
default:
3030
throw new IllegalArgumentException(
31-
String.format("Invalid _llm_interface. Supported values are %s,%s,%s",
32-
LLM_INTERFACE_BEDROCK_CONVERSE_CLAUDE,
33-
LLM_INTERFACE_OPENAI_V1_CHAT_COMPLETIONS,
34-
LLM_INTERFACE_BEDROCK_CONVERSE_DEEPSEEK_R1));
31+
String
32+
.format(
33+
"Invalid _llm_interface. Supported values are %s,%s,%s",
34+
LLM_INTERFACE_BEDROCK_CONVERSE_CLAUDE,
35+
LLM_INTERFACE_OPENAI_V1_CHAT_COMPLETIONS,
36+
LLM_INTERFACE_BEDROCK_CONVERSE_DEEPSEEK_R1
37+
)
38+
);
3539
}
3640
}
3741
}

0 commit comments

Comments
 (0)