Skip to content

Commit c55f62e

Browse files
committed
build: add ONNX Runtime and model loading dependencies
- Add ONNX Runtime dependency for local model execution - Include Gson for JSON parsing in model configurations - Update notebook dependencies for cache demonstrations - Configure proper dependency versions for compatibility
1 parent 5959bc1 commit c55f62e

File tree

2 files changed

+91
-1
lines changed

2 files changed

+91
-1
lines changed

core/build.gradle.kts

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ description = "RedisVL4J - Vector Library for Java"
88

99
dependencies {
1010
// Redis client
11-
api("redis.clients:jedis:5.2.0")
11+
api("redis.clients:jedis:6.2.0")
1212

1313
// JSON processing
1414
implementation("com.fasterxml.jackson.core:jackson-databind:2.18.2")
@@ -32,6 +32,63 @@ dependencies {
3232

3333
// SpotBugs annotations for suppressing false positives
3434
implementation("com.github.spotbugs:spotbugs-annotations:4.8.3")
35+
36+
// LangChain4J - Core API (required for vectorizers)
37+
compileOnly("dev.langchain4j:langchain4j:0.36.2")
38+
39+
// LangChain4J Embedding Providers (optional - users include what they need)
40+
compileOnly("dev.langchain4j:langchain4j-open-ai:0.36.2")
41+
compileOnly("dev.langchain4j:langchain4j-azure-open-ai:0.36.2")
42+
compileOnly("dev.langchain4j:langchain4j-hugging-face:0.36.2")
43+
compileOnly("dev.langchain4j:langchain4j-ollama:0.36.2")
44+
compileOnly("dev.langchain4j:langchain4j-vertex-ai-gemini:0.36.2")
45+
46+
// LangChain4J Local Embedding Models (optional)
47+
compileOnly("dev.langchain4j:langchain4j-embeddings-all-minilm-l6-v2:0.36.2")
48+
compileOnly("dev.langchain4j:langchain4j-embeddings-bge-small-en-v15:0.36.2")
49+
compileOnly("dev.langchain4j:langchain4j-embeddings-e5-small-v2:0.36.2")
50+
51+
// ONNX Runtime for running models locally
52+
implementation("com.microsoft.onnxruntime:onnxruntime:1.16.3")
53+
54+
// HTTP client for downloading from HuggingFace
55+
implementation("com.squareup.okhttp3:okhttp:4.12.0")
56+
57+
// JSON parsing for config.json
58+
implementation("com.google.code.gson:gson:2.10.1")
59+
60+
// Test dependencies for LangChain4J (include in tests to verify integration)
61+
testImplementation("dev.langchain4j:langchain4j:0.36.2")
62+
testImplementation("dev.langchain4j:langchain4j-embeddings-all-minilm-l6-v2:0.36.2")
63+
testImplementation("dev.langchain4j:langchain4j-hugging-face:0.36.2")
64+
65+
// Additional test dependencies
66+
testImplementation("com.squareup.okhttp3:mockwebserver:4.12.0")
67+
testImplementation("org.mockito:mockito-core:5.11.0")
68+
}
69+
70+
// Configure test execution
71+
tasks.test {
72+
// Exclude slow and integration tests by default
73+
useJUnitPlatform {
74+
excludeTags("slow", "integration")
75+
}
76+
}
77+
78+
// Create a task for running integration tests
79+
tasks.register<Test>("integrationTest") {
80+
useJUnitPlatform {
81+
includeTags("integration")
82+
}
83+
shouldRunAfter(tasks.test)
84+
}
85+
86+
// Create a task for running slow tests
87+
tasks.register<Test>("slowTest") {
88+
useJUnitPlatform {
89+
includeTags("slow")
90+
}
91+
shouldRunAfter(tasks.test)
3592
}
3693

3794
// Configure all JAR tasks to use the desired artifact name

notebooks/jupyter/java/pom.xml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,38 @@
5757
<artifactId>jackson-dataformat-yaml</artifactId>
5858
<version>2.18.0</version>
5959
</dependency>
60+
61+
<!-- ULID Creator for unique ID generation -->
62+
<dependency>
63+
<groupId>com.github.f4b6a3</groupId>
64+
<artifactId>ulid-creator</artifactId>
65+
<version>5.2.3</version>
66+
</dependency>
67+
68+
<!-- LangChain4J for embeddings -->
69+
<dependency>
70+
<groupId>dev.langchain4j</groupId>
71+
<artifactId>langchain4j</artifactId>
72+
<version>0.36.2</version>
73+
</dependency>
74+
<dependency>
75+
<groupId>dev.langchain4j</groupId>
76+
<artifactId>langchain4j-open-ai</artifactId>
77+
<version>0.36.2</version>
78+
</dependency>
79+
80+
<!-- ONNX Runtime for SentenceTransformersVectorizer -->
81+
<dependency>
82+
<groupId>com.microsoft.onnxruntime</groupId>
83+
<artifactId>onnxruntime</artifactId>
84+
<version>1.16.3</version>
85+
</dependency>
86+
87+
<!-- Gson for JSON parsing in ONNX loader -->
88+
<dependency>
89+
<groupId>com.google.code.gson</groupId>
90+
<artifactId>gson</artifactId>
91+
<version>2.10.1</version>
92+
</dependency>
6093
</dependencies>
6194
</project>

0 commit comments

Comments
 (0)