Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Quarkus LangChain4j 0.23.x] AI services should be resolvable by name #6866

Open
aldettinger opened this issue Dec 12, 2024 · 3 comments
Open
Assignees
Labels
area/langchain4j enhancement New feature or request

Comments

@aldettinger
Copy link
Contributor

aldettinger commented Dec 12, 2024

Describe the feature here

Ai service defined like:

@ApplicationScoped
@Named("aiServiceResolvedByName")
public interface AiServiceResolvedByName {
...
}

Should be invokable with bean syntax ala .bean("aiServiceResolvedByName");.

@aldettinger aldettinger added the enhancement New feature or request label Dec 12, 2024
@aldettinger aldettinger changed the title AI services should not be resolvable by name AI services should be resolvable by name Dec 12, 2024
@aldettinger aldettinger self-assigned this Dec 12, 2024
@aldettinger aldettinger changed the title AI services should be resolvable by name [Quarkus LangChain4j 0.23.x] AI services should be resolvable by name Dec 12, 2024
@aldettinger
Copy link
Contributor Author

Today, error below is produced:

Expected: is "AiServiceResolvedByName has been resolved"
  Actual: dev.langchain4j.memory.chat.MessageWindowChatMemory@328a59bf

	at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:62)
	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:502)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:486)
	at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:73)
	at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:108)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:57)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:263)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:277)
	at io.restassured.internal.ResponseSpecificationImpl$HamcrestAssertionClosure.validate(ResponseSpecificationImpl.groovy:512)
	at io.restassured.internal.ResponseSpecificationImpl$HamcrestAssertionClosure$validate$1.call(Unknown Source)
	at io.restassured.internal.ResponseSpecificationImpl.validateResponseIfRequired(ResponseSpecificationImpl.groovy:696)
	at io.restassured.internal.ResponseSpecificationImpl.this$2$validateResponseIfRequired(ResponseSpecificationImpl.groovy)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at org.codehaus.groovy.runtime.callsite.PlainObjectMetaMethodSite.doInvoke(PlainObjectMetaMethodSite.java:43)
	at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:198)
	at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:62)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:185)
	at io.restassured.internal.ResponseSpecificationImpl.body(ResponseSpecificationImpl.groovy:107)
	at io.restassured.internal.ValidatableResponseOptionsImpl.body(ValidatableResponseOptionsImpl.java:238)
	at org.apache.camel.quarkus.component.langchain4jit.LangChain4jTest.aiServiceShouldBeResolvedByName(LangChain4jTest.java:54)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at io.quarkus.test.junit.QuarkusTestExtension.runExtensionMethod(QuarkusTestExtension.java:967)
	at io.quarkus.test.junit.QuarkusTestExtension.interceptTestMethod(QuarkusTestExtension.java:817)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)

aldettinger added a commit to aldettinger/camel-quarkus that referenced this issue Dec 12, 2024
@zbendhiba zbendhiba added this to the 3.18.0 milestone Dec 12, 2024
@aldettinger aldettinger reopened this Dec 12, 2024
@aldettinger aldettinger removed this from the 3.18.0 milestone Dec 12, 2024
@aldettinger
Copy link
Contributor Author

aldettinger commented Dec 12, 2024

@zbendhiba Actually, this one is not fixed yet. Adoption of coming quarkus-langchain4j 0.23.x is needed before, thus the title is prefixed with [Quarkus LangChain4j 0.23.x].

@zbendhiba
Copy link
Contributor

ok, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/langchain4j enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants