feat: add tool configuration support for processors

新增:
- ToolConfig 結構體(工具名稱、優先級、啟用狀態、參數)
- ProcessorConfig 擴展(tools 列表、default_tool)
- 預設配置文件 config/processor_tools.json

目的:
- 支持處理器工具軟定義
- 替換 hard-coded 邏輯
- 提供配置驅動的工具選擇

配置示例:
- pose: mediapipe > rust > swift > yolov8
- face: swift > python
- asr: whisper

下一步:
- Phase 2: 創建 ToolSelector 模塊
- Phase 3: 替換 POSE 處理器 hard-coded 邏輯
This commit is contained in:
Accusys
2026-09-28 01:20:53 +08:00
parent b4e4b30b8e
commit 123ae87c1a
2 changed files with 87 additions and 0 deletions
+15
View File
@@ -37,6 +37,21 @@ pub struct ProcessorConfig {
pub enabled: bool,
#[serde(skip_serializing_if = "Option::is_none")]
pub confidence: Option<f32>,
#[serde(default)]
pub tools: Vec<ToolConfig>,
#[serde(default)]
pub default_tool: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct ToolConfig {
pub name: String,
#[serde(default)]
pub priority: u8,
#[serde(default = "default_true")]
pub enabled: bool,
#[serde(default)]
pub parameters: serde_json::Map<String, serde_json::Value>,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]