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
111 lines
3.6 KiB
TypeScript
111 lines
3.6 KiB
TypeScript
import type {
|
|
ElevenLabsListVoicesParams,
|
|
ElevenLabsListVoicesResponse,
|
|
ElevenLabsVoiceSummary,
|
|
} from '@/tools/elevenlabs/types'
|
|
import type { ToolConfig } from '@/tools/types'
|
|
|
|
export const elevenLabsListVoicesTool: ToolConfig<
|
|
ElevenLabsListVoicesParams,
|
|
ElevenLabsListVoicesResponse
|
|
> = {
|
|
id: 'elevenlabs_list_voices',
|
|
name: 'ElevenLabs List Voices',
|
|
description: 'List the voices available in your ElevenLabs account',
|
|
version: '1.0.0',
|
|
|
|
params: {
|
|
apiKey: {
|
|
type: 'string',
|
|
required: true,
|
|
visibility: 'user-only',
|
|
description: 'Your ElevenLabs API key',
|
|
},
|
|
search: {
|
|
type: 'string',
|
|
required: false,
|
|
visibility: 'user-or-llm',
|
|
description: 'Search term to filter voices by name, description, labels, or category',
|
|
},
|
|
category: {
|
|
type: 'string',
|
|
required: false,
|
|
visibility: 'user-or-llm',
|
|
description: 'Filter by category: premade, cloned, generated, or professional',
|
|
},
|
|
pageSize: {
|
|
type: 'number',
|
|
required: false,
|
|
visibility: 'user-or-llm',
|
|
description: 'Number of voices to return (1-100, default 10)',
|
|
},
|
|
nextPageToken: {
|
|
type: 'string',
|
|
required: false,
|
|
visibility: 'user-or-llm',
|
|
description: 'Page token from a previous response to fetch the next page of voices',
|
|
},
|
|
},
|
|
|
|
request: {
|
|
url: (params) => {
|
|
const query = new URLSearchParams()
|
|
if (params.search) query.set('search', params.search)
|
|
if (params.category) query.set('category', params.category)
|
|
if (params.pageSize !== undefined) query.set('page_size', String(params.pageSize))
|
|
if (params.nextPageToken) query.set('next_page_token', params.nextPageToken)
|
|
const qs = query.toString()
|
|
return `https://api.elevenlabs.io/v2/voices${qs ? `?${qs}` : ''}`
|
|
},
|
|
method: 'GET',
|
|
headers: (params) => ({
|
|
'xi-api-key': params.apiKey,
|
|
}),
|
|
},
|
|
|
|
transformResponse: async (response: Response) => {
|
|
const data = await response.json()
|
|
const voices: ElevenLabsVoiceSummary[] = (data.voices ?? []).map((voice: any) => ({
|
|
voiceId: voice.voice_id,
|
|
name: voice.name ?? null,
|
|
category: voice.category ?? null,
|
|
description: voice.description ?? null,
|
|
labels: voice.labels ?? null,
|
|
previewUrl: voice.preview_url ?? null,
|
|
settings: voice.settings ?? null,
|
|
}))
|
|
|
|
return {
|
|
success: true,
|
|
output: {
|
|
voices,
|
|
totalCount: data.total_count ?? null,
|
|
hasMore: data.has_more ?? false,
|
|
nextPageToken: data.next_page_token ?? null,
|
|
},
|
|
}
|
|
},
|
|
|
|
outputs: {
|
|
voices: {
|
|
type: 'array',
|
|
description: 'List of voices',
|
|
items: {
|
|
type: 'object',
|
|
properties: {
|
|
voiceId: { type: 'string', description: 'Unique voice identifier' },
|
|
name: { type: 'string', description: 'Voice name' },
|
|
category: { type: 'string', description: 'Voice category' },
|
|
description: { type: 'string', description: 'Voice description' },
|
|
labels: { type: 'json', description: 'Voice labels (accent, gender, age, use case)' },
|
|
previewUrl: { type: 'string', description: 'URL to a preview audio sample' },
|
|
settings: { type: 'json', description: 'Default voice settings' },
|
|
},
|
|
},
|
|
},
|
|
totalCount: { type: 'number', description: 'Total number of matching voices', optional: true },
|
|
hasMore: { type: 'boolean', description: 'Whether more voices are available' },
|
|
nextPageToken: { type: 'string', description: 'Token to fetch the next page', optional: true },
|
|
},
|
|
}
|