Releases: datastax/astra-db-java
2.0.0-PREVIEW
This release introduces the support for Tables in the DATA API different effort to align Java, Typescript and Python clients.
1.3.0
This release introduces the following changes
New Features
- Different Embeddings providers supported by Astra :
uptageAI
,nVidia
,voyageAI
,JinaAI
,openAI
,Azure OpenAi
,
// ---------------------------------------------------------------
// Create a collection for OpenAI - with no KEY in the Astra UI
// ---------------------------------------------------------------
DataAPIClient client = new DataAPIClient(astraToken, DataAPIOptions
.builder()
.withEmbeddingAPIKey("MY_OPEN_API_KEY")
.build());
Database db = client
.getDatabase(astraApiEndpoint, "default_keyspace");
Collection<Document> collectionWithOpenAI = localDb
.createCollection(CollectionOptions.builder()
.vectorDimension(1536)
.vectorSimilarity(SimilarityMetric.COSINE)
.vectorize("openai", "text-embedding-3-small")
.build());
// Insert Stuff
collectionWithOpenAI.insertMany(
new Document(1).vectorize("A lovestruck Romeo sings the streets a serenade"),
new Document(2).vectorize("Finds a streetlight, steps out of the shade")
);
// ---------------------------------------------------------------
// Create a collection for OpenAI - with KEY in the AstraUI
// ---------------------------------------------------------------
DataAPIClient client2 = new DataAPIClient(astraToken);
Database db2 = client.getDatabase(astraApiEndpoint, "default_keyspace");
Collection<Document> collection2 = db2.createCollection("openai_with_shared_key",
CollectionOptions.builder()
.vectorDimension(1536)
.vectorSimilarity(SimilarityMetric.COSINE)
.vectorize("openai", "text-embedding-3-small", "OPENAI_API_KEY")
.build(), new CommandOptions<>());
// Insert Stuff
collection2.insertMany(
new Document(1).vectorize("A lovestruck Romeo sings the streets a serenade"),
new Document(2).vectorize("Finds a streetlight, steps out of the shade")
);
Feature Updates
-
The
$vector
and$vectorize
operation are now in the sort block -
A new options
sortVector
is needed to retrieve the vector otherwize it is not returned by the API.
FindIterable<Document> docs= collection.find(new FindOptions()
.sort("You shouldn't come around here singing up at people like that")
.includeSortVector()
.includeSimilarity());
-
bulkWrite*
operations are at collection level are deprecated, they will be implemented at server side in future release to ensure atomicity. -
deleteMany
now accepts an empty filter to perform thedeleteAll()
operation -
Improve alignment with the others clients and the API. This release support Datastax Enterprise and HCD with dedicated token provider
String token = new UsernamePasswordTokenProvider(cassandraUserName, cassandraPassword).getTokenAsString();
DataAPIClient client = new DataAPIClient(token, builder().withDestination(HCD).build());
1.2.0
NEW FEATURES
- Adding
CommandOptions
everywhere to overload the DataApiOptions default - Support for
vectorize
feature with the different providers
Updates
- Renaming some function from "vector" to "sort" for consistency
- Made the vector dimension optional to leverage default
PREVIEW
- Introducing new function
listEmbeddingProviders
onDatabaseAdmin
1.0 GA
1.0.0-beta1
This pre-release tests the releasing pipeline and worklow.
Tested Operations
- Build all the components
- Run all tests
- Package components
- Sign the deliverables
- Push to maven central
- Validate the assets
Documentation is available at
https://datastaxdevs.github.io/astra-db-java/1.0.0-beta1/index.html
Maven Coordinates
- To use the assets with maven you can use :
<dependency>
<groupId>com.datastax.astra</groupId>
<artifactId>astra-db-java</artifactId>
<version>1.0.0-beta1</version>
</dependency>
- To use the assets with gradle you can use :
implementation group: 'com.datastax.astra', name: 'astra-sb-java', version: '1.0.0-beta1'