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

better error message when compiled without -parameters #942

Open
maxandersen opened this issue Sep 28, 2024 · 2 comments
Open

better error message when compiled without -parameters #942

maxandersen opened this issue Sep 28, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@maxandersen
Copy link
Member

if you (like me) forget to add -parameters to your jbang project then quarkus langchain4j shows this error:

java.lang.NullPointerException
        at java.base/java.util.Objects.requireNonNull(Objects.java:233)
        at io.quarkus.qute.TemplateInstanceBase.data(TemplateInstanceBase.java:45)
        at io.quarkiverse.langchain4j.QuarkusPromptTemplateFactory$QuteTemplate.render(QuarkusPromptTemplateFactory.java:67)
        at dev.langchain4j.model.input.PromptTemplate.apply(PromptTemplate.java:102)
        at io.quarkiverse.langchain4j.runtime.aiservice.AiServiceMethodImplementationSupport.prepareSystemMessage(AiServiceMethodImplementationSupport.java:502)
        at io.quarkiverse.langchain4j.runtime.aiservice.AiServiceMethodImplementationSupport.doImplement(AiServiceMethodImplementationSupport.java:140)
        at io.quarkiverse.langchain4j.runtime.aiservice.AiServiceMethodImplementationSupport.implement(AiServiceMethodImplementationSupport.java:122)

would be great if it would provide hint that the reason for NPE is that parameters are missing names and should add -parameter to the compilation.

@geoand
Copy link
Collaborator

geoand commented Sep 29, 2024

Yeah, it makes sense to see what we can better on the Quarkus LangChain4j side, but doesn't it also make sense to have JBang invoke javac with -parameters by default?

@geoand
Copy link
Collaborator

geoand commented Sep 30, 2024

Actually, we do have a warning message, it should be:

The application has been compiled without the '-parameters' being set flag on javac. Make sure your build tool is configured to pass this flag to javac, otherwise Quarkus LangChain4j is unlikely to work properly without it.

did you not get that at all?

@geoand geoand added the enhancement New feature or request label Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants