Skip to content

Commit

Permalink
Regenerate speech v1p1beta1 (#66)
Browse files Browse the repository at this point in the history
* Regenerate for the removal of GoogleDataCollectionConfig and google_data_collection_opt_in from v1p1beta1
  • Loading branch information
crwilcox authored Apr 25, 2018
1 parent 7eb7b7b commit 98408b8
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 67 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -295,19 +295,11 @@ message RecognitionConfig {
// version of the specified model does not exist, then the speech is
// recognized using the standard version of the specified model.
//
// Enhanced speech models require that you enable audio logging for
// your request. To enable audio logging, set the `loggingConsentState` field
// to ENABLED in the [GoogleDataCollectionConfig][google.cloud.speech.v1p1beta1.GoogleDataCollectionConfig] section of your request.
// You must also opt-in to the audio logging alpha using the instructions in
// the [alpha documentation](/speech/data-sharing). If you set `use_enhanced`
// to true and you have not enabled audio logging, then you will receive
// an error.
// Enhanced speech models require that you opt-in to the audio logging using
// instructions in the [alpha documentation](/speech/data-sharing). If you set
// `use_enhanced` to true and you have not enabled audio logging, then you
// will receive an error.
bool use_enhanced = 14;

// *Optional* Contains settings to opt-in to allow Google to
// collect and use data from this request to improve Google's products and
// services.
GoogleDataCollectionConfig google_data_collection_opt_in = 10;
}

// Description of audio data to be recognized.
Expand Down Expand Up @@ -441,20 +433,6 @@ message RecognitionMetadata {
string audio_topic = 10;
}

// Google data collection opt-in settings.
message GoogleDataCollectionConfig {
// Speech content will not be logged until authorized consent is opted in.
// Once it is opted in, this flag enables/disables logging to override that
// consent. default = ENABLED (logging due to consent).
enum LoggingConsentState {
ENABLED = 0;

DISABLED = 1;
}

LoggingConsentState logging_consent_state = 1;
}

// Provides "hints" to the speech recognizer to favor specific words and phrases
// in the results.
message SpeechContext {
Expand Down Expand Up @@ -652,6 +630,8 @@ message SpeechRecognitionAlternative {
float confidence = 2;

// Output only. A list of word-specific information for each recognized word.
// Note: When enable_speaker_diarization is true, you will see all the words
// from the beginning of the audio.
repeated WordInfo words = 3;
}

Expand Down
49 changes: 49 additions & 0 deletions packages/google-cloud-speech/smoke-test/speech_smoke_test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// Copyright 2018 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

'use strict';

describe('SpeechSmokeTest', () => {
it('successfully makes a call to the service', done => {
const speech = require('../src');

var client = new speech.v1p1beta1.SpeechClient({
// optional auth parameters.
});

var languageCode = 'en-US';
var sampleRateHertz = 44100;
var encoding = 'FLAC';
var config = {
languageCode: languageCode,
sampleRateHertz: sampleRateHertz,
encoding: encoding,
};
var uri = 'gs://gapic-toolkit/hello.flac';
var audio = {
uri: uri,
};
var request = {
config: config,
audio: audio,
};
client.recognize(request)
.then(responses => {
var response = responses[0];
console.log(response);
})
.then(done)
.catch(done);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -237,20 +237,10 @@ var StreamingRecognitionConfig = {
* version of the specified model does not exist, then the speech is
* recognized using the standard version of the specified model.
*
* Enhanced speech models require that you enable audio logging for
* your request. To enable audio logging, set the `loggingConsentState` field
* to ENABLED in the GoogleDataCollectionConfig section of your request.
* You must also opt-in to the audio logging alpha using the instructions in
* the [alpha documentation](https://cloud.google.com/speech/data-sharing). If you set `use_enhanced`
* to true and you have not enabled audio logging, then you will receive
* an error.
*
* @property {Object} googleDataCollectionOptIn
* *Optional* Contains settings to opt-in to allow Google to
* collect and use data from this request to improve Google's products and
* services.
*
* This object should have the same structure as [GoogleDataCollectionConfig]{@link google.cloud.speech.v1p1beta1.GoogleDataCollectionConfig}
* Enhanced speech models require that you opt-in to the audio logging using
* instructions in the [alpha documentation](https://cloud.google.com/speech/data-sharing). If you set
* `use_enhanced` to true and you have not enabled audio logging, then you
* will receive an error.
*
* @typedef RecognitionConfig
* @memberof google.cloud.speech.v1p1beta1
Expand Down Expand Up @@ -564,33 +554,6 @@ var RecognitionMetadata = {
}
};

/**
* Google data collection opt-in settings.
*
* @property {number} loggingConsentState
* The number should be among the values of [LoggingConsentState]{@link google.cloud.speech.v1p1beta1.LoggingConsentState}
*
* @typedef GoogleDataCollectionConfig
* @memberof google.cloud.speech.v1p1beta1
* @see [google.cloud.speech.v1p1beta1.GoogleDataCollectionConfig definition in proto format]{@link https://github.com/googleapis/googleapis/blob/master/google/cloud/speech/v1p1beta1/cloud_speech.proto}
*/
var GoogleDataCollectionConfig = {
// This is for documentation. Actual contents will be loaded by gRPC.

/**
* Speech content will not be logged until authorized consent is opted in.
* Once it is opted in, this flag enables/disables logging to override that
* consent. default = ENABLED (logging due to consent).
*
* @enum {number}
* @memberof google.cloud.speech.v1p1beta1
*/
LoggingConsentState: {
ENABLED: 0,
DISABLED: 1
}
};

/**
* Provides "hints" to the speech recognizer to favor specific words and phrases
* in the results.
Expand Down Expand Up @@ -878,6 +841,8 @@ var SpeechRecognitionResult = {
*
* @property {Object[]} words
* Output only. A list of word-specific information for each recognized word.
* Note: When enable_speaker_diarization is true, you will see all the words
* from the beginning of the audio.
*
* This object should have the same structure as [WordInfo]{@link google.cloud.speech.v1p1beta1.WordInfo}
*
Expand Down

0 comments on commit 98408b8

Please sign in to comment.