Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
127 changes: 127 additions & 0 deletions .fern/replay.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .fernignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,9 @@

# ignore context7 config file
context7.json
.fern/replay.lock
.fern/replay.yml
.gitattributes

# Hand-written realtime connect layer (not generated by Fern)
src/speechify/realtime/
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.fern/replay.lock linguist-generated=true
37 changes: 30 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ The Speechifyinc Python library provides convenient access to the Speechifyinc A
- [Usage](#usage)
- [Async Client](#async-client)
- [Exception Handling](#exception-handling)
- [Pagination](#pagination)
- [Advanced](#advanced)
- [Retries](#retries)
- [Timeouts](#timeouts)
Expand Down Expand Up @@ -43,8 +44,10 @@ from speechify import Speechify
client = Speechify(
token="YOUR_TOKEN",
)
client.tts.audio.speech(
input="input",
client.agent.create(
name="name",
prompt="prompt",
first_message="first_message",
voice_id="voice_id",
)
```
Expand All @@ -64,8 +67,10 @@ client = AsyncSpeechify(


async def main() -> None:
await client.tts.audio.speech(
input="input",
await client.agent.create(
name="name",
prompt="prompt",
first_message="first_message",
voice_id="voice_id",
)

Expand All @@ -82,12 +87,30 @@ will be thrown.
from speechify.core.api_error import ApiError

try:
client.tts.audio.speech(...)
client.agent.create(...)
except ApiError as e:
print(e.status_code)
print(e.body)
```

## Pagination

Paginated requests will return a `SyncPager` or `AsyncPager`, which can be used as generators for the underlying object.

```python
from speechify import Speechify

client = Speechify(
token="YOUR_TOKEN",
)
response = client.agent.tools.list()
for item in response:
yield item
# alternatively, you can paginate page-by-page
for page in response.iter_pages():
yield page
```

## Advanced

### Retries
Expand All @@ -105,7 +128,7 @@ A request is deemed retryable when any of the following HTTP status codes is ret
Use the `max_retries` request option to configure this behavior.

```python
client.tts.audio.speech(..., request_options={
client.agent.create(..., request_options={
"max_retries": 1
})
```
Expand All @@ -125,7 +148,7 @@ client = Speechify(


# Override timeout for a specific method
client.tts.audio.speech(..., request_options={
client.agent.create(..., request_options={
"timeout_in_seconds": 1
})
```
Expand Down
Loading
Loading