LangChain tools for FlowSpeech text-to-speech generation.
Project description
langchain-flowspeech
langchain-flowspeech provides LangChain tools for generating text-to-speech audio with FlowSpeech.
FlowSpeech is a context-aware text-to-speech service for human-like narration with emotion control, pause control, and multi-speaker voice configuration.
Installation
pip install langchain-flowspeech
Authentication
Create a FlowSpeech API key in your FlowSpeech account, then export it:
export FLOWSPEECH_API_KEY="..."
Do not commit API keys, cookies, session tokens, or provider credentials.
Usage
from langchain_flowspeech import FlowSpeechTextToSpeechTool
tool = FlowSpeechTextToSpeechTool()
result = tool.invoke({
"text": "Welcome to FlowSpeech. This audio is generated from a LangChain tool.",
"voice_name": "Kore",
"output_path": "flowspeech-demo.wav",
})
print(result["output_path"])
print(result["mime_type"])
print(result["quota"])
Multi-Speaker Speech
from langchain_flowspeech import FlowSpeechSpeaker, FlowSpeechTextToSpeechTool
tool = FlowSpeechTextToSpeechTool()
result = tool.invoke({
"text": "Speaker A: We can make this sound natural.\nSpeaker B: Great, let's use different voices.",
"speakers": [
FlowSpeechSpeaker(speaker="Speaker A", voice_name="Kore"),
FlowSpeechSpeaker(speaker="Speaker B", voice_name="Puck"),
],
"output_path": "conversation.wav",
})
API Surface
The package uses the public FlowSpeech API:
GET /api/ai/text-to-speech/quotaPOST /api/ai/text-to-speech
Responses include base64-encoded audio and metadata such as MIME type, sample rate, channel count, bit depth, and quota information.
Development
python -m venv .venv
. .venv/bin/activate
pip install -e ".[test]"
pytest
Publishing
This project is ready for PyPI packaging. Build locally with:
python -m pip install build
python -m build
For GitHub Actions trusted publishing, configure a PyPI trusted publisher for waeckerlinfederowicz66-sketch/langchain-flowspeech, then add a publishing workflow with id-token: write.
Safety
This repository intentionally contains no secrets. Tests use mocked HTTP responses.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file langchain_flowspeech-0.1.0.tar.gz.
File metadata
- Download URL: langchain_flowspeech-0.1.0.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
892e1acb2d273152229ad73569e829a028887f270324f40e727c3a5dbc5d9107
|
|
| MD5 |
4448cb15354c2219789dda5e1a98c65a
|
|
| BLAKE2b-256 |
5417ecde278492f1d2de0632f065853800162cf276e24b9929d4d68768affff4
|
Provenance
The following attestation bundles were made for langchain_flowspeech-0.1.0.tar.gz:
Publisher:
publish.yml on waeckerlinfederowicz66-sketch/langchain-flowspeech
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
langchain_flowspeech-0.1.0.tar.gz -
Subject digest:
892e1acb2d273152229ad73569e829a028887f270324f40e727c3a5dbc5d9107 - Sigstore transparency entry: 2209810630
- Sigstore integration time:
-
Permalink:
waeckerlinfederowicz66-sketch/langchain-flowspeech@761ddb51cb5e2d8ef0082ffce03b6c284f7d3038 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/waeckerlinfederowicz66-sketch
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@761ddb51cb5e2d8ef0082ffce03b6c284f7d3038 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file langchain_flowspeech-0.1.0-py3-none-any.whl.
File metadata
- Download URL: langchain_flowspeech-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e4c47a33221b8af51128c04c5b848e1acc0f98096eeb81723fee3cd668834f24
|
|
| MD5 |
c0f0f50662ed5a55530031dcad654704
|
|
| BLAKE2b-256 |
31bde0c9f6ef6b091c69ade7fbde7909d332a3ec388b20bc491739524f1189a6
|
Provenance
The following attestation bundles were made for langchain_flowspeech-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on waeckerlinfederowicz66-sketch/langchain-flowspeech
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
langchain_flowspeech-0.1.0-py3-none-any.whl -
Subject digest:
e4c47a33221b8af51128c04c5b848e1acc0f98096eeb81723fee3cd668834f24 - Sigstore transparency entry: 2209810655
- Sigstore integration time:
-
Permalink:
waeckerlinfederowicz66-sketch/langchain-flowspeech@761ddb51cb5e2d8ef0082ffce03b6c284f7d3038 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/waeckerlinfederowicz66-sketch
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@761ddb51cb5e2d8ef0082ffce03b6c284f7d3038 -
Trigger Event:
workflow_dispatch
-
Statement type: