langchain4j
langchain4j copied to clipboard
[FEATURE] BOM: add Spring Boot modules
Now, if you want to reference multiple langchain4j modules, you always need to define multiple 'artifacts'.
like this:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>dev.langchain4j</groupId>
<artifactId>langchain4j-core</artifactId>
<version>0.23.0</version>
</dependency>
<dependency>
<groupId>dev.langchain4j</groupId>
<artifactId>langchain4j-open-ai</artifactId>
<version>0.23.0</version>
</dependency>
<dependency>
<groupId>dev.langchain4j</groupId>
<artifactId>langchain4j-azure-open-ai</artifactId>
<version>0.23.0</version>
</dependency>
<dependency>
<groupId>dev.langchain4j</groupId>
<artifactId>langchain4j-elasticsearch</artifactId>
<version>0.23.0</version>
</dependency>
</dependencies>
</dependencyManagement>
It would be great if a single BOM could be provided. Just like jackson-bom
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.fasterxml.jackson</groupId>
<artifactId>jackson-bom</artifactId>
<version>${jackson-bom.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
Sounds great. I think it's a good way to manage artifacts.
@me0106 could you please clarify? Do you expect that declaring a single dependency will automatically import all available langchain4j modules? Or that it will only import right versions and you will still need to explicitly define which modules you want? Thanks
@langchain4j This PR is actually what I need, https://github.com/langchain4j/langchain4j/pull/227 I usually define all the dependencies required for the entire project in a parent to avoid various version definitions in the submodules, including variable references in the format of ${xxx.version}. If there is no unified BOM provided, I have to define all versions of langchain4j in the parent pom,
--------//parent pom
<dependencyManagement>
<dependencies>
<dependency>
<groupId>dev.langchain4j</groupId>
<artifactId>langchain4j-core</artifactId>
<version>0.23.0</version>
</dependency>
<dependency>
<groupId>dev.langchain4j</groupId>
<artifactId>langchain4j-open-ai</artifactId>
<version>0.23.0</version>
</dependency>
<dependency>
<groupId>dev.langchain4j</groupId>
<artifactId>langchain4j-azure-open-ai</artifactId>
<version>0.23.0</version>
</dependency>
<dependency>
<groupId>dev.langchain4j</groupId>
<artifactId>langchain4j-elasticsearch</artifactId>
<version>0.23.0</version>
</dependency>
<dependency>
<groupId>dev.langchain4j</groupId>
<artifactId>langchain4j-pinecone</artifactId>
<version>0.23.0</version>
</dependency>
</dependencies>
</dependencyManagement>
----- //sub module
<dependencies>
<dependency>
<groupId>dev.langchain4j</groupId>
<artifactId>langchain4j-elasticsearch</artifactId>
</dependency>
<dependency>
<groupId>dev.langchain4j</groupId>
<artifactId>langchain4j-pinecone</artifactId>
</dependency>
</dependencies>
If there is a simple BOM that can be referenced, I only need to define one <dependency/>
:
//parent
<dependencyManagement>
<dependencies>
<dependency>
<groupId>dev.langchain4j</groupId>
<artifactId>langchain4j-all</artifactId>
<version>0.23.0</version>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>
// sub module
<dependencies>
<dependency>
<groupId>dev.langchain4j</groupId>
<artifactId>langchain4j-elasticsearch</artifactId>
</dependency>
<dependency>
<groupId>dev.langchain4j</groupId>
<artifactId>langchain4j-pinecone</artifactId>
</dependency>
</dependencies>
And if a new module appears in langchain4j, I don't have to define them one by one, I only need to upgrade the version and then directly use it in the submodules.
Having a unified BOM can simplify the definition of the parent.
is available since 0.24.0
is available since 0.24.0
I hope you can provide a BOM that includes the Spring Plugin and Spring Boot Starter.