I have a small sample project where I have a simple poem AI Service like this
@RegisterAiService(retrievalAugmentor = NoRetrievalAugmentorSupplier::class, chatMemoryProviderSupplier = NoChatMemoryProviderSupplier::class)
@SystemMessage("You are a professional poet of the 18th century")
interface SimplePoemAiService {
@UserMessage("Write a poem about {topic}. The poem should be {lines} lines long.")
fun writeAPoem(topic: String, lines: Int): String
}
as soon as I add the easyrag extension, Quarkus crashes when I call the writeAPoem() method, while it works fine without easyrag. The exception is:
2024-05-29 10:54:00,412 ERROR [io.qua.ver.htt.run.QuarkusErrorHandler] (executor-thread-1) HTTP Request to /poem?topic=Quarkus%20and%20Kotlin%20are%20a%20match%20made%20in%20heaven&lines=8 failed, error id: f84fcc55-9d7e-40aa-891c-c953f78431bd-1: java.util.ServiceConfigurationError: io.quarkiverse.langchain4j.spi.DefaultMemoryIdProvider: Provider io.quarkiverse.langchain4j.websockets.next.runtime.WebSocketConnectionDefaultMemoryIdProvider not found
at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:593)
at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.nextProviderClass(ServiceLoader.java:1219)
at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService(ServiceLoader.java:1228)
at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNext(ServiceLoader.java:1273)
at java.base/java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1309)
at java.base/java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1393)
at java.base/java.util.Iterator.forEachRemaining(Iterator.java:132)
at dev.langchain4j.spi.ServiceHelper.loadAll(ServiceHelper.java:73)
at dev.langchain4j.spi.ServiceHelper.loadFactories(ServiceHelper.java:53)
at dev.langchain4j.spi.ServiceHelper.loadFactories(ServiceHelper.java:26)
at io.quarkiverse.langchain4j.runtime.aiservice.AiServiceMethodImplementationSupport.<clinit>(AiServiceMethodImplementationSupport.java:65)
at io.quarkiverse.langchain4j.runtime.aiservice.MethodImplementationSupportProducer.methodImplementationSupport(MethodImplementationSupportProducer.java:20)
at io.quarkiverse.langchain4j.runtime.aiservice.MethodImplementationSupportProducer_ProducerMethod_methodImplementationSupport_MimluGTOW4J_OymBP0vYo0MFSbY_Bean.doCreate(Unknown Source)
at io.quarkiverse.langchain4j.runtime.aiservice.MethodImplementationSupportProducer_ProducerMethod_methodImplementationSupport_MimluGTOW4J_OymBP0vYo0MFSbY_Bean.create(Unknown Source)
at io.quarkiverse.langchain4j.runtime.aiservice.MethodImplementationSupportProducer_ProducerMethod_methodImplementationSupport_MimluGTOW4J_OymBP0vYo0MFSbY_Bean.create(Unknown Source)
at io.quarkus.arc.impl.AbstractSharedContext.createInstanceHandle(AbstractSharedContext.java:119)
at io.quarkus.arc.impl.AbstractSharedContext$1.get(AbstractSharedContext.java:38)
at io.quarkus.arc.impl.AbstractSharedContext$1.get(AbstractSharedContext.java:35)
at io.quarkus.arc.impl.LazyValue.get(LazyValue.java:32)
at io.quarkus.arc.impl.ComputingCache.computeIfAbsent(ComputingCache.java:69)
at io.quarkus.arc.impl.ComputingCacheContextInstances.computeIfAbsent(ComputingCacheContextInstances.java:19)
at io.quarkus.arc.impl.AbstractSharedContext.get(AbstractSharedContext.java:35)
at io.quarkiverse.langchain4j.runtime.aiservice.MethodImplementationSupportProducer_ProducerMethod_methodImplementationSupport_MimluGTOW4J_OymBP0vYo0MFSbY_Bean.get(Unknown Source)
at io.quarkiverse.langchain4j.runtime.aiservice.MethodImplementationSupportProducer_ProducerMethod_methodImplementationSupport_MimluGTOW4J_OymBP0vYo0MFSbY_Bean.get(Unknown Source)
at io.quarkus.arc.impl.ArcContainerImpl.beanInstanceHandle(ArcContainerImpl.java:559)
at io.quarkus.arc.impl.ArcContainerImpl.beanInstanceHandle(ArcContainerImpl.java:539)
at io.quarkus.arc.impl.ArcContainerImpl.beanInstanceHandle(ArcContainerImpl.java:572)
at io.quarkus.arc.impl.ArcContainerImpl.instanceHandle(ArcContainerImpl.java:534)
at io.quarkus.arc.impl.ArcContainerImpl.instance(ArcContainerImpl.java:294)
at com.arconsis.youtube.quarkus.langchain.services.ai.SimplePoemAiService$$QuarkusImpl.writeAPoem(Unknown Source)
at com.arconsis.youtube.quarkus.langchain.services.ai.SimplePoemAiService$$QuarkusImpl_ClientProxy.writeAPoem(Unknown Source)
at com.arconsis.youtube.quarkus.langchain.rest.PoemResource.writePoem(PoemResource.kt:17)
at com.arconsis.youtube.quarkus.langchain.rest.PoemResource$quarkusrestinvoker$writePoem_e48ade224912576c2c6dfeeffd679c1d9c589563.invoke(Unknown Source)
at org.jboss.resteasy.reactive.server.handlers.InvocationHandler.handle(InvocationHandler.java:29)
at io.quarkus.resteasy.reactive.server.runtime.QuarkusResteasyReactiveRequestContext.invokeHandler(QuarkusResteasyReactiveRequestContext.java:141)
at org.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext.run(AbstractResteasyReactiveContext.java:147)
at io.quarkus.vertx.core.runtime.VertxCoreRecorder$14.runWith(VertxCoreRecorder.java:599)
at org.jboss.threads.EnhancedQueueExecutor$Task.doRunWith(EnhancedQueueExecutor.java:2516)
at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2495)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1521)
at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:11)
at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:11)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:1583)
I have a small sample project where I have a simple poem AI Service like this
as soon as I add the easyrag extension, Quarkus crashes when I call the
writeAPoem()
method, while it works fine without easyrag. The exception is:Versions used
Reproducer
./gradlew quarkusDev
curl -L 'http://localhost:8080/poem?topic=Quarkus%20and%20Kotlin%20are%20a%20match%20made%20in%20heaven&lines=8'
build.gradle.kts
file and run it again => no crash when you run the curl