Skip to content

Commit 9996587

Browse files
authored
Increase speech max received msg size to 256 MiB (googleapis#8338)
1 parent 5efc7c9 commit 9996587

3 files changed

Lines changed: 21 additions & 8 deletions

File tree

speech/google/cloud/speech_v1/gapic/transports/speech_grpc_transport.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,10 @@ def create_channel(cls, address="speech.googleapis.com:443", credentials=None):
9090
grpc.Channel: A gRPC channel object.
9191
"""
9292
return google.api_core.grpc_helpers.create_channel(
93-
address, credentials=credentials, scopes=cls._OAUTH_SCOPES
93+
address,
94+
credentials=credentials,
95+
scopes=cls._OAUTH_SCOPES,
96+
options={"grpc.max_receive_message_length": 256 * 1024 * 1024}.items(),
9497
)
9598

9699
@property

speech/synth.metadata

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
{
2-
"updateTime": "2019-06-14T12:31:03.692038Z",
2+
"updateTime": "2019-06-17T08:38:08.782762Z",
33
"sources": [
44
{
55
"generator": {
66
"name": "artman",
7-
"version": "0.25.0",
8-
"dockerImage": "googleapis/artman@sha256:ef1a98ab1e2b8f05f4d9a56f27d63347aefe14020e5f2d585172b14ca76f1d90"
7+
"version": "0.26.0",
8+
"dockerImage": "googleapis/artman@sha256:6db0735b0d3beec5b887153a2a7c7411fc7bb53f73f6f389a822096bd14a3a15"
99
}
1010
},
1111
{
1212
"git": {
1313
"name": "googleapis",
1414
"remote": "https://github.com/googleapis/googleapis.git",
15-
"sha": "c23b68eecb00c4d285a730a49b1d7d943cd56183",
16-
"internalRef": "253113405"
15+
"sha": "7b58b37559f6a5337c4c564518e9573d742df225",
16+
"internalRef": "253322136"
1717
}
1818
},
1919
{

speech/synth.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2018 Google LLC
1+
# Copyright 2019 Google LLC
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -28,7 +28,7 @@
2828
# Generate speech GAPIC layer
2929
# ----------------------------------------------------------------------------
3030
for version in versions:
31-
library = gapic.py_library("speech", version, include_protos=True,)
31+
library = gapic.py_library("speech", version, include_protos=True)
3232

3333
# Don't move over __init__.py, as we modify it to make the generated client
3434
# use helpers.py.
@@ -55,6 +55,16 @@
5555
r"from google.cloud.speech_\1.gapic import speech_client as speech_\1",
5656
)
5757

58+
# Set the maximum received message size to 256 MiB, the default of 4 MiB is
59+
# often insufficient in practice.
60+
s.replace(
61+
"google/cloud/speech_v1/gapic/transports/speech_grpc_transport.py",
62+
r".*scopes=cls\._OAUTH_SCOPES.*",
63+
"""\g<0>
64+
options={"grpc.max_receive_message_length": 256 * 1024 * 1024}.items()
65+
""",
66+
)
67+
5868
# ----------------------------------------------------------------------------
5969
# Add templated files
6070
# ----------------------------------------------------------------------------

0 commit comments

Comments
 (0)