🚸 (elevenLabs) Only show text-to-speech compatible models
This commit is contained in:
@ -17,12 +17,12 @@ export const convertTextToSpeech = createAction({
|
||||
}),
|
||||
voiceId: option.string.layout({
|
||||
fetcher: 'fetchVoices',
|
||||
label: 'Voice ID',
|
||||
label: 'Voice',
|
||||
placeholder: 'Select a voice',
|
||||
}),
|
||||
modelId: option.string.layout({
|
||||
fetcher: 'fetchModels',
|
||||
label: 'Model ID',
|
||||
label: 'Model',
|
||||
placeholder: 'Select a model',
|
||||
defaultValue: 'eleven_monolingual_v1',
|
||||
}),
|
||||
@ -64,7 +64,9 @@ export const convertTextToSpeech = createAction({
|
||||
})
|
||||
.json<ModelsResponse>()
|
||||
|
||||
return response.map((model) => ({
|
||||
return response
|
||||
.filter((model) => model.can_do_text_to_speech)
|
||||
.map((model) => ({
|
||||
value: model.model_id,
|
||||
label: model.name,
|
||||
}))
|
||||
|
@ -8,4 +8,5 @@ export type VoicesResponse = {
|
||||
export type ModelsResponse = {
|
||||
model_id: string
|
||||
name: string
|
||||
can_do_text_to_speech: boolean
|
||||
}[]
|
||||
|
Reference in New Issue
Block a user