diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/langchain4j-chat.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/langchain4j-chat.json index 19edad3ec67b9..3fcef48c03fd3 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/langchain4j-chat.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/langchain4j-chat.json @@ -38,13 +38,10 @@ "properties": { "chatId": { "index": 0, "kind": "path", "displayName": "Chat Id", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The id" }, "chatOperation": { "index": 1, "kind": "parameter", "displayName": "Chat Operation", "group": "common", "label": "", "required": true, "type": "object", "javaType": "org.apache.camel.component.langchain4j.chat.LangChain4jChatOperations", "enum": [ "CHAT_SINGLE_MESSAGE", "CHAT_SINGLE_MESSAGE_WITH_PROMPT", "CHAT_MULTIPLE_MESSAGES" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": "CHAT_SINGLE_MESSAGE", "configurationClass": "org.apache.camel.component.langchain4j.chat.LangChain4jChatConfiguration", "configurationField": "configuration", "description": "Operation in case of Endpoint of type CHAT. The value is one of the values of org.apache.camel.component.langchain4j.chat.LangChain4jChatOperations" }, - "description": { "index": 2, "kind": "parameter", "displayName": "Description", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Tool description" }, - "parameters": { "index": 3, "kind": "parameter", "displayName": "Parameters", "group": "consumer", "label": "consumer", "required": false, "type": "object", "javaType": "java.util.Map", "enum": [ "string", "integer", "number", "object", "array", "boolean", "null" ], "prefix": "parameter.", "multiValue": true, "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "List of Tool parameters in the form of parameter.=" }, - "bridgeErrorHandler": { "index": 4, "kind": "parameter", "displayName": "Bridge Error Handler", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored." }, - "camelToolParameter": { "index": 5, "kind": "parameter", "displayName": "Camel Tool Parameter", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.langchain4j.chat.tool.CamelSimpleToolParameter", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Tool's Camel Parameters, programmatically define Tool description and parameters" }, - "exceptionHandler": { "index": 6, "kind": "parameter", "displayName": "Exception Handler", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.ExceptionHandler", "optionalPrefix": "consumer.", "deprecated": false, "autowired": false, "secret": false, "description": "To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored." }, - "exchangePattern": { "index": 7, "kind": "parameter", "displayName": "Exchange Pattern", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.ExchangePattern", "enum": [ "InOnly", "InOut" ], "deprecated": false, "autowired": false, "secret": false, "description": "Sets the exchange pattern when the consumer creates an exchange." }, - "lazyStartProducer": { "index": 8, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing." }, - "chatModel": { "index": 9, "kind": "parameter", "displayName": "Chat Model", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "dev.langchain4j.model.chat.ChatLanguageModel", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.langchain4j.chat.LangChain4jChatConfiguration", "configurationField": "configuration", "description": "Chat Language Model of type dev.langchain4j.model.chat.ChatLanguageModel" } + "bridgeErrorHandler": { "index": 2, "kind": "parameter", "displayName": "Bridge Error Handler", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored." }, + "exceptionHandler": { "index": 3, "kind": "parameter", "displayName": "Exception Handler", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.ExceptionHandler", "optionalPrefix": "consumer.", "deprecated": false, "autowired": false, "secret": false, "description": "To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored." }, + "exchangePattern": { "index": 4, "kind": "parameter", "displayName": "Exchange Pattern", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.ExchangePattern", "enum": [ "InOnly", "InOut" ], "deprecated": false, "autowired": false, "secret": false, "description": "Sets the exchange pattern when the consumer creates an exchange." }, + "lazyStartProducer": { "index": 5, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing." }, + "chatModel": { "index": 6, "kind": "parameter", "displayName": "Chat Model", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "dev.langchain4j.model.chat.ChatLanguageModel", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.langchain4j.chat.LangChain4jChatConfiguration", "configurationField": "configuration", "description": "Chat Language Model of type dev.langchain4j.model.chat.ChatLanguageModel" } } } diff --git a/components/camel-ai/camel-langchain4j-chat/src/generated/java/org/apache/camel/component/langchain4j/chat/LangChain4jChatEndpointConfigurer.java b/components/camel-ai/camel-langchain4j-chat/src/generated/java/org/apache/camel/component/langchain4j/chat/LangChain4jChatEndpointConfigurer.java index 6eb9dc47c2fb6..3cd66b4d8d0c7 100644 --- a/components/camel-ai/camel-langchain4j-chat/src/generated/java/org/apache/camel/component/langchain4j/chat/LangChain4jChatEndpointConfigurer.java +++ b/components/camel-ai/camel-langchain4j-chat/src/generated/java/org/apache/camel/component/langchain4j/chat/LangChain4jChatEndpointConfigurer.java @@ -25,20 +25,16 @@ public boolean configure(CamelContext camelContext, Object obj, String name, Obj switch (ignoreCase ? name.toLowerCase() : name) { case "bridgeerrorhandler": case "bridgeErrorHandler": target.setBridgeErrorHandler(property(camelContext, boolean.class, value)); return true; - case "cameltoolparameter": - case "camelToolParameter": target.setCamelToolParameter(property(camelContext, org.apache.camel.component.langchain4j.chat.tool.CamelSimpleToolParameter.class, value)); return true; case "chatmodel": case "chatModel": target.getConfiguration().setChatModel(property(camelContext, dev.langchain4j.model.chat.ChatLanguageModel.class, value)); return true; case "chatoperation": case "chatOperation": target.getConfiguration().setChatOperation(property(camelContext, org.apache.camel.component.langchain4j.chat.LangChain4jChatOperations.class, value)); return true; - case "description": target.setDescription(property(camelContext, java.lang.String.class, value)); return true; case "exceptionhandler": case "exceptionHandler": target.setExceptionHandler(property(camelContext, org.apache.camel.spi.ExceptionHandler.class, value)); return true; case "exchangepattern": case "exchangePattern": target.setExchangePattern(property(camelContext, org.apache.camel.ExchangePattern.class, value)); return true; case "lazystartproducer": case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true; - case "parameters": target.setParameters(property(camelContext, java.util.Map.class, value)); return true; default: return false; } } @@ -53,20 +49,16 @@ public Class getOptionType(String name, boolean ignoreCase) { switch (ignoreCase ? name.toLowerCase() : name) { case "bridgeerrorhandler": case "bridgeErrorHandler": return boolean.class; - case "cameltoolparameter": - case "camelToolParameter": return org.apache.camel.component.langchain4j.chat.tool.CamelSimpleToolParameter.class; case "chatmodel": case "chatModel": return dev.langchain4j.model.chat.ChatLanguageModel.class; case "chatoperation": case "chatOperation": return org.apache.camel.component.langchain4j.chat.LangChain4jChatOperations.class; - case "description": return java.lang.String.class; case "exceptionhandler": case "exceptionHandler": return org.apache.camel.spi.ExceptionHandler.class; case "exchangepattern": case "exchangePattern": return org.apache.camel.ExchangePattern.class; case "lazystartproducer": case "lazyStartProducer": return boolean.class; - case "parameters": return java.util.Map.class; default: return null; } } @@ -77,28 +69,16 @@ public Object getOptionValue(Object obj, String name, boolean ignoreCase) { switch (ignoreCase ? name.toLowerCase() : name) { case "bridgeerrorhandler": case "bridgeErrorHandler": return target.isBridgeErrorHandler(); - case "cameltoolparameter": - case "camelToolParameter": return target.getCamelToolParameter(); case "chatmodel": case "chatModel": return target.getConfiguration().getChatModel(); case "chatoperation": case "chatOperation": return target.getConfiguration().getChatOperation(); - case "description": return target.getDescription(); case "exceptionhandler": case "exceptionHandler": return target.getExceptionHandler(); case "exchangepattern": case "exchangePattern": return target.getExchangePattern(); case "lazystartproducer": case "lazyStartProducer": return target.isLazyStartProducer(); - case "parameters": return target.getParameters(); - default: return null; - } - } - - @Override - public Object getCollectionValueType(Object target, String name, boolean ignoreCase) { - switch (ignoreCase ? name.toLowerCase() : name) { - case "parameters": return java.lang.String.class; default: return null; } } diff --git a/components/camel-ai/camel-langchain4j-chat/src/generated/java/org/apache/camel/component/langchain4j/chat/LangChain4jChatEndpointUriFactory.java b/components/camel-ai/camel-langchain4j-chat/src/generated/java/org/apache/camel/component/langchain4j/chat/LangChain4jChatEndpointUriFactory.java index 23e12af9774a2..08e5e261398f2 100644 --- a/components/camel-ai/camel-langchain4j-chat/src/generated/java/org/apache/camel/component/langchain4j/chat/LangChain4jChatEndpointUriFactory.java +++ b/components/camel-ai/camel-langchain4j-chat/src/generated/java/org/apache/camel/component/langchain4j/chat/LangChain4jChatEndpointUriFactory.java @@ -23,22 +23,17 @@ public class LangChain4jChatEndpointUriFactory extends org.apache.camel.support. private static final Set SECRET_PROPERTY_NAMES; private static final Set MULTI_VALUE_PREFIXES; static { - Set props = new HashSet<>(10); + Set props = new HashSet<>(7); props.add("bridgeErrorHandler"); - props.add("camelToolParameter"); props.add("chatId"); props.add("chatModel"); props.add("chatOperation"); - props.add("description"); props.add("exceptionHandler"); props.add("exchangePattern"); props.add("lazyStartProducer"); - props.add("parameters"); PROPERTY_NAMES = Collections.unmodifiableSet(props); SECRET_PROPERTY_NAMES = Collections.emptySet(); - Set prefixes = new HashSet<>(1); - prefixes.add("parameter."); - MULTI_VALUE_PREFIXES = Collections.unmodifiableSet(prefixes); + MULTI_VALUE_PREFIXES = Collections.emptySet(); } @Override diff --git a/components/camel-ai/camel-langchain4j-chat/src/generated/resources/META-INF/org/apache/camel/component/langchain4j/chat/langchain4j-chat.json b/components/camel-ai/camel-langchain4j-chat/src/generated/resources/META-INF/org/apache/camel/component/langchain4j/chat/langchain4j-chat.json index 19edad3ec67b9..3fcef48c03fd3 100644 --- a/components/camel-ai/camel-langchain4j-chat/src/generated/resources/META-INF/org/apache/camel/component/langchain4j/chat/langchain4j-chat.json +++ b/components/camel-ai/camel-langchain4j-chat/src/generated/resources/META-INF/org/apache/camel/component/langchain4j/chat/langchain4j-chat.json @@ -38,13 +38,10 @@ "properties": { "chatId": { "index": 0, "kind": "path", "displayName": "Chat Id", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The id" }, "chatOperation": { "index": 1, "kind": "parameter", "displayName": "Chat Operation", "group": "common", "label": "", "required": true, "type": "object", "javaType": "org.apache.camel.component.langchain4j.chat.LangChain4jChatOperations", "enum": [ "CHAT_SINGLE_MESSAGE", "CHAT_SINGLE_MESSAGE_WITH_PROMPT", "CHAT_MULTIPLE_MESSAGES" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": "CHAT_SINGLE_MESSAGE", "configurationClass": "org.apache.camel.component.langchain4j.chat.LangChain4jChatConfiguration", "configurationField": "configuration", "description": "Operation in case of Endpoint of type CHAT. The value is one of the values of org.apache.camel.component.langchain4j.chat.LangChain4jChatOperations" }, - "description": { "index": 2, "kind": "parameter", "displayName": "Description", "group": "consumer", "label": "consumer", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Tool description" }, - "parameters": { "index": 3, "kind": "parameter", "displayName": "Parameters", "group": "consumer", "label": "consumer", "required": false, "type": "object", "javaType": "java.util.Map", "enum": [ "string", "integer", "number", "object", "array", "boolean", "null" ], "prefix": "parameter.", "multiValue": true, "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "List of Tool parameters in the form of parameter.=" }, - "bridgeErrorHandler": { "index": 4, "kind": "parameter", "displayName": "Bridge Error Handler", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored." }, - "camelToolParameter": { "index": 5, "kind": "parameter", "displayName": "Camel Tool Parameter", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.langchain4j.chat.tool.CamelSimpleToolParameter", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "Tool's Camel Parameters, programmatically define Tool description and parameters" }, - "exceptionHandler": { "index": 6, "kind": "parameter", "displayName": "Exception Handler", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.ExceptionHandler", "optionalPrefix": "consumer.", "deprecated": false, "autowired": false, "secret": false, "description": "To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored." }, - "exchangePattern": { "index": 7, "kind": "parameter", "displayName": "Exchange Pattern", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.ExchangePattern", "enum": [ "InOnly", "InOut" ], "deprecated": false, "autowired": false, "secret": false, "description": "Sets the exchange pattern when the consumer creates an exchange." }, - "lazyStartProducer": { "index": 8, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing." }, - "chatModel": { "index": 9, "kind": "parameter", "displayName": "Chat Model", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "dev.langchain4j.model.chat.ChatLanguageModel", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.langchain4j.chat.LangChain4jChatConfiguration", "configurationField": "configuration", "description": "Chat Language Model of type dev.langchain4j.model.chat.ChatLanguageModel" } + "bridgeErrorHandler": { "index": 2, "kind": "parameter", "displayName": "Bridge Error Handler", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored." }, + "exceptionHandler": { "index": 3, "kind": "parameter", "displayName": "Exception Handler", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.ExceptionHandler", "optionalPrefix": "consumer.", "deprecated": false, "autowired": false, "secret": false, "description": "To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored." }, + "exchangePattern": { "index": 4, "kind": "parameter", "displayName": "Exchange Pattern", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.ExchangePattern", "enum": [ "InOnly", "InOut" ], "deprecated": false, "autowired": false, "secret": false, "description": "Sets the exchange pattern when the consumer creates an exchange." }, + "lazyStartProducer": { "index": 5, "kind": "parameter", "displayName": "Lazy Start Producer", "group": "producer (advanced)", "label": "producer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing." }, + "chatModel": { "index": 6, "kind": "parameter", "displayName": "Chat Model", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "dev.langchain4j.model.chat.ChatLanguageModel", "deprecated": false, "deprecationNote": "", "autowired": true, "secret": false, "configurationClass": "org.apache.camel.component.langchain4j.chat.LangChain4jChatConfiguration", "configurationField": "configuration", "description": "Chat Language Model of type dev.langchain4j.model.chat.ChatLanguageModel" } } } diff --git a/components/camel-ai/camel-langchain4j-chat/src/main/java/org/apache/camel/component/langchain4j/chat/LangChain4jChatComponent.java b/components/camel-ai/camel-langchain4j-chat/src/main/java/org/apache/camel/component/langchain4j/chat/LangChain4jChatComponent.java index 08412be9e1b02..0ceab358b7606 100644 --- a/components/camel-ai/camel-langchain4j-chat/src/main/java/org/apache/camel/component/langchain4j/chat/LangChain4jChatComponent.java +++ b/components/camel-ai/camel-langchain4j-chat/src/main/java/org/apache/camel/component/langchain4j/chat/LangChain4jChatComponent.java @@ -17,14 +17,12 @@ package org.apache.camel.component.langchain4j.chat; import java.util.Map; -import java.util.stream.Collectors; import org.apache.camel.CamelContext; import org.apache.camel.Endpoint; import org.apache.camel.spi.Metadata; import org.apache.camel.spi.annotations.Component; import org.apache.camel.support.DefaultComponent; -import org.apache.camel.util.PropertiesHelper; import static org.apache.camel.component.langchain4j.chat.LangChain4jChat.SCHEME; @@ -60,11 +58,7 @@ protected Endpoint createEndpoint(String uri, String remaining, Map toolParameters = PropertiesHelper.extractProperties(parameters, "parameter."); Endpoint endpoint = new LangChain4jChatEndpoint(uri, this, remaining, langchain4jChatConfiguration); - ((LangChain4jChatEndpoint) endpoint).setParameters(toolParameters.entrySet().stream() - .collect(Collectors.toMap(Map.Entry::getKey, e -> (String) e.getValue()))); - setProperties(endpoint, parameters); return endpoint; } diff --git a/components/camel-ai/camel-langchain4j-chat/src/main/java/org/apache/camel/component/langchain4j/chat/LangChain4jChatEndpoint.java b/components/camel-ai/camel-langchain4j-chat/src/main/java/org/apache/camel/component/langchain4j/chat/LangChain4jChatEndpoint.java index 4d57d9434de91..06b710884ad50 100644 --- a/components/camel-ai/camel-langchain4j-chat/src/main/java/org/apache/camel/component/langchain4j/chat/LangChain4jChatEndpoint.java +++ b/components/camel-ai/camel-langchain4j-chat/src/main/java/org/apache/camel/component/langchain4j/chat/LangChain4jChatEndpoint.java @@ -16,25 +16,15 @@ */ package org.apache.camel.component.langchain4j.chat; -import java.util.Map; -import java.util.UUID; - -import dev.langchain4j.agent.tool.JsonSchemaProperty; -import dev.langchain4j.agent.tool.ToolSpecification; import org.apache.camel.Category; import org.apache.camel.Consumer; import org.apache.camel.Processor; import org.apache.camel.Producer; -import org.apache.camel.component.langchain4j.chat.tool.CamelSimpleToolParameter; -import org.apache.camel.component.langchain4j.chat.tool.CamelToolExecutorCache; -import org.apache.camel.component.langchain4j.chat.tool.CamelToolSpecification; -import org.apache.camel.component.langchain4j.chat.tool.NamedJsonSchemaProperty; import org.apache.camel.spi.Metadata; import org.apache.camel.spi.UriEndpoint; import org.apache.camel.spi.UriParam; import org.apache.camel.spi.UriPath; import org.apache.camel.support.DefaultEndpoint; -import org.apache.camel.util.StringHelper; import static org.apache.camel.component.langchain4j.chat.LangChain4jChat.SCHEME; @@ -51,19 +41,6 @@ public class LangChain4jChatEndpoint extends DefaultEndpoint { @UriParam private LangChain4jChatConfiguration configuration; - @Metadata(label = "consumer") - @UriParam(description = "Tool description") - private String description; - - @Metadata(label = "consumer") - @UriParam(description = "List of Tool parameters in the form of parameter.=", prefix = "parameter.", - multiValue = true, enums = "string,integer,number,object,array,boolean,null") - private Map parameters; - - @Metadata(label = "consumer,advanced") - @UriParam(description = "Tool's Camel Parameters, programmatically define Tool description and parameters") - private CamelSimpleToolParameter camelToolParameter; - public LangChain4jChatEndpoint(String uri, LangChain4jChatComponent component, String chatId, LangChain4jChatConfiguration configuration) { super(uri, component); @@ -78,44 +55,7 @@ public Producer createProducer() throws Exception { @Override public Consumer createConsumer(Processor processor) throws Exception { - ToolSpecification.Builder toolSpecificationBuilder = ToolSpecification.builder(); - toolSpecificationBuilder.name(UUID.randomUUID().toString()); - if (camelToolParameter != null) { - toolSpecificationBuilder.description(camelToolParameter.getDescription()); - - for (NamedJsonSchemaProperty namedJsonSchemaProperty : camelToolParameter.getProperties()) { - toolSpecificationBuilder.addParameter(namedJsonSchemaProperty.getName(), - namedJsonSchemaProperty.getProperties()); - } - } else if (description != null) { - toolSpecificationBuilder.description(description); - - if (parameters != null) { - parameters.forEach((name, type) -> toolSpecificationBuilder.addParameter(name, JsonSchemaProperty.type(type))); - } - } else { - // Consumer without toolParameter or description - throw new IllegalArgumentException( - "In order to use the langchain4j component as a consumer, you need to specify at least description, or a camelToolParameter"); - } - - String simpleDescription = null; - if (description != null) { - simpleDescription = StringHelper.dashToCamelCase(description.replace(" ", "-")); - } - - ToolSpecification toolSpecification = toolSpecificationBuilder - .name(simpleDescription) - .build(); - - final LangChain4jChatConsumer langChain4jChatConsumer = new LangChain4jChatConsumer(this, processor); - configureConsumer(langChain4jChatConsumer); - - CamelToolSpecification camelToolSpecification - = new CamelToolSpecification(toolSpecification, langChain4jChatConsumer); - CamelToolExecutorCache.getInstance().put(chatId, camelToolSpecification); - - return camelToolSpecification.getConsumer(); + throw new UnsupportedOperationException("Consumer not supported"); } /** @@ -131,34 +71,8 @@ public LangChain4jChatConfiguration getConfiguration() { return configuration; } - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public Map getParameters() { - return parameters; - } - - public void setParameters(Map parameters) { - this.parameters = parameters; - } - - public CamelSimpleToolParameter getCamelToolParameter() { - return camelToolParameter; - } - - public void setCamelToolParameter(CamelSimpleToolParameter camelToolParameter) { - this.camelToolParameter = camelToolParameter; - } - @Override protected void doStop() throws Exception { super.doStop(); - - CamelToolExecutorCache.getInstance().getTools().clear(); } } diff --git a/components/camel-ai/camel-langchain4j-chat/src/main/java/org/apache/camel/component/langchain4j/chat/LangChain4jChatProducer.java b/components/camel-ai/camel-langchain4j-chat/src/main/java/org/apache/camel/component/langchain4j/chat/LangChain4jChatProducer.java index b7cc1c7d58196..7b1a990b44d96 100644 --- a/components/camel-ai/camel-langchain4j-chat/src/main/java/org/apache/camel/component/langchain4j/chat/LangChain4jChatProducer.java +++ b/components/camel-ai/camel-langchain4j-chat/src/main/java/org/apache/camel/component/langchain4j/chat/LangChain4jChatProducer.java @@ -18,16 +18,10 @@ import java.util.List; import java.util.Map; -import java.util.Set; -import java.util.stream.Collectors; -import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; -import dev.langchain4j.agent.tool.ToolExecutionRequest; -import dev.langchain4j.agent.tool.ToolSpecification; import dev.langchain4j.data.message.AiMessage; import dev.langchain4j.data.message.ChatMessage; -import dev.langchain4j.data.message.ToolExecutionResultMessage; import dev.langchain4j.data.message.UserMessage; import dev.langchain4j.model.chat.ChatLanguageModel; import dev.langchain4j.model.input.Prompt; @@ -39,8 +33,6 @@ import org.apache.camel.Exchange; import org.apache.camel.InvalidPayloadException; import org.apache.camel.NoSuchHeaderException; -import org.apache.camel.component.langchain4j.chat.tool.CamelToolExecutorCache; -import org.apache.camel.component.langchain4j.chat.tool.CamelToolSpecification; import org.apache.camel.support.DefaultProducer; import org.apache.camel.util.ObjectHelper; @@ -171,52 +163,7 @@ private String sendListChatMessage(List chatMessages, Exchange exch } - final Map> tools = CamelToolExecutorCache.getInstance().getTools(); - if (tools.containsKey(langChain4jChatEndpoint.getChatId())) { - final Set camelToolSpecificationSet = tools - .get(langChain4jChatEndpoint.getChatId()); - - final List toolSpecifications = camelToolSpecificationSet.stream() - .map(camelToolSpecification -> camelToolSpecification.getToolSpecification()) - .collect(Collectors.toList()); - - response = this.chatLanguageModel.generate(chatMessages, toolSpecifications); - } else { - response = this.chatLanguageModel.generate(chatMessages); - } - - if (response.content().hasToolExecutionRequests()) { - chatMessages.add(response.content()); - - for (ToolExecutionRequest toolExecutionRequest : response.content().toolExecutionRequests()) { - String toolName = toolExecutionRequest.name(); - CamelToolSpecification camelToolSpecification = CamelToolExecutorCache.getInstance().getTools() - .get(langChain4jChatEndpoint.getChatId()).stream() - .filter(cts -> cts.getToolSpecification().name().equals(toolName)) - .findFirst().orElseThrow(() -> new RuntimeException("Tool " + toolName + " not found")); - try { - // Map Json to Header - JsonNode jsonNode = objectMapper.readValue(toolExecutionRequest.arguments(), JsonNode.class); - - jsonNode.fieldNames() - .forEachRemaining(name -> exchange.getMessage().setHeader(name, jsonNode.get(name))); - - // Execute the consumer route - camelToolSpecification.getConsumer().getProcessor().process(exchange); - } catch (Exception e) { - // How to handle this exception? - exchange.setException(e); - } - - chatMessages.add(new ToolExecutionResultMessage( - toolExecutionRequest.id(), - toolExecutionRequest.name(), - exchange.getIn().getBody(String.class))); - } - - response = this.chatLanguageModel.generate(chatMessages); - } - + response = this.chatLanguageModel.generate(chatMessages); return extractAiResponse(response); } diff --git a/components/camel-ai/camel-langchain4j-chat/src/main/java/org/apache/camel/component/langchain4j/chat/tool/CamelSimpleToolParameter.java b/components/camel-ai/camel-langchain4j-chat/src/main/java/org/apache/camel/component/langchain4j/chat/tool/CamelSimpleToolParameter.java deleted file mode 100644 index 9d83d1d1fa624..0000000000000 --- a/components/camel-ai/camel-langchain4j-chat/src/main/java/org/apache/camel/component/langchain4j/chat/tool/CamelSimpleToolParameter.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.component.langchain4j.chat.tool; - -import java.util.List; - -/** - * langchain4j Simple Tool parameter implementation, this class can be used to provide multiple properties/input - * parameters to the tool itself, the NamedJsonSchemaProperty can be then found as headers into the consumer route - */ -@Deprecated(since = "4.8.0") -public class CamelSimpleToolParameter { - - private final String description; - private final List properties; - - public CamelSimpleToolParameter(String description, List properties) { - this.description = description; - this.properties = properties; - } - - public List getProperties() { - return properties; - } - - public String getDescription() { - return description; - } -} diff --git a/components/camel-ai/camel-langchain4j-chat/src/main/java/org/apache/camel/component/langchain4j/chat/tool/CamelToolExecutorCache.java b/components/camel-ai/camel-langchain4j-chat/src/main/java/org/apache/camel/component/langchain4j/chat/tool/CamelToolExecutorCache.java deleted file mode 100644 index 17dcb918ad1de..0000000000000 --- a/components/camel-ai/camel-langchain4j-chat/src/main/java/org/apache/camel/component/langchain4j/chat/tool/CamelToolExecutorCache.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.component.langchain4j.chat.tool; - -import java.util.LinkedHashSet; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.ConcurrentHashMap; - -/** - * Caches Tools Specification and Consumer route reference by the chatId, so that different chats can have different - * Tool implementation - */ -@Deprecated(since = "4.8.0") -public final class CamelToolExecutorCache { - - private Map> tools; - - private CamelToolExecutorCache() { - tools = new ConcurrentHashMap<>(); - } - - private static final class SingletonHolder { - private static final CamelToolExecutorCache INSTANCE = new CamelToolExecutorCache(); - } - - public static CamelToolExecutorCache getInstance() { - return SingletonHolder.INSTANCE; - } - - public void put(String chatId, CamelToolSpecification specification) { - if (tools.get(chatId) != null) { - tools.get(chatId).add(specification); - } else { - Set camelToolSpecifications = new LinkedHashSet<>(); - camelToolSpecifications.add(specification); - tools.put(chatId, camelToolSpecifications); - } - } - - public Map> getTools() { - return tools; - } - -} diff --git a/components/camel-ai/camel-langchain4j-chat/src/main/java/org/apache/camel/component/langchain4j/chat/tool/CamelToolSpecification.java b/components/camel-ai/camel-langchain4j-chat/src/main/java/org/apache/camel/component/langchain4j/chat/tool/CamelToolSpecification.java deleted file mode 100644 index 5a5ff039e2fcc..0000000000000 --- a/components/camel-ai/camel-langchain4j-chat/src/main/java/org/apache/camel/component/langchain4j/chat/tool/CamelToolSpecification.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.component.langchain4j.chat.tool; - -import java.util.Objects; - -import dev.langchain4j.agent.tool.ToolSpecification; -import org.apache.camel.component.langchain4j.chat.LangChain4jChatConsumer; - -/** - * Holds ToolSpecification needed by langchain4j and the associated Camel Consumer. In this way, a specific route can be - * invoked by a specific Tool - */ -@Deprecated(since = "4.8.0") -public class CamelToolSpecification { - - private ToolSpecification toolSpecification; - private LangChain4jChatConsumer consumer; - - public CamelToolSpecification(ToolSpecification toolSpecification, LangChain4jChatConsumer consumer) { - this.toolSpecification = toolSpecification; - this.consumer = consumer; - } - - public ToolSpecification getToolSpecification() { - return toolSpecification; - } - - public void setToolSpecification(ToolSpecification toolSpecification) { - this.toolSpecification = toolSpecification; - } - - public LangChain4jChatConsumer getConsumer() { - return consumer; - } - - public void setConsumer(LangChain4jChatConsumer consumer) { - this.consumer = consumer; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CamelToolSpecification that = (CamelToolSpecification) o; - return Objects.equals(toolSpecification, that.toolSpecification) && Objects.equals(consumer, - that.consumer); - } - - @Override - public int hashCode() { - return Objects.hash(toolSpecification, consumer); - } - - @Override - public String toString() { - return "CamelToolSpecification{" + - "toolSpecification=" + toolSpecification + - ", consumer=" + consumer + - '}'; - } -} diff --git a/components/camel-ai/camel-langchain4j-chat/src/main/java/org/apache/camel/component/langchain4j/chat/tool/NamedJsonSchemaProperty.java b/components/camel-ai/camel-langchain4j-chat/src/main/java/org/apache/camel/component/langchain4j/chat/tool/NamedJsonSchemaProperty.java deleted file mode 100644 index 050d2553f0a77..0000000000000 --- a/components/camel-ai/camel-langchain4j-chat/src/main/java/org/apache/camel/component/langchain4j/chat/tool/NamedJsonSchemaProperty.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.component.langchain4j.chat.tool; - -import java.util.List; - -import dev.langchain4j.agent.tool.JsonSchemaProperty; - -@Deprecated(since = "4.8.0") -public class NamedJsonSchemaProperty { - - private final String name; - private final List properties; - - public NamedJsonSchemaProperty(String name, List properties) { - this.name = name; - this.properties = properties; - } - - public String getName() { - return name; - } - - public List getProperties() { - return properties; - } -} diff --git a/components/camel-ai/camel-langchain4j-chat/src/test/java/org/apache/camel/component/langchain4j.chat/LangChain4jConsumerIT.java b/components/camel-ai/camel-langchain4j-chat/src/test/java/org/apache/camel/component/langchain4j.chat/LangChain4jConsumerIT.java deleted file mode 100644 index aa8748b88907e..0000000000000 --- a/components/camel-ai/camel-langchain4j-chat/src/test/java/org/apache/camel/component/langchain4j.chat/LangChain4jConsumerIT.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.component.langchain4j.chat; - -import java.util.ArrayList; -import java.util.List; - -import dev.langchain4j.agent.tool.JsonSchemaProperty; -import dev.langchain4j.data.message.ChatMessage; -import dev.langchain4j.data.message.SystemMessage; -import dev.langchain4j.data.message.UserMessage; -import dev.langchain4j.model.chat.ChatLanguageModel; -import dev.langchain4j.model.openai.OpenAiChatModel; -import org.apache.camel.CamelContext; -import org.apache.camel.Exchange; -import org.apache.camel.builder.RouteBuilder; -import org.apache.camel.component.langchain4j.chat.tool.CamelSimpleToolParameter; -import org.apache.camel.component.langchain4j.chat.tool.NamedJsonSchemaProperty; -import org.apache.camel.test.infra.ollama.services.OllamaService; -import org.apache.camel.test.infra.ollama.services.OllamaServiceFactory; -import org.apache.camel.test.junit5.CamelTestSupport; -import org.assertj.core.api.Assertions; -import org.junit.jupiter.api.RepeatedTest; -import org.junit.jupiter.api.condition.DisabledIfSystemProperty; -import org.junit.jupiter.api.extension.RegisterExtension; - -import static java.time.Duration.ofSeconds; - -@DisabledIfSystemProperty(named = "ci.env.name", matches = ".*", disabledReason = "Requires too much network resources") -public class LangChain4jConsumerIT extends CamelTestSupport { - - public static final String MODEL_NAME = "llama3.1:latest"; - private final String nameFromDB = "pippo"; - private ChatLanguageModel chatLanguageModel; - - @RegisterExtension - static OllamaService OLLAMA = OllamaServiceFactory.createServiceWithConfiguration(() -> MODEL_NAME); - - @Override - protected void setupResources() throws Exception { - super.setupResources(); - - chatLanguageModel = createModel(); - } - - @Override - protected CamelContext createCamelContext() throws Exception { - CamelContext context = super.createCamelContext(); - - LangChain4jChatComponent component - = context.getComponent(LangChain4jChat.SCHEME, LangChain4jChatComponent.class); - - component.getConfiguration().setChatModel(chatLanguageModel); - - return context; - } - - protected ChatLanguageModel createModel() { - chatLanguageModel = OpenAiChatModel.builder() - .apiKey("NO_API_KEY") - .modelName(MODEL_NAME) - .baseUrl(OLLAMA.getEndpoint()) - .temperature(0.0) - .timeout(ofSeconds(60)) - .logRequests(true) - .logResponses(true) - .build(); - - return chatLanguageModel; - } - - @Override - protected RouteBuilder createRouteBuilder() { - return new RouteBuilder() { - public void configure() { - - NamedJsonSchemaProperty namedJsonSchemaProperty - = new NamedJsonSchemaProperty("name", List.of(JsonSchemaProperty.STRING)); - CamelSimpleToolParameter camelToolParameter = new CamelSimpleToolParameter( - "This is a tool description", - List.of(namedJsonSchemaProperty)); - context().getRegistry().bind("parameters", camelToolParameter); - - from("direct:test") - .to("langchain4j-chat:test1?chatOperation=CHAT_MULTIPLE_MESSAGES") - .log("response is: ${body}"); - - from("langchain4j-chat:test1?description=Query user database by number¶meter.number=integer") - .setBody(simple("{\"name\": \"pippo\"}")); - - from("langchain4j-chat:test1?camelToolParameter=#parameters") - .setBody(constant("Hello World")); - } - }; - } - - @RepeatedTest(10) - public void testSimpleInvocation() { - List messages = new ArrayList<>(); - messages.add(new SystemMessage( - """ - You provide the requested information using the functions you hava available. You can invoke the functions to obtain the information you need to complete the answer. - """)); - messages.add(new UserMessage(""" - What is the name of the user 1? - """)); - - Exchange message = fluentTemplate.to("direct:test").withBody(messages).request(Exchange.class); - - Assertions.assertThat(message).isNotNull(); - final String responseContent = message.getMessage().getBody().toString(); - Assertions.assertThat(responseContent).containsIgnoringCase(nameFromDB); - } -} diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/LangChain4jChatEndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/LangChain4jChatEndpointBuilderFactory.java index 9bbc202d01796..a7d7e5d2bd49d 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/LangChain4jChatEndpointBuilderFactory.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/LangChain4jChatEndpointBuilderFactory.java @@ -81,57 +81,6 @@ default LangChain4jChatEndpointConsumerBuilder chatOperation(String chatOperatio doSetProperty("chatOperation", chatOperation); return this; } - /** - * Tool description. - * - * The option is a: java.lang.String type. - * - * Group: consumer - * - * @param description the value to set - * @return the dsl builder - */ - default LangChain4jChatEndpointConsumerBuilder description(String description) { - doSetProperty("description", description); - return this; - } - /** - * List of Tool parameters in the form of parameter.=. - * - * The option is a: java.util.Map<java.lang.String, - * java.lang.String> type. - * The option is multivalued, and you can use the parameters(String, - * Object) method to add a value (call the method multiple times to set - * more values). - * - * Group: consumer - * - * @param key the option key - * @param value the option value - * @return the dsl builder - */ - default LangChain4jChatEndpointConsumerBuilder parameters(String key, Object value) { - doSetMultiValueProperty("parameters", "parameter." + key, value); - return this; - } - /** - * List of Tool parameters in the form of parameter.=. - * - * The option is a: java.util.Map<java.lang.String, - * java.lang.String> type. - * The option is multivalued, and you can use the parameters(String, - * Object) method to add a value (call the method multiple times to set - * more values). - * - * Group: consumer - * - * @param values the values - * @return the dsl builder - */ - default LangChain4jChatEndpointConsumerBuilder parameters(Map values) { - doSetMultiValueProperties("parameters", "parameter.", values); - return this; - } } /** @@ -195,38 +144,6 @@ default AdvancedLangChain4jChatEndpointConsumerBuilder bridgeErrorHandler(String doSetProperty("bridgeErrorHandler", bridgeErrorHandler); return this; } - /** - * Tool's Camel Parameters, programmatically define Tool description and - * parameters. - * - * The option is a: - * org.apache.camel.component.langchain4j.chat.tool.CamelSimpleToolParameter type. - * - * Group: consumer (advanced) - * - * @param camelToolParameter the value to set - * @return the dsl builder - */ - default AdvancedLangChain4jChatEndpointConsumerBuilder camelToolParameter(org.apache.camel.component.langchain4j.chat.tool.CamelSimpleToolParameter camelToolParameter) { - doSetProperty("camelToolParameter", camelToolParameter); - return this; - } - /** - * Tool's Camel Parameters, programmatically define Tool description and - * parameters. - * - * The option will be converted to a - * org.apache.camel.component.langchain4j.chat.tool.CamelSimpleToolParameter type. - * - * Group: consumer (advanced) - * - * @param camelToolParameter the value to set - * @return the dsl builder - */ - default AdvancedLangChain4jChatEndpointConsumerBuilder camelToolParameter(String camelToolParameter) { - doSetProperty("camelToolParameter", camelToolParameter); - return this; - } /** * To let the consumer use a custom ExceptionHandler. Notice if the * option bridgeErrorHandler is enabled then this option is not in use.