The official pyannoteAI Python SDK provides a convenient way to interact with the pyannoteAI platform. It offers state-of-the-art AI models for tasks like speaker diarization (who spoke when), speaker identification, and STT orchestration (speech-to-text with speaker attribution) via a cloud API. The library is actively maintained, with frequent releases bringing new features and improvements.
pip install pyannoteai-sdkVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize the pyannoteAI client with your API key and submit an audio file for speaker diarization. It then fetches and prints the diarization results. Remember to replace `YOUR_API_KEY_HERE` with a valid key from your pyannoteAI dashboard and use a publicly accessible audio URL.
Store API keys as environment variables and access them using `os.environ.get('PYANNOTE_API_KEY')`.Use direct, publicly accessible URLs for audio files. For cloud storage, generate signed URLs if the files are private, or upload them to pyannoteAI's servers directly using the SDK if supported.
Ensure your audio files adhere to the specified size and duration limits before submitting them. Consider pre-processing or splitting larger files if necessary.
Be aware that benchmarks and features might differ between the cloud API accessed via this SDK and the locally run open-source `pyannote.audio` library.
Implement logic to poll for job completion and download/store the `get_job_result` output promptly.
Install the SDK using pip: `pip install pyannoteai-sdk`
Ensure you have generated a valid API key from your pyannoteAI dashboard (dashboard.pyannote.ai), copied it correctly, and are passing it to the `Client` constructor. Example: `client = Client('YOUR_API_KEY_HERE')`Verify that the audio file URL is a direct link, publicly accessible, not expired, and does not require authentication. Also, check that the file size is within the allowed limits (1GiB for diarization/identification, 100MiB for voiceprints).
Examine the specific error message provided within the `PyannoteAIFailedJob` exception (e.g., 'no_speech_detected', 'file_not_audio', 'file_too_large'). Adjust your input audio or job parameters accordingly. For persistent or 'unknown_error' issues, consult the pyannoteAI troubleshooting guide or contact support.