zbendhiba commented on code in PR #8378: URL: https://github.com/apache/camel-quarkus/pull/8378#discussion_r2929817912
########## integration-tests-jvm/langchain4j-agent-ql4j/src/test/java/org/apache/camel/quarkus/component/langchain4j/agent/it/Langchain4jAgentQl4jTest.java: ########## @@ -0,0 +1,46 @@ +/* + * 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.quarkus.component.langchain4j.agent.it; + +import io.quarkus.test.common.QuarkusTestResource; +import io.quarkus.test.junit.QuarkusTest; +import io.quarkus.test.junit.TestProfile; +import io.restassured.RestAssured; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; + +import static org.hamcrest.Matchers.*; + +@ExtendWith(Langchain4jTestWatcher.class) +@QuarkusTestResource(Langchain4jAgentTestResource.class) +@TestProfile(Langchain4jAgentQl4jProfile.class) +@QuarkusTest +@Disabled("https://github.com/apache/camel-quarkus/issues/8412") Review Comment: Do we plan on fixing this issue ? ########## integration-tests-jvm/langchain4j-agent-ql4j/README.adoc: ########## @@ -0,0 +1,34 @@ +== Limitations of Quarkus LangChain4j being on the classpath + + * Does not work in the native + * QL4J requires a different httpClient - `io.quarkiverse.langchain4j.jaxrsclient.JaxRsHttpClientBuilderFactory`. See processor and recorder for more information. + * Even if tests are using `AgentWithoutMemory`, QL4J creates agentWithMemory automatically + +[IMPORTANT] +If a `RetrievalAugmentor` with the default scope exists, QL4J detects it and applies it to the `AiAgent` (which should not have the `RetrievalAugmentor` at all). +The issue can be simulated on the test `simpleUserMessage` (see QL4J https://github.com/quarkiverse/quarkus-langchain4j/blob/8cae9528c12bd0dce143fe2f63daa1660bfcd018/core/runtime/src/main/java/io/quarkiverse/langchain4j/RegisterAiService.java#L136[code]). +Fot that reason, the `RetrievalAugmentor` in `AgentProducer` is annotated via `@LookupUnlessProperty`, to disable lookup for the QL4J tests. Review Comment: ```suggestion For that reason, the `RetrievalAugmentor` in `AgentProducer` is annotated via `@LookupUnlessProperty`, to disable lookup for the QL4J tests. ``` ########## integration-tests-jvm/langchain4j-agent-ql4j/README.adoc: ########## @@ -0,0 +1,34 @@ +== Limitations of Quarkus LangChain4j being on the classpath + + * Does not work in the native + * QL4J requires a different httpClient - `io.quarkiverse.langchain4j.jaxrsclient.JaxRsHttpClientBuilderFactory`. See processor and recorder for more information. + * Even if tests are using `AgentWithoutMemory`, QL4J creates agentWithMemory automatically + +[IMPORTANT] +If a `RetrievalAugmentor` with the default scope exists, QL4J detects it and applies it to the `AiAgent` (which should not have the `RetrievalAugmentor` at all). +The issue can be simulated on the test `simpleUserMessage` (see QL4J https://github.com/quarkiverse/quarkus-langchain4j/blob/8cae9528c12bd0dce143fe2f63daa1660bfcd018/core/runtime/src/main/java/io/quarkiverse/langchain4j/RegisterAiService.java#L136[code]). +Fot that reason, the `RetrievalAugmentor` in `AgentProducer` is annotated via `@LookupUnlessProperty`, to disable lookup for the QL4J tests. +Camel-langchain4j works event if lookup is disabled! Review Comment: ```suggestion Camel-langchain4j works even if lookup is disabled! ``` -- 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]
