Feat/speech support (#392)

* feat: expand speech provider support with new client types and configuration schema

* feat: add icon support for speech providers and update related configurations

* feat: add SVG support for Deepgram and Elevenlabs with Vue components

* feat: except *-speech client type in llm provider

* feat: enhance speech provider functionality with advanced settings and model import capabilities

* chore: remove go.mod replace

* feat: enhance speech provider functionality with advanced settings and model import capabilities

* chore: update go module dependencies

* feat: Ear and Mouth

* fix: separate ear/mouth page

* fix: separate audio domain and restore transcription templates

Move speech and transcription internals into the audio domain, restore template-driven transcription providers, and regenerate Swagger/SDK so the frontend can stop hand-calling /transcription-* APIs.

---------

Co-authored-by: aki <arisu@ieee.org>
This commit is contained in:
Acbox
2026-04-22 00:09:46 +08:00
committed by GitHub
parent 8d78925a23
commit c9dcfe287f
70 changed files with 6612 additions and 1692 deletions
+61 -11
View File
@@ -16,18 +16,27 @@ SELECT * FROM providers WHERE id = sqlc.arg(id);
-- name: GetProviderByName :one
SELECT * FROM providers WHERE name = sqlc.arg(name);
-- name: GetProviderByClientType :one
SELECT * FROM providers WHERE client_type = sqlc.arg(client_type);
-- name: ListProviders :many
SELECT * FROM providers
WHERE client_type NOT IN (
'edge-speech',
'openai-speech',
'openai-transcription',
'openrouter-speech',
'openrouter-transcription',
'elevenlabs-speech',
'elevenlabs-transcription',
'deepgram-speech',
'deepgram-transcription',
'minimax-speech',
'volcengine-speech',
'alibabacloud-speech',
'microsoft-speech'
'microsoft-speech',
'google-speech',
'google-transcription'
)
ORDER BY created_at DESC;
@@ -53,13 +62,19 @@ FROM providers
WHERE client_type NOT IN (
'edge-speech',
'openai-speech',
'openai-transcription',
'openrouter-speech',
'openrouter-transcription',
'elevenlabs-speech',
'elevenlabs-transcription',
'deepgram-speech',
'deepgram-transcription',
'minimax-speech',
'volcengine-speech',
'alibabacloud-speech',
'microsoft-speech'
'microsoft-speech',
'google-speech',
'google-transcription'
);
-- name: CreateModel :one
@@ -86,7 +101,7 @@ ORDER BY created_at DESC;
-- name: ListModels :many
SELECT * FROM models
WHERE type != 'speech'
WHERE type NOT IN ('speech', 'transcription')
ORDER BY created_at DESC;
-- name: ListModelsByType :many
@@ -97,7 +112,7 @@ ORDER BY created_at DESC;
-- name: ListModelsByProviderID :many
SELECT * FROM models
WHERE provider_id = sqlc.arg(provider_id)
AND type != 'speech'
AND type NOT IN ('speech', 'transcription')
ORDER BY created_at DESC;
-- name: ListModelsByProviderIDAndType :many
@@ -136,9 +151,15 @@ DELETE FROM models
WHERE provider_id = sqlc.arg(provider_id)
AND model_id = sqlc.arg(model_id);
-- name: DeleteModelByProviderAndType :exec
DELETE FROM models
WHERE provider_id = sqlc.arg(provider_id)
AND model_id = sqlc.arg(model_id)
AND type = sqlc.arg(type);
-- name: CountModels :one
SELECT COUNT(*) FROM models
WHERE type != 'speech';
WHERE type NOT IN ('speech', 'transcription');
-- name: CountModelsByType :one
SELECT COUNT(*) FROM models WHERE type = sqlc.arg(type);
@@ -150,11 +171,6 @@ VALUES (sqlc.arg(name), sqlc.arg(client_type), sqlc.arg(icon), false, sqlc.arg(c
ON CONFLICT (name) DO UPDATE SET
icon = EXCLUDED.icon,
client_type = EXCLUDED.client_type,
config = CASE
WHEN providers.config->>'api_key' IS NOT NULL AND providers.config->>'api_key' != ''
THEN jsonb_set(EXCLUDED.config, '{api_key}', providers.config->'api_key')
ELSE EXCLUDED.config
END,
updated_at = now()
RETURNING *;
@@ -173,7 +189,7 @@ SELECT m.*
FROM models m
JOIN providers p ON m.provider_id = p.id
WHERE p.enable = true
AND m.type != 'speech'
AND m.type NOT IN ('speech', 'transcription')
ORDER BY m.created_at DESC;
-- name: ListEnabledModelsByType :many
@@ -231,6 +247,17 @@ WHERE client_type IN (
)
ORDER BY created_at DESC;
-- name: ListTranscriptionProviders :many
SELECT * FROM providers
WHERE client_type IN (
'openai-transcription',
'openrouter-transcription',
'elevenlabs-transcription',
'deepgram-transcription',
'google-transcription'
)
ORDER BY created_at DESC;
-- name: ListSpeechModels :many
SELECT m.*,
p.client_type AS provider_type
@@ -250,3 +277,26 @@ SELECT * FROM models
WHERE provider_id = sqlc.arg(provider_id)
AND model_id = sqlc.arg(model_id)
LIMIT 1;
-- name: GetTranscriptionModelWithProvider :one
SELECT
m.*,
p.client_type AS provider_type
FROM models m
JOIN providers p ON p.id = m.provider_id
WHERE m.id = sqlc.arg(id)
AND m.type = 'transcription';
-- name: ListTranscriptionModels :many
SELECT m.*,
p.client_type AS provider_type
FROM models m
JOIN providers p ON p.id = m.provider_id
WHERE m.type = 'transcription'
ORDER BY m.created_at DESC;
-- name: ListTranscriptionModelsByProviderID :many
SELECT * FROM models
WHERE provider_id = sqlc.arg(provider_id)
AND type = 'transcription'
ORDER BY created_at DESC;