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

V8 patch #842

Merged
merged 2 commits into from
Mar 13, 2024
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
16 changes: 8 additions & 8 deletions ibm_watson/speech_to_text_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def recognize(
timestamps: Optional[bool] = None,
profanity_filter: Optional[bool] = None,
smart_formatting: Optional[bool] = None,
smart_formatting_version: Optional[bool] = None,
smart_formatting_version: Optional[int] = None,
speaker_labels: Optional[bool] = None,
grammar_name: Optional[str] = None,
redaction: Optional[bool] = None,
Expand Down Expand Up @@ -447,9 +447,9 @@ def recognize(
(all dialects) transcription only.
See [Smart
formatting](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-formatting#smart-formatting).
:param bool smart_formatting_version: (optional) Smart formatting version
is for next-generation models and that is supported in US English,
Brazilian Portuguese, French and German languages.
:param int smart_formatting_version: (optional) Smart formatting version is
for next-generation models and that is supported in US English, Brazilian
Portuguese, French and German languages.
:param bool speaker_labels: (optional) If `true`, the response includes
labels that identify which words were spoken by which participants in a
multi-person exchange. By default, the service returns no speaker labels.
Expand Down Expand Up @@ -818,7 +818,7 @@ def create_job(
timestamps: Optional[bool] = None,
profanity_filter: Optional[bool] = None,
smart_formatting: Optional[bool] = None,
smart_formatting_version: Optional[bool] = None,
smart_formatting_version: Optional[int] = None,
speaker_labels: Optional[bool] = None,
grammar_name: Optional[str] = None,
redaction: Optional[bool] = None,
Expand Down Expand Up @@ -1106,9 +1106,9 @@ def create_job(
(all dialects) transcription only.
See [Smart
formatting](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-formatting#smart-formatting).
:param bool smart_formatting_version: (optional) Smart formatting version
is for next-generation models and that is supported in US English,
Brazilian Portuguese, French and German languages.
:param int smart_formatting_version: (optional) Smart formatting version is
for next-generation models and that is supported in US English, Brazilian
Portuguese, French and German languages.
:param bool speaker_labels: (optional) If `true`, the response includes
labels that identify which words were spoken by which participants in a
multi-person exchange. By default, the service returns no speaker labels.
Expand Down
5 changes: 5 additions & 0 deletions ibm_watson/speech_to_text_v1_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def recognize_using_websocket(self,
timestamps=None,
profanity_filter=None,
smart_formatting=None,
smart_formatting_version=None,
speaker_labels=None,
http_proxy_host=None,
http_proxy_port=None,
Expand Down Expand Up @@ -175,6 +176,9 @@ def recognize_using_websocket(self,
**Note:** Applies to US English, Japanese, and Spanish transcription only.
See [Smart
formatting](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-formatting#smart-formatting).
:param int smart_formatting_version: (optional) Smart formatting version is
for next-generation models and that is supported in US English, Brazilian
Portuguese, French and German languages.
:param bool speaker_labels: (optional) If `true`, the response includes
labels that identify which words were spoken by which participants in a
multi-person exchange. By default, the service returns no speaker labels.
Expand Down Expand Up @@ -360,6 +364,7 @@ def recognize_using_websocket(self,
'timestamps': timestamps,
'profanity_filter': profanity_filter,
'smart_formatting': smart_formatting,
'smart_formatting_version': smart_formatting_version,
'speaker_labels': speaker_labels,
'grammar_name': grammar_name,
'redaction': redaction,
Expand Down
8 changes: 4 additions & 4 deletions test/unit/test_speech_to_text_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def test_recognize_all_params(self):
timestamps = False
profanity_filter = True
smart_formatting = False
smart_formatting_version = False
smart_formatting_version = 0
speaker_labels = False
grammar_name = 'testString'
redaction = False
Expand Down Expand Up @@ -299,7 +299,7 @@ def test_recognize_all_params(self):
assert 'timestamps={}'.format('true' if timestamps else 'false') in query_string
assert 'profanity_filter={}'.format('true' if profanity_filter else 'false') in query_string
assert 'smart_formatting={}'.format('true' if smart_formatting else 'false') in query_string
assert 'smart_formatting_version={}'.format('true' if smart_formatting_version else 'false') in query_string
assert 'smart_formatting_version={}'.format(smart_formatting_version) in query_string
assert 'speaker_labels={}'.format('true' if speaker_labels else 'false') in query_string
assert 'grammar_name={}'.format(grammar_name) in query_string
assert 'redaction={}'.format('true' if redaction else 'false') in query_string
Expand Down Expand Up @@ -657,7 +657,7 @@ def test_create_job_all_params(self):
timestamps = False
profanity_filter = True
smart_formatting = False
smart_formatting_version = False
smart_formatting_version = 0
speaker_labels = False
grammar_name = 'testString'
redaction = False
Expand Down Expand Up @@ -731,7 +731,7 @@ def test_create_job_all_params(self):
assert 'timestamps={}'.format('true' if timestamps else 'false') in query_string
assert 'profanity_filter={}'.format('true' if profanity_filter else 'false') in query_string
assert 'smart_formatting={}'.format('true' if smart_formatting else 'false') in query_string
assert 'smart_formatting_version={}'.format('true' if smart_formatting_version else 'false') in query_string
assert 'smart_formatting_version={}'.format(smart_formatting_version) in query_string
assert 'speaker_labels={}'.format('true' if speaker_labels else 'false') in query_string
assert 'grammar_name={}'.format(grammar_name) in query_string
assert 'redaction={}'.format('true' if redaction else 'false') in query_string
Expand Down
Loading