Skip to content
Permalink
Browse files
feat: add output_config request field (#252)
* feat: add output_config request field

Committer: @cherba
PiperOrigin-RevId: 397621106

Source-Link: googleapis/googleapis@1872f45

Source-Link: googleapis/googleapis-gen@fd4bb9f
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZmQ0YmI5ZjNmY2M2YjdiZjQ5ODgwOGM0NDNlYWU5YmYwZDQ0NDdkZiJ9

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] committed Sep 20, 2021
1 parent 839e2b5 commit b9f856e93cbb926e9531639a9bb50c654ff1033e
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 1 deletion.
@@ -33,6 +33,7 @@
from google.cloud.speech_v1.types.cloud_speech import StreamingRecognitionResult
from google.cloud.speech_v1.types.cloud_speech import StreamingRecognizeRequest
from google.cloud.speech_v1.types.cloud_speech import StreamingRecognizeResponse
from google.cloud.speech_v1.types.cloud_speech import TranscriptOutputConfig
from google.cloud.speech_v1.types.cloud_speech import WordInfo

__all__ = (
@@ -54,5 +55,6 @@
"StreamingRecognitionResult",
"StreamingRecognizeRequest",
"StreamingRecognizeResponse",
"TranscriptOutputConfig",
"WordInfo",
)
@@ -33,6 +33,7 @@
from .types.cloud_speech import StreamingRecognitionResult
from .types.cloud_speech import StreamingRecognizeRequest
from .types.cloud_speech import StreamingRecognizeResponse
from .types.cloud_speech import TranscriptOutputConfig
from .types.cloud_speech import WordInfo

from google.cloud.speech_v1.helpers import SpeechHelpers
@@ -61,5 +62,6 @@ class SpeechClient(SpeechHelpers, SpeechClient):
"StreamingRecognitionResult",
"StreamingRecognizeRequest",
"StreamingRecognizeResponse",
"TranscriptOutputConfig",
"WordInfo",
)
@@ -30,6 +30,7 @@
StreamingRecognitionResult,
StreamingRecognizeRequest,
StreamingRecognizeResponse,
TranscriptOutputConfig,
WordInfo,
)

@@ -50,5 +51,6 @@
"StreamingRecognitionResult",
"StreamingRecognizeRequest",
"StreamingRecognizeResponse",
"TranscriptOutputConfig",
"WordInfo",
)
@@ -25,6 +25,7 @@
manifest={
"RecognizeRequest",
"LongRunningRecognizeRequest",
"TranscriptOutputConfig",
"StreamingRecognizeRequest",
"StreamingRecognitionConfig",
"RecognitionConfig",
@@ -72,10 +73,31 @@ class LongRunningRecognizeRequest(proto.Message):
request.
audio (google.cloud.speech_v1.types.RecognitionAudio):
Required. The audio data to be recognized.
output_config (google.cloud.speech_v1.types.TranscriptOutputConfig):
Optional. Specifies an optional destination
for the recognition results.
"""

config = proto.Field(proto.MESSAGE, number=1, message="RecognitionConfig",)
audio = proto.Field(proto.MESSAGE, number=2, message="RecognitionAudio",)
output_config = proto.Field(
proto.MESSAGE, number=4, message="TranscriptOutputConfig",
)


class TranscriptOutputConfig(proto.Message):
r"""Specifies an optional destination for the recognition
results.
Attributes:
gcs_uri (str):
Specifies a Cloud Storage URI for the recognition results.
Must be specified in the format:
``gs://bucket_name/object_name``, and the bucket must
already exist.
"""

gcs_uri = proto.Field(proto.STRING, number=1, oneof="output_type",)


class StreamingRecognizeRequest(proto.Message):
@@ -39,7 +39,7 @@ def partition(
class speechCallTransformer(cst.CSTTransformer):
CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata')
METHOD_TO_PARAMS: Dict[str, Tuple[str]] = {
'long_running_recognize': ('config', 'audio', ),
'long_running_recognize': ('config', 'audio', 'output_config', ),
'recognize': ('config', 'audio', ),
'streaming_recognize': ('streaming_config', 'audio_content', ),
}

0 comments on commit b9f856e

Please sign in to comment.