Search in sources :

Example 6 with GetModelOptions

use of com.ibm.watson.developer_cloud.speech_to_text.v1.model.GetModelOptions in project java-sdk by watson-developer-cloud.

the class SpeechToText method getModel.

/**
 * Retrieves information about the model.
 *
 * Returns information about a single specified language model that is available for use with the service. The
 * information includes the name of the model and its minimum sampling rate in Hertz, among other things.
 *
 * @param getModelOptions the {@link GetModelOptions} containing the options for the call
 * @return a {@link ServiceCall} with a response type of {@link SpeechModel}
 */
public ServiceCall<SpeechModel> getModel(GetModelOptions getModelOptions) {
    Validator.notNull(getModelOptions, "getModelOptions cannot be null");
    String[] pathSegments = { "v1/models" };
    String[] pathParameters = { getModelOptions.modelId() };
    RequestBuilder builder = RequestBuilder.get(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments, pathParameters));
    return createServiceCall(builder.build(), ResponseConverterUtils.getObject(SpeechModel.class));
}
Also used : RequestBuilder(com.ibm.watson.developer_cloud.http.RequestBuilder) SpeechModel(com.ibm.watson.developer_cloud.speech_to_text.v1.model.SpeechModel)

Aggregations

Test (org.junit.Test)5 WatsonServiceUnitTest (com.ibm.watson.developer_cloud.WatsonServiceUnitTest)3 GetModelOptions (com.ibm.watson.developer_cloud.language_translator.v2.model.GetModelOptions)3 SpeechModel (com.ibm.watson.developer_cloud.speech_to_text.v1.model.SpeechModel)3 WatsonServiceTest (com.ibm.watson.developer_cloud.WatsonServiceTest)2 TranslationModel (com.ibm.watson.developer_cloud.language_translator.v2.model.TranslationModel)2 GetModelOptions (com.ibm.watson.developer_cloud.speech_to_text.v1.model.GetModelOptions)2 RecordedRequest (okhttp3.mockwebserver.RecordedRequest)2 RequestBuilder (com.ibm.watson.developer_cloud.http.RequestBuilder)1 MockResponse (okhttp3.mockwebserver.MockResponse)1