2
0

🚸 (elevenLabs) Only show text-to-speech compatible models

This commit is contained in:
Baptiste Arnaud
2024-03-05 09:50:33 +01:00
parent 14022fe92f
commit 022a320e7e
2 changed files with 9 additions and 6 deletions

View File

@ -17,12 +17,12 @@ export const convertTextToSpeech = createAction({
}), }),
voiceId: option.string.layout({ voiceId: option.string.layout({
fetcher: 'fetchVoices', fetcher: 'fetchVoices',
label: 'Voice ID', label: 'Voice',
placeholder: 'Select a voice', placeholder: 'Select a voice',
}), }),
modelId: option.string.layout({ modelId: option.string.layout({
fetcher: 'fetchModels', fetcher: 'fetchModels',
label: 'Model ID', label: 'Model',
placeholder: 'Select a model', placeholder: 'Select a model',
defaultValue: 'eleven_monolingual_v1', defaultValue: 'eleven_monolingual_v1',
}), }),
@ -64,7 +64,9 @@ export const convertTextToSpeech = createAction({
}) })
.json<ModelsResponse>() .json<ModelsResponse>()
return response.map((model) => ({ return response
.filter((model) => model.can_do_text_to_speech)
.map((model) => ({
value: model.model_id, value: model.model_id,
label: model.name, label: model.name,
})) }))

View File

@ -8,4 +8,5 @@ export type VoicesResponse = {
export type ModelsResponse = { export type ModelsResponse = {
model_id: string model_id: string
name: string name: string
can_do_text_to_speech: boolean
}[] }[]