Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 13 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@ The REST API documentation can be found on [docs.lmnt.com](https://docs.lmnt.com
## Installation

```sh
# install from PyPI
pip install lmnt
```

> [!NOTE]
> Once this package is [published to PyPI](https://www.stainless.com/docs/guides/publish), this will become: `pip install --pre lmnt`

## Usage

The full API of this library can be found in [api.md](api.md).
Expand All @@ -39,7 +37,7 @@ client = Lmnt(

response = client.speech.generate(
text="hello world.",
voice="ava",
voice="leah",
)
```

Expand All @@ -65,7 +63,7 @@ client = AsyncLmnt(
async def main() -> None:
response = await client.speech.generate(
text="hello world.",
voice="ava",
voice="leah",
)


Expand Down Expand Up @@ -99,7 +97,7 @@ async def main() -> None:
) as client:
response = await client.speech.generate(
text="hello world.",
voice="ava",
voice="leah",
)


Expand All @@ -125,9 +123,10 @@ from lmnt import Lmnt

client = Lmnt()

client.speech.convert(
audio=Path("/path/to/file"),
voice="ava",
client.voices.create(
name="My Voice",
files=[Path("sample1.wav"), Path("sample2.wav")],
enhance=False,
)
```

Expand All @@ -151,7 +150,7 @@ client = Lmnt()
try:
client.speech.generate(
text="hello world.",
voice="ava",
voice="leah",
)
except lmnt.APIConnectionError as e:
print("The server could not be reached")
Expand Down Expand Up @@ -197,7 +196,7 @@ client = Lmnt(
# Or, configure per-request:
client.with_options(max_retries=5).speech.generate(
text="hello world.",
voice="ava",
voice="leah",
)
```

Expand All @@ -223,7 +222,7 @@ client = Lmnt(
# Override per-request:
client.with_options(timeout=5.0).speech.generate(
text="hello world.",
voice="ava",
voice="leah",
)
```

Expand Down Expand Up @@ -267,7 +266,7 @@ from lmnt import Lmnt
client = Lmnt()
response = client.speech.with_raw_response.generate(
text="hello world.",
voice="ava",
voice="leah",
)
print(response.headers.get('X-My-Header'))

Expand All @@ -288,7 +287,7 @@ To stream the response body, use `.with_streaming_response` instead, which requi
```python
with client.speech.with_streaming_response.generate(
text="hello world.",
voice="ava",
voice="leah",
) as response:
print(response.headers.get("X-My-Header"))

Expand Down