From 9003aa05483b7a97ccfe3ede957d426e4ce8347a Mon Sep 17 00:00:00 2001 From: Accusys Date: Mon, 28 Sep 2026 01:57:35 +0800 Subject: [PATCH] feat: add ASRX processor config support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增: - ASRX 處理器配置 - ToolSelector 支持 ASRX 工具 工具優先級: 1. swift (priority=0, enabled=true) - Apple Vision 2. rust (priority=1, enabled=false) - 待實現 3. python (priority=2, enabled=true) - 備用 配置: - processor_tools.json 新增 asrx 配置 - tool_selector.rs 支持 asrx_swift, rust_asrx, python 目的: - 為未來 Rust ASRX 實現預留接口 - 統一處理器配置架構 --- config/processor_tools.json | 24 ++++++++++++++++++++++++ src/core/processor/tool_selector.rs | 16 ++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/config/processor_tools.json b/config/processor_tools.json index 3250492b..a4588a02 100644 --- a/config/processor_tools.json +++ b/config/processor_tools.json @@ -74,6 +74,30 @@ ], "default_tool": "whisper", "enabled": true + }, + "asrx": { + "tools": [ + { + "name": "swift", + "priority": 0, + "enabled": true, + "parameters": {} + }, + { + "name": "rust", + "priority": 1, + "enabled": false, + "parameters": {} + }, + { + "name": "python", + "priority": 2, + "enabled": true, + "parameters": {} + } + ], + "default_tool": "swift", + "enabled": true } } } diff --git a/src/core/processor/tool_selector.rs b/src/core/processor/tool_selector.rs index 1b1286a3..7e66cba3 100644 --- a/src/core/processor/tool_selector.rs +++ b/src/core/processor/tool_selector.rs @@ -108,6 +108,22 @@ impl ToolSelector { executor.rust_binary_path("rust_asr") } + // ASRX processor tools + ("asrx", "swift") => { + let swift_path = std::path::Path::new( + "/Users/accusys/momentry_core/scripts/swift_processors/.build/release/asrx_swift" + ); + if swift_path.exists() { Some(swift_path.to_path_buf()) } else { None } + } + ("asrx", "rust") => { + // Future: Rust ASRX implementation + executor.rust_binary_path("rust_asrx") + } + ("asrx", "python") => { + let script = executor.script_path("asrx_processor.py"); + if script.exists() { Some(script) } else { None } + } + // OCR processor tools ("ocr", "swift") => { let swift_path = std::path::Path::new(