Skip to content

Commit 2174669

Browse files
authored
Update client.py
return request id and total audio
1 parent 18daf27 commit 2174669

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: src/elevenlabs/text_to_speech/client.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,9 @@ def convert(
150150
) as _response:
151151
try:
152152
if 200 <= _response.status_code < 300:
153-
for _chunk in _response.iter_bytes():
154-
yield _chunk
155-
return
153+
audio_data = b''.join(chunk for chunk in _response.iter_bytes())
154+
request_id = _response.headers.get("request-id")
155+
return audio_data, request_id
156156
_response.read()
157157
if _response.status_code == 422:
158158
raise UnprocessableEntityError(

0 commit comments

Comments
 (0)