File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
examples/src/main/java/com/datastax/astra/genai Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -43,11 +43,13 @@ public static void main(String[] args) {
43
43
.build ());
44
44
45
45
// Access to the database
46
- Database localDb = localDataAPI .getDatabase (DEFAULT_ENDPOINT_LOCAL , DEFAULT_NAMESPACE );
46
+ Database localDb = localDataAPI
47
+ .getDatabase (DEFAULT_ENDPOINT_LOCAL , DEFAULT_NAMESPACE );
47
48
48
49
// Create a Namespace if Needed
49
- DataAPIDatabaseAdmin dbAdmin = (DataAPIDatabaseAdmin ) localDb .getDatabaseAdmin ();
50
- dbAdmin .createNamespace (DEFAULT_NAMESPACE );
50
+ ((DataAPIDatabaseAdmin ) localDb
51
+ .getDatabaseAdmin ())
52
+ .createNamespace (DEFAULT_NAMESPACE );
51
53
52
54
// Create a collection for the provider
53
55
Collection <Document > collection = localDb .createCollection (
@@ -57,9 +59,7 @@ public static void main(String[] args) {
57
59
.vectorDimension (embeddingModel .getDimension ())
58
60
.vectorSimilarity (SimilarityMetric .COSINE )
59
61
.vectorize (embeddingModel .getProvider (), embeddingModel .getName ())
60
- .build (),
61
- // Save API Key at collection level
62
- new CommandOptions <>().embeddingAPIKey (embeddingApiKey ));
62
+ .build ());
63
63
64
64
// Insert documents
65
65
collection .deleteAll ();
You can’t perform that action at this time.
0 commit comments