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.6.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.6.1.tar.gz.

File metadata

  • Download URL: vision_agents_plugins_smart_turn-0.6.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.6.1.tar.gz
Algorithm Hash digest
SHA256 f85d6e7e8af92cc0775afe4b1b6146a2425ded8a5b96d7674d84b9fd00e743ea
MD5 dede07e238f19ef02e3924196ec459c4
BLAKE2b-256 cc7964553d3184a570e9887acf66c0ac66c711420ec2f0340e95a7413f55d4ee

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vision_agents_plugins_smart_turn-0.6.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.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b3567a8f3e95752c6fb18edb55ead2cd88d8cd49114ee8d892cd48a6ebab7f05
MD5 87210bab860517c84f495ec46b0e15c9
BLAKE2b-256 953023cd471c2518c434fec54f6f0e72e45697fd86b9bcd8dd8de521cc42d574

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