Skip to content

Commit bb5ecf7

Browse files
feat(v1): Added ABNF Grammars field in Speech Adaptation (#474)
* feat: Added ABNF Grammars field in Speech Adaptation * Added a new field to Speech Adaptation to specify ABNF grammar definitions PiperOrigin-RevId: 499896786 Source-Link: googleapis/googleapis@ba57145 Source-Link: googleapis/googleapis-gen@f5d8be2 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZjVkOGJlMjkwNTYzMTFjMzBkZTkzMGZjMDk5YmFjY2ZiZDBlYWJlYiJ9 * 🦉 Updates from OwlBot post-processor 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>
1 parent 0a5af87 commit bb5ecf7

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed

google-cloud-speech/google/cloud/speech_v1/types/resource.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,28 @@ class SpeechAdaptation(proto.Message):
184184
of its fields, giving it a unique ``custom_class_id``. Refer
185185
to the inline defined class in phrase hints by its
186186
``custom_class_id``.
187+
abnf_grammar (google.cloud.speech_v1.types.SpeechAdaptation.ABNFGrammar):
188+
Augmented Backus-Naur form (ABNF) is a
189+
standardized grammar notation comprised by a set
190+
of derivation rules. See specifications:
191+
https://www.w3.org/TR/speech-grammar
187192
"""
188193

194+
class ABNFGrammar(proto.Message):
195+
r"""
196+
197+
Attributes:
198+
abnf_strings (MutableSequence[str]):
199+
All declarations and rules of an ABNF grammar
200+
broken up into multiple strings that will end up
201+
concatenated.
202+
"""
203+
204+
abnf_strings: MutableSequence[str] = proto.RepeatedField(
205+
proto.STRING,
206+
number=1,
207+
)
208+
189209
phrase_sets: MutableSequence["PhraseSet"] = proto.RepeatedField(
190210
proto.MESSAGE,
191211
number=1,
@@ -200,6 +220,11 @@ class SpeechAdaptation(proto.Message):
200220
number=3,
201221
message="CustomClass",
202222
)
223+
abnf_grammar: ABNFGrammar = proto.Field(
224+
proto.MESSAGE,
225+
number=4,
226+
message=ABNFGrammar,
227+
)
203228

204229

205230
__all__ = tuple(sorted(__protobuf__.manifest))

google-cloud-speech/google/cloud/speech_v1p1beta1/types/resource.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,28 @@ class SpeechAdaptation(proto.Message):
185185
of its fields, giving it a unique ``custom_class_id``. Refer
186186
to the inline defined class in phrase hints by its
187187
``custom_class_id``.
188+
abnf_grammar (google.cloud.speech_v1p1beta1.types.SpeechAdaptation.ABNFGrammar):
189+
Augmented Backus-Naur form (ABNF) is a
190+
standardized grammar notation comprised by a set
191+
of derivation rules. See specifications:
192+
https://www.w3.org/TR/speech-grammar
188193
"""
189194

195+
class ABNFGrammar(proto.Message):
196+
r"""
197+
198+
Attributes:
199+
abnf_strings (MutableSequence[str]):
200+
All declarations and rules of an ABNF grammar
201+
broken up into multiple strings that will end up
202+
concatenated.
203+
"""
204+
205+
abnf_strings: MutableSequence[str] = proto.RepeatedField(
206+
proto.STRING,
207+
number=1,
208+
)
209+
190210
phrase_sets: MutableSequence["PhraseSet"] = proto.RepeatedField(
191211
proto.MESSAGE,
192212
number=1,
@@ -201,6 +221,11 @@ class SpeechAdaptation(proto.Message):
201221
number=3,
202222
message="CustomClass",
203223
)
224+
abnf_grammar: ABNFGrammar = proto.Field(
225+
proto.MESSAGE,
226+
number=4,
227+
message=ABNFGrammar,
228+
)
204229

205230

206231
class TranscriptNormalization(proto.Message):

0 commit comments

Comments
 (0)