From 77cfb181f60f0c19bf635bf8189e022d60b8bc47 Mon Sep 17 00:00:00 2001 From: Paul Kompfner Date: Mon, 30 Mar 2026 23:25:56 -0400 Subject: [PATCH] Clarify per-inference helper usage in WebsocketLLMService docstring --- src/pipecat/services/llm_service.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/pipecat/services/llm_service.py b/src/pipecat/services/llm_service.py index c6526fd49..ff68e177a 100644 --- a/src/pipecat/services/llm_service.py +++ b/src/pipecat/services/llm_service.py @@ -1012,8 +1012,13 @@ class WebsocketLLMService(LLMService, WebsocketService): Provides connection lifecycle management (connect on start, disconnect on stop/cancel), automatic reconnection with exponential backoff, and - helpers for the per-inference exchange (``_ws_send``, ``_ws_recv``, - ``_ensure_connected``). + three helpers for running each inference: + + 1. ``_ensure_connected()`` — verify the websocket is alive, reconnect + with exponential backoff if not. + 2. ``_ws_send(message)`` — send the inference request as JSON. + 3. ``_ws_recv()`` — receive and parse response events one at a time + until the caller sees a terminal event. ``_ws_send`` and ``_ws_recv`` catch ``ConnectionClosed`` transparently, auto-reconnect via ``_try_reconnect``, and raise