This commit is contained in:
Your Name
2026-08-03 10:00:05 +08:00
parent 0fb03d0bca
commit 01729b1e0b
109 changed files with 7577 additions and 1153 deletions
+26
View File
@@ -0,0 +1,26 @@
<?php
return [
// 开启后优先请求 CosyVoice;服务异常时会自动回落到 OpenAI / 浏览器语音。
'enabled' => filter_var(env('COSYVOICE_ENABLED', true), FILTER_VALIDATE_BOOLEAN),
'base_url' => rtrim((string) env('COSYVOICE_BASE_URL', 'http://127.0.0.1:50000'), '/'),
// sft / instruct / zero_shot / cross_lingual / instruct2
'mode' => (string) env('COSYVOICE_MODE', 'sft'),
'speaker' => (string) env('COSYVOICE_SPEAKER', '中文女'),
'instruct_text' => (string) env(
'COSYVOICE_INSTRUCT',
'请用温暖、自然、耐心的中文客服语气表达,语速适中,停顿真实,避免播音腔和夸张情绪。'
),
'prompt_text' => (string) env('COSYVOICE_PROMPT_TEXT', ''),
'prompt_wav' => (string) env(
'COSYVOICE_PROMPT_WAV',
root_path() . 'storage/cosyvoice/customer-service.wav'
),
// CosyVoice-300M 常用 22050CosyVoice2/3 通常应配置为 24000。
'sample_rate' => max(8000, (int) env('COSYVOICE_SAMPLE_RATE', 22050)),
'connect_timeout_ms' => max(200, (int) env('COSYVOICE_CONNECT_TIMEOUT_MS', 800)),
'timeout_seconds' => max(2, (int) env('COSYVOICE_TIMEOUT_SECONDS', 8)),
'failure_ttl' => max(5, (int) env('COSYVOICE_FAILURE_TTL', 20)),
// 官方 FastAPI 默认无鉴权;经网关暴露时可使用 Bearer Token。
'api_key' => (string) env('COSYVOICE_API_KEY', ''),
];