-
Notifications
You must be signed in to change notification settings - Fork 25
feat: add WebSocketOptions for configurable WebSocket connections #48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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, |
Copilot
AI
Nov 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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, |
Copilot
AI
Nov 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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