Skip to content
This repository has been archived by the owner on Apr 20, 2024. It is now read-only.

Commit

Permalink
feat: add result_end_time to SpeechRecognitionResult (#291)
Browse files Browse the repository at this point in the history
- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 413728495

Source-Link: googleapis/googleapis@10f96cb

Source-Link: googleapis/googleapis-gen@f464864
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZjQ2NDg2NDI5MmViNmIwNTVmMWUxZDg0MDhhZmY4NzgxN2NjYTY0YyJ9

docs: add clarification for global and regional endpoints
  • Loading branch information
gcf-owl-bot[bot] committed Dec 5, 2021
1 parent 3fdef1f commit 6ac4df6
Show file tree
Hide file tree
Showing 5 changed files with 258 additions and 49 deletions.
90 changes: 78 additions & 12 deletions google/cloud/speech_v1p1beta1/services/adaptation/async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,15 @@ async def create_phrase_set(
parent (:class:`str`):
Required. The parent resource where this phrase set will
be created. Format:
{api_version}/projects/{project}/locations/{location}/phraseSets
``projects/{project}/locations/{location}/phraseSets``
Speech-to-Text supports three locations: ``global``,
``us`` (US North America), and ``eu`` (Europe). If you
are calling the ``speech.googleapis.com`` endpoint, use
the ``global`` location. To specify a region, use a
`regional endpoint </speech-to-text/docs/endpoints>`__
with matching ``us`` or ``eu`` location value.
This corresponds to the ``parent`` field
on the ``request`` instance; if ``request`` is provided, this
Expand Down Expand Up @@ -280,7 +288,15 @@ async def get_phrase_set(
name (:class:`str`):
Required. The name of the phrase set to retrieve.
Format:
{api_version}/projects/{project}/locations/{location}/phraseSets/{phrase_set}
``projects/{project}/locations/{location}/phraseSets/{phrase_set}``
Speech-to-Text supports three locations: ``global``,
``us`` (US North America), and ``eu`` (Europe). If you
are calling the ``speech.googleapis.com`` endpoint, use
the ``global`` location. To specify a region, use a
`regional endpoint </speech-to-text/docs/endpoints>`__
with matching ``us`` or ``eu`` location value.
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
Expand Down Expand Up @@ -351,9 +367,17 @@ async def list_phrase_set(
The request object. Message sent by the client for the
`ListPhraseSet` method.
parent (:class:`str`):
Required. The parent, which owns this
collection of phrase set. Format:
projects/{project}/locations/{location}
Required. The parent, which owns this collection of
phrase set. Format:
``projects/{project}/locations/{location}``
Speech-to-Text supports three locations: ``global``,
``us`` (US North America), and ``eu`` (Europe). If you
are calling the ``speech.googleapis.com`` endpoint, use
the ``global`` location. To specify a region, use a
`regional endpoint </speech-to-text/docs/endpoints>`__
with matching ``us`` or ``eu`` location value.
This corresponds to the ``parent`` field
on the ``request`` instance; if ``request`` is provided, this
Expand Down Expand Up @@ -437,7 +461,15 @@ async def update_phrase_set(
The phrase set's ``name`` field is used to identify the
set to be updated. Format:
{api_version}/projects/{project}/locations/{location}/phraseSets/{phrase_set}
``projects/{project}/locations/{location}/phraseSets/{phrase_set}``
Speech-to-Text supports three locations: ``global``,
``us`` (US North America), and ``eu`` (Europe). If you
are calling the ``speech.googleapis.com`` endpoint, use
the ``global`` location. To specify a region, use a
`regional endpoint </speech-to-text/docs/endpoints>`__
with matching ``us`` or ``eu`` location value.
This corresponds to the ``phrase_set`` field
on the ``request`` instance; if ``request`` is provided, this
Expand Down Expand Up @@ -518,7 +550,8 @@ async def delete_phrase_set(
`DeletePhraseSet` method.
name (:class:`str`):
Required. The name of the phrase set to delete. Format:
{api_version}/projects/{project}/locations/{location}/phraseSets/{phrase_set}
``projects/{project}/locations/{location}/phraseSets/{phrase_set}``
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
Expand Down Expand Up @@ -585,7 +618,15 @@ async def create_custom_class(
parent (:class:`str`):
Required. The parent resource where this custom class
will be created. Format:
{api_version}/projects/{project}/locations/{location}/customClasses
``projects/{project}/locations/{location}/customClasses``
Speech-to-Text supports three locations: ``global``,
``us`` (US North America), and ``eu`` (Europe). If you
are calling the ``speech.googleapis.com`` endpoint, use
the ``global`` location. To specify a region, use a
`regional endpoint </speech-to-text/docs/endpoints>`__
with matching ``us`` or ``eu`` location value.
This corresponds to the ``parent`` field
on the ``request`` instance; if ``request`` is provided, this
Expand Down Expand Up @@ -682,7 +723,8 @@ async def get_custom_class(
name (:class:`str`):
Required. The name of the custom class to retrieve.
Format:
{api_version}/projects/{project}/locations/{location}/customClasses/{custom_class}
``projects/{project}/locations/{location}/customClasses/{custom_class}``
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
Expand Down Expand Up @@ -759,7 +801,15 @@ async def list_custom_classes(
parent (:class:`str`):
Required. The parent, which owns this collection of
custom classes. Format:
{api_version}/projects/{project}/locations/{location}/customClasses
``projects/{project}/locations/{location}/customClasses``
Speech-to-Text supports three locations: ``global``,
``us`` (US North America), and ``eu`` (Europe). If you
are calling the ``speech.googleapis.com`` endpoint, use
the ``global`` location. To specify a region, use a
`regional endpoint </speech-to-text/docs/endpoints>`__
with matching ``us`` or ``eu`` location value.
This corresponds to the ``parent`` field
on the ``request`` instance; if ``request`` is provided, this
Expand Down Expand Up @@ -843,7 +893,15 @@ async def update_custom_class(
The custom class's ``name`` field is used to identify
the custom class to be updated. Format:
{api_version}/projects/{project}/locations/{location}/customClasses/{custom_class}
``projects/{project}/locations/{location}/customClasses/{custom_class}``
Speech-to-Text supports three locations: ``global``,
``us`` (US North America), and ``eu`` (Europe). If you
are calling the ``speech.googleapis.com`` endpoint, use
the ``global`` location. To specify a region, use a
`regional endpoint </speech-to-text/docs/endpoints>`__
with matching ``us`` or ``eu`` location value.
This corresponds to the ``custom_class`` field
on the ``request`` instance; if ``request`` is provided, this
Expand Down Expand Up @@ -929,7 +987,15 @@ async def delete_custom_class(
name (:class:`str`):
Required. The name of the custom class to delete.
Format:
{api_version}/projects/{project}/locations/{location}/customClasses/{custom_class}
``projects/{project}/locations/{location}/customClasses/{custom_class}``
Speech-to-Text supports three locations: ``global``,
``us`` (US North America), and ``eu`` (Europe). If you
are calling the ``speech.googleapis.com`` endpoint, use
the ``global`` location. To specify a region, use a
`regional endpoint </speech-to-text/docs/endpoints>`__
with matching ``us`` or ``eu`` location value.
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
Expand Down
90 changes: 78 additions & 12 deletions google/cloud/speech_v1p1beta1/services/adaptation/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,15 @@ def create_phrase_set(
parent (str):
Required. The parent resource where this phrase set will
be created. Format:
{api_version}/projects/{project}/locations/{location}/phraseSets
``projects/{project}/locations/{location}/phraseSets``
Speech-to-Text supports three locations: ``global``,
``us`` (US North America), and ``eu`` (Europe). If you
are calling the ``speech.googleapis.com`` endpoint, use
the ``global`` location. To specify a region, use a
`regional endpoint </speech-to-text/docs/endpoints>`__
with matching ``us`` or ``eu`` location value.
This corresponds to the ``parent`` field
on the ``request`` instance; if ``request`` is provided, this
Expand Down Expand Up @@ -490,7 +498,15 @@ def get_phrase_set(
name (str):
Required. The name of the phrase set to retrieve.
Format:
{api_version}/projects/{project}/locations/{location}/phraseSets/{phrase_set}
``projects/{project}/locations/{location}/phraseSets/{phrase_set}``
Speech-to-Text supports three locations: ``global``,
``us`` (US North America), and ``eu`` (Europe). If you
are calling the ``speech.googleapis.com`` endpoint, use
the ``global`` location. To specify a region, use a
`regional endpoint </speech-to-text/docs/endpoints>`__
with matching ``us`` or ``eu`` location value.
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
Expand Down Expand Up @@ -561,9 +577,17 @@ def list_phrase_set(
The request object. Message sent by the client for the
`ListPhraseSet` method.
parent (str):
Required. The parent, which owns this
collection of phrase set. Format:
projects/{project}/locations/{location}
Required. The parent, which owns this collection of
phrase set. Format:
``projects/{project}/locations/{location}``
Speech-to-Text supports three locations: ``global``,
``us`` (US North America), and ``eu`` (Europe). If you
are calling the ``speech.googleapis.com`` endpoint, use
the ``global`` location. To specify a region, use a
`regional endpoint </speech-to-text/docs/endpoints>`__
with matching ``us`` or ``eu`` location value.
This corresponds to the ``parent`` field
on the ``request`` instance; if ``request`` is provided, this
Expand Down Expand Up @@ -647,7 +671,15 @@ def update_phrase_set(
The phrase set's ``name`` field is used to identify the
set to be updated. Format:
{api_version}/projects/{project}/locations/{location}/phraseSets/{phrase_set}
``projects/{project}/locations/{location}/phraseSets/{phrase_set}``
Speech-to-Text supports three locations: ``global``,
``us`` (US North America), and ``eu`` (Europe). If you
are calling the ``speech.googleapis.com`` endpoint, use
the ``global`` location. To specify a region, use a
`regional endpoint </speech-to-text/docs/endpoints>`__
with matching ``us`` or ``eu`` location value.
This corresponds to the ``phrase_set`` field
on the ``request`` instance; if ``request`` is provided, this
Expand Down Expand Up @@ -728,7 +760,8 @@ def delete_phrase_set(
`DeletePhraseSet` method.
name (str):
Required. The name of the phrase set to delete. Format:
{api_version}/projects/{project}/locations/{location}/phraseSets/{phrase_set}
``projects/{project}/locations/{location}/phraseSets/{phrase_set}``
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
Expand Down Expand Up @@ -795,7 +828,15 @@ def create_custom_class(
parent (str):
Required. The parent resource where this custom class
will be created. Format:
{api_version}/projects/{project}/locations/{location}/customClasses
``projects/{project}/locations/{location}/customClasses``
Speech-to-Text supports three locations: ``global``,
``us`` (US North America), and ``eu`` (Europe). If you
are calling the ``speech.googleapis.com`` endpoint, use
the ``global`` location. To specify a region, use a
`regional endpoint </speech-to-text/docs/endpoints>`__
with matching ``us`` or ``eu`` location value.
This corresponds to the ``parent`` field
on the ``request`` instance; if ``request`` is provided, this
Expand Down Expand Up @@ -892,7 +933,8 @@ def get_custom_class(
name (str):
Required. The name of the custom class to retrieve.
Format:
{api_version}/projects/{project}/locations/{location}/customClasses/{custom_class}
``projects/{project}/locations/{location}/customClasses/{custom_class}``
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
Expand Down Expand Up @@ -969,7 +1011,15 @@ def list_custom_classes(
parent (str):
Required. The parent, which owns this collection of
custom classes. Format:
{api_version}/projects/{project}/locations/{location}/customClasses
``projects/{project}/locations/{location}/customClasses``
Speech-to-Text supports three locations: ``global``,
``us`` (US North America), and ``eu`` (Europe). If you
are calling the ``speech.googleapis.com`` endpoint, use
the ``global`` location. To specify a region, use a
`regional endpoint </speech-to-text/docs/endpoints>`__
with matching ``us`` or ``eu`` location value.
This corresponds to the ``parent`` field
on the ``request`` instance; if ``request`` is provided, this
Expand Down Expand Up @@ -1053,7 +1103,15 @@ def update_custom_class(
The custom class's ``name`` field is used to identify
the custom class to be updated. Format:
{api_version}/projects/{project}/locations/{location}/customClasses/{custom_class}
``projects/{project}/locations/{location}/customClasses/{custom_class}``
Speech-to-Text supports three locations: ``global``,
``us`` (US North America), and ``eu`` (Europe). If you
are calling the ``speech.googleapis.com`` endpoint, use
the ``global`` location. To specify a region, use a
`regional endpoint </speech-to-text/docs/endpoints>`__
with matching ``us`` or ``eu`` location value.
This corresponds to the ``custom_class`` field
on the ``request`` instance; if ``request`` is provided, this
Expand Down Expand Up @@ -1139,7 +1197,15 @@ def delete_custom_class(
name (str):
Required. The name of the custom class to delete.
Format:
{api_version}/projects/{project}/locations/{location}/customClasses/{custom_class}
``projects/{project}/locations/{location}/customClasses/{custom_class}``
Speech-to-Text supports three locations: ``global``,
``us`` (US North America), and ``eu`` (Europe). If you
are calling the ``speech.googleapis.com`` endpoint, use
the ``global`` location. To specify a region, use a
`regional endpoint </speech-to-text/docs/endpoints>`__
with matching ``us`` or ``eu`` location value.
This corresponds to the ``name`` field
on the ``request`` instance; if ``request`` is provided, this
Expand Down
15 changes: 10 additions & 5 deletions google/cloud/speech_v1p1beta1/types/cloud_speech.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,11 +276,10 @@ class RecognitionConfig(proto.Message):
``false`` or omitted, profanities won't be filtered out.
adaptation (google.cloud.speech_v1p1beta1.types.SpeechAdaptation):
Speech adaptation configuration improves the accuracy of
speech recognition. When speech adaptation is set it
supersedes the ``speech_contexts`` field. For more
information, see the `speech
speech recognition. For more information, see the `speech
adaptation <https://cloud.google.com/speech-to-text/docs/adaptation>`__
documentation.
documentation. When speech adaptation is set it supersedes
the ``speech_contexts`` field.
transcript_normalization (google.cloud.speech_v1p1beta1.types.TranscriptNormalization):
Use transcription normalization to
automatically replace parts of the transcript
Expand Down Expand Up @@ -414,7 +413,7 @@ class AudioEncoding(proto.Enum):
codecs are used to capture or transmit audio, particularly if
background noise is present. Lossy codecs include ``MULAW``,
``AMR``, ``AMR_WB``, ``OGG_OPUS``, ``SPEEX_WITH_HEADER_BYTE``,
``MP3``.
``MP3``, and ``WEBM_OPUS``.
The ``FLAC`` and ``WAV`` audio file formats include a header that
describes the included audio content. You can request recognition
Expand Down Expand Up @@ -926,6 +925,9 @@ class SpeechRecognitionResult(proto.Message):
corresponding to the recognized result for the audio from
that channel. For audio_channel_count = N, its output values
can range from '1' to 'N'.
result_end_time (google.protobuf.duration_pb2.Duration):
Time offset of the end of this result
relative to the beginning of the audio.
language_code (str):
Output only. The
`BCP-47 <https://www.rfc-editor.org/rfc/bcp/bcp47.txt>`__
Expand All @@ -938,6 +940,9 @@ class SpeechRecognitionResult(proto.Message):
proto.MESSAGE, number=1, message="SpeechRecognitionAlternative",
)
channel_tag = proto.Field(proto.INT32, number=2,)
result_end_time = proto.Field(
proto.MESSAGE, number=4, message=duration_pb2.Duration,
)
language_code = proto.Field(proto.STRING, number=5,)


Expand Down
Loading

0 comments on commit 6ac4df6

Please sign in to comment.