Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* Specifies the properties for connecting to an AML vectorizer.
*/
@Fluent
public final class AMLParameters implements JsonSerializable<AMLParameters> {
public final class AzureMachineLearningParameters implements JsonSerializable<AzureMachineLearningParameters> {
/*
* (Required for no authentication or key authentication) The scoring URI of the AML service to which the JSON
* payload will be sent. Only the https URI scheme is allowed.
Expand Down Expand Up @@ -55,11 +55,11 @@ public final class AMLParameters implements JsonSerializable<AMLParameters> {
private AIStudioModelCatalogName modelName;

/**
* Creates an instance of AMLParameters class.
* Creates an instance of AzureMachineLearningParameters class.
*
* @param scoringUri the scoringUri value to set.
*/
public AMLParameters(String scoringUri) {
public AzureMachineLearningParameters(String scoringUri) {
this.scoringUri = scoringUri;
}

Expand All @@ -86,9 +86,9 @@ public String getAuthenticationKey() {
* Set the authenticationKey property: (Required for key authentication) The key for the AML service.
*
* @param authenticationKey the authenticationKey value to set.
* @return the AMLParameters object itself.
* @return the AzureMachineLearningParameters object itself.
*/
public AMLParameters setAuthenticationKey(String authenticationKey) {
public AzureMachineLearningParameters setAuthenticationKey(String authenticationKey) {
this.authenticationKey = authenticationKey;
return this;
}
Expand All @@ -110,9 +110,9 @@ public String getResourceId() {
* subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.MachineLearningServices/workspaces/{workspace-name}/services/{service_name}.
*
* @param resourceId the resourceId value to set.
* @return the AMLParameters object itself.
* @return the AzureMachineLearningParameters object itself.
*/
public AMLParameters setResourceId(String resourceId) {
public AzureMachineLearningParameters setResourceId(String resourceId) {
this.resourceId = resourceId;
return this;
}
Expand All @@ -132,9 +132,9 @@ public Duration getTimeout() {
* call.
*
* @param timeout the timeout value to set.
* @return the AMLParameters object itself.
* @return the AzureMachineLearningParameters object itself.
*/
public AMLParameters setTimeout(Duration timeout) {
public AzureMachineLearningParameters setTimeout(Duration timeout) {
this.timeout = timeout;
return this;
}
Expand All @@ -152,9 +152,9 @@ public String getRegion() {
* Set the region property: (Optional for token authentication). The region the AML service is deployed in.
*
* @param region the region value to set.
* @return the AMLParameters object itself.
* @return the AzureMachineLearningParameters object itself.
*/
public AMLParameters setRegion(String region) {
public AzureMachineLearningParameters setRegion(String region) {
this.region = region;
return this;
}
Expand All @@ -174,9 +174,9 @@ public AIStudioModelCatalogName getModelName() {
* the provided endpoint.
*
* @param modelName the modelName value to set.
* @return the AMLParameters object itself.
* @return the AzureMachineLearningParameters object itself.
*/
public AMLParameters setModelName(AIStudioModelCatalogName modelName) {
public AzureMachineLearningParameters setModelName(AIStudioModelCatalogName modelName) {
this.modelName = modelName;
return this;
}
Expand All @@ -194,15 +194,15 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
}

/**
* Reads an instance of AMLParameters from the JsonReader.
* Reads an instance of AzureMachineLearningParameters from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of AMLParameters if the JsonReader was pointing to an instance of it, or null if it was
* pointing to JSON null.
* @return An instance of AzureMachineLearningParameters if the JsonReader was pointing to an instance of it, or
* null if it was pointing to JSON null.
* @throws IllegalStateException If the deserialized JSON object was missing any required properties.
* @throws IOException If an error occurs while reading the AMLParameters.
* @throws IOException If an error occurs while reading the AzureMachineLearningParameters.
*/
public static AMLParameters fromJson(JsonReader jsonReader) throws IOException {
public static AzureMachineLearningParameters fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
boolean scoringUriFound = false;
String scoringUri = null;
Expand Down Expand Up @@ -233,14 +233,15 @@ public static AMLParameters fromJson(JsonReader jsonReader) throws IOException {
}
}
if (scoringUriFound) {
AMLParameters deserializedAMLParameters = new AMLParameters(scoringUri);
deserializedAMLParameters.authenticationKey = authenticationKey;
deserializedAMLParameters.resourceId = resourceId;
deserializedAMLParameters.timeout = timeout;
deserializedAMLParameters.region = region;
deserializedAMLParameters.modelName = modelName;

return deserializedAMLParameters;
AzureMachineLearningParameters deserializedAzureMachineLearningParameters
= new AzureMachineLearningParameters(scoringUri);
deserializedAzureMachineLearningParameters.authenticationKey = authenticationKey;
deserializedAzureMachineLearningParameters.resourceId = resourceId;
deserializedAzureMachineLearningParameters.timeout = timeout;
deserializedAzureMachineLearningParameters.region = region;
deserializedAzureMachineLearningParameters.modelName = modelName;

return deserializedAzureMachineLearningParameters;
}
throw new IllegalStateException("Missing required property: uri");
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@
* vector embedding of a query string.
*/
@Fluent
public final class AMLVectorizer extends VectorSearchVectorizer {
public final class AzureMachineLearningVectorizer extends VectorSearchVectorizer {
/*
* Specifies the properties of the AML vectorizer.
*/
private AMLParameters aMLParameters;
private AzureMachineLearningParameters aMLParameters;

/**
* Creates an instance of AMLVectorizer class.
* Creates an instance of AzureMachineLearningVectorizer class.
*
* @param name the name value to set.
*/
public AMLVectorizer(String name) {
public AzureMachineLearningVectorizer(String name) {
super(name);
}

Expand All @@ -37,17 +37,17 @@ public AMLVectorizer(String name) {
*
* @return the aMLParameters value.
*/
public AMLParameters getAMLParameters() {
public AzureMachineLearningParameters getAMLParameters() {
return this.aMLParameters;
}

/**
* Set the aMLParameters property: Specifies the properties of the AML vectorizer.
*
* @param aMLParameters the aMLParameters value to set.
* @return the AMLVectorizer object itself.
* @return the AzureMachineLearningVectorizer object itself.
*/
public AMLVectorizer setAMLParameters(AMLParameters aMLParameters) {
public AzureMachineLearningVectorizer setAMLParameters(AzureMachineLearningParameters aMLParameters) {
this.aMLParameters = aMLParameters;
return this;
}
Expand All @@ -63,20 +63,20 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
}

/**
* Reads an instance of AMLVectorizer from the JsonReader.
* Reads an instance of AzureMachineLearningVectorizer from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of AMLVectorizer if the JsonReader was pointing to an instance of it, or null if it was
* pointing to JSON null.
* @return An instance of AzureMachineLearningVectorizer if the JsonReader was pointing to an instance of it, or
* null if it was pointing to JSON null.
* @throws IllegalStateException If the deserialized JSON object was missing any required properties or the
* polymorphic discriminator.
* @throws IOException If an error occurs while reading the AMLVectorizer.
* @throws IOException If an error occurs while reading the AzureMachineLearningVectorizer.
*/
public static AMLVectorizer fromJson(JsonReader jsonReader) throws IOException {
public static AzureMachineLearningVectorizer fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
boolean nameFound = false;
String name = null;
AMLParameters aMLParameters = null;
AzureMachineLearningParameters aMLParameters = null;
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
Expand All @@ -92,16 +92,17 @@ public static AMLVectorizer fromJson(JsonReader jsonReader) throws IOException {
name = reader.getString();
nameFound = true;
} else if ("amlParameters".equals(fieldName)) {
aMLParameters = AMLParameters.fromJson(reader);
aMLParameters = AzureMachineLearningParameters.fromJson(reader);
} else {
reader.skipChildren();
}
}
if (nameFound) {
AMLVectorizer deserializedAMLVectorizer = new AMLVectorizer(name);
deserializedAMLVectorizer.aMLParameters = aMLParameters;
AzureMachineLearningVectorizer deserializedAzureMachineLearningVectorizer
= new AzureMachineLearningVectorizer(name);
deserializedAzureMachineLearningVectorizer.aMLParameters = aMLParameters;

return deserializedAMLVectorizer;
return deserializedAzureMachineLearningVectorizer;
}
throw new IllegalStateException("Missing required property: name");
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeNumberField("maxComplexCollectionFieldsPerIndex", this.maxComplexCollectionFieldsPerIndex);
jsonWriter.writeNumberField("maxComplexObjectsInCollectionsPerDocument",
this.maxComplexObjectsInCollectionsPerDocument);
jsonWriter.writeNumberField("maxStoragePerIndexInBytes", this.maxStoragePerIndexInBytes);
jsonWriter.writeNumberField("maxStoragePerIndex", this.maxStoragePerIndexInBytes);
return jsonWriter.writeEndObject();
}

Expand Down Expand Up @@ -195,7 +195,7 @@ public static SearchServiceLimits fromJson(JsonReader jsonReader) throws IOExcep
} else if ("maxComplexObjectsInCollectionsPerDocument".equals(fieldName)) {
deserializedSearchServiceLimits.maxComplexObjectsInCollectionsPerDocument
= reader.getNullable(JsonReader::getInt);
} else if ("maxStoragePerIndexInBytes".equals(fieldName)) {
} else if ("maxStoragePerIndex".equals(fieldName)) {
deserializedSearchServiceLimits.maxStoragePerIndexInBytes = reader.getNullable(JsonReader::getLong);
} else {
reader.skipChildren();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public static VectorSearchVectorizer fromJson(JsonReader jsonReader) throws IOEx
} else if ("aiServicesVision".equals(discriminatorValue)) {
return AIServicesVisionVectorizer.fromJson(readerToUse.reset());
} else if ("aml".equals(discriminatorValue)) {
return AMLVectorizer.fromJson(readerToUse.reset());
return AzureMachineLearningVectorizer.fromJson(readerToUse.reset());
} else {
return fromJsonKnownDiscriminator(readerToUse.reset());
}
Expand Down
30 changes: 19 additions & 11 deletions sdk/search/azure-search-documents/swagger/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,17 +216,6 @@ directive:
return $;
```

### Rename `maxStoragePerIndex` property to `maxStoragePerIndexInBytes` in ServiceLimits

``` yaml $(tag) == 'searchservice'
directive:
- from: swagger-document
where: $.definitions.ServiceLimits.properties
transform: >
$.maxStoragePerIndexInBytes = $.maxStoragePerIndex;
delete $.maxStoragePerIndex;
```

### Set `hybridSearch` property to be type `HybridSearch` in SearchRequest

``` yaml $(tag) == 'searchindex'
Expand Down Expand Up @@ -264,6 +253,7 @@ directive:
transform: >
$.ServiceCounters["x-ms-client-name"] = "SearchServiceCounters";
$.ServiceLimits["x-ms-client-name"] = "SearchServiceLimits";
$.ServiceLimits.properties.maxStoragePerIndex["x-ms-client-name"] = "maxStoragePerIndexInBytes";
$.ServiceStatistics["x-ms-client-name"] = "SearchServiceStatistics";
```

Expand Down Expand Up @@ -438,3 +428,21 @@ directive:
where: $.definitions.VectorQuery.properties.k
transform: $["x-ms-client-name"] = "KNearestNeighborsCount";
```

### Rename `AMLVectorizer` to `AzureMachineLearningVectorizer`

```yaml $(tag) == 'searchservice'
directive:
- from: swagger-document
where: $.definitions.AMLVectorizer
transform: $["x-ms-client-name"] = "AzureMachineLearningVectorizer";
```

### Rename `AMLParameters` to `AzureMachineLearningParameters`

```yaml $(tag) == 'searchservice'
directive:
- from: swagger-document
where: $.definitions.AMLParameters
transform: $["x-ms-client-name"] = "AzureMachineLearningParameters";
```