Skip to content

Commit 6a267e1

Browse files
committed
mutualizing db java and langcahin
1 parent 10581d5 commit 6a267e1

File tree

10 files changed

+512
-756
lines changed

10 files changed

+512
-756
lines changed

astra-db-java/pom.xml

Lines changed: 6 additions & 319 deletions
Large diffs are not rendered by default.

examples/src/main/java/Quickstart.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
import com.datastax.astra.client.Database;
44
import com.datastax.astra.client.model.Document;
55
import com.datastax.astra.client.model.FindIterable;
6+
import com.datastax.astra.client.model.FindOptions;
7+
8+
import java.util.List;
69

710
import static com.datastax.astra.client.model.SimilarityMetric.COSINE;
811

@@ -59,6 +62,12 @@ public static void main(String[] args) {
5962
System.out.println("Deleted the collection");
6063
// end::cleanup[]
6164

65+
List<Document> matches = collection.find(
66+
new FindOptions()
67+
.sort(new float[] {0.15f, 0.1f, 0.1f, 0.35f, 0.55f}))
68+
.all();
69+
70+
6271
// tag::end[]
6372
}
6473
}

langchain4j-astradb/pom.xml

Lines changed: 7 additions & 260 deletions
Original file line numberDiff line numberDiff line change
@@ -5,39 +5,15 @@
55
<artifactId>langchain4j-astradb</artifactId>
66
<name>LangChain4j :: Integration :: AstraDB</name>
77
<description>Some dependencies have a "Public Domain" license</description>
8-
<version>1.4.3-SNAPSHOT</version>
9-
<url>https://github.com/datastax/astra-db-java</url>
10-
<inceptionYear>2024</inceptionYear>
8+
9+
<parent>
10+
<groupId>com.datastax.astra</groupId>
11+
<artifactId>astra-db-java-parent</artifactId>
12+
<version>1.4.4-SNAPSHOT</version>
13+
</parent>
1114

1215
<properties>
13-
<logback.version>1.5.6</logback.version>
14-
<jackson.version>2.17.2</jackson.version>
15-
<lombok.version>1.18.34</lombok.version>
16-
<assertj.version>3.26.3</assertj.version>
17-
<junit-jupiter.version>5.10.3</junit-jupiter.version>
18-
<astra-db-java.version>1.4.0</astra-db-java.version>
1916
<langchain4j.version>0.33.0</langchain4j.version>
20-
21-
<!-- Maven -->
22-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
23-
<maven.compiler.release>11</maven.compiler.release>
24-
<maven.plugin.compiler.source>11</maven.plugin.compiler.source>
25-
<maven.plugin.compiler.target>11</maven.plugin.compiler.target>
26-
<version.maven.plugin.compiler>3.13.0</version.maven.plugin.compiler>
27-
<version.maven.plugin.coveralls>4.3.0</version.maven.plugin.coveralls>
28-
<version.maven.plugin.dependency>3.7.1</version.maven.plugin.dependency>
29-
<version.maven.plugin.enforcer>3.5.0</version.maven.plugin.enforcer>
30-
<version.maven.plugin.gpg>3.2.4</version.maven.plugin.gpg>
31-
<version.maven.plugin.jacoco>0.8.12</version.maven.plugin.jacoco>
32-
<version.maven.plugin.javadoc>3.8.0</version.maven.plugin.javadoc>
33-
<version.maven.plugin.jar>3.4.2</version.maven.plugin.jar>
34-
<version.maven.plugin.license>2.4.0</version.maven.plugin.license>
35-
<version.maven.plugin.nexus>1.7.0</version.maven.plugin.nexus>
36-
<version.maven.plugin.release>3.1.1</version.maven.plugin.release>
37-
<version.maven.plugin.resources>3.3.1</version.maven.plugin.resources>
38-
<version.maven.plugin.source>3.3.1</version.maven.plugin.source>
39-
<version.maven.plugin.surefire>3.2.5</version.maven.plugin.surefire>
40-
<version.maven.plugin.surefire>3.2.5</version.maven.plugin.surefire>
4117
</properties>
4218

4319
<dependencyManagement>
@@ -58,230 +34,63 @@
5834
<dependency>
5935
<groupId>com.datastax.astra</groupId>
6036
<artifactId>astra-db-java</artifactId>
61-
<version>${astra-db-java.version}</version>
37+
<version>${project.version}</version>
6238
</dependency>
63-
6439
<dependency>
6540
<groupId>org.projectlombok</groupId>
6641
<artifactId>lombok</artifactId>
67-
<version>${lombok.version}</version>
6842
<scope>provided</scope>
6943
</dependency>
70-
7144
<dependency>
7245
<groupId>dev.langchain4j</groupId>
7346
<artifactId>langchain4j-core</artifactId>
74-
<version>${langchain4j.version}</version>
7547
</dependency>
76-
77-
<!-- Enforce Jackson Latest to support @Unwrapped -->
7848
<dependency>
7949
<groupId>com.fasterxml.jackson.core</groupId>
8050
<artifactId>jackson-core</artifactId>
81-
<version>${jackson.version}</version>
8251
</dependency>
83-
8452
<dependency>
8553
<groupId>dev.langchain4j</groupId>
8654
<artifactId>langchain4j-core</artifactId>
8755
<classifier>tests</classifier>
88-
<version>${langchain4j.version}</version>
8956
<type>test-jar</type>
9057
<scope>test</scope>
9158
</dependency>
9259
<!-- Same embeddings model to keep the 1% -->
9360
<dependency>
9461
<groupId>dev.langchain4j</groupId>
9562
<artifactId>langchain4j-embeddings-all-minilm-l6-v2-q</artifactId>
96-
<version>${langchain4j.version}</version>
9763
<scope>test</scope>
9864
</dependency>
9965
<dependency>
10066
<groupId>dev.langchain4j</groupId>
10167
<artifactId>langchain4j</artifactId>
102-
<version>${langchain4j.version}</version>
10368
<scope>test</scope>
10469
</dependency>
10570
<dependency>
10671
<groupId>dev.langchain4j</groupId>
10772
<artifactId>langchain4j-open-ai</artifactId>
108-
<version>${langchain4j.version}</version>
10973
<scope>test</scope>
11074
</dependency>
11175
<dependency>
11276
<groupId>org.junit.jupiter</groupId>
11377
<artifactId>junit-jupiter-engine</artifactId>
114-
<version>${junit-jupiter.version}</version>
11578
<scope>test</scope>
11679
</dependency>
11780
<dependency>
11881
<groupId>org.assertj</groupId>
11982
<artifactId>assertj-core</artifactId>
120-
<version>${assertj.version}</version>
12183
<scope>test</scope>
12284
</dependency>
12385
<dependency>
12486
<groupId>ch.qos.logback</groupId>
12587
<artifactId>logback-classic</artifactId>
126-
<version>${logback.version}</version>
12788
<scope>test</scope>
12889
</dependency>
12990
</dependencies>
13091

13192
<build>
13293
<plugins>
133-
<plugin>
134-
<groupId>org.sonatype.plugins</groupId>
135-
<artifactId>nexus-staging-maven-plugin</artifactId>
136-
<version>${version.maven.plugin.nexus}</version>
137-
<extensions>true</extensions>
138-
<configuration>
139-
<serverId>ossrh</serverId>
140-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
141-
<autoReleaseAfterClose>false</autoReleaseAfterClose>
142-
<skipLocalStaging>true</skipLocalStaging>
143-
</configuration>
144-
</plugin>
145-
146-
<plugin>
147-
<groupId>org.apache.maven.plugins</groupId>
148-
<artifactId>maven-gpg-plugin</artifactId>
149-
<version>${version.maven.plugin.gpg}</version>
150-
</plugin>
151-
152-
<plugin>
153-
<groupId>org.apache.maven.plugins</groupId>
154-
<artifactId>maven-source-plugin</artifactId>
155-
<version>${version.maven.plugin.source}</version>
156-
<executions>
157-
<execution>
158-
<id>attach-sources</id>
159-
<goals>
160-
<goal>jar-no-fork</goal>
161-
</goals>
162-
</execution>
163-
</executions>
164-
</plugin>
165-
166-
<plugin>
167-
<groupId>org.apache.maven.plugins</groupId>
168-
<artifactId>maven-release-plugin</artifactId>
169-
<version>${version.maven.plugin.release}</version>
170-
<configuration>
171-
<tagNameFormat>@{project.version}</tagNameFormat>
172-
<autoVersionSubmodules>true</autoVersionSubmodules>
173-
<useReleaseProfile>false</useReleaseProfile>
174-
<releaseProfiles>release</releaseProfiles>
175-
<goals>deploy</goals>
176-
</configuration>
177-
</plugin>
178-
179-
<plugin>
180-
<groupId>org.apache.maven.plugins</groupId>
181-
<artifactId>maven-compiler-plugin</artifactId>
182-
<version>${version.maven.plugin.compiler}</version>
183-
<configuration>
184-
<source>${maven.plugin.compiler.source}</source>
185-
<target>${maven.plugin.compiler.target}</target>
186-
<showWarnings>false</showWarnings>
187-
</configuration>
188-
</plugin>
189-
190-
<plugin>
191-
<groupId>org.apache.maven.plugins</groupId>
192-
<artifactId>maven-surefire-plugin</artifactId>
193-
<version>${version.maven.plugin.surefire}</version>
194-
<configuration>
195-
<skipTests>true</skipTests>
196-
</configuration>
197-
<dependencies>
198-
<dependency>
199-
<groupId>org.junit.jupiter</groupId>
200-
<artifactId>junit-jupiter-engine</artifactId>
201-
<version>${junit-jupiter.version}</version>
202-
</dependency>
203-
</dependencies>
204-
</plugin>
205-
206-
<plugin>
207-
<groupId>org.apache.maven.plugins</groupId>
208-
<artifactId>maven-javadoc-plugin</artifactId>
209-
<version>${version.maven.plugin.javadoc}</version>
210-
<executions>
211-
<execution>
212-
<id>attach-javadocs</id>
213-
<goals>
214-
<goal>jar</goal>
215-
</goals>
216-
</execution>
217-
</executions>
218-
<configuration>
219-
<source>${maven.plugin.compiler.source}</source>
220-
<overview>${basedir}/src/main/java/overview.html</overview>
221-
</configuration>
222-
</plugin>
223-
224-
<plugin>
225-
<groupId>org.jacoco</groupId>
226-
<artifactId>jacoco-maven-plugin</artifactId>
227-
<version>${version.maven.plugin.jacoco}</version>
228-
<executions>
229-
<execution>
230-
<id>default-prepare-agent</id>
231-
<goals>
232-
<goal>prepare-agent</goal>
233-
</goals>
234-
</execution>
235-
<execution>
236-
<id>default-prepare-agent-integration</id>
237-
<goals>
238-
<goal>prepare-agent-integration</goal>
239-
</goals>
240-
</execution>
241-
<execution>
242-
<id>default-report</id>
243-
<goals>
244-
<goal>report</goal>
245-
</goals>
246-
</execution>
247-
<execution>
248-
<id>default-report-integration</id>
249-
<goals>
250-
<goal>report-integration</goal>
251-
</goals>
252-
</execution>
253-
</executions>
254-
</plugin>
255-
256-
<plugin>
257-
<groupId>org.apache.maven.plugins</groupId>
258-
<artifactId>maven-dependency-plugin</artifactId>
259-
<version>${version.maven.plugin.dependency}</version>
260-
</plugin>
261-
262-
<plugin>
263-
<groupId>org.apache.maven.plugins</groupId>
264-
<artifactId>maven-jar-plugin</artifactId>
265-
<version>${version.maven.plugin.jar}</version>
266-
<configuration>
267-
<archive>
268-
<manifest>
269-
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
270-
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
271-
</manifest>
272-
</archive>
273-
</configuration>
274-
</plugin>
275-
276-
<plugin>
277-
<groupId>org.apache.maven.plugins</groupId>
278-
<artifactId>maven-resources-plugin</artifactId>
279-
<version>${version.maven.plugin.resources}</version>
280-
<configuration>
281-
<escapeString>\</escapeString>
282-
<encoding>UTF-8</encoding>
283-
</configuration>
284-
</plugin>
28594
<plugin>
28695
<groupId>org.codehaus.mojo</groupId>
28796
<artifactId>license-maven-plugin</artifactId>
@@ -315,66 +124,4 @@
315124
</plugin>
316125
</plugins>
317126
</build>
318-
319-
<distributionManagement>
320-
<repository>
321-
<id>ossrh</id>
322-
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
323-
</repository>
324-
</distributionManagement>
325-
326-
<scm>
327-
<connection>scm:git:[email protected]:datastax/astra-db-java.git</connection>
328-
<developerConnection>scm:git:[email protected]:datastax/astra-db-java.git</developerConnection>
329-
<url>https://github.com/datastax/astra-db-java</url>
330-
<tag>1.0.0-beta1</tag>
331-
</scm>
332-
333-
<developers>
334-
<developer>
335-
<id>clunven</id>
336-
<name>Cedrick Lunven</name>
337-
<email>[email protected]</email>
338-
<url>https://github.com/clun</url>
339-
</developer>
340-
</developers>
341-
342-
<profiles>
343-
<profile>
344-
<id>release</id>
345-
<build>
346-
<plugins>
347-
<plugin>
348-
<groupId>org.apache.maven.plugins</groupId>
349-
<artifactId>maven-gpg-plugin</artifactId>
350-
<executions>
351-
<execution>
352-
<id>sign-artifacts</id>
353-
<phase>verify</phase>
354-
<goals>
355-
<goal>sign</goal>
356-
</goals>
357-
</execution>
358-
</executions>
359-
</plugin>
360-
</plugins>
361-
</build>
362-
</profile>
363-
</profiles>
364-
365-
<!-- Organization -->
366-
<organization>
367-
<name>DataStax</name>
368-
<url>https://www.datastax.com</url>
369-
</organization>
370-
371-
<!-- Release the client with Apache License -->
372-
<licenses>
373-
<license>
374-
<name>Apache-2.0</name>
375-
<url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
376-
<distribution>repo</distribution>
377-
<comments>A business-friendly OSS license</comments>
378-
</license>
379-
</licenses>
380127
</project>

0 commit comments

Comments
 (0)