Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit 65a2d84

Browse files
Fix
1 parent 0c15211 commit 65a2d84

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

openrobot/api_wrapper/speech.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ def speech_to_text(self, source: typing.Union[str, io.BytesIO], language_code: s
5252
if self._is_async:
5353
async def _text_to_speech() -> TextToSpeechResult:
5454
if isinstance(source, str):
55-
js = await self._client.request('POST', '/api/speech/speech-to-text', params={'url': source, 'language_code': language_code})
55+
js = await self._client._request('POST', '/api/speech/speech-to-text', params={'url': source, 'language_code': language_code})
5656
elif isinstance(source, io.BytesIO):
5757
data = aiohttp.FormData()
5858
data.add_field('file', source)
5959

60-
js = await self._client.request('POST', '/api/speech/speech-to-text', data=data)
60+
js = await self._client._request('POST', '/api/speech/speech-to-text', data=data)
6161
else:
6262
raise OpenRobotAPIError('source must be a URL or BytesIO.')
6363

@@ -66,12 +66,12 @@ async def _text_to_speech() -> TextToSpeechResult:
6666
return _text_to_speech()
6767
else:
6868
if isinstance(source, str):
69-
js = self._client.request('POST', '/api/speech/speech-to-text', params={'url': source, 'language_code': language_code})
69+
js = self._client._request('POST', '/api/speech/speech-to-text', params={'url': source, 'language_code': language_code})
7070
elif isinstance(source, io.BytesIO):
7171
data = aiohttp.FormData()
7272
data.add_field('file', source)
7373

74-
js = self._client.request('POST', '/api/speech/speech-to-text', files={'upload_file': getattr(source, 'getvalue', lambda: source)()}, params={'language_code': language_code})
74+
js = self._client._request('POST', '/api/speech/speech-to-text', files={'upload_file': getattr(source, 'getvalue', lambda: source)()}, params={'language_code': language_code})
7575
else:
7676
raise OpenRobotAPIError('source must be a URL or BytesIO.')
7777

@@ -102,13 +102,13 @@ def speech_to_text_support(self) -> typing.Union[typing.Coroutine[None, None, ty
102102

103103
if self._is_async:
104104
async def _speech_to_text_support() -> typing.Dict[str, typing.Any]:
105-
js = await self._client.request('GET', '/api/speech/speech-to-text/supports')
105+
js = await self._client._request('GET', '/api/speech/speech-to-text/supports')
106106

107107
return js
108108

109109
return _speech_to_text_support()
110110
else:
111-
js = self._client.request('GET', '/api/speech/speech-to-text/supports')
111+
js = self._client._request('GET', '/api/speech/speech-to-text/supports')
112112

113113
return js
114114

@@ -148,13 +148,13 @@ def text_to_speech(self, text: str, language_code: str, voice_id: str, *, engine
148148

149149
if self._is_async:
150150
async def _text_to_speech() -> TextToSpeechResult:
151-
js = await self._client.request('GET', '/api/speech/text-to-speech', params={'text': text, 'language_code': language_code, 'voice_id': voice_id, 'engine': engine})
151+
js = await self._client._request('GET', '/api/speech/text-to-speech', params={'text': text, 'language_code': language_code, 'voice_id': voice_id, 'engine': engine})
152152

153153
return TextToSpeechResult(js)
154154

155155
return _text_to_speech()
156156
else:
157-
js = self._client.request('GET', '/api/speech/text-to-speech', params={'text': text, 'language_code': language_code, 'voice_id': voice_id, 'engine': engine})
157+
js = self._client._request('GET', '/api/speech/text-to-speech', params={'text': text, 'language_code': language_code, 'voice_id': voice_id, 'engine': engine})
158158

159159
return TextToSpeechResult(js)
160160

@@ -190,12 +190,12 @@ def text_to_speech_support(self, language_code: str, *, engine: typing.Optional[
190190

191191
if self._is_async:
192192
async def _text_to_speech_support() -> TextToSpeechSupportResult:
193-
js = await self._client.request('GET', '/api/speech/text-to-speech/supports', params={'language_code': language_code, 'engine': engine})
193+
js = await self._client._request('GET', '/api/speech/text-to-speech/supports', params={'language_code': language_code, 'engine': engine})
194194

195195
return TextToSpeechSupportResult(js)
196196

197197
return _text_to_speech_support()
198198
else:
199-
js = self._client.request('GET', '/api/speech/text-to-speech/supports', params={'language_code': language_code, 'engine': engine})
199+
js = self._client._request('GET', '/api/speech/text-to-speech/supports', params={'language_code': language_code, 'engine': engine})
200200

201201
return TextToSpeechSupportResult(js)

0 commit comments

Comments
 (0)