Metadata-Version: 2.5
Name: llama-index-tools-lokutor
Version: 0.1.0
Summary: llama-index tools lokutor integration: give agents Lokutor text-to-speech and speech-to-text
Project-URL: Homepage, https://lokutor.com
Project-URL: Documentation, https://docs.lokutor.com
Project-URL: Source, https://github.com/lokutor-ai/llama-index-lokutor
Author-email: Lokutor AI <contact@lokutor.com>
License-Expression: Apache-2.0
License-File: LICENSE
Requires-Python: <4.0,>=3.10
Requires-Dist: httpx>=0.25
Requires-Dist: llama-index-core<0.15,>=0.13.0
Description-Content-Type: text/markdown

# LlamaIndex Tools Integration: Lokutor

Gives agents [Lokutor](https://lokutor.com) text-to-speech (Versa 2.0) and speech-to-text (Conv 2.0).

```bash
pip install llama-index-tools-lokutor
export LOKUTOR_API_KEY=...   # https://app.lokutor.com
```

```python
from llama_index.tools.lokutor import LokutorToolSpec
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.openai import OpenAI

spec = LokutorToolSpec(voice="F1", language="en")
agent = FunctionAgent(tools=spec.to_tool_list(), llm=OpenAI(model="gpt-4.1"))
print(await agent.run('Say "Hello world!" and save it to hello.wav, then transcribe hello.wav.'))
```

Functions:

- `text_to_speech(text, output_path, voice=None, language=None)`: writes a WAV (16-bit PCM, 44.1 kHz, mono; up to 5,000 characters; expression tags like `[laugh]` are performed) and returns its path. Voices `F1`-`F5`, `M1`-`M5` or a clone id.
- `transcribe_audio(audio_path, language=None)`: returns the transcript of a **WAV** file (Lokutor does not decode MP3/M4A).

API errors raise `RuntimeError` with Lokutor's message. For indexing audio into documents use [`llama-index-readers-lokutor`](../readers). API docs: [docs.lokutor.com](https://docs.lokutor.com). Licence: Apache-2.0.
