Skip to main content

Gandr Tool

This tool allows Agents to use the Gandr text-to-speech API to create audio files from text. API keys are managed at https://gandr.ai and the free tier is 50,000 tokens.

Usage

from llama_index.tools.gandr import GandrToolSpec
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.openai import OpenAI

speech_tool = GandrToolSpec(api_key="gnd_your-key")

agent = FunctionAgent(
    tools=speech_tool.to_tool_list(),
    llm=OpenAI(model="gpt-4.1"),
)
print(
    await agent.run(
        'Create speech from the following text "Hello world" and output the file to "speech.mp3"'
    )
)

text_to_speech: Takes an input string and saves the synthesized audio to a file get_voices: Lists the available Gandr voice names

The tool POSTs to https://tts.gandr.ai/v1/audio/speech with a Bearer key. The key can also be provided through the GANDR_API_KEY environment variable.

Details:

  • Voices: gandr-mia, gandr-ava, gandr-jenny, gandr-dane, gandr-leo, gandr-lewis
  • Formats: mp3 (default), wav, pcm. pcm is headerless s16le mono at 24000 Hz.
  • Input is capped at 2000 characters per request; the tool validates this client side.
  • 23 languages are supported.
  • Every render is watermarked.

This loader is designed to be used as a way to load data as a Tool in a Agent.

This tool has a more extensive example usage documented in a Jupyter notebook here

Download files

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

Source Distribution

llama_index_tools_gandr-0.1.0.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

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

llama_index_tools_gandr-0.1.0-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file llama_index_tools_gandr-0.1.0.tar.gz.

File metadata

  • Download URL: llama_index_tools_gandr-0.1.0.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for llama_index_tools_gandr-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a9885058c74755fe6a7281e138cb7cc97810de7c6b3ae775f27444a28683f67a
MD5 49124fdf4ae6dfe75b9f7cb187828f99
BLAKE2b-256 e011c50137113aaecac51cb0be1962c4b26fda559623f1146ea1c335b7d68edc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: llama_index_tools_gandr-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for llama_index_tools_gandr-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 79e5830ef33d0ab7ecc4f208d54d429c3bb37fa8c26c8e7b521289729761307e
MD5 ea906ecb2977a3d0c75819de2e0129a5
BLAKE2b-256 022f2cca402d720a420ffcf10c5b49386061fef91138b42c35b6acaa76b2fe73

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page