chore: import upstream snapshot with attribution
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
Publish CLI Package / publish-npm (push) Has been cancelled
Publish Python SDK / publish-pypi (push) Has been cancelled
Publish TypeScript SDK / publish-npm (push) Has been cancelled
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
Publish CLI Package / publish-npm (push) Has been cancelled
Publish Python SDK / publish-pypi (push) Has been cancelled
Publish TypeScript SDK / publish-npm (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,92 @@
|
||||
import { z } from 'zod'
|
||||
import { toolJsonResponseSchema } from '@/lib/api/contracts/tools/media/shared'
|
||||
import { defineRouteContract } from '@/lib/api/contracts/types'
|
||||
|
||||
export const ttsToolBodySchema = z.object({
|
||||
text: z.string({ error: 'Missing required parameters' }).min(1, 'Missing required parameters'),
|
||||
voiceId: z.string({ error: 'Missing required parameters' }).min(1, 'Missing required parameters'),
|
||||
apiKey: z.string({ error: 'Missing required parameters' }).min(1, 'Missing required parameters'),
|
||||
modelId: z.string().optional().default('eleven_monolingual_v1'),
|
||||
stability: z.coerce.number().min(0).max(1).optional(),
|
||||
similarityBoost: z.coerce.number().min(0).max(1).optional(),
|
||||
workspaceId: z.string().optional(),
|
||||
workflowId: z.string().optional(),
|
||||
executionId: z.string().optional(),
|
||||
})
|
||||
|
||||
export const ttsOutputFormatSchema = z.union([z.record(z.string(), z.unknown()), z.string()])
|
||||
export const playHtOutputFormatSchema = z.enum(['mp3', 'wav', 'ogg', 'flac', 'mulaw'])
|
||||
|
||||
export const ttsUnifiedToolBodySchema = z
|
||||
.object({
|
||||
provider: z.enum(
|
||||
['openai', 'deepgram', 'elevenlabs', 'cartesia', 'google', 'azure', 'playht'],
|
||||
{
|
||||
error: 'Missing required fields: provider, text, and apiKey',
|
||||
}
|
||||
),
|
||||
text: z
|
||||
.string({ error: 'Missing required fields: provider, text, and apiKey' })
|
||||
.min(1, 'Missing required fields: provider, text, and apiKey'),
|
||||
apiKey: z
|
||||
.string({ error: 'Missing required fields: provider, text, and apiKey' })
|
||||
.min(1, 'Missing required fields: provider, text, and apiKey'),
|
||||
model: z.enum(['tts-1', 'tts-1-hd', 'gpt-4o-mini-tts']).optional(),
|
||||
voice: z.string().optional(),
|
||||
responseFormat: z.enum(['mp3', 'opus', 'aac', 'flac', 'wav', 'pcm']).optional(),
|
||||
speed: z.coerce.number().optional(),
|
||||
encoding: z.enum(['linear16', 'mp3', 'opus', 'aac', 'flac', 'mulaw', 'alaw']).optional(),
|
||||
sampleRate: z.coerce.number().optional(),
|
||||
bitRate: z.coerce.number().optional(),
|
||||
container: z.enum(['none', 'wav', 'ogg']).optional(),
|
||||
voiceId: z.string().optional(),
|
||||
modelId: z.string().optional(),
|
||||
stability: z.coerce.number().optional(),
|
||||
similarityBoost: z.coerce.number().optional(),
|
||||
style: z.union([z.coerce.number(), z.string()]).optional(),
|
||||
useSpeakerBoost: z.boolean().optional(),
|
||||
language: z.string().optional(),
|
||||
outputFormat: ttsOutputFormatSchema.optional().nullable(),
|
||||
emotion: z.array(z.string()).optional(),
|
||||
languageCode: z.string().optional(),
|
||||
gender: z.enum(['MALE', 'FEMALE', 'NEUTRAL']).optional(),
|
||||
audioEncoding: z.enum(['LINEAR16', 'MP3', 'OGG_OPUS', 'MULAW', 'ALAW']).optional(),
|
||||
speakingRate: z.coerce.number().optional(),
|
||||
pitch: z.union([z.number(), z.string()]).optional(),
|
||||
volumeGainDb: z.coerce.number().optional(),
|
||||
sampleRateHertz: z.coerce.number().optional(),
|
||||
effectsProfileId: z.array(z.string()).optional(),
|
||||
region: z
|
||||
.string()
|
||||
.regex(
|
||||
/^[a-z][a-z0-9-]{1,30}[a-z0-9]$/,
|
||||
'region must be a valid Azure region identifier (e.g. eastus, westeurope)'
|
||||
)
|
||||
.optional(),
|
||||
rate: z.string().optional(),
|
||||
styleDegree: z.coerce.number().optional(),
|
||||
role: z.string().optional(),
|
||||
userId: z.string().optional(),
|
||||
quality: z.enum(['draft', 'standard', 'premium']).optional(),
|
||||
temperature: z.coerce.number().optional(),
|
||||
voiceGuidance: z.coerce.number().optional(),
|
||||
textGuidance: z.coerce.number().optional(),
|
||||
workspaceId: z.string().optional(),
|
||||
workflowId: z.string().optional(),
|
||||
executionId: z.string().optional(),
|
||||
})
|
||||
.passthrough()
|
||||
|
||||
export const ttsToolContract = defineRouteContract({
|
||||
method: 'POST',
|
||||
path: '/api/tools/tts',
|
||||
body: ttsToolBodySchema,
|
||||
response: { mode: 'json', schema: toolJsonResponseSchema },
|
||||
})
|
||||
|
||||
export const ttsUnifiedToolContract = defineRouteContract({
|
||||
method: 'POST',
|
||||
path: '/api/tools/tts/unified',
|
||||
body: ttsUnifiedToolBodySchema,
|
||||
response: { mode: 'json', schema: toolJsonResponseSchema },
|
||||
})
|
||||
Reference in New Issue
Block a user