Skip to main content

Smart Turn detection plugin for Vision Agents

Project description

Smart Turn Detection Plugin

An AI-powered turn detection plugin for Vision Agents that uses the Smart Turn model to detect when a speaker has completed their turn in a conversation.

Overview

Smart Turn is an open-source, community-driven, native audio turn detection model that goes beyond simple Voice Activity Detection (VAD). It analyzes grammar, tone, pace of speech, and various other complex audio and semantic cues to determine when a user has finished speaking, matching human expectations more closely than VAD-based approaches.

For more information about the Smart Turn model, visit the official repository.

Installation

uv add "vision-agents[smart_turn]"
# or directly
uv add vision-agents-plugins-smart-turn

Usage

from vision_agents.plugins.smart_turn import TurnDetection

# Initialize with FAL API key from environment variable
turn_detector = TurnDetection()

# Or specify API key directly
turn_detector = TurnDetection(api_key="your_fal_api_key")


# Register event handlers
@turn_detector.on("turn_started")
def on_turn_started(event_data):
    print(f"Turn started: {event_data.participant}")


@turn_detector.on("turn_ended")
def on_turn_ended(event_data):
    print(f"Turn ended: {event_data.participant} (confidence: {event_data.confidence:.3f})")


# Start detection
turn_detector.start()

# Process audio
await turn_detector.process_audio(pcm_data, user_id="user123")

# Stop detection
turn_detector.stop()

Configuration Options

  • api_key: FAL API key (default: reads from FAL_KEY environment variable)
  • buffer_duration: Duration in seconds to buffer audio before processing (default: 2.0)
  • confidence_threshold: Probability threshold for "complete" predictions (default: 0.5)
  • sample_rate: Audio sample rate in Hz (default: 16000)
  • channels: Number of audio channels (default: 1)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vision_agents_plugins_smart_turn-0.5.3.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file vision_agents_plugins_smart_turn-0.5.3.tar.gz.

File metadata

  • Download URL: vision_agents_plugins_smart_turn-0.5.3.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for vision_agents_plugins_smart_turn-0.5.3.tar.gz
Algorithm Hash digest
SHA256 74606659df1125d43b8df8f0e048ab9ce329784134b37de36f7785a07dc78d9c
MD5 94d77b518784b2454377340c2d600755
BLAKE2b-256 00210233306d9c95821929188350d6ec5bb7bca3e0f67f4be46273b91f48ce5a

See more details on using hashes here.

File details

Details for the file vision_agents_plugins_smart_turn-0.5.3-py3-none-any.whl.

File metadata

  • Download URL: vision_agents_plugins_smart_turn-0.5.3-py3-none-any.whl
  • Upload date:
  • Size: 16.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for vision_agents_plugins_smart_turn-0.5.3-py3-none-any.whl
Algorithm Hash digest
SHA256 563180dfa555dfea01abaac996529db5c98e315d2d3e7eaf58124b72b3ddef43
MD5 b419ece787e889bda3076bf9821c470c
BLAKE2b-256 4981157159a1c684917d9c8e01b8524a2534d819ab711766d81b60d9e223ee50

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page