quarkiverse / quarkus-langchain4j

Quarkus Langchain4j extension
https://docs.quarkiverse.io/quarkus-langchain4j/dev/index.html
Apache License 2.0
139 stars 82 forks source link

Anthropic chat model not available when enabled. #984

Open dennysfredericci opened 4 hours ago

dennysfredericci commented 4 hours ago

Hey all,

I just have found a small issue, the anthropic chat model is not available when the property quarkus.langchain4j.anthropic.chat-model.enabled is set to true.

When it is set to true we will see the exception below:

Caused by: io.quarkus.runtime.configuration.ConfigurationException: A ChatLanguageModel or StreamingChatLanguageModel bean was requested, but no langchain4j providers were configured. Consider adding an extension like 'quarkus-langchain4j-openai'
        at io.quarkiverse.langchain4j.deployment.BeansProcessor.selectProvider(BeansProcessor.java:267)
        at io.quarkiverse.langchain4j.deployment.BeansProcessor.handleProviders(BeansProcessor.java:140)
        at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:733)
        at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:856)

The root cause seems to be a missing piece of code at AnthropicProcessor

I have created a project to reproduce the issue here

geoand commented 4 hours ago

Thanks for reporting!

You would to contribute a fix for the issue?

dennysfredericci commented 4 hours ago

Yeah... I realize I have spent more time writing this issue and the project to reproduce than fixing... 😅...

I will do it later this week...

geoand commented 4 hours ago

🙏🏽