From 0af9082aa90f8656f86b4c7b3cde0cb4146039e5 Mon Sep 17 00:00:00 2001 From: Accusys Date: Mon, 28 Sep 2026 01:53:20 +0800 Subject: [PATCH] feat: add Rust CLI support for ASR processor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增: - ASR Rust CLI 支持(備用方案) - ToolSelector 支持 rust_asr 工具 配置: - Whisper CLI: 優先(Apple MLX 加速) - Rust ASR: 備用(待實現) 工具優先級: 1. whisper (priority=0, enabled=true) 2. rust (priority=1, enabled=false) 目的: - 為未來 Rust ASR 實現預留接口 - 保持配置擴展性 --- config/processor_tools.json | 9 ++++++++- src/core/processor/tool_selector.rs | 8 ++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/config/processor_tools.json b/config/processor_tools.json index 503e784d..3250492b 100644 --- a/config/processor_tools.json +++ b/config/processor_tools.json @@ -61,8 +61,15 @@ "priority": 0, "enabled": true, "parameters": { - "model": "large-v3" + "model": "large-v3", + "model_dir": "/Users/accusys/models/whisper-small-mlx" } + }, + { + "name": "rust", + "priority": 1, + "enabled": false, + "parameters": {} } ], "default_tool": "whisper", diff --git a/src/core/processor/tool_selector.rs b/src/core/processor/tool_selector.rs index 61d5dbbe..1b1286a3 100644 --- a/src/core/processor/tool_selector.rs +++ b/src/core/processor/tool_selector.rs @@ -100,8 +100,12 @@ impl ToolSelector { // ASR processor tools ("asr", "whisper") => { - let script = executor.script_path("asr_processor.py"); - if script.exists() { Some(script) } else { None } + let whisper_cli = std::path::Path::new("/opt/homebrew/bin/whisper"); + if whisper_cli.exists() { Some(whisper_cli.to_path_buf()) } else { None } + } + ("asr", "rust") => { + // Future: Rust ASR implementation + executor.rust_binary_path("rust_asr") } // OCR processor tools