Skip to main content

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/quota
  • POST /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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

langchain_flowspeech-0.1.0.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

langchain_flowspeech-0.1.0-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

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

Hashes for langchain_flowspeech-0.1.0.tar.gz
Algorithm Hash digest
SHA256 892e1acb2d273152229ad73569e829a028887f270324f40e727c3a5dbc5d9107
MD5 4448cb15354c2219789dda5e1a98c65a
BLAKE2b-256 5417ecde278492f1d2de0632f065853800162cf276e24b9929d4d68768affff4

See more details on using hashes here.

Provenance

The following attestation bundles were made for langchain_flowspeech-0.1.0.tar.gz:

Publisher: publish.yml on waeckerlinfederowicz66-sketch/langchain-flowspeech

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file langchain_flowspeech-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for langchain_flowspeech-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e4c47a33221b8af51128c04c5b848e1acc0f98096eeb81723fee3cd668834f24
MD5 c0f0f50662ed5a55530031dcad654704
BLAKE2b-256 31bde0c9f6ef6b091c69ade7fbde7909d332a3ec388b20bc491739524f1189a6

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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