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.1.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.1.tar.gz.

File metadata

  • Download URL: vision_agents_plugins_smart_turn-0.5.1.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.6 {"installer":{"name":"uv","version":"0.10.6","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.1.tar.gz
Algorithm Hash digest
SHA256 e5e997cc6c5c86638c373d0f5c530ad4dfd5d086e6e6248afdd7ccbaa700d3d9
MD5 4ba349e99cc02e7cf1ad03a97eb88f1f
BLAKE2b-256 084cc106504403a21e42921670226eba61cccdf38aa0b328077774fadd3fd776

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vision_agents_plugins_smart_turn-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 16.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.6 {"installer":{"name":"uv","version":"0.10.6","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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e697969c4697eb17b561a5fd9ae98d8f375c96faec40f7ddf5c6f000adb36e62
MD5 5476a24f3b85a8f8063470b7154c543e
BLAKE2b-256 32af45eb2839d72e993e99f7e7621e6822b97d95ca611b5ef299c8e0420f1be0

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