Files
simstudioai--sim/apps/sim/tools/elevenlabs/get-user.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

73 lines
2.5 KiB
TypeScript

import type { ElevenLabsGetUserParams, ElevenLabsGetUserResponse } from '@/tools/elevenlabs/types'
import type { ToolConfig } from '@/tools/types'
export const elevenLabsGetUserTool: ToolConfig<ElevenLabsGetUserParams, ElevenLabsGetUserResponse> =
{
id: 'elevenlabs_get_user',
name: 'ElevenLabs Get User',
description: 'Get account and subscription information for the ElevenLabs user',
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/user',
method: 'GET',
headers: (params) => ({
'xi-api-key': params.apiKey,
}),
},
transformResponse: async (response: Response) => {
const data = await response.json()
const subscription = data.subscription
return {
success: true,
output: {
userId: data.user_id ?? null,
isNewUser: data.is_new_user ?? null,
subscription: subscription
? {
tier: subscription.tier ?? null,
characterCount: subscription.character_count ?? null,
characterLimit: subscription.character_limit ?? null,
canExtendCharacterLimit: subscription.can_extend_character_limit ?? null,
status: subscription.status ?? null,
nextCharacterCountResetUnix: subscription.next_character_count_reset_unix ?? null,
}
: null,
},
}
},
outputs: {
userId: { type: 'string', description: 'Unique user identifier' },
isNewUser: { type: 'boolean', description: 'Whether the user is new' },
subscription: {
type: 'object',
description: 'Subscription and usage details',
properties: {
tier: { type: 'string', description: 'Subscription tier' },
characterCount: { type: 'number', description: 'Characters used this period' },
characterLimit: { type: 'number', description: 'Character quota for this period' },
canExtendCharacterLimit: {
type: 'boolean',
description: 'Whether the character limit can be extended',
},
status: { type: 'string', description: 'Subscription status' },
nextCharacterCountResetUnix: {
type: 'number',
description: 'Unix timestamp when the character count resets',
},
},
},
},
}