Skip to content

Commit

Permalink
Merge pull request #179 from pipecat-ai/aleix/aiohttp-response-text
Browse files Browse the repository at this point in the history
fix aiohttp response text
  • Loading branch information
aconchillo authored May 23, 2024
2 parents fac43ce + 88f6436 commit a32ece8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
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

0 comments on commit a32ece8

Please sign in to comment.