Skip to content

Commit

Permalink
Merge pull request #2717 from daspecster/fix-speech-streaming-speech-…
Browse files Browse the repository at this point in the history
…context-bug

Fix bug with speech streaming speech_context.
  • Loading branch information
daspecster authored Nov 10, 2016
2 parents 56560e7 + e55935e commit f72ac54
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 2 additions & 1 deletion google-cloud-speech/google/cloud/speech/_gax.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,8 @@ def _stream_requests(sample, language_code=None, max_alternatives=None,
"""
config_request = _make_streaming_request(
sample, language_code=language_code, max_alternatives=max_alternatives,
profanity_filter=profanity_filter, speech_context=speech_context,
profanity_filter=profanity_filter,
speech_context=SpeechContext(phrases=speech_context),
single_utterance=single_utterance, interim_results=interim_results)

# The config request MUST go first and not contain any audio data.
Expand Down
4 changes: 1 addition & 3 deletions google-cloud-speech/unit_tests/test__gax.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,6 @@ def test_stream_requests(self):
from io import BytesIO
from google.cloud import speech
from google.cloud.speech.sample import Sample
from google.cloud.grpc.speech.v1beta1.cloud_speech_pb2 import (
SpeechContext)
from google.cloud.grpc.speech.v1beta1.cloud_speech_pb2 import (
StreamingRecognitionConfig)
from google.cloud.grpc.speech.v1beta1.cloud_speech_pb2 import (
Expand All @@ -143,7 +141,7 @@ def test_stream_requests(self):
language_code = 'US-en'
max_alternatives = 2
profanity_filter = True
speech_context = SpeechContext(phrases=self.HINTS)
speech_context = self.HINTS
single_utterance = True
interim_results = False
streaming_requests = self._callFUT(sample, language_code,
Expand Down

0 comments on commit f72ac54

Please sign in to comment.