Skip to content

Commit 1bfa9e2

Browse files
committed
fix: call super().close() in ElevenLabs TTS, clean up getattr chains
- Add super().close() call in finally block - Break nested getattr into readable steps in both ElevenLabs and Deepgram - Add SDK workaround comments
1 parent 228f65b commit 1bfa9e2

2 files changed

Lines changed: 13 additions & 17 deletions

File tree

  • plugins

plugins/deepgram/vision_agents/plugins/deepgram/deepgram_stt.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -313,13 +313,9 @@ async def close(self):
313313
self._connection_context = None
314314
self._connection_ready.clear()
315315

316-
# Close the underlying HTTP client
317-
httpx_client = getattr(
318-
getattr(
319-
getattr(self.client, "_client_wrapper", None), "httpx_client", None
320-
),
321-
"httpx_client",
322-
None,
323-
)
316+
# SDK doesn't expose a public aclose() - workaround using internals
317+
wrapper = getattr(self.client, "_client_wrapper", None)
318+
http_client = getattr(wrapper, "httpx_client", None)
319+
httpx_client = getattr(http_client, "httpx_client", None)
324320
if httpx_client is not None:
325321
await httpx_client.aclose()

plugins/elevenlabs/vision_agents/plugins/elevenlabs/tts.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,15 @@ async def stream_audio(
6464
)
6565

6666
async def close(self) -> None:
67-
httpx_client = getattr(
68-
getattr(
69-
getattr(self.client, "_client_wrapper", None), "httpx_client", None
70-
),
71-
"httpx_client",
72-
None,
73-
)
74-
if httpx_client is not None:
75-
await httpx_client.aclose()
67+
# SDK doesn't expose a public aclose() - workaround using internals
68+
try:
69+
wrapper = getattr(self.client, "_client_wrapper", None)
70+
http_client = getattr(wrapper, "httpx_client", None)
71+
httpx_client = getattr(http_client, "httpx_client", None)
72+
if httpx_client is not None:
73+
await httpx_client.aclose()
74+
finally:
75+
await super().close()
7676

7777
async def stop_audio(self) -> None:
7878
"""

0 commit comments

Comments
 (0)