Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speech: Increase speech max received msg size to 256 MiB #8338

Merged
merged 1 commit into from
Jun 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,10 @@ def create_channel(cls, address="speech.googleapis.com:443", credentials=None):
grpc.Channel: A gRPC channel object.
"""
return google.api_core.grpc_helpers.create_channel(
address, credentials=credentials, scopes=cls._OAUTH_SCOPES
address,
credentials=credentials,
scopes=cls._OAUTH_SCOPES,
options={"grpc.max_receive_message_length": 256 * 1024 * 1024}.items(),
)

@property
Expand Down
10 changes: 5 additions & 5 deletions speech/synth.metadata
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"updateTime": "2019-06-14T12:31:03.692038Z",
"updateTime": "2019-06-17T08:38:08.782762Z",
"sources": [
{
"generator": {
"name": "artman",
"version": "0.25.0",
"dockerImage": "googleapis/artman@sha256:ef1a98ab1e2b8f05f4d9a56f27d63347aefe14020e5f2d585172b14ca76f1d90"
"version": "0.26.0",
"dockerImage": "googleapis/artman@sha256:6db0735b0d3beec5b887153a2a7c7411fc7bb53f73f6f389a822096bd14a3a15"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "c23b68eecb00c4d285a730a49b1d7d943cd56183",
"internalRef": "253113405"
"sha": "7b58b37559f6a5337c4c564518e9573d742df225",
"internalRef": "253322136"
}
},
{
Expand Down
14 changes: 12 additions & 2 deletions speech/synth.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2018 Google LLC
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -28,7 +28,7 @@
# Generate speech GAPIC layer
# ----------------------------------------------------------------------------
for version in versions:
library = gapic.py_library("speech", version, include_protos=True,)
library = gapic.py_library("speech", version, include_protos=True)

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

# Set the maximum received message size to 256 MiB, the default of 4 MiB is
# often insufficient in practice.
s.replace(
"google/cloud/speech_v1/gapic/transports/speech_grpc_transport.py",
r".*scopes=cls\._OAUTH_SCOPES.*",
"""\g<0>
options={"grpc.max_receive_message_length": 256 * 1024 * 1024}.items()
""",
)

# ----------------------------------------------------------------------------
# Add templated files
# ----------------------------------------------------------------------------
Expand Down