Skip to content

Conversation

@twangodev
Copy link
Collaborator

@twangodev twangodev commented Nov 17, 2025

Exposes WebSocketOptions

Copilot AI review requested due to automatic review settings November 17, 2025 20:43
@codecov-commenter
Copy link

codecov-commenter commented Nov 17, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Files with missing lines Coverage Δ
src/fishaudio/__init__.py 100.00% <100.00%> (ø)
src/fishaudio/core/__init__.py 100.00% <100.00%> (ø)
src/fishaudio/core/websocket_options.py 100.00% <100.00%> (ø)
src/fishaudio/resources/tts.py 94.78% <100.00%> (+0.09%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

Copilot AI left a 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 WebSocketOptions class with parameters for keepalive ping timeout/interval, max message size, and queue size
  • Adds ws_options parameter to both sync and async stream_websocket methods
  • Exports WebSocketOptions from 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,
Copy link

Copilot AI Nov 17, 2025

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.

Copilot uses AI. Check for mistakes.
speed: Optional[float] = None,
config: TTSConfig = TTSConfig(),
model: Model = "s1",
ws_options: Optional[WebSocketOptions] = None,
Copy link

Copilot AI Nov 17, 2025

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.

Copilot uses AI. Check for mistakes.
@twangodev twangodev merged commit 6f9ab7b into main Nov 18, 2025
23 checks passed
@twangodev twangodev deleted the feat/websocket-options branch November 18, 2025 00:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow configuring keepalive_ping_timeout_seconds for tts.stream_websocket (AsyncFishAudio)

3 participants