From 1bb044a3d760acc6fa82b69d60c8d0f00aca7780 Mon Sep 17 00:00:00 2001 From: pulsareonbot Date: Sat, 4 Jul 2026 15:09:11 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20M2.1=20=E9=AA=A8?= =?UTF-8?q?=E6=9E=B6=E7=BC=96=E8=AF=91=E9=94=99=E8=AF=AF=20(import/match/A?= =?UTF-8?q?ppConfig=20=E5=AD=97=E6=AE=B5)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/tests.rs | 3 +++ src/plugins/ai/mod.rs | 3 +-- src/plugins/http/routes.rs | 2 +- src/plugins/video/processor.rs | 2 ++ 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/core/tests.rs b/src/core/tests.rs index 2fc3c58..cdf6294 100644 --- a/src/core/tests.rs +++ b/src/core/tests.rs @@ -103,6 +103,9 @@ fn message_label(message: &Message) -> String { Message::DeviceCommand(_) => "device_command".to_string(), Message::DeviceResponse(_) => "device_response".to_string(), Message::DeviceEvent(_) => "device_event".to_string(), + Message::ChatRequest(_) => "chat_request".to_string(), + Message::ChatResponse(_) => "chat_response".to_string(), + Message::AiModelEvent(_) => "ai_model_event".to_string(), } } diff --git a/src/plugins/ai/mod.rs b/src/plugins/ai/mod.rs index 5a28baa..8f76f83 100644 --- a/src/plugins/ai/mod.rs +++ b/src/plugins/ai/mod.rs @@ -24,7 +24,7 @@ pub mod model_manager; pub use chat::{ChatPipeline, SessionContext}; -use crate::core::message::{Message, StateChanged}; +use crate::core::message::Message; use crate::core::plugin::*; use anyhow::Result; use std::path::PathBuf; @@ -137,7 +137,6 @@ impl Plugin for AiPlugin { if new_state == "talk" || old_state == "talk" { println!("[AiPlugin] 画面状态: {old_state} → {new_state}"); } - let _ = StateChanged { old_state, new_state }; // 抑制未用警告 } _ => {} } diff --git a/src/plugins/http/routes.rs b/src/plugins/http/routes.rs index de71429..de74f5e 100644 --- a/src/plugins/http/routes.rs +++ b/src/plugins/http/routes.rs @@ -1,7 +1,7 @@ use super::HttpState; use crate::core::config::{self, AppConfig}; use crate::core::dispatch; -use crate::core::message::{ChatInput, ChatRequest, Destination, Envelope, Message, PlayerCommand, WifiCommand}; +use crate::core::message::{ChatInput, ChatRequest, ChatResponse, Destination, Envelope, Message, PlayerCommand, WifiCommand}; use bytes::Buf; use futures_util::{SinkExt, StreamExt, TryStreamExt}; use serde::de::DeserializeOwned; diff --git a/src/plugins/video/processor.rs b/src/plugins/video/processor.rs index 2c5c7a3..1d9ed40 100644 --- a/src/plugins/video/processor.rs +++ b/src/plugins/video/processor.rs @@ -1750,6 +1750,8 @@ mod tests { port: 8080, }, ble: BleConfig::default(), + character: Default::default(), + ai: Default::default(), source_path: PathBuf::from("/tmp/config.json"), source_dir: PathBuf::from("/tmp"), }