Skip to content

Commit 5aed885

Browse files
committed
update dimension
1 parent ff60c97 commit 5aed885

File tree

3 files changed

+53
-9
lines changed

3 files changed

+53
-9
lines changed

astra-db-java/src/main/java/com/datastax/astra/client/model/CollectionOptions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public static class VectorOptions {
121121
/**
122122
* Size of the vector.
123123
*/
124-
private int dimension;
124+
private Integer dimension;
125125

126126
/**
127127
* Similarity metric.

astra-db-java/src/main/java/com/datastax/astra/client/model/EmbeddingProvider.java

Lines changed: 48 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,10 @@
2727
import java.util.Map;
2828
import java.util.Optional;
2929

30+
/**
31+
* Class representing the Embedding Provider returned by findEmbeddingProviders command.
32+
*/
3033
@Data
31-
@NoArgsConstructor
3234
public class EmbeddingProvider {
3335

3436
/** Keys for the supported authentication methods */
@@ -55,6 +57,12 @@ public class EmbeddingProvider {
5557
/** List of models support. */
5658
private List<Model> models;
5759

60+
/**
61+
* Default constructor.
62+
*/
63+
public EmbeddingProvider() {
64+
}
65+
5866
/**
5967
* Accessor for the Share Secret Authentication.
6068
*
@@ -79,54 +87,86 @@ public Optional<AuthenticationMethod> getHeaderAuthentication() {
7987
* Model for the service.
8088
*/
8189
@Data
82-
@NoArgsConstructor
8390
public static class Model {
91+
92+
/** Model name */
8493
private String name;
94+
95+
/** Model dimension. */
8596
private Integer vectorDimension;
97+
98+
/** Parameters for the model. */
8699
private List<Parameter> parameters;
100+
101+
/**
102+
* Default constructor.
103+
*/
104+
public Model() {}
87105
}
88106

89107
/**
90108
* Authentication method.
91109
*/
92110
@Data
93-
@NoArgsConstructor
94111
public static class AuthenticationMethod {
95-
private boolean enabled;
96-
private List<Token> tokens;
112+
113+
/** If this method is enabled. */
114+
private boolean enabled;
115+
116+
/** List of tokens. */
117+
private List<Token> tokens;
118+
119+
/**
120+
* Default constructor.
121+
*/
122+
public AuthenticationMethod() {}
97123
}
98124

99125
/**
100126
* Token method.
101127
*/
102128
@Data
103-
@NoArgsConstructor
104129
public static class Token {
130+
131+
/** If token is forwarded. */
105132
private String forwarded;
133+
134+
/** Accept token. */
106135
private String accepted;
136+
137+
/**
138+
* Default constructor.
139+
*/
140+
public Token() {}
107141
}
108142

109143
/**
110144
* Parameters for the service.
111145
*/
112146
@Data
113-
@NoArgsConstructor
114147
public static class Parameter {
115148
private String name;
116149
private String type;
117150
private boolean required;
118151
private String defaultValue;
119152
private Validation validation;
120153
private String help;
154+
/**
155+
* Default constructor.
156+
*/
157+
public Parameter() {}
121158
}
122159

123160
/**
124161
* Validation Component for the parameter.
125162
*/
126163
@Data
127-
@NoArgsConstructor
128164
public static class Validation {
129165
private List<Integer> numericRange;
166+
/**
167+
* Default constructor.
168+
*/
169+
public Validation() {}
130170
}
131171

132172

examples/src/main/java/com/datastax/astra/genai/AzureOpenAI_SharedSecret_AstraDev.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import com.datastax.astra.client.model.Document;
1010
import com.datastax.astra.client.model.FindOneOptions;
1111
import com.datastax.astra.client.model.SimilarityMetric;
12+
import com.datastax.astra.internal.command.LoggingCommandObserver;
1213
import lombok.extern.slf4j.Slf4j;
1314

1415
import java.util.HashMap;
@@ -37,10 +38,13 @@ public static void main(String[] args) {
3738

3839
// Create a collection
3940
Database db = dataAPIClient.getDatabase(UUID.fromString("2341e6dc-c6b2-4031-9c36-a93b8c1549e0"));
41+
db.getCommandOptions().getObservers().put("logger", new LoggingCommandObserver(AzureOpenAI_SharedSecret_AstraDev.class));
4042

4143
Map<String, Object> parameters = new HashMap<>();
4244
parameters.put("deploymentId", "text-embedding-3-small-steo");
4345
parameters.put("resourceName", "steo-azure-openai");
46+
47+
db.dropCollection("collection_azure_openai");
4448
Collection<Document> collection = db.createCollection(
4549
"collection_azure_openai",
4650
// Create collection with a Service in vectorize

0 commit comments

Comments
 (0)