This is an automated email from the ASF dual-hosted git repository. aldettinger pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
The following commit(s) were added to refs/heads/main by this push: new de68f20725 Fix camel annotated parameters that were not usable as template variable #6543 (#6558) de68f20725 is described below commit de68f20725927cf15442cc695e7bf854b3d2afb1 Author: Alexandre Gallice <aldettin...@gmail.com> AuthorDate: Thu Sep 26 21:36:11 2024 +0200 Fix camel annotated parameters that were not usable as template variable #6543 (#6558) --- .../component/langchain/chat/deployment/LangChain4jProcessor.java | 6 ++++++ .../camel/quarkus/component/langchain4jit/LangChain4jTest.java | 2 -- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/extensions/langchain4j/deployment/src/main/java/org/apache/camel/quarkus/component/langchain/chat/deployment/LangChain4jProcessor.java b/extensions/langchain4j/deployment/src/main/java/org/apache/camel/quarkus/component/langchain/chat/deployment/LangChain4jProcessor.java index fc7e0954bc..9709abdf52 100644 --- a/extensions/langchain4j/deployment/src/main/java/org/apache/camel/quarkus/component/langchain/chat/deployment/LangChain4jProcessor.java +++ b/extensions/langchain4j/deployment/src/main/java/org/apache/camel/quarkus/component/langchain/chat/deployment/LangChain4jProcessor.java @@ -16,6 +16,7 @@ */ package org.apache.camel.quarkus.component.langchain.chat.deployment; +import io.quarkiverse.langchain4j.deployment.items.MethodParameterAllowedAnnotationsBuildItem; import io.quarkus.deployment.annotations.BuildStep; import io.quarkus.deployment.builditem.FeatureBuildItem; @@ -26,4 +27,9 @@ class LangChain4jProcessor { FeatureBuildItem feature() { return new FeatureBuildItem(FEATURE); } + + @BuildStep + MethodParameterAllowedAnnotationsBuildItem camelAnnotatedParametersCouldBeUsedAsTemplateVariable() { + return new MethodParameterAllowedAnnotationsBuildItem(anno -> anno.name().toString().startsWith("org.apache.camel")); + }; } diff --git a/integration-tests/langchain4j/src/test/java/org/apache/camel/quarkus/component/langchain4jit/LangChain4jTest.java b/integration-tests/langchain4j/src/test/java/org/apache/camel/quarkus/component/langchain4jit/LangChain4jTest.java index d12b47ac26..26d5642894 100644 --- a/integration-tests/langchain4j/src/test/java/org/apache/camel/quarkus/component/langchain4jit/LangChain4jTest.java +++ b/integration-tests/langchain4j/src/test/java/org/apache/camel/quarkus/component/langchain4jit/LangChain4jTest.java @@ -18,7 +18,6 @@ package org.apache.camel.quarkus.component.langchain4jit; import io.quarkus.test.junit.QuarkusTest; import io.restassured.RestAssured; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import static org.hamcrest.Matchers.is; @@ -27,7 +26,6 @@ import static org.hamcrest.Matchers.is; class LangChain4jTest { @Test - @Disabled("https://github.com/apache/camel-quarkus/issues/6543") void camelAnnotationsShouldWorkAsExpected() { RestAssured.given() .body("{\"included\": \"included-content\", \"ignored\": \"ignored-content\"}")