google-cloud-speech-v1p1beta1 0.3.6 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.md +188 -190
- data/README.md +66 -2
- data/lib/google/cloud/speech/v1p1beta1.rb +1 -0
- data/lib/google/cloud/speech/v1p1beta1/adaptation.rb +49 -0
- data/lib/google/cloud/speech/v1p1beta1/adaptation/client.rb +1102 -0
- data/lib/google/cloud/speech/v1p1beta1/adaptation/credentials.rb +51 -0
- data/lib/google/cloud/speech/v1p1beta1/adaptation/paths.rb +88 -0
- data/lib/google/cloud/speech/v1p1beta1/cloud_speech_adaptation_pb.rb +85 -0
- data/lib/google/cloud/speech/v1p1beta1/cloud_speech_adaptation_services_pb.rb +65 -0
- data/lib/google/cloud/speech/v1p1beta1/cloud_speech_pb.rb +13 -1
- data/lib/google/cloud/speech/v1p1beta1/resource_pb.rb +3 -2
- data/lib/google/cloud/speech/v1p1beta1/speech/client.rb +22 -14
- data/lib/google/cloud/speech/v1p1beta1/speech/operations.rb +94 -9
- data/lib/google/cloud/speech/v1p1beta1/version.rb +1 -1
- data/proto_docs/google/api/field_behavior.rb +6 -0
- data/proto_docs/google/cloud/speech/v1p1beta1/cloud_speech.rb +70 -24
- data/proto_docs/google/cloud/speech/v1p1beta1/cloud_speech_adaptation.rb +218 -0
- data/proto_docs/google/cloud/speech/v1p1beta1/resource.rb +4 -1
- data/proto_docs/google/longrunning/operations.rb +17 -3
- data/proto_docs/google/protobuf/any.rb +5 -2
- data/proto_docs/google/protobuf/field_mask.rb +229 -0
- data/proto_docs/google/protobuf/timestamp.rb +10 -1
- data/proto_docs/google/protobuf/wrappers.rb +121 -0
- metadata +20 -9
@@ -0,0 +1,51 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2021 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
require "googleauth"
|
20
|
+
|
21
|
+
module Google
|
22
|
+
module Cloud
|
23
|
+
module Speech
|
24
|
+
module V1p1beta1
|
25
|
+
module Adaptation
|
26
|
+
# Credentials for the Adaptation API.
|
27
|
+
class Credentials < ::Google::Auth::Credentials
|
28
|
+
self.scope = [
|
29
|
+
"https://www.googleapis.com/auth/cloud-platform"
|
30
|
+
]
|
31
|
+
self.env_vars = [
|
32
|
+
"SPEECH_CREDENTIALS",
|
33
|
+
"SPEECH_KEYFILE",
|
34
|
+
"GOOGLE_CLOUD_CREDENTIALS",
|
35
|
+
"GOOGLE_CLOUD_KEYFILE",
|
36
|
+
"GCLOUD_KEYFILE",
|
37
|
+
"SPEECH_CREDENTIALS_JSON",
|
38
|
+
"SPEECH_KEYFILE_JSON",
|
39
|
+
"GOOGLE_CLOUD_CREDENTIALS_JSON",
|
40
|
+
"GOOGLE_CLOUD_KEYFILE_JSON",
|
41
|
+
"GCLOUD_KEYFILE_JSON"
|
42
|
+
]
|
43
|
+
self.paths = [
|
44
|
+
"~/.config/google_cloud/application_default_credentials.json"
|
45
|
+
]
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,88 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2021 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
|
20
|
+
module Google
|
21
|
+
module Cloud
|
22
|
+
module Speech
|
23
|
+
module V1p1beta1
|
24
|
+
module Adaptation
|
25
|
+
# Path helper methods for the Adaptation API.
|
26
|
+
module Paths
|
27
|
+
##
|
28
|
+
# Create a fully-qualified CustomClass resource string.
|
29
|
+
#
|
30
|
+
# The resource will be in the following format:
|
31
|
+
#
|
32
|
+
# `projects/{project}/locations/{location}/customClasses/{custom_class}`
|
33
|
+
#
|
34
|
+
# @param project [String]
|
35
|
+
# @param location [String]
|
36
|
+
# @param custom_class [String]
|
37
|
+
#
|
38
|
+
# @return [::String]
|
39
|
+
def custom_class_path project:, location:, custom_class:
|
40
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
41
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
42
|
+
|
43
|
+
"projects/#{project}/locations/#{location}/customClasses/#{custom_class}"
|
44
|
+
end
|
45
|
+
|
46
|
+
##
|
47
|
+
# Create a fully-qualified Location resource string.
|
48
|
+
#
|
49
|
+
# The resource will be in the following format:
|
50
|
+
#
|
51
|
+
# `projects/{project}/locations/{location}`
|
52
|
+
#
|
53
|
+
# @param project [String]
|
54
|
+
# @param location [String]
|
55
|
+
#
|
56
|
+
# @return [::String]
|
57
|
+
def location_path project:, location:
|
58
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
59
|
+
|
60
|
+
"projects/#{project}/locations/#{location}"
|
61
|
+
end
|
62
|
+
|
63
|
+
##
|
64
|
+
# Create a fully-qualified PhraseSet resource string.
|
65
|
+
#
|
66
|
+
# The resource will be in the following format:
|
67
|
+
#
|
68
|
+
# `projects/{project}/locations/{location}/phraseSets/{phrase_set}`
|
69
|
+
#
|
70
|
+
# @param project [String]
|
71
|
+
# @param location [String]
|
72
|
+
# @param phrase_set [String]
|
73
|
+
#
|
74
|
+
# @return [::String]
|
75
|
+
def phrase_set_path project:, location:, phrase_set:
|
76
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
77
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
78
|
+
|
79
|
+
"projects/#{project}/locations/#{location}/phraseSets/#{phrase_set}"
|
80
|
+
end
|
81
|
+
|
82
|
+
extend self
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
@@ -0,0 +1,85 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto
|
3
|
+
|
4
|
+
require 'google/protobuf'
|
5
|
+
|
6
|
+
require 'google/api/annotations_pb'
|
7
|
+
require 'google/api/client_pb'
|
8
|
+
require 'google/api/field_behavior_pb'
|
9
|
+
require 'google/api/resource_pb'
|
10
|
+
require 'google/cloud/speech/v1p1beta1/resource_pb'
|
11
|
+
require 'google/protobuf/empty_pb'
|
12
|
+
require 'google/protobuf/field_mask_pb'
|
13
|
+
Google::Protobuf::DescriptorPool.generated_pool.build do
|
14
|
+
add_file("google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto", :syntax => :proto3) do
|
15
|
+
add_message "google.cloud.speech.v1p1beta1.CreatePhraseSetRequest" do
|
16
|
+
optional :parent, :string, 1
|
17
|
+
optional :phrase_set_id, :string, 2
|
18
|
+
optional :phrase_set, :message, 3, "google.cloud.speech.v1p1beta1.PhraseSet"
|
19
|
+
end
|
20
|
+
add_message "google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest" do
|
21
|
+
optional :phrase_set, :message, 1, "google.cloud.speech.v1p1beta1.PhraseSet"
|
22
|
+
optional :update_mask, :message, 2, "google.protobuf.FieldMask"
|
23
|
+
end
|
24
|
+
add_message "google.cloud.speech.v1p1beta1.GetPhraseSetRequest" do
|
25
|
+
optional :name, :string, 1
|
26
|
+
end
|
27
|
+
add_message "google.cloud.speech.v1p1beta1.ListPhraseSetRequest" do
|
28
|
+
optional :parent, :string, 1
|
29
|
+
optional :page_size, :int32, 2
|
30
|
+
optional :page_token, :string, 3
|
31
|
+
end
|
32
|
+
add_message "google.cloud.speech.v1p1beta1.ListPhraseSetResponse" do
|
33
|
+
repeated :phrase_sets, :message, 1, "google.cloud.speech.v1p1beta1.PhraseSet"
|
34
|
+
optional :next_page_token, :string, 2
|
35
|
+
end
|
36
|
+
add_message "google.cloud.speech.v1p1beta1.DeletePhraseSetRequest" do
|
37
|
+
optional :name, :string, 1
|
38
|
+
end
|
39
|
+
add_message "google.cloud.speech.v1p1beta1.CreateCustomClassRequest" do
|
40
|
+
optional :parent, :string, 1
|
41
|
+
optional :custom_class_id, :string, 2
|
42
|
+
optional :custom_class, :message, 3, "google.cloud.speech.v1p1beta1.CustomClass"
|
43
|
+
end
|
44
|
+
add_message "google.cloud.speech.v1p1beta1.UpdateCustomClassRequest" do
|
45
|
+
optional :custom_class, :message, 1, "google.cloud.speech.v1p1beta1.CustomClass"
|
46
|
+
optional :update_mask, :message, 2, "google.protobuf.FieldMask"
|
47
|
+
end
|
48
|
+
add_message "google.cloud.speech.v1p1beta1.GetCustomClassRequest" do
|
49
|
+
optional :name, :string, 1
|
50
|
+
end
|
51
|
+
add_message "google.cloud.speech.v1p1beta1.ListCustomClassesRequest" do
|
52
|
+
optional :parent, :string, 1
|
53
|
+
optional :page_size, :int32, 2
|
54
|
+
optional :page_token, :string, 3
|
55
|
+
end
|
56
|
+
add_message "google.cloud.speech.v1p1beta1.ListCustomClassesResponse" do
|
57
|
+
repeated :custom_classes, :message, 1, "google.cloud.speech.v1p1beta1.CustomClass"
|
58
|
+
optional :next_page_token, :string, 2
|
59
|
+
end
|
60
|
+
add_message "google.cloud.speech.v1p1beta1.DeleteCustomClassRequest" do
|
61
|
+
optional :name, :string, 1
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
module Google
|
67
|
+
module Cloud
|
68
|
+
module Speech
|
69
|
+
module V1p1beta1
|
70
|
+
CreatePhraseSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.CreatePhraseSetRequest").msgclass
|
71
|
+
UpdatePhraseSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.UpdatePhraseSetRequest").msgclass
|
72
|
+
GetPhraseSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.GetPhraseSetRequest").msgclass
|
73
|
+
ListPhraseSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.ListPhraseSetRequest").msgclass
|
74
|
+
ListPhraseSetResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.ListPhraseSetResponse").msgclass
|
75
|
+
DeletePhraseSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.DeletePhraseSetRequest").msgclass
|
76
|
+
CreateCustomClassRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.CreateCustomClassRequest").msgclass
|
77
|
+
UpdateCustomClassRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.UpdateCustomClassRequest").msgclass
|
78
|
+
GetCustomClassRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.GetCustomClassRequest").msgclass
|
79
|
+
ListCustomClassesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.ListCustomClassesRequest").msgclass
|
80
|
+
ListCustomClassesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.ListCustomClassesResponse").msgclass
|
81
|
+
DeleteCustomClassRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.DeleteCustomClassRequest").msgclass
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
@@ -0,0 +1,65 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# Source: google/cloud/speech/v1p1beta1/cloud_speech_adaptation.proto for package 'google.cloud.speech.v1p1beta1'
|
3
|
+
# Original file comments:
|
4
|
+
# Copyright 2021 Google LLC
|
5
|
+
#
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
+
# you may not use this file except in compliance with the License.
|
8
|
+
# You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
# See the License for the specific language governing permissions and
|
16
|
+
# limitations under the License.
|
17
|
+
#
|
18
|
+
|
19
|
+
require 'grpc'
|
20
|
+
require 'google/cloud/speech/v1p1beta1/cloud_speech_adaptation_pb'
|
21
|
+
|
22
|
+
module Google
|
23
|
+
module Cloud
|
24
|
+
module Speech
|
25
|
+
module V1p1beta1
|
26
|
+
module Adaptation
|
27
|
+
# Service that implements Google Cloud Speech Adaptation API.
|
28
|
+
class Service
|
29
|
+
|
30
|
+
include GRPC::GenericService
|
31
|
+
|
32
|
+
self.marshal_class_method = :encode
|
33
|
+
self.unmarshal_class_method = :decode
|
34
|
+
self.service_name = 'google.cloud.speech.v1p1beta1.Adaptation'
|
35
|
+
|
36
|
+
# Create a set of phrase hints. Each item in the set can be a single word or
|
37
|
+
# a multi-word phrase. The items in the PhraseSet are favored by the
|
38
|
+
# recognition model when you send a call that includes the PhraseSet.
|
39
|
+
rpc :CreatePhraseSet, ::Google::Cloud::Speech::V1p1beta1::CreatePhraseSetRequest, ::Google::Cloud::Speech::V1p1beta1::PhraseSet
|
40
|
+
# Get a phrase set.
|
41
|
+
rpc :GetPhraseSet, ::Google::Cloud::Speech::V1p1beta1::GetPhraseSetRequest, ::Google::Cloud::Speech::V1p1beta1::PhraseSet
|
42
|
+
# List phrase sets.
|
43
|
+
rpc :ListPhraseSet, ::Google::Cloud::Speech::V1p1beta1::ListPhraseSetRequest, ::Google::Cloud::Speech::V1p1beta1::ListPhraseSetResponse
|
44
|
+
# Update a phrase set.
|
45
|
+
rpc :UpdatePhraseSet, ::Google::Cloud::Speech::V1p1beta1::UpdatePhraseSetRequest, ::Google::Cloud::Speech::V1p1beta1::PhraseSet
|
46
|
+
# Delete a phrase set.
|
47
|
+
rpc :DeletePhraseSet, ::Google::Cloud::Speech::V1p1beta1::DeletePhraseSetRequest, ::Google::Protobuf::Empty
|
48
|
+
# Create a custom class.
|
49
|
+
rpc :CreateCustomClass, ::Google::Cloud::Speech::V1p1beta1::CreateCustomClassRequest, ::Google::Cloud::Speech::V1p1beta1::CustomClass
|
50
|
+
# Get a custom class.
|
51
|
+
rpc :GetCustomClass, ::Google::Cloud::Speech::V1p1beta1::GetCustomClassRequest, ::Google::Cloud::Speech::V1p1beta1::CustomClass
|
52
|
+
# List custom classes.
|
53
|
+
rpc :ListCustomClasses, ::Google::Cloud::Speech::V1p1beta1::ListCustomClassesRequest, ::Google::Cloud::Speech::V1p1beta1::ListCustomClassesResponse
|
54
|
+
# Update a custom class.
|
55
|
+
rpc :UpdateCustomClass, ::Google::Cloud::Speech::V1p1beta1::UpdateCustomClassRequest, ::Google::Cloud::Speech::V1p1beta1::CustomClass
|
56
|
+
# Delete a custom class.
|
57
|
+
rpc :DeleteCustomClass, ::Google::Cloud::Speech::V1p1beta1::DeleteCustomClassRequest, ::Google::Protobuf::Empty
|
58
|
+
end
|
59
|
+
|
60
|
+
Stub = Service.rpc_stub_class
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
@@ -6,12 +6,12 @@ require 'google/protobuf'
|
|
6
6
|
require 'google/api/annotations_pb'
|
7
7
|
require 'google/api/client_pb'
|
8
8
|
require 'google/api/field_behavior_pb'
|
9
|
-
require 'google/api/resource_pb'
|
10
9
|
require 'google/cloud/speech/v1p1beta1/resource_pb'
|
11
10
|
require 'google/longrunning/operations_pb'
|
12
11
|
require 'google/protobuf/any_pb'
|
13
12
|
require 'google/protobuf/duration_pb'
|
14
13
|
require 'google/protobuf/timestamp_pb'
|
14
|
+
require 'google/protobuf/wrappers_pb'
|
15
15
|
require 'google/rpc/status_pb'
|
16
16
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
17
17
|
add_file("google/cloud/speech/v1p1beta1/cloud_speech.proto", :syntax => :proto3) do
|
@@ -22,6 +22,12 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
22
22
|
add_message "google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest" do
|
23
23
|
optional :config, :message, 1, "google.cloud.speech.v1p1beta1.RecognitionConfig"
|
24
24
|
optional :audio, :message, 2, "google.cloud.speech.v1p1beta1.RecognitionAudio"
|
25
|
+
optional :output_config, :message, 4, "google.cloud.speech.v1p1beta1.TranscriptOutputConfig"
|
26
|
+
end
|
27
|
+
add_message "google.cloud.speech.v1p1beta1.TranscriptOutputConfig" do
|
28
|
+
oneof :output_type do
|
29
|
+
optional :gcs_uri, :string, 1
|
30
|
+
end
|
25
31
|
end
|
26
32
|
add_message "google.cloud.speech.v1p1beta1.StreamingRecognizeRequest" do
|
27
33
|
oneof :streaming_request do
|
@@ -48,6 +54,8 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
48
54
|
optional :enable_word_time_offsets, :bool, 8
|
49
55
|
optional :enable_word_confidence, :bool, 15
|
50
56
|
optional :enable_automatic_punctuation, :bool, 11
|
57
|
+
optional :enable_spoken_punctuation, :message, 22, "google.protobuf.BoolValue"
|
58
|
+
optional :enable_spoken_emojis, :message, 23, "google.protobuf.BoolValue"
|
51
59
|
optional :enable_speaker_diarization, :bool, 16
|
52
60
|
optional :diarization_speaker_count, :int32, 17
|
53
61
|
optional :diarization_config, :message, 19, "google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig"
|
@@ -129,12 +137,15 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
129
137
|
end
|
130
138
|
add_message "google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse" do
|
131
139
|
repeated :results, :message, 2, "google.cloud.speech.v1p1beta1.SpeechRecognitionResult"
|
140
|
+
optional :output_config, :message, 6, "google.cloud.speech.v1p1beta1.TranscriptOutputConfig"
|
141
|
+
optional :output_error, :message, 7, "google.rpc.Status"
|
132
142
|
end
|
133
143
|
add_message "google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata" do
|
134
144
|
optional :progress_percent, :int32, 1
|
135
145
|
optional :start_time, :message, 2, "google.protobuf.Timestamp"
|
136
146
|
optional :last_update_time, :message, 3, "google.protobuf.Timestamp"
|
137
147
|
optional :uri, :string, 4
|
148
|
+
optional :output_config, :message, 5, "google.cloud.speech.v1p1beta1.TranscriptOutputConfig"
|
138
149
|
end
|
139
150
|
add_message "google.cloud.speech.v1p1beta1.StreamingRecognizeResponse" do
|
140
151
|
optional :error, :message, 1, "google.rpc.Status"
|
@@ -179,6 +190,7 @@ module Google
|
|
179
190
|
module V1p1beta1
|
180
191
|
RecognizeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.RecognizeRequest").msgclass
|
181
192
|
LongRunningRecognizeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest").msgclass
|
193
|
+
TranscriptOutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.TranscriptOutputConfig").msgclass
|
182
194
|
StreamingRecognizeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.StreamingRecognizeRequest").msgclass
|
183
195
|
StreamingRecognitionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.StreamingRecognitionConfig").msgclass
|
184
196
|
RecognitionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.speech.v1p1beta1.RecognitionConfig").msgclass
|
@@ -3,8 +3,8 @@
|
|
3
3
|
|
4
4
|
require 'google/protobuf'
|
5
5
|
|
6
|
-
require 'google/api/annotations_pb'
|
7
6
|
require 'google/api/resource_pb'
|
7
|
+
require 'google/api/annotations_pb'
|
8
8
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
9
9
|
add_file("google/cloud/speech/v1p1beta1/resource.proto", :syntax => :proto3) do
|
10
10
|
add_message "google.cloud.speech.v1p1beta1.CustomClass" do
|
@@ -26,7 +26,8 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
26
26
|
end
|
27
27
|
add_message "google.cloud.speech.v1p1beta1.SpeechAdaptation" do
|
28
28
|
repeated :phrase_sets, :message, 1, "google.cloud.speech.v1p1beta1.PhraseSet"
|
29
|
-
repeated :
|
29
|
+
repeated :phrase_set_references, :string, 2
|
30
|
+
repeated :custom_classes, :message, 3, "google.cloud.speech.v1p1beta1.CustomClass"
|
30
31
|
end
|
31
32
|
end
|
32
33
|
end
|
@@ -60,7 +60,7 @@ module Google
|
|
60
60
|
parent_config = while namespace.any?
|
61
61
|
parent_name = namespace.join "::"
|
62
62
|
parent_const = const_get parent_name
|
63
|
-
break parent_const.configure if parent_const
|
63
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
64
64
|
namespace.pop
|
65
65
|
end
|
66
66
|
default_config = Client::Configuration.new parent_config
|
@@ -68,9 +68,9 @@ module Google
|
|
68
68
|
default_config.rpcs.recognize.timeout = 5000.0
|
69
69
|
default_config.rpcs.recognize.retry_policy = {
|
70
70
|
initial_delay: 0.1,
|
71
|
-
|
72
|
-
|
73
|
-
|
71
|
+
max_delay: 60.0,
|
72
|
+
multiplier: 1.3,
|
73
|
+
retry_codes: [4, 14]
|
74
74
|
}
|
75
75
|
|
76
76
|
default_config.rpcs.long_running_recognize.timeout = 5000.0
|
@@ -78,9 +78,9 @@ module Google
|
|
78
78
|
default_config.rpcs.streaming_recognize.timeout = 5000.0
|
79
79
|
default_config.rpcs.streaming_recognize.retry_policy = {
|
80
80
|
initial_delay: 0.1,
|
81
|
-
|
82
|
-
|
83
|
-
|
81
|
+
max_delay: 60.0,
|
82
|
+
multiplier: 1.3,
|
83
|
+
retry_codes: [4, 14]
|
84
84
|
}
|
85
85
|
|
86
86
|
default_config
|
@@ -144,7 +144,13 @@ module Google
|
|
144
144
|
|
145
145
|
# Create credentials
|
146
146
|
credentials = @config.credentials
|
147
|
-
|
147
|
+
# Use self-signed JWT if the scope and endpoint are unchanged from default,
|
148
|
+
# but only if the default endpoint does not have a region prefix.
|
149
|
+
enable_self_signed_jwt = @config.scope == Client.configure.scope &&
|
150
|
+
@config.endpoint == Client.configure.endpoint &&
|
151
|
+
!@config.endpoint.split(".").first.include?("-")
|
152
|
+
credentials ||= Credentials.default scope: @config.scope,
|
153
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
148
154
|
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
149
155
|
credentials = Credentials.new credentials, scope: @config.scope
|
150
156
|
end
|
@@ -256,7 +262,7 @@ module Google
|
|
256
262
|
# @param options [::Gapic::CallOptions, ::Hash]
|
257
263
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
258
264
|
#
|
259
|
-
# @overload long_running_recognize(config: nil, audio: nil)
|
265
|
+
# @overload long_running_recognize(config: nil, audio: nil, output_config: nil)
|
260
266
|
# Pass arguments to `long_running_recognize` via keyword arguments. Note that at
|
261
267
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
262
268
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
@@ -266,6 +272,8 @@ module Google
|
|
266
272
|
# process the request.
|
267
273
|
# @param audio [::Google::Cloud::Speech::V1p1beta1::RecognitionAudio, ::Hash]
|
268
274
|
# Required. The audio data to be recognized.
|
275
|
+
# @param output_config [::Google::Cloud::Speech::V1p1beta1::TranscriptOutputConfig, ::Hash]
|
276
|
+
# Optional. Specifies an optional destination for the recognition results.
|
269
277
|
#
|
270
278
|
# @yield [response, operation] Access the result along with the RPC operation
|
271
279
|
# @yieldparam response [::Gapic::Operation]
|
@@ -452,7 +460,7 @@ module Google
|
|
452
460
|
config_attr :scope, nil, ::String, ::Array, nil
|
453
461
|
config_attr :lib_name, nil, ::String, nil
|
454
462
|
config_attr :lib_version, nil, ::String, nil
|
455
|
-
config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
|
463
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
|
456
464
|
config_attr :interceptors, nil, ::Array, nil
|
457
465
|
config_attr :timeout, nil, ::Numeric, nil
|
458
466
|
config_attr :metadata, nil, ::Hash, nil
|
@@ -473,7 +481,7 @@ module Google
|
|
473
481
|
def rpcs
|
474
482
|
@rpcs ||= begin
|
475
483
|
parent_rpcs = nil
|
476
|
-
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config
|
484
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
477
485
|
Rpcs.new parent_rpcs
|
478
486
|
end
|
479
487
|
end
|
@@ -514,11 +522,11 @@ module Google
|
|
514
522
|
|
515
523
|
# @private
|
516
524
|
def initialize parent_rpcs = nil
|
517
|
-
recognize_config = parent_rpcs
|
525
|
+
recognize_config = parent_rpcs.recognize if parent_rpcs.respond_to? :recognize
|
518
526
|
@recognize = ::Gapic::Config::Method.new recognize_config
|
519
|
-
long_running_recognize_config = parent_rpcs
|
527
|
+
long_running_recognize_config = parent_rpcs.long_running_recognize if parent_rpcs.respond_to? :long_running_recognize
|
520
528
|
@long_running_recognize = ::Gapic::Config::Method.new long_running_recognize_config
|
521
|
-
streaming_recognize_config = parent_rpcs
|
529
|
+
streaming_recognize_config = parent_rpcs.streaming_recognize if parent_rpcs.respond_to? :streaming_recognize
|
522
530
|
@streaming_recognize = ::Gapic::Config::Method.new streaming_recognize_config
|
523
531
|
|
524
532
|
yield self if block_given?
|