This release is a pre-release and may not be stable for production use.
Swarmauri Text-to-Speech Agent
swarmauri_agent_texttospeech provides a stateless agent that converts each
text prompt into an audio file through any Swarmauri TTSBase provider.
Features
- Converts one fresh text input into one audio file.
- Uses any provider implementing Swarmauri's
TTSBasecontract. - Keeps no conversation history, memory, or system context.
- Supports synchronous, asynchronous, and batch agent execution.
- Generates distinct default paths for batch outputs.
Installation
uv add swarmauri_agent_texttospeech
pip install swarmauri_agent_texttospeech
Install a TTS provider package alongside the agent. For the alpha OpenAI provider:
uv add --prerelease allow swarmauri_tts_openai
Or with pip:
pip install --pre swarmauri_tts_openai
Usage
import os
from swarmauri_agent_texttospeech import TextToSpeechAgent
from swarmauri_tts_openai import OpenaiTTS
tts = OpenaiTTS(
api_key=os.environ["OPENAI_API_KEY"],
name="gpt-4o-mini-tts",
voice="alloy",
)
agent = TextToSpeechAgent(tts=tts, output_path="greeting.mp3")
audio_path = agent.exec("Welcome to Swarmauri.")
print(audio_path)
Each call is independent. The agent passes only that call's text to the TTS provider and never constructs a conversation or system message.
Structured dialogue and bounded batches
The agent also forwards a nonempty tuple of typed dialogue turns unchanged:
import os
from swarmauri_agent_texttospeech import TextToSpeechAgent
from swarmauri_tts_gemini_dialogue import (
GeminiDialogueTTS, GeminiDialogueTurn,
)
provider = GeminiDialogueTTS(
api_key=os.environ["GEMINI_API_KEY"],
speaker_voices={"A": "Puck", "B": "Kore"},
)
agent = TextToSpeechAgent(tts=provider, output_path="dialogue.wav")
turns = (
GeminiDialogueTurn(text="Hello", speaker="A"),
GeminiDialogueTurn(text="Hello back", speaker="B"),
)
agent.exec(turns)
# await agent.abatch([turns], max_concurrent=2)
Speaker and voice validation belongs to the selected provider. A JSON string is not parsed into turns. Set filenames to match the codec; Gemini/native DeepInfra WAV defaults require .wav paths. Async batches default to at most five concurrent calls, with a positive integer max_concurrent override.
The OpenAI Speech example above is temporary compatibility: its models have a scheduled 2027-01-06 shutdown. All new provider packages remain alpha and live verification is pending; see the SDK migration and verification guides.
Contributing
This package is part of the Swarmauri SDK. Contributions should follow the repository contribution and style guides.
License
Apache-2.0
Metadata
Release files for swarmauri_agent_texttospeech 0.11.0.dev5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| swarmauri_agent_texttospeech-0.11.0.dev5.tar.gz | 8.4 kB | Without provenance | Details for swarmauri_agent_texttospeech-0.11.0.dev5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| swarmauri_agent_texttospeech-0.11.0.dev5-py3-none-any.whl | Python 3 | none | any | Details for swarmauri_agent_texttospeech-0.11.0.dev5-py3-none-any.whl |
Total release size: 18.2 kB
Release files / swarmauri_agent_texttospeech-0.11.0.dev5.tar.gz
| Download URL | swarmauri_agent_texttospeech-0.11.0.dev5.tar.gz |
|---|---|
| Size | 8.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
489df9a18d2b7ca370a32bd42bbfec7e8bf6714a8374b749eb7d49dc14c6e3f2
|
|
BLAKE2b-256 checksum How to use checksums |
6abe1de3e3b67dffa2f99d2dd7e8bb6c37eff8b4ce6c6b766be9191948f58a55
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / swarmauri_agent_texttospeech-0.11.0.dev5-py3-none-any.whl
| Download URL | swarmauri_agent_texttospeech-0.11.0.dev5-py3-none-any.whl |
|---|---|
| Size | 9.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
24aabe9622de1d1b1c6f4e08cce1a4930570f520e66e5610284c93fb280f6518
|
|
BLAKE2b-256 checksum How to use checksums |
03ced9e279c6726e25be10a0aa5c89143ed8f1ac3df101f2577cf6fc65492953
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for swarmauri_agent_texttospeech 0.11.0.dev5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.