Files
simstudioai--sim/apps/sim/tools/elevenlabs/list-models.ts
T
wehub-resource-sync d25d482dc2
Publish CLI Package / publish-npm (push) Waiting to run
Publish Python SDK / publish-pypi (push) Waiting to run
Publish TypeScript SDK / publish-npm (push) Waiting to run
CI / Migrate Dev DB (push) Has been skipped
CI / Detect Version (push) Has been cancelled
CI / Migrate DB (push) Has been cancelled
CI / Build Dev ECR (./docker/app.Dockerfile, ECR_APP) (push) Has been cancelled
CI / Build Dev ECR (./docker/db.Dockerfile, ECR_MIGRATIONS) (push) Has been cancelled
CI / Build Dev ECR (./docker/pii.Dockerfile, ECR_PII) (push) Has been cancelled
CI / Build Dev ECR (./docker/realtime.Dockerfile, ECR_REALTIME) (push) Has been cancelled
CI / Deploy Trigger.dev (Dev) (push) Has been cancelled
CI / Build AMD64 (./docker/app.Dockerfile, ECR_APP, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build AMD64 (./docker/db.Dockerfile, ECR_MIGRATIONS, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build AMD64 (./docker/pii.Dockerfile, ECR_PII, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build AMD64 (./docker/realtime.Dockerfile, ECR_REALTIME, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/app.Dockerfile, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/db.Dockerfile, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/pii.Dockerfile, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/realtime.Dockerfile, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Check Docs Changes (push) Has been cancelled
CI / Process Docs (push) Has been cancelled
CI / Create GitHub Release (push) Has been cancelled
CI / Test and Build (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:20:55 +08:00

88 lines
2.7 KiB
TypeScript

import type {
ElevenLabsListModelsParams,
ElevenLabsListModelsResponse,
ElevenLabsModelSummary,
} from '@/tools/elevenlabs/types'
import type { ToolConfig } from '@/tools/types'
export const elevenLabsListModelsTool: ToolConfig<
ElevenLabsListModelsParams,
ElevenLabsListModelsResponse
> = {
id: 'elevenlabs_list_models',
name: 'ElevenLabs List Models',
description: 'List the models available in ElevenLabs',
version: '1.0.0',
params: {
apiKey: {
type: 'string',
required: true,
visibility: 'user-only',
description: 'Your ElevenLabs API key',
},
},
request: {
url: 'https://api.elevenlabs.io/v1/models',
method: 'GET',
headers: (params) => ({
'xi-api-key': params.apiKey,
}),
},
transformResponse: async (response: Response) => {
const data = await response.json()
const models: ElevenLabsModelSummary[] = (Array.isArray(data) ? data : []).map(
(model: any) => ({
modelId: model.model_id,
name: model.name ?? null,
description: model.description ?? null,
canDoTextToSpeech: model.can_do_text_to_speech ?? null,
canDoVoiceConversion: model.can_do_voice_conversion ?? null,
canUseStyle: model.can_use_style ?? null,
canUseSpeakerBoost: model.can_use_speaker_boost ?? null,
languages: (model.languages ?? []).map((language: any) => ({
languageId: language.language_id ?? null,
name: language.name ?? null,
})),
})
)
return {
success: true,
output: { models },
}
},
outputs: {
models: {
type: 'array',
description: 'List of available models',
items: {
type: 'object',
properties: {
modelId: { type: 'string', description: 'Unique model identifier' },
name: { type: 'string', description: 'Model name' },
description: { type: 'string', description: 'Model description' },
canDoTextToSpeech: { type: 'boolean', description: 'Supports text-to-speech' },
canDoVoiceConversion: { type: 'boolean', description: 'Supports voice conversion' },
canUseStyle: { type: 'boolean', description: 'Supports the style parameter' },
canUseSpeakerBoost: { type: 'boolean', description: 'Supports speaker boost' },
languages: {
type: 'array',
description: 'Languages supported by the model',
items: {
type: 'object',
properties: {
languageId: { type: 'string', description: 'Language code' },
name: { type: 'string', description: 'Language name' },
},
},
},
},
},
},
},
}