smallrye / smallrye-llm

Experimentation around LLM and MicroProfile
Apache License 2.0
11 stars 5 forks source link

CommonLLMPluginCreator might fail to create bean if multiple setters exist #22

Closed ehsavoie closed 3 months ago

ehsavoie commented 3 months ago

Using OpenAI LangChain4J implementation to connect to Ollama with llama3.1 model fails because of:

Caused by: java.lang.IllegalArgumentException: Failed to convert property "smallrye.llm.plugin.chat-model.config.model-name" from its value "llama3.1" to dev.langchain4j.model.openai.OpenAiChatModelName at io.helidon.config.mp.MpConfigImpl.convert(MpConfigImpl.java:311) at io.helidon.config.mp.MpConfigImpl.lambda$optionalValue$7(MpConfigImpl.java:192) at java.base/java.util.Optional.map(Optional.java:260) at io.helidon.config.mp.MpConfigImpl.optionalValue(MpConfigImpl.java:192) at io.helidon.config.mp.MpConfigImpl.getOptionalValue(MpConfigImpl.java:130) at io.helidon.config.mp.MpConfigProviderResolver$ConfigDelegate.getOptionalValue(MpConfigProviderResolver.java:361) at io.smallrye.llm.core.langchain4j.mpconfig.LLMConfigMPConfig.getBeanPropertyValue(LLMConfigMPConfig.java:42) at io.smallrye.llm.plugin.CommonLLMPluginCreator.create(CommonLLMPluginCreator.java:117) ... 64 more Caused by: java.lang.IllegalArgumentException: No enum constant dev.langchain4j.model.openai.OpenAiChatModelName.llama3.1 at java.base/java.lang.Enum.valueOf(Enum.java:293) at io.helidon.config.mp.MpConfigImpl.lambda$findImplicit$fb345045$1(MpConfigImpl.java:454) at io.helidon.config.mp.MpConfigImpl.convert(MpConfigImpl.java:304) ... 71 more