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

[AI] Add more uses statements #11788

Merged
merged 11 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 36 additions & 27 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ dependencies {
// YAML formatting
implementation 'org.yaml:snakeyaml:2.3'

// AI
// region AI
implementation 'dev.langchain4j:langchain4j:0.34.0'
// Even though we use jvm-openai for LLM connection, we still need this package for tokenization.
implementation('dev.langchain4j:langchain4j-open-ai:0.34.0') {
Expand All @@ -336,16 +336,19 @@ dependencies {
implementation('dev.langchain4j:langchain4j-mistral-ai:0.34.0')
implementation('dev.langchain4j:langchain4j-google-ai-gemini:0.34.0')
implementation('dev.langchain4j:langchain4j-hugging-face:0.34.0')
implementation 'ai.djl:api:0.30.0'
implementation 'ai.djl.pytorch:pytorch-model-zoo:0.30.0'
implementation 'ai.djl.huggingface:tokenizers:0.29.0'

implementation platform('ai.djl:bom:0.30.0')
implementation 'ai.djl:api'
implementation 'ai.djl.huggingface:tokenizers'
implementation 'ai.djl.pytorch:pytorch-model-zoo'
implementation 'io.github.stefanbratanov:jvm-openai:0.11.0'
// openai depends on okhttp, which needs kotlin - see https://github.com/square/okhttp/issues/5299 for details
implementation ('com.squareup.okhttp3:okhttp:4.12.0') {
exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib-jdk8'
}
// GemxFX also (transitively) depends on kotlin
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.0.20'
// endregion

implementation 'commons-io:commons-io:2.16.1'

Expand Down Expand Up @@ -738,48 +741,52 @@ jlink {
// This is based on ./gradlew suggestMergedModuleInfo, sort, strip ";"", comment non-used modules, and include the suggested directives here.
// However, we need to fine-tune this manually (non-alphabetic order)
mergedModule {
requires 'javafx.base'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the xth time! Do not reorder the dependencies here!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see the comment above in the build.gradle!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to find out the reason, while I am on it. We did not document it back than. We just said: Some local experiments showd that it does not work.

I tried today with alphabetic ordering. It works. - Having alphabetic ordering in place helps to include the output of ./gradlew suggestMergedModuleInfo. Otherwise, it is an endless brainfuck.

If it does not, we have enough time before a release.

requires 'javafx.controls'
requires 'javafx.fxml'
requires 'javafx.graphics'
requires 'javafx.media'
requires 'javafx.swing'

requires 'com.google.gson'
requires 'jakarta.xml.bind'
requires 'java.compiler'
requires 'java.datatransfer'
requires 'java.desktop'
requires 'java.logging'
requires 'java.management'
requires 'java.naming'
requires 'java.net.http'
requires 'java.rmi'
requires 'java.scripting'
requires 'java.security.jgss'
requires 'java.security.sasl'
requires 'java.sql'
requires 'java.sql.rowset'
requires 'java.transaction.xa'
requires 'java.rmi'
requires 'java.xml'
requires 'javafx.base'
requires 'javafx.controls'
requires 'javafx.fxml'
requires 'javafx.graphics'
requires 'javafx.media'
requires 'javafx.swing'
requires 'jdk.jsobject'
requires 'jdk.security.jgss'
requires 'jdk.unsupported'
requires 'jdk.unsupported.desktop'
requires 'jdk.security.jgss'
requires 'jdk.xml.dom'
requires 'com.google.gson'
requires 'org.jsoup'
requires 'org.slf4j'
requires 'jakarta.xml.bind'
requires 'org.apache.commons.lang3'
requires 'org.apache.commons.logging'
Siedlerchr marked this conversation as resolved.
Show resolved Hide resolved
requires 'org.apache.commons.text'
requires 'org.apache.commons.logging';
uses 'org.mariadb.jdbc.credential.CredentialPlugin'
requires 'org.freedesktop.dbus'
requires 'org.jsoup'
requires 'org.slf4j'
uses 'ai.djl.engine.EngineProvider'
uses 'ai.djl.repository.RepositoryFactory'
uses 'ai.djl.repository.zoo.ZooProvider'
uses 'dev.langchain4j.spi.prompt.PromptTemplateFactory'
uses 'kong.unirest.core.json.JsonEngine'
uses 'org.eclipse.jgit.lib.GpgSigner'
uses 'org.eclipse.jgit.transport.SshSessionFactory'
uses 'org.mariadb.jdbc.LocalInfileInterceptor'
uses 'org.mariadb.jdbc.authentication.AuthenticationPlugin'
uses 'org.mariadb.jdbc.credential.CredentialPlugin'
uses 'org.mariadb.jdbc.tls.TlsSocketPlugin'
uses 'org.mariadb.jdbc.LocalInfileInterceptor'
uses 'org.eclipse.jgit.transport.SshSessionFactory'
uses 'org.eclipse.jgit.lib.GpgSigner'
uses 'kong.unirest.core.json.JsonEngine';
uses 'ai.djl.repository.zoo.ZooProvider';

provides 'org.mariadb.jdbc.tls.TlsSocketPlugin' with 'org.mariadb.jdbc.internal.protocol.tls.DefaultTlsSocketPlugin'
provides 'java.sql.Driver' with 'org.postgresql.Driver'
provides 'org.mariadb.jdbc.authentication.AuthenticationPlugin' with 'org.mariadb.jdbc.internal.com.send.authentication.CachingSha2PasswordPlugin',
Expand All @@ -797,9 +804,11 @@ jlink {
'org.bouncycastle.pqc.jcajce.provider.BouncyCastlePQCProvider'
provides 'kong.unirest.core.json.JsonEngine' with 'kong.unirest.modules.gson.GsonEngine';
provides 'ai.djl.repository.zoo.ZooProvider' with 'ai.djl.engine.rust.zoo.RsZooProvider',
'ai.djl.huggingface.zoo.HfZooProvider',
Siedlerchr marked this conversation as resolved.
Show resolved Hide resolved
'ai.djl.pytorch.zoo.PtZooProvider',
'ai.djl.repository.zoo.DefaultZooProvider';
'ai.djl.huggingface.zoo.HfZooProvider',
'ai.djl.pytorch.zoo.PtZooProvider',
'ai.djl.repository.zoo.DefaultZooProvider';
provides 'ai.djl.engine.EngineProvider' with 'ai.djl.engine.rust.RsEngineProvider',
'ai.djl.pytorch.engine.PtEngineProvider';
}

jpackage {
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,18 @@

// region AI
requires ai.djl.api;
uses ai.djl.repository.zoo.ZooProvider;
requires ai.djl.pytorch_model_zoo;
requires ai.djl.tokenizers;
requires jvm.openai;
requires langchain4j;
requires langchain4j.core;
requires langchain4j.hugging.face;
requires langchain4j.mistral.ai;
requires langchain4j.open.ai;
uses ai.djl.engine.EngineProvider;
uses ai.djl.repository.RepositoryFactory;
uses ai.djl.repository.zoo.ZooProvider;
uses dev.langchain4j.spi.prompt.PromptTemplateFactory;
// endregion

// region: Lucene
Expand Down
Loading