Skip to content

Commit

Permalink
(fix): httpx.stream calls are awaited
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] authored Mar 28, 2024
1 parent 2d350b9 commit 9815c5b
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "elevenlabs"
version = "v1.0.2"
version = "v1.0.3"
description = ""
readme = "README.md"
authors = []
Expand Down
2 changes: 1 addition & 1 deletion src/elevenlabs/core/client_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def get_headers(self) -> typing.Dict[str, str]:
headers: typing.Dict[str, str] = {
"X-Fern-Language": "Python",
"X-Fern-SDK-Name": "elevenlabs",
"X-Fern-SDK-Version": "v1.0.2",
"X-Fern-SDK-Version": "v1.0.3",
}
if self._api_key is not None:
headers["xi-api-key"] = self._api_key
Expand Down
2 changes: 1 addition & 1 deletion src/elevenlabs/history/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ async def get_audio(
history_item_id="string",
)
"""
async with self._client_wrapper.httpx_client.stream(
async with await self._client_wrapper.httpx_client.stream(
"GET",
urllib.parse.urljoin(
f"{self._client_wrapper.get_base_url()}/", f"v1/history/{jsonable_encoder(history_item_id)}/audio"
Expand Down
4 changes: 2 additions & 2 deletions src/elevenlabs/speech_to_speech/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ async def convert(
optimize_streaming_latency=1,
)
"""
async with self._client_wrapper.httpx_client.stream(
async with await self._client_wrapper.httpx_client.stream(
"POST",
urllib.parse.urljoin(
f"{self._client_wrapper.get_base_url()}/", f"v1/speech-to-speech/{jsonable_encoder(voice_id)}"
Expand Down Expand Up @@ -339,7 +339,7 @@ async def convert_as_stream(
optimize_streaming_latency=1,
)
"""
async with self._client_wrapper.httpx_client.stream(
async with await self._client_wrapper.httpx_client.stream(
"POST",
urllib.parse.urljoin(
f"{self._client_wrapper.get_base_url()}/", f"v1/speech-to-speech/{jsonable_encoder(voice_id)}/stream"
Expand Down
4 changes: 2 additions & 2 deletions src/elevenlabs/text_to_speech/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ async def convert(
_request["voice_settings"] = voice_settings
if pronunciation_dictionary_locators is not OMIT:
_request["pronunciation_dictionary_locators"] = pronunciation_dictionary_locators
async with self._client_wrapper.httpx_client.stream(
async with await self._client_wrapper.httpx_client.stream(
"POST",
urllib.parse.urljoin(
f"{self._client_wrapper.get_base_url()}/", f"v1/text-to-speech/{jsonable_encoder(voice_id)}"
Expand Down Expand Up @@ -442,7 +442,7 @@ async def convert_as_stream(
_request["voice_settings"] = voice_settings
if pronunciation_dictionary_locators is not OMIT:
_request["pronunciation_dictionary_locators"] = pronunciation_dictionary_locators
async with self._client_wrapper.httpx_client.stream(
async with await self._client_wrapper.httpx_client.stream(
"POST",
urllib.parse.urljoin(
f"{self._client_wrapper.get_base_url()}/", f"v1/text-to-speech/{jsonable_encoder(voice_id)}/stream"
Expand Down
2 changes: 1 addition & 1 deletion src/elevenlabs/voice_generation/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ async def generate(
text="string",
)
"""
async with self._client_wrapper.httpx_client.stream(
async with await self._client_wrapper.httpx_client.stream(
"POST",
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "v1/voice-generation/generate-voice"),
params=jsonable_encoder(
Expand Down

0 comments on commit 9815c5b

Please sign in to comment.