jamesnetherton commented on code in PR #8946:
URL: https://github.com/apache/camel-quarkus/pull/8946#discussion_r3813094701
##########
extensions-support/langchain4j/runtime/pom.xml:
##########
@@ -70,6 +70,11 @@
<artifactId>nativeimage</artifactId>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>io.quarkiverse.langchain4j</groupId>
+ <artifactId>quarkus-langchain4j-core</artifactId>
+ <optional>true</optional>
+ </dependency>
Review Comment:
Can be removed because it's already declared.
##########
extensions-support/langchain4j/deployment/pom.xml:
##########
@@ -52,6 +52,11 @@
<artifactId>quarkus-junit-internal</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>io.quarkiverse.langchain4j</groupId>
+ <artifactId>quarkus-langchain4j-core-deployment</artifactId>
+ <optional>true</optional>
+ </dependency>
Review Comment:
`<optional>true</optional>` can't work here.
If you run a test where QL4J is not present like `langchain4j-agent`, then
you get:
```
ClassNotFoundException:
io.quarkiverse.langchain4j.deployment.ExcludeFromImpliedAiServiceBuildItem
```
The only way around it is to make the dependency non-optional. But then
you'd need to also make the runtime dependency also non-optional. That'd mean
the QL4J is always on the runtime classpath whether you want it or not.
##########
extensions-support/langchain4j/pom.xml:
##########
@@ -30,6 +30,18 @@
<name>Camel Quarkus :: Support :: Langchain4j</name>
<packaging>pom</packaging>
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>io.quarkiverse.langchain4j</groupId>
+ <artifactId>quarkus-langchain4j-bom</artifactId>
+ <version>${quarkiverse-langchain4j.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
Review Comment:
This is probably to get the `quarkus-langchain4j-core-deployment` artifact.
We could remove this BOM import and just add the dependency into the CQ bom
like we did for the core runtime dependency.
##########
extensions-support/langchain4j/deployment/src/main/java/org/apache/camel/quarkus/component/support/langchain4j/deployment/SupportQuarkusLangchain4jProcessor.java:
##########
@@ -253,6 +254,16 @@ void configureCamelAiToolTags(
.build());
}
+ @BuildStep
+ void excludeCamelAgentInterfacesFromImpliedRegistration(
+ CombinedIndexBuildItem combinedIndex,
+ BuildProducer<ExcludeFromImpliedAiServiceBuildItem>
excludedFromImplied) {
+ String agentWithoutMemory =
"org.apache.camel.component.langchain4j.agent.api.AiAgentWithoutMemoryService";
Review Comment:
Maybe we'd also want to include `AiAgentWithMemoryService`. Not sure what
the consequences would be.
--
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]