Trying to run make-chat-model
(ns problem.problem
(:require [clojure.java.data.builder :as builder])
(:import (dev.langchain4j.model.openai OpenAiChatModel)
(dev.langchain4j.model.openai OpenAiChatModel$OpenAiChatModelBuilder)))
(defn make-chat-model []
(builder/to-java
OpenAiChatModel
OpenAiChatModel$OpenAiChatModelBuilder
(OpenAiChatModel/builder)
{:baseUrl "localhost"
:apiKey (System/getenv "OPENAI_API_KEY")} {}))
fails with the following error
:#error {}
:cause Duplicate setter found for :modelName in dev.langchain4j.model.openai.OpenAiChatModel$OpenAiChatModelBuilder class
:via
[{:type java.lang.IllegalArgumentException
:message Duplicate setter found for :modelName in dev.langchain4j.model.openai.OpenAiChatModel$OpenAiChatModelBuilder class
:at [clojure.java.data.builder$find_setters$fn__9041 invoke builder.clj 66]}]
The code is in the following repo: https://github.com/gavlooth/problem