Skip to content

Commit c732380

Browse files
add missing parameters to speech to text
1 parent c796126 commit c732380

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ sudo: false
33
notifications:
44
email: false
55
python:
6-
- '2.6'
76
- '2.7'
87
- '3.2'
98
- '3.3'

watson_developer_cloud/speech_to_text_v1.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,22 @@ def __init__(self, url=default_url, username=None, password=None, use_vcap_servi
2727
WatsonDeveloperCloudService.__init__(
2828
self, 'speech_to_text', url, username, password, use_vcap_services)
2929

30-
def recognize(self, audio, content_type, continuous=False, model=None):
30+
def recognize(self, audio, content_type, continuous=False, model=None, inactivity_timeout=None,
31+
keywords=None, keywords_threshold=None, max_alternatives=None, word_alternatives_threshold=None,
32+
word_confidence=None, timestamps=None, interim_results=None):
3133
"""
3234
Returns the recognized text from the audio input
3335
"""
3436
headers = {'content-type': content_type}
35-
params = {'continuous': continuous}
37+
params = {'continuous': continuous,
38+
'inactivityTimeout': inactivity_timeout,
39+
'keywords': keywords,
40+
'keywordsThreshold': keywords_threshold,
41+
'maxAlternatives': max_alternatives,
42+
'wordAlternativesThreshold': word_alternatives_threshold,
43+
'wordConfidence': word_confidence,
44+
'timestamps': timestamps,
45+
'interimResults': interim_results}
3646
if model:
3747
params['model'] = model
3848

0 commit comments

Comments
 (0)