feat: add WebSocketOptions for configurable WebSocket connections#48
feat: add WebSocketOptions for configurable WebSocket connections#48
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull Request Overview
This PR adds configurable WebSocket connection options to the Fish Audio SDK by introducing a new WebSocketOptions class that allows users to customize WebSocket behavior such as keepalive ping settings, message size limits, and queue size.
- Introduces
WebSocketOptionsclass with parameters for keepalive ping timeout/interval, max message size, and queue size - Adds
ws_optionsparameter to both sync and asyncstream_websocketmethods - Exports
WebSocketOptionsfrom the main package and core module for easy access
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/fishaudio/core/websocket_options.py | New class for configuring WebSocket connection options with conversion method for httpx-ws |
| src/fishaudio/core/init.py | Exports the new WebSocketOptions class from the core module |
| src/fishaudio/init.py | Exports WebSocketOptions at the package level for user access |
| src/fishaudio/resources/tts.py | Adds ws_options parameter to stream_websocket methods and applies the configuration to WebSocket connections |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| config: TTSConfig = TTSConfig(), | ||
| model: Model = "s1", | ||
| max_workers: int = 10, | ||
| ws_options: Optional[WebSocketOptions] = None, |
There was a problem hiding this comment.
The ws_options parameter is missing from the method's docstring Args section. Please add documentation for this parameter to help users understand how to configure WebSocket connection options.
| speed: Optional[float] = None, | ||
| config: TTSConfig = TTSConfig(), | ||
| model: Model = "s1", | ||
| ws_options: Optional[WebSocketOptions] = None, |
There was a problem hiding this comment.
The ws_options parameter is missing from the method's docstring Args section. Please add documentation for this parameter to help users understand how to configure WebSocket connection options.
Exposes WebSocketOptions