davsclaus commented on code in PR #25368:
URL: https://github.com/apache/camel/pull/25368#discussion_r3726025889
##########
catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/jbang/camel-jbang-configuration-metadata.json:
##########
@@ -35,6 +35,7 @@
{ "name": "camel.jbang.maven-settings", "required": false, "description":
"Optional location of Maven settings.xml file to configure servers,
repositories, mirrors, and proxies. If set to false, not even the default
\/.m2\/settings.xml will be used.", "label": "maven", "type": "string",
"javaType": "String", "secret": false },
{ "name": "camel.jbang.maven-settings-security", "required": false,
"description": "Optional location of Maven settings-security.xml file to
decrypt Maven Settings (settings.xml) file", "label": "maven", "type":
"string", "javaType": "String", "secret": false },
{ "name": "camel.jbang.mavenWrapper", "required": false, "description":
"Include Maven Wrapper files in the exported project", "type": "boolean",
"javaType": "boolean", "defaultValue": true, "secret": false },
+ { "name": "camel.jbang.mcp", "required": false, "description": "Embed
dev\/diagnostics MCP tools on the local HTTP management server (\/mcp by
default)", "type": "boolean", "javaType": "boolean", "defaultValue": false,
"secret": false, "security": "insecure:dev" },
Review Comment:
This `camel.jbang.mcp` entry has no backing source code in the jbang modules
and is unrelated to the ai-tool argSchema feature. Please revert this file to
its state on `main`.
##########
components/camel-ai/camel-langchain4j-agent/src/test/java/org/apache/camel/component/langchain4j/agent/AiToolSpecToLangChain4jTest.java:
##########
@@ -160,6 +160,45 @@ void testMultipleParametersWithMixedTypes() {
assertEquals(1, result.parameters().required().size());
}
+ @Test
+ void testRawArgSchemaConversion() {
+ String schema = """
+ {
+ "type": "object",
+ "properties": {
+ "customer": {
+ "type": "object",
+ "properties": {
+ "id": { "type": "string" }
+ },
+ "required": ["id"]
+ },
+ "items": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "sku": { "type": "string" },
+ "qty": { "type": "integer" }
+ }
+ }
+ }
+ },
+ "required": ["customer", "items"]
+ }
+ """;
+
+ AiToolSpec spec = new AiToolSpec("createOrder", "Create order",
Map.of(), schema, null);
+ ToolSpecification result =
AiToolSpecToLangChain4j.toToolSpecification(spec);
+
+ assertNotNull(result.parameters());
+ assertEquals(2, result.parameters().properties().size());
+ assertTrue(result.parameters().properties().containsKey("customer"));
Review Comment:
Non-blocking: this test uses JUnit assertions (`assertNotNull`,
`assertEquals`, `assertTrue`) while the other new tests in this PR properly use
AssertJ. Per project conventions, new test code should prefer AssertJ
(`assertThat(...)`) and should not mix styles within the same method.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]