feat: add scoped read-only audio preview and isolated Dify transport

This commit is contained in:
2026-10-09 16:10:59 +08:00
parent 27772bec61
commit 4d0af7f3f4
36 changed files with 1517 additions and 68 deletions
+10
View File
@@ -2,6 +2,10 @@
/** Audio is deliberately OFF until the synthetic short/15m/1h gate passes for the current app. */
return [
'preview_only' => filter_var(env('followup_audio.PREVIEW_ONLY', false), FILTER_VALIDATE_BOOLEAN),
// Parse strictly at the gate; empty/malformed diagnosis lists never grant preview access.
'test_diagnosis_ids' => env('followup_audio.TEST_DIAGNOSIS_IDS', ''),
'test_admin_ids' => env('followup_audio.TEST_ADMIN_IDS', ''),
'enabled' => filter_var(env('followup_audio.ENABLED', false), FILTER_VALIDATE_BOOLEAN),
'audio_verified' => filter_var(env('followup_audio.AUDIO_VERIFIED', false), FILTER_VALIDATE_BOOLEAN),
// Each selected application must separately pass all three synthetic fixtures.
@@ -15,6 +19,7 @@ return [
'chunk_bytes' => 2097152,
'retention_days' => 90,
'lease_seconds' => 600,
'http_transport' => (string) env('followup_audio.HTTP_TRANSPORT', 'curl'),
'request_timeout' => (int) env('followup_audio.REQUEST_TIMEOUT', 240),
'concurrency' => max(1, min(8, (int) env('followup_audio.CONCURRENCY', 1))),
// Keep one stable key across web/worker nodes; empty reuses the existing prescription AI key.
@@ -46,11 +51,15 @@ return [
// Explicit server-only two-stage identities; no fallback to prescription_ai or another slot.
'allow_loopback_tunnel' => filter_var(env($prefix . 'ALLOW_LOOPBACK_TUNNEL', false), FILTER_VALIDATE_BOOLEAN),
'asr' => [
'protocol' => (string) env($prefix . 'ASR_PROTOCOL', 'openai'),
'binding_revision' => (string) env($prefix . 'ASR_BINDING_REVISION', ''),
'base_url' => (string) env($prefix . 'ASR_BASE_URL', ''),
'api_key' => (string) env($prefix . 'ASR_API_KEY', ''),
'model' => (string) env($prefix . 'ASR_MODEL', ''),
],
'extraction' => [
'protocol' => (string) env($prefix . 'EXTRACTION_PROTOCOL', 'openai'),
'binding_revision' => (string) env($prefix . 'EXTRACTION_BINDING_REVISION', ''),
'base_url' => (string) env($prefix . 'EXTRACTION_BASE_URL', ''),
'api_key' => (string) env($prefix . 'EXTRACTION_API_KEY', ''),
'model' => (string) env($prefix . 'EXTRACTION_MODEL', ''),
@@ -60,6 +69,7 @@ return [
'enable_thinking' => env($prefix . 'EXTRACTION_ENABLE_THINKING', null) === null ? null
: (filter_var(env($prefix . 'EXTRACTION_ENABLE_THINKING'), FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE) ?? 'invalid'),
],
'preview_verified_fingerprint' => (string) env($prefix . 'PREVIEW_VERIFIED_FINGERPRINT', ''),
'verified_fingerprint' => (string) env($prefix . 'VERIFIED_FINGERPRINT', ''),
];
}, ['qwen', 'openai'])),