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

fix aiohttp response text #179

Merged
merged 1 commit into from
May 23, 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
5 changes: 3 additions & 2 deletions src/pipecat/services/elevenlabs.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ async def run_tts(self, text: str) -> AsyncGenerator[Frame, None]:

async with self._aiohttp_session.post(url, json=payload, headers=headers, params=querystring) as r:
if r.status != 200:
logger.error(f"Error getting audio (status: {r.status}, error: {r.text()})")
yield ErrorFrame(f"Error getting audio (status: {r.status}, error: {r.text()})")
text = await r.text()
logger.error(f"Error getting audio (status: {r.status}, error: {text})")
yield ErrorFrame(f"Error getting audio (status: {r.status}, error: {text})")
return

async for chunk in r.content:
Expand Down
3 changes: 2 additions & 1 deletion src/pipecat/transports/services/daily.py
Original file line number Diff line number Diff line change
Expand Up @@ -745,8 +745,9 @@ async def _handle_dialin_ready(self, sip_endpoint: str):

async with session.post(url, headers=headers, data=data) as r:
if r.status != 200:
text = await r.text()
logger.error(
f"Unable to handle dialin-ready event (status: {r.status}, error: {r.text()})")
f"Unable to handle dialin-ready event (status: {r.status}, error: {text})")
return

logger.debug("dialin-ready event handled successfully")
Expand Down
Loading