From 88f6436aaa3ab4ae53d86187591ae3f5038f7a7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Conchillo=20Flaqu=C3=A9?= Date: Thu, 23 May 2024 15:51:00 -0700 Subject: [PATCH] fix aiohttp response text --- src/pipecat/services/elevenlabs.py | 5 +++-- src/pipecat/transports/services/daily.py | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/pipecat/services/elevenlabs.py b/src/pipecat/services/elevenlabs.py index 036e68987..42d5b3eae 100644 --- a/src/pipecat/services/elevenlabs.py +++ b/src/pipecat/services/elevenlabs.py @@ -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: diff --git a/src/pipecat/transports/services/daily.py b/src/pipecat/transports/services/daily.py index 143ac170d..7832a1621 100644 --- a/src/pipecat/transports/services/daily.py +++ b/src/pipecat/transports/services/daily.py @@ -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")