Skip to content

Added new params to support Fish Audio#298

Open
Sirsho1997 wants to merge 1 commit into
mainfrom
feature-fishAudio
Open

Added new params to support Fish Audio#298
Sirsho1997 wants to merge 1 commit into
mainfrom
feature-fishAudio

Conversation

@Sirsho1997
Copy link
Copy Markdown
Collaborator

Added

  • IAudioReferenceVoice (audio, text) for reference-voice input on audioInference
  • IAudioInputs now includes:
    • referenceVoices: Optional[List[Union[IAudioReferenceVoice, Dict[str, Any]]]]
  • IAudioSpeech.voices now accepts voice model ID strings in addition to IAudioVoice objects
  • ISettings now includes:
    • chunkLength: Optional[int]
    • minChunkLength: Optional[int]
    • normalize: Optional[bool]
    • normalizeLoudness: Optional[bool]
    • latency: Optional[str]
    • conditionOnPreviousChunks: Optional[bool]
    • earlyStopThreshold: Optional[float]

Changed

  • IAudioSpeech.volume type changed from Optional[int] to Optional[float]

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 22, 2026

Important

Review skipped

Auto reviews are disabled on this repository. To trigger a review, include review in the PR description. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 821310ea-3ece-456d-9f19-5461519e6c59

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch feature-fishAudio

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
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 extends the SDK’s request type models to support additional Fish Audio / audio-inference parameters (reference voices, additional settings knobs, and more flexible voice selection).

Changes:

  • Added new ISettings fields for audio chunking/normalization/latency behavior.
  • Introduced IAudioReferenceVoice and added IAudioInputs.referenceVoices with dict-to-dataclass normalization.
  • Expanded IAudioSpeech.voices to accept voice model ID strings; changed IAudioSpeech.volume to Optional[float].
Comments suppressed due to low confidence (2)

runware/types.py:2155

  • After normalization, self.voices will contain only str and IAudioVoice entries (dicts are converted). The local variable annotation List[Union[str, IAudioVoice, Dict[str, Any]]] is misleading; tightening it to match the post-normalized shape will make the code easier to reason about.
        if self.voices is not None and isinstance(self.voices, (list, tuple)):
            normalized_voices: List[Union[str, IAudioVoice, Dict[str, Any]]] = []
            for v in self.voices:
                if isinstance(v, dict):
                    normalized_voices.append(IAudioVoice(**v))
                else:
                    normalized_voices.append(v)

            self.voices = normalized_voices

runware/types.py:2155

  • New input shapes (IAudioInputs.referenceVoices dict-to-dataclass normalization and IAudioSpeech.voices accepting str IDs) aren’t covered by tests. Since this module already has unit coverage (tests/test_types.py), add tests asserting these new coercions/accepted types serialize as expected.
@dataclass
class IAudioInputs(SerializableMixin):
    audio: Optional[str] = None
    audios: Optional[List[str]] = None
    video: Optional[str] = None
    videos: Optional[List[str]] = None
    referenceVoices: Optional[List[Union[IAudioReferenceVoice, Dict[str, Any]]]] = None

    @property
    def request_key(self) -> str:
        return "inputs"

    def __post_init__(self) -> None:
        if self.referenceVoices is not None:
            self.referenceVoices = [
                IAudioReferenceVoice(**ref) if isinstance(ref, dict) else ref
                for ref in self.referenceVoices
            ]


@dataclass
class IAudioVoice(SerializableMixin):
    speaker: str
    voice: str


@dataclass
class IAudioSpeech(SerializableMixin):
    text: Optional[str] = None  
    voice: Optional[str] = None
    voices: Optional[List[Union[str, IAudioVoice, Dict[str, Any]]]] = None
    language: Optional[str] = None
    speed: Optional[float] = None
    volume: Optional[float] = None
    pitch: Optional[int] = None
    emotion: Optional[str] = None
    tone: Optional[List[str]] = None  

    def __post_init__(self) -> None:
        if self.voices is not None and isinstance(self.voices, (list, tuple)):
            normalized_voices: List[Union[str, IAudioVoice, Dict[str, Any]]] = []
            for v in self.voices:
                if isinstance(v, dict):
                    normalized_voices.append(IAudioVoice(**v))
                else:
                    normalized_voices.append(v)

            self.voices = normalized_voices

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread runware/types.py
Comment thread runware/types.py
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.

2 participants