http_smart_turn

HTTP-based smart turn analyzer for remote ML inference.

This module provides a smart turn analyzer that sends audio data to remote HTTP endpoints for ML-based end-of-turn detection.

class pipecat.audio.turn.smart_turn.http_smart_turn.HttpSmartTurnAnalyzer(*, url: str, aiohttp_session: ClientSession, headers: dict[str, str] | None = None, **kwargs)[source]

Bases: BaseSmartTurn

Smart turn analyzer using HTTP-based ML inference.

Sends audio data to remote HTTP endpoints for ML-based end-of-turn prediction. Handles serialization, HTTP communication, and error recovery.

__init__(*, url: str, aiohttp_session: ClientSession, headers: dict[str, str] | None = None, **kwargs)[source]

Initialize the HTTP smart turn analyzer.

Parameters:
  • url – HTTP endpoint URL for the smart turn ML service.

  • aiohttp_session – HTTP client session for making requests.

  • headers – Optional HTTP headers to include in requests.

  • **kwargs – Additional arguments passed to BaseSmartTurn.