ShipBit / wingman-ai

GNU General Public License v3.0
146 stars 37 forks source link

add new Custom Property types #228

Closed Shackless closed 2 months ago

Shackless commented 2 months ago

This PR introduces two new custom property types:

The params are passed using the "options" field like this:

- custom_properties:
  - id: volume
    options:
    - label: min
      value: 0
    - label: max
      value: 1
    - label: step
      value: 0.1
  - id: voices
    options:
    - label: multiple
      value: True (client re-saves this as "1" for unknown reasons)

While slider just writes back a number into value, the voice selection return type is a bit more complicated as it depends on the TTS provider and looks like this:

- id: voices
    options:
    value:
    - provider: wingman_pro
      subprovider: azure
      voice: en-US-AvaMultilingualNeural
    - provider: wingman_pro
      subprovider: azure
      voice: en-US-EmmaMultilingualNeural
    - provider: openai
      voice: onyx
    - provider: elevenlabs
      voice:
        id: xJdlhl5fElnVB2MjhlkD
        name: Mel (Hades II)
    - provider: edge_tts
      voice: en-US-ChristopherNeural
    - provider: wingman_pro
      subprovider: openai
      voice: fable
    - provider: xvasynth
      voice:
        language: en
        model_directory: borderlands
        voice_name: tn-850

if multiple is unset or False, then value will just be an instance of VoiceSelection (instead of a list[VoiceSelection].

Other changes:

XVASynth now has a proper voice selection and shows the installed models and voices in filterable dropdowns just like the other providers. Its settings and config were split and the provider is now like a singleton that is passed around (similar to Whispercpp). Users need to enable XVASynth in the Settings view or else it won't appear as provider in the TTS provider dropdowns.

CleanShot 2024-07-16 at 16 57 25

CleanShot 2024-07-16 at 16 56 03

CleanShot 2024-07-16 at 16 56 34

VoiceChanger and RadioChatter Skills were changed (and migrated) to use the new custom property types as examples but need some refactoring to work with them properly @SawPsyder.