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

File metadata

  • Download URL: vision_agents_plugins_smart_turn-0.5.4.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.4.tar.gz
Algorithm Hash digest
SHA256 a9cc08c29def2cff49667d4990f0f5ded2d6c1a36d1dde60bc97254f155b1604
MD5 b2dc3c7ccaa3e87e830d4beda9ea24a5
BLAKE2b-256 713051c0b8ecb256873eedd3c08de635281a916b899fff6da41b111a4d604a05

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vision_agents_plugins_smart_turn-0.5.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 818f3c5b65b5f9ccd4f7c09811d826e39512b6563a0a0aa9ca0bb66e56c04523
MD5 913e8c621248f15050f89cbbce70d63a
BLAKE2b-256 a7e138b2726dfeba03cd26b8e8eec2a6f8bbe66b85d6665c4f6fbc1ddca67f3d

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