Skip to content

Commit

Permalink
Regenerate QnAMaker with 5.0-preview1 API (#17365)
Browse files Browse the repository at this point in the history
* Regenerate QnAMaker with 5.0-preview1 API

* Remove code model v1 file

* Bump pom version
  • Loading branch information
jianghaolu authored Nov 10, 2020
1 parent 00cba53 commit 423673d
Show file tree
Hide file tree
Showing 31 changed files with 1,391 additions and 895 deletions.
2 changes: 1 addition & 1 deletion eng/versioning/version_data.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ com.microsoft.azure.cognitiveservices:azure-cognitiveservices-contentmoderator;1
com.microsoft.azure.cognitiveservices:azure-cognitiveservices-customvision-prediction;1.1.0-beta.3;1.1.0-beta.3
com.microsoft.azure.cognitiveservices:azure-cognitiveservices-customvision-training;1.1.0-beta.3;1.1.0-beta.3
com.microsoft.azure.cognitiveservices:azure-cognitiveservices-faceapi;1.1.0-beta.1;1.1.0-beta.1
com.microsoft.azure.cognitiveservices:azure-cognitiveservices-qnamaker;1.0.0-beta.1;1.0.0-beta.1
com.microsoft.azure.cognitiveservices:azure-cognitiveservices-qnamaker;1.0.0-beta.2;1.0.0-beta.2
com.microsoft.azure:azure-eventhubs;3.2.2;3.3.0-beta.1
com.microsoft.azure:azure-eventhubs-eph;3.2.2;3.3.0-beta.1
com.microsoft.azure:azure-eventhubs-extensions;3.2.2;3.3.0-beta.1
Expand Down
2 changes: 1 addition & 1 deletion sdk/cognitiveservices/ms-azure-cs-qnamaker/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</parent>
<artifactId>azure-cognitiveservices-qnamaker</artifactId>
<groupId>com.microsoft.azure.cognitiveservices</groupId>
<version>1.0.0-beta.1</version> <!-- {x-version-update;com.microsoft.azure.cognitiveservices:azure-cognitiveservices-qnamaker;current} -->
<version>1.0.0-beta.2</version> <!-- {x-version-update;com.microsoft.azure.cognitiveservices:azure-cognitiveservices-qnamaker;current} -->
<packaging>jar</packaging>
<name>Microsoft Azure SDK for Cognitive Service QnA Maker</name>
<description>This package contains Microsoft Cognitive Service QnA Maker SDK.</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,49 @@ public interface Alterations {
Observable<Void> replaceAsync(List<AlterationsDTO> wordAlterations);



/**
* Download alterations per Knowledgebase (QnAMaker Managed).
*
* @param kbId Knowledgebase id.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws ErrorResponseException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @return the WordAlterationsDTO object if successful.
*/
WordAlterationsDTO getAlterationsForKb(String kbId);

/**
* Download alterations per Knowledgebase (QnAMaker Managed).
*
* @param kbId Knowledgebase id.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the WordAlterationsDTO object
*/
Observable<WordAlterationsDTO> getAlterationsForKbAsync(String kbId);



/**
* Replace alterations data per Knowledgebase (QnAMaker Managed).
*
* @param kbId Knowledgebase id.
* @param wordAlterations Collection of word alterations.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws ErrorResponseException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
*/
void replaceAlterationsForKb(String kbId, List<AlterationsDTO> wordAlterations);

/**
* Replace alterations data per Knowledgebase (QnAMaker Managed).
*
* @param kbId Knowledgebase id.
* @param wordAlterations Collection of word alterations.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return a representation of the deferred computation of this call if successful.
*/
Observable<Void> replaceAlterationsForKbAsync(String kbId, List<AlterationsDTO> wordAlterations);


}
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@

package com.microsoft.azure.cognitiveservices.knowledge.qnamaker;

import com.microsoft.azure.cognitiveservices.knowledge.qnamaker.models.UpdateSettingsOptionalParameter;
import com.microsoft.azure.cognitiveservices.knowledge.qnamaker.models.EndpointSettingsDTO;
import com.microsoft.azure.cognitiveservices.knowledge.qnamaker.models.EndpointSettingsDTOActiveLearning;
import com.microsoft.azure.cognitiveservices.knowledge.qnamaker.models.ErrorResponseException;
import java.io.IOException;
import com.microsoft.azure.cognitiveservices.knowledge.qnamaker.models.UpdateSettingsOptionalParameter;
import rx.Observable;

/**
Expand Down Expand Up @@ -47,18 +46,17 @@ public interface EndpointSettings {
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws ErrorResponseException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @return the String object if successful.
*/
String updateSettings(UpdateSettingsOptionalParameter updateSettingsOptionalParameter);
void updateSettings(UpdateSettingsOptionalParameter updateSettingsOptionalParameter);

/**
* Updates endpoint settings for an endpoint.
*
* @param updateSettingsOptionalParameter the object representing the optional parameters to be set before calling this API
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the String object
* @return a representation of the deferred computation of this call if successful.
*/
Observable<String> updateSettingsAsync(UpdateSettingsOptionalParameter updateSettingsOptionalParameter);
Observable<Void> updateSettingsAsync(UpdateSettingsOptionalParameter updateSettingsOptionalParameter);

/**
* Updates endpoint settings for an endpoint.
Expand Down Expand Up @@ -92,16 +90,15 @@ interface WithExecute extends EndpointSettingsUpdateSettingsDefinitionStages.Wit
/**
* Execute the request.
*
* @return the String object if successful.
*/
String execute();
void execute();

/**
* Execute the request asynchronously.
*
* @return the observable to the String object
* @return a representation of the deferred computation of this call if successful.
*/
Observable<String> executeAsync();
Observable<Void> executeAsync();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,20 @@

package com.microsoft.azure.cognitiveservices.knowledge.qnamaker;

import com.microsoft.azure.cognitiveservices.knowledge.qnamaker.models.DownloadOptionalParameter;
import com.microsoft.azure.cognitiveservices.knowledge.qnamaker.models.TrainOptionalParameter;
import com.microsoft.azure.cognitiveservices.knowledge.qnamaker.models.CreateKbDTO;
import com.microsoft.azure.cognitiveservices.knowledge.qnamaker.models.EnvironmentType;
import com.microsoft.azure.cognitiveservices.knowledge.qnamaker.models.ErrorResponseException;
import com.microsoft.azure.cognitiveservices.knowledge.qnamaker.models.FeedbackRecordDTO;
import com.microsoft.azure.cognitiveservices.knowledge.qnamaker.models.KnowledgebaseDTO;
import com.microsoft.azure.cognitiveservices.knowledge.qnamaker.models.KnowledgebasesDTO;
import com.microsoft.azure.cognitiveservices.knowledge.qnamaker.models.KnowledgebaseUpdateHeaders;
import com.microsoft.azure.cognitiveservices.knowledge.qnamaker.models.Operation;
import com.microsoft.azure.cognitiveservices.knowledge.qnamaker.models.QnADocumentsDTO;
import com.microsoft.azure.cognitiveservices.knowledge.qnamaker.models.QnADTO;
import com.microsoft.azure.cognitiveservices.knowledge.qnamaker.models.QnASearchResultList;
import com.microsoft.azure.cognitiveservices.knowledge.qnamaker.models.QueryDTO;
import com.microsoft.azure.cognitiveservices.knowledge.qnamaker.models.UpdateKbOperationDTO;
import java.io.IOException;
import java.util.List;
Expand Down Expand Up @@ -182,28 +187,219 @@ public interface Knowledgebases {
Observable<Operation> createAsync(CreateKbDTO createKbPayload);



/**
* Download the knowledgebase.
*
* @param kbId Knowledgebase id.
* @param environment Specifies whether environment is Test or Prod. Possible values include: 'Prod', 'Test'.
* @param downloadOptionalParameter the object representing the optional parameters to be set before calling this API
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws ErrorResponseException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @return the QnADocumentsDTO object if successful.
*/
QnADocumentsDTO download(String kbId, EnvironmentType environment);
QnADocumentsDTO download(String kbId, EnvironmentType environment, DownloadOptionalParameter downloadOptionalParameter);

/**
* Download the knowledgebase.
*
* @param kbId Knowledgebase id.
* @param environment Specifies whether environment is Test or Prod. Possible values include: 'Prod', 'Test'.
* @param downloadOptionalParameter the object representing the optional parameters to be set before calling this API
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the QnADocumentsDTO object
*/
Observable<QnADocumentsDTO> downloadAsync(String kbId, EnvironmentType environment);
Observable<QnADocumentsDTO> downloadAsync(String kbId, EnvironmentType environment, DownloadOptionalParameter downloadOptionalParameter);

/**
* Download the knowledgebase.
*
* @return the first stage of the download call
*/
KnowledgebasesDownloadDefinitionStages.WithKbId download();

/**
* Grouping of download definition stages.
*/
interface KnowledgebasesDownloadDefinitionStages {
/**
* The stage of the definition to be specify kbId.
*/
interface WithKbId {
/**
* Knowledgebase id.
*
* @return next definition stage
*/
WithEnvironment withKbId(String kbId);
}
/**
* The stage of the definition to be specify environment.
*/
interface WithEnvironment {
/**
* Specifies whether environment is Test or Prod. Possible values include: 'Prod', 'Test'.
*
* @return next definition stage
*/
KnowledgebasesDownloadDefinitionStages.WithExecute withEnvironment(EnvironmentType environment);
}

/**
* The stage of the definition which allows for any other optional settings to be specified.
*/
interface WithAllOptions {
/**
* The source property filter to apply.
*
* @return next definition stage
*/
KnowledgebasesDownloadDefinitionStages.WithExecute withSource(String source);

/**
* The last changed status property filter to apply.
*
* @return next definition stage
*/
KnowledgebasesDownloadDefinitionStages.WithExecute withChangedSince(String changedSince);

}

/**
* The last stage of the definition which will make the operation call.
*/
interface WithExecute extends KnowledgebasesDownloadDefinitionStages.WithAllOptions {
/**
* Execute the request.
*
* @return the QnADocumentsDTO object if successful.
*/
QnADocumentsDTO execute();

/**
* Execute the request asynchronously.
*
* @return the observable to the QnADocumentsDTO object
*/
Observable<QnADocumentsDTO> executeAsync();
}
}

/**
* The entirety of download definition.
*/
interface KnowledgebasesDownloadDefinition extends
KnowledgebasesDownloadDefinitionStages.WithKbId,
KnowledgebasesDownloadDefinitionStages.WithEnvironment,
KnowledgebasesDownloadDefinitionStages.WithExecute {
}


/**
* GenerateAnswer call to query knowledgebase (QnA Maker Managed).
*
* @param kbId Knowledgebase id.
* @param generateAnswerPayload Post body of the request.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws ErrorResponseException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @return the QnASearchResultList object if successful.
*/
QnASearchResultList generateAnswer(String kbId, QueryDTO generateAnswerPayload);

/**
* GenerateAnswer call to query knowledgebase (QnA Maker Managed).
*
* @param kbId Knowledgebase id.
* @param generateAnswerPayload Post body of the request.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the QnASearchResultList object
*/
Observable<QnASearchResultList> generateAnswerAsync(String kbId, QueryDTO generateAnswerPayload);


/**
* Train call to add suggestions to knowledgebase (QnAMaker Managed).
*
* @param kbId Knowledgebase id.
* @param trainOptionalParameter the object representing the optional parameters to be set before calling this API
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws ErrorResponseException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
*/
void train(String kbId, TrainOptionalParameter trainOptionalParameter);

/**
* Train call to add suggestions to knowledgebase (QnAMaker Managed).
*
* @param kbId Knowledgebase id.
* @param trainOptionalParameter the object representing the optional parameters to be set before calling this API
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return a representation of the deferred computation of this call if successful.
*/
Observable<Void> trainAsync(String kbId, TrainOptionalParameter trainOptionalParameter);

/**
* Train call to add suggestions to knowledgebase (QnAMaker Managed).
*
* @return the first stage of the train call
*/
KnowledgebasesTrainDefinitionStages.WithKbId train();

/**
* Grouping of train definition stages.
*/
interface KnowledgebasesTrainDefinitionStages {
/**
* The stage of the definition to be specify kbId.
*/
interface WithKbId {
/**
* Knowledgebase id.
*
* @return next definition stage
*/
KnowledgebasesTrainDefinitionStages.WithExecute withKbId(String kbId);
}

/**
* The stage of the definition which allows for any other optional settings to be specified.
*/
interface WithAllOptions {
/**
* List of feedback records.
*
* @return next definition stage
*/
KnowledgebasesTrainDefinitionStages.WithExecute withFeedbackRecords(List<FeedbackRecordDTO> feedbackRecords);

}

/**
* The last stage of the definition which will make the operation call.
*/
interface WithExecute extends KnowledgebasesTrainDefinitionStages.WithAllOptions {
/**
* Execute the request.
*
*/
void execute();

/**
* Execute the request asynchronously.
*
* @return a representation of the deferred computation of this call if successful.
*/
Observable<Void> executeAsync();
}
}

/**
* The entirety of train definition.
*/
interface KnowledgebasesTrainDefinition extends
KnowledgebasesTrainDefinitionStages.WithKbId,
KnowledgebasesTrainDefinitionStages.WithExecute {
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ public interface QnAMakerClient {
String userAgent();

/**
* Gets Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com)..
* Gets Supported Cognitive Services endpoint (e.g., https://< qnamaker-resource-name >.api.cognitiveservices.azure.com)..
*
* @return the endpoint value.
*/
String endpoint();

/**
* Sets Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com)..
* Sets Supported Cognitive Services endpoint (e.g., https://< qnamaker-resource-name >.api.cognitiveservices.azure.com)..
*
* @param endpoint the endpoint value.
* @return the service client itself
Expand Down
Loading

0 comments on commit 423673d

Please sign in to comment.