Add transcription provider comparison chain
This commit is contained in:
@@ -48,14 +48,31 @@ func main() {
|
||||
}
|
||||
|
||||
llmClient := llm.New(cfg.LLMBaseURL, cfg.LLMAPIKey, cfg.LLMModel, cfg.LLMTimeout)
|
||||
transcriber := transcription.New(cfg.WhisperXURL, cfg.WhisperXTimeout, cfg.FfmpegPath, cfg.WhisperXLeadSilence)
|
||||
transcriber := transcription.NewWithOptions(transcription.Options{
|
||||
Providers: cfg.TranscriptionProviders,
|
||||
WhisperXURL: cfg.WhisperXURL,
|
||||
WhisperXTimeout: cfg.WhisperXTimeout,
|
||||
FfmpegPath: cfg.FfmpegPath,
|
||||
LeadSilence: cfg.WhisperXLeadSilence,
|
||||
QwenAudioBaseURL: cfg.QwenAudioBaseURL,
|
||||
QwenAudioAPIKey: cfg.QwenAudioAPIKey,
|
||||
QwenAudioModel: cfg.QwenAudioModel,
|
||||
QwenAudioTimeout: cfg.QwenAudioTimeout,
|
||||
VoxtralBaseURL: cfg.VoxtralBaseURL,
|
||||
VoxtralAPIKey: cfg.VoxtralAPIKey,
|
||||
VoxtralModel: cfg.VoxtralModel,
|
||||
VoxtralTimeout: cfg.VoxtralTimeout,
|
||||
AudioLLMPrompt: cfg.AudioLLMPrompt,
|
||||
AudioLLMMaxTokens: cfg.AudioLLMMaxTokens,
|
||||
})
|
||||
w := worker.New(db, llmClient, transcriber, cfg.WorkerID, cfg.LLMModel, cfg.WorkerTaskTypes, cfg.WorkerModelProfiles, cfg.WorkerPollInterval, cfg.WorkerLeaseTimeout, cfg.WorkerClaimLimit)
|
||||
healthSrv := startHealthServer(ctx, db, cfg)
|
||||
|
||||
slog.Info("ai_worker_started",
|
||||
"worker_id", cfg.WorkerID,
|
||||
"model", cfg.LLMModel,
|
||||
"whisperx_enabled", transcriber != nil,
|
||||
"transcription_enabled", transcriber != nil,
|
||||
"transcription_providers", cfg.TranscriptionProviders,
|
||||
"whisperx_lead_silence", cfg.WhisperXLeadSilence.String(),
|
||||
"task_types", cfg.WorkerTaskTypes,
|
||||
"model_profiles", cfg.WorkerModelProfiles,
|
||||
@@ -123,13 +140,14 @@ func (h workerHealth) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
})
|
||||
case r.Method == http.MethodGet && path == "/worker/status":
|
||||
writeWorkerJSON(w, http.StatusOK, map[string]any{
|
||||
"status": "running",
|
||||
"worker_id": h.cfg.WorkerID,
|
||||
"task_types": h.cfg.WorkerTaskTypes,
|
||||
"model_profiles": h.cfg.WorkerModelProfiles,
|
||||
"claim_limit": h.cfg.WorkerClaimLimit,
|
||||
"poll_interval": h.cfg.WorkerPollInterval.String(),
|
||||
"lease_timeout": h.cfg.WorkerLeaseTimeout.String(),
|
||||
"status": "running",
|
||||
"worker_id": h.cfg.WorkerID,
|
||||
"task_types": h.cfg.WorkerTaskTypes,
|
||||
"model_profiles": h.cfg.WorkerModelProfiles,
|
||||
"transcription_providers": h.cfg.TranscriptionProviders,
|
||||
"claim_limit": h.cfg.WorkerClaimLimit,
|
||||
"poll_interval": h.cfg.WorkerPollInterval.String(),
|
||||
"lease_timeout": h.cfg.WorkerLeaseTimeout.String(),
|
||||
})
|
||||
default:
|
||||
writeWorkerJSON(w, http.StatusNotFound, map[string]any{"error": "not found"})
|
||||
|
||||
Reference in New Issue
Block a user