fix(stage-ui): add model list for player2 speech (#1067)
This commit is contained in:
@@ -1321,6 +1321,18 @@ export const useProvidersStore = defineStore('providers', () => {
|
||||
}),
|
||||
createProvider: async config => createPlayer2((config.baseUrl as string).trim(), 'airi'),
|
||||
capabilities: {
|
||||
listModels: async () => {
|
||||
return [
|
||||
{
|
||||
id: 'player2-tts',
|
||||
name: 'Player2 Speech',
|
||||
provider: 'player2-speech',
|
||||
description: 'Default model for Player2 speech endpoint',
|
||||
contextLength: 0,
|
||||
deprecated: false,
|
||||
},
|
||||
]
|
||||
},
|
||||
listVoices: async (config) => {
|
||||
const baseUrl = (config.baseUrl as string).endsWith('/') ? (config.baseUrl as string).slice(0, -1) : config.baseUrl as string
|
||||
return await fetch(`${baseUrl}/tts/voices`).then(res => res.json()).then(({ voices }) => (voices as { id: string, language: 'american_english' | 'british_english' | 'japanese' | 'mandarin_chinese' | 'spanish' | 'french' | 'hindi' | 'italian' | 'brazilian_portuguese', name: string, gender: string }[]).map(({ id, language, name, gender }) => (
|
||||
|
||||
Reference in New Issue
Block a user